From b589b73c70bc4c644b7a040d9aee5083881254b9 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Sun, 26 Nov 2017 15:46:26 -0500 Subject: [PATCH] cmake: add WITH_BOOST_CONTEXT option adds a more specific option for this boost::context dependency, which was previously only used by the radosgw beast frontend. see http://tracker.ceph.com/issues/20048 for more background Signed-off-by: Casey Bodley --- CMakeLists.txt | 12 ++++++++++++ ceph.spec.in | 4 ++-- debian/rules | 6 +++--- src/include/config-h.in.cmake | 3 +++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfbdaef28bb3..8316276cf08f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -390,6 +390,11 @@ if(WITH_BLKIN) include_directories(SYSTEM src/blkin/blkin-lib) endif(WITH_BLKIN) +option(WITH_BOOST_CONTEXT "Enable boost::asio stackful coroutines" ON) +if(WITH_BOOST_CONTEXT) + set(HAVE_BOOST_CONTEXT ON) +endif() + #option for RGW option(WITH_RADOSGW "Rados Gateway is enabled" ON) option(WITH_RADOSGW_FCGI_FRONTEND "Rados Gateway's FCGI frontend is enabled" OFF) @@ -399,6 +404,10 @@ if(WITH_RADOSGW) if(WITH_RADOSGW_FCGI_FRONTEND) find_package(fcgi REQUIRED) endif() + if(WITH_RADOSGW_BEAST_FRONTEND AND NOT WITH_BOOST_CONTEXT) + message(WARNING "disabling WITH_RADOSGW_BEAST_FRONTEND, which depends on WITH_BOOST_CONTEXT") + set(WITH_RADOSGW_BEAST_FRONTEND OFF) + endif() endif(WITH_RADOSGW) @@ -570,6 +579,9 @@ set(BOOST_HEADER_COMPONENTS container) if(WITH_MGR) list(APPEND BOOST_COMPONENTS python) endif() +if(WITH_BOOST_CONTEXT) + list(APPEND BOOST_COMPONENTS context coroutine) +endif() set(Boost_USE_MULTITHREADED ON) # require minimally the bundled version diff --git a/ceph.spec.in b/ceph.spec.in index 517be8f3be49..a9fb8bbdc24a 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -862,9 +862,9 @@ cmake .. \ -DWITH_OCF=ON \ %endif %ifarch aarch64 armv7hl mips mipsel ppc ppc64 ppc64le %{ix86} x86_64 - -DWITH_RADOSGW_BEAST_FRONTEND=ON \ + -DWITH_BOOST_CONTEXT=ON \ %else - -DWITH_RADOSGW_BEAST_FRONTEND=OFF \ + -DWITH_BOOST_CONTEXT=OFF \ %endif -DBOOST_J=%{_smp_ncpus} diff --git a/debian/rules b/debian/rules index 61dc2d3c1c1c..8678b2905e9c 100755 --- a/debian/rules +++ b/debian/rules @@ -17,10 +17,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif ifneq (,$(filter $(DEB_HOST_ARCH), arm armel armhf arm64 i386 amd64 mips mipsel powerpc ppc64)) - # beast depends on libboost_context which only support the archs above - extraopts += -DWITH_RADOSGW_BEAST_FRONTEND=ON + # libboost_context only support the archs above + extraopts += -DWITH_BOOST_CONTEXT=ON else - extraopts += -DWITH_RADOSGW_BEAST_FRONTEND=OFF + extraopts += -DWITH_BOOST_CONTEXT=OFF endif %: diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index 46beb891ed6d..7030a53bd8ca 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -330,4 +330,7 @@ /* Defined if getentropy() is available */ #cmakedefine HAVE_GETENTROPY +/* Defined if boost::context is available */ +#cmakedefine HAVE_BOOST_CONTEXT + #endif /* CONFIG_H */ -- 2.47.3