diff --git a/CMakeLists.txt b/CMakeLists.txt index cc7bc33c5f2..daefcf79fd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,12 @@ if(HOST_OS STREQUAL "linux") link_libraries(dl) endif(HOST_OS STREQUAL "linux") +if (HOST_OS STREQUAL "darwin") + set(CMAKE_MACOSX_RPATH 1) +endif(HOST_OS STREQUAL "darwin") + +set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + add_compile_definitions(${HOST_OS} PACKAGE_NAME="ats" PACKAGE_VERSION="${TS_VERSION_STRING}") add_compile_options(-Wno-invalid-offsetof) @@ -175,6 +181,7 @@ configure_file(include/tscore/ink_config.h.cmake.in include/tscore/ink_config.h) configure_file(include/ts/apidefs.h.in include/ts/apidefs.h) add_subdirectory(src/tscpp/util) +add_subdirectory(src/tscpp/api) add_subdirectory(src/tscore) add_subdirectory(src/records) add_subdirectory(iocore) @@ -184,3 +191,5 @@ add_subdirectory(mgmt/config) add_subdirectory(mgmt/rpc) add_subdirectory(src/traffic_server) add_subdirectory(src/tests) +add_subdirectory(plugins) +add_subdirectory(configs) diff --git a/configs/CMakeLists.txt b/configs/CMakeLists.txt new file mode 100644 index 00000000000..f9754f32b79 --- /dev/null +++ b/configs/CMakeLists.txt @@ -0,0 +1,24 @@ +# Makefile.am for config +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +file(GLOB CONFIG_FILES *.default) + +foreach(CONFIG_FILE ${CONFIG_FILES}) + cmake_path(GET CONFIG_FILE STEM LAST_ONLY CONFIG_FILE_NAME) + install(FILES ${CONFIG_FILE} DESTINATION etc/trafficserver RENAME ${CONFIG_FILE_NAME}) +endforeach() diff --git a/iocore/eventsystem/CMakeLists.txt b/iocore/eventsystem/CMakeLists.txt index 0fc3a53a1ba..556336aa1a9 100644 --- a/iocore/eventsystem/CMakeLists.txt +++ b/iocore/eventsystem/CMakeLists.txt @@ -16,7 +16,7 @@ ####################### -add_library(inkevent SHARED +add_library(inkevent STATIC EventSystem.cc IOBuffer.cc Inline.cc diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index e5c46c68905..72f185710d3 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -20,8 +20,11 @@ # yamlcpp shadows a bunch of variables but we don't want to hear bout it add_compile_options(-Wno-shadow) set(BUILD_SHARED_LIBS 1) +set(YAML_CPP_INSTALL ON) add_subdirectory(yamlcpp) set(YAML_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/lib/yamlcpp/include PARENT_SCOPE) add_subdirectory(fastlz) add_subdirectory(swoc) set(SWOC_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/lib/swoc/include PARENT_SCOPE) + +install(TARGETS libswoc yaml-cpp) diff --git a/lib/fastlz/CMakeLists.txt b/lib/fastlz/CMakeLists.txt index 38556fc74e4..1a283f50e4c 100644 --- a/lib/fastlz/CMakeLists.txt +++ b/lib/fastlz/CMakeLists.txt @@ -18,3 +18,4 @@ add_library(fastlz) target_sources(fastlz PRIVATE fastlz.cc fastlz.h) +install(TARGETS fastlz) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt new file mode 100644 index 00000000000..2566eeeb755 --- /dev/null +++ b/plugins/CMakeLists.txt @@ -0,0 +1,42 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +set(CMAKE_SHARED_LIBRARY_PREFIX "") + +function(add_atsplugin name) + add_library(${name} MODULE ${ARGN}) + set_target_properties(${name} PROPERTIES PREFIX "") + set_target_properties(${name} PROPERTIES SUFFIX ".so") + set_target_properties(${name} PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib") + install(TARGETS ${name} DESTINATION libexec/trafficserver) +endfunction() + +if(APPLE) + set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup") +endif() + +add_subdirectory(authproxy) +add_subdirectory(background_fetch) +add_subdirectory(cache_promote) +add_subdirectory(cache_range_requests) +add_subdirectory(cachekey) +add_subdirectory(certifier) +add_subdirectory(compress) +add_subdirectory(conf_remap) + +add_subdirectory(generator) +add_subdirectory(xdebug) diff --git a/plugins/authproxy/CMakeLists.txt b/plugins/authproxy/CMakeLists.txt new file mode 100644 index 00000000000..2902e3dcbfc --- /dev/null +++ b/plugins/authproxy/CMakeLists.txt @@ -0,0 +1,18 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(authproxy authproxy.cc utils.cc) diff --git a/plugins/background_fetch/CMakeLists.txt b/plugins/background_fetch/CMakeLists.txt new file mode 100644 index 00000000000..4ebb6db6034 --- /dev/null +++ b/plugins/background_fetch/CMakeLists.txt @@ -0,0 +1,23 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(background_fetch + background_fetch.cc + configs.cc + headers.cc + rules.cc +) diff --git a/plugins/cache_promote/CMakeLists.txt b/plugins/cache_promote/CMakeLists.txt new file mode 100644 index 00000000000..f3c3638de83 --- /dev/null +++ b/plugins/cache_promote/CMakeLists.txt @@ -0,0 +1,24 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(cache_promote + cache_promote.cc + configs.cc + policy.cc + lru_policy.cc + policy_manager.cc +) diff --git a/plugins/cache_range_requests/CMakeLists.txt b/plugins/cache_range_requests/CMakeLists.txt new file mode 100644 index 00000000000..b3f526bb656 --- /dev/null +++ b/plugins/cache_range_requests/CMakeLists.txt @@ -0,0 +1,20 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(cache_range_requests + cache_range_requests.cc +) diff --git a/plugins/cachekey/CMakeLists.txt b/plugins/cachekey/CMakeLists.txt new file mode 100644 index 00000000000..4ad2546b6db --- /dev/null +++ b/plugins/cachekey/CMakeLists.txt @@ -0,0 +1,24 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(cachekey + cachekey.cc + common.cc + configs.cc + pattern.cc + plugin.cc +) diff --git a/plugins/certifier/CMakeLists.txt b/plugins/certifier/CMakeLists.txt new file mode 100644 index 00000000000..6495cfeb9e1 --- /dev/null +++ b/plugins/certifier/CMakeLists.txt @@ -0,0 +1,18 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(certifier certifier.cc) diff --git a/plugins/compress/CMakeLists.txt b/plugins/compress/CMakeLists.txt new file mode 100644 index 00000000000..130e7798ec4 --- /dev/null +++ b/plugins/compress/CMakeLists.txt @@ -0,0 +1,22 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(compress + compress.cc + configuration.cc + misc.cc +) diff --git a/plugins/compress/compress.cc b/plugins/compress/compress.cc index 4151e7e94f2..ecfd534dc5b 100644 --- a/plugins/compress/compress.cc +++ b/plugins/compress/compress.cc @@ -24,7 +24,7 @@ #include #include -#include "ink_autoconf.h" +#include "tscore/ink_config.h" #if HAVE_BROTLI_ENCODE_H #include diff --git a/plugins/compress/configuration.cc b/plugins/compress/configuration.cc index f582b710900..abcf554e9c4 100644 --- a/plugins/compress/configuration.cc +++ b/plugins/compress/configuration.cc @@ -21,7 +21,7 @@ limitations under the License. */ -#include "ink_autoconf.h" +#include "tscore/ink_config.h" #include "configuration.h" #include #include diff --git a/plugins/conf_remap/CMakeLists.txt b/plugins/conf_remap/CMakeLists.txt new file mode 100644 index 00000000000..06193c33fc5 --- /dev/null +++ b/plugins/conf_remap/CMakeLists.txt @@ -0,0 +1,20 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(conf_remap + conf_remap.cc +) diff --git a/plugins/generator/CMakeLists.txt b/plugins/generator/CMakeLists.txt new file mode 100644 index 00000000000..1402a9ec6fc --- /dev/null +++ b/plugins/generator/CMakeLists.txt @@ -0,0 +1,18 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(generator generator.cc) diff --git a/plugins/xdebug/CMakeLists.txt b/plugins/xdebug/CMakeLists.txt new file mode 100644 index 00000000000..6044ea3c152 --- /dev/null +++ b/plugins/xdebug/CMakeLists.txt @@ -0,0 +1,18 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_atsplugin(xdebug xdebug.cc) diff --git a/src/records/CMakeLists.txt b/src/records/CMakeLists.txt index c3a9953fb32..3dd431afcb8 100644 --- a/src/records/CMakeLists.txt +++ b/src/records/CMakeLists.txt @@ -38,4 +38,5 @@ target_include_directories(records_p PRIVATE ${CMAKE_SOURCE_DIR}/iocore/eventsystem ${CMAKE_SOURCE_DIR}/iocore/utils ) -target_link_libraries(records_p tscore libswoc) \ No newline at end of file +target_link_libraries(records_p tscore libswoc) +install(TARGETS records_p) diff --git a/src/traffic_server/CMakeLists.txt b/src/traffic_server/CMakeLists.txt index 904334973fc..f8e97e09ed5 100644 --- a/src/traffic_server/CMakeLists.txt +++ b/src/traffic_server/CMakeLists.txt @@ -65,3 +65,5 @@ if (TS_USE_LINUX_IO_URING) target_link_libraries(traffic_server inkuring uring) endif (TS_USE_LINUX_IO_URING) +install(TARGETS traffic_server) + diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt index 0dfae75d228..ab5e5b66e6c 100644 --- a/src/tscore/CMakeLists.txt +++ b/src/tscore/CMakeLists.txt @@ -142,3 +142,5 @@ add_executable(test_tscore ) target_link_libraries(test_tscore PRIVATE tscore inkevent records_p libswoc) target_include_directories(test_tscore PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/iocore/eventsystem ${CATCH_INCLUDE_DIR}) + +install(TARGETS tscore) diff --git a/src/tscpp/api/CMakeLists.txt b/src/tscpp/api/CMakeLists.txt new file mode 100644 index 00000000000..a08b5abf2f6 --- /dev/null +++ b/src/tscpp/api/CMakeLists.txt @@ -0,0 +1,44 @@ +####################### +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor license +# agreements. See the NOTICE file distributed with this work for additional information regarding +# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# +####################### + +add_library(tscppapi STATIC + AsyncHttpFetch.cc + AsyncTimer.cc + CaseInsensitiveStringComparator.cc + ClientRequest.cc + Continuation.cc + GlobalPlugin.cc + GzipDeflateTransformation.cc + GzipInflateTransformation.cc + Headers.cc + HttpMethod.cc + HttpVersion.cc + InterceptPlugin.cc + Logger.cc + Plugin.cc + RemapPlugin.cc + Request.cc + Response.cc + Stat.cc + Transaction.cc + TransactionPlugin.cc + TransformationPlugin.cc + Url.cc + utils.cc + utils_internal.cc + ) +install(TARGETS tscppapi) diff --git a/src/tscpp/util/CMakeLists.txt b/src/tscpp/util/CMakeLists.txt index 7a2b70acc86..d4df32b2416 100644 --- a/src/tscpp/util/CMakeLists.txt +++ b/src/tscpp/util/CMakeLists.txt @@ -36,3 +36,4 @@ add_executable(test_tscpputil ) target_link_libraries(test_tscpputil PRIVATE tscpputil libswoc) target_include_directories(test_tscpputil PRIVATE ${CMAKE_SOURCE_DIR}/include ${CATCH_INCLUDE_DIR}) +install(TARGETS tscpputil)