]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: s/HAVE_MSGHDR/WITH_SYSTEMD/
authorKefu Chai <kchai@redhat.com>
Thu, 8 Apr 2021 08:43:33 +0000 (16:43 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 8 Apr 2021 08:58:50 +0000 (16:58 +0800)
as FreeBSD also has msghdr but it does not have systemd, or
flags like MFD_ALLOW_SEALING, O_TMPFILE or F_SEAL_GROW. so
use WITH_SYSTEMD for enabling journald backend of logging system.

also move the option of "WITH_SYSTEMD" up so that the src/CMakeLists.txt
is able to see the variable of WITH_SYSTEMD defined by it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt
cmake/modules/CephChecks.cmake
src/common/CMakeLists.txt
src/common/Journald.h
src/include/config-h.in.cmake
src/test/CMakeLists.txt
src/test/common/CMakeLists.txt

index a913cbe6c939774a2cc49b80ee8227066752a4b4..f623c5e1b791eae46994e9ea85a6e343ff8402ea 100644 (file)
@@ -682,6 +682,8 @@ add_custom_target(check
   COMMAND ${CMAKE_CTEST_COMMAND}
   DEPENDS tests)
 
+option(WITH_SYSTEMD "build with systemd support" ON)
+
 add_subdirectory(src)
 
 add_subdirectory(qa)
@@ -691,7 +693,6 @@ if(WITH_MANPAGE)
   add_subdirectory(man)
 endif(WITH_MANPAGE)
 
-option(WITH_SYSTEMD "install systemd target and service files" ON)
 if(WITH_SYSTEMD)
   add_subdirectory(systemd)
 endif()
index ed1d2c827af5976836d39d177929dd48146b959e..46b50b387c70ceb3879ef148c2927761354589ac 100644 (file)
@@ -65,8 +65,6 @@ CHECK_TYPE_SIZE(__s8 __S8)
 CHECK_TYPE_SIZE(__s16 __S16) 
 CHECK_TYPE_SIZE(__s32 __S32) 
 CHECK_TYPE_SIZE(__s64 __S64)
-set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h")
-CHECK_TYPE_SIZE("struct msghdr" MSGHDR)
 unset(CMAKE_EXTRA_INCLUDE_FILES)
 
 include(CheckSymbolExists)
index 807f8a23b4430bb441cb0d44058a4d0e4a0df1e5..ea9d46cfe776833dba012f1b1b55a11664f7fbff 100644 (file)
@@ -100,7 +100,7 @@ set(common_srcs
   util.cc
   version.cc)
 
-if(HAVE_MSGHDR)
+if(WITH_SYSTEMD)
   list(APPEND common_srcs
     Journald.cc)
 endif()
index deb415731283f180755c440669b771ffeef5c56c..8653b0461b5f10af464973b59008c6d77aebaf0b 100644 (file)
@@ -13,7 +13,7 @@ struct LogEntry;
 
 namespace ceph::logging {
 
-#ifdef HAVE_MSGHDR
+#ifdef WITH_SYSTEMD
 
 namespace detail {
 
@@ -86,7 +86,7 @@ class JournaldClusterLogger {
   std::unique_ptr<detail::LogEntryEncoder> m_log_entry_encoder;
 };
 
-#else  // HAVE_MSGHDR
+#else  // WITH_SYSTEMD
 
 class JournaldLogger {
 public:
@@ -103,7 +103,7 @@ public:
   }
 };
 
-#endif // HAVE_MSGHDR
+#endif // WITH_SYSTEMD
 
 } // ceph::logging
 
index 4425ae97bec16de053cf28ab33b82a018bce6c46..338f7a4839036c8770a392de5be40788257a871e 100644 (file)
@@ -63,9 +63,6 @@
 /* Define to 1 if the system has the type `__u8'. */
 #cmakedefine HAVE___U8 1
 
-/* Define to 1 if the system has the type `msghdr` */
-#cmakedefine HAVE_MSGHDR 1
-
 /* Define if you have res_nquery */
 #cmakedefine HAVE_RES_NQUERY
 
 /* define if cephfs enabled */
 #cmakedefine WITH_CEPHFS
 
+/* define if systemed is enabled */
+#cmakedefine WITH_SYSTEMD
+
 /*define if GSSAPI/KRB5 enabled */
 #cmakedefine HAVE_GSSAPI
 
index 5ead748421326802921553185675dc8aac8bfd63..b30ed6955b20b912af8b2b57c3d5d01eee733010 100644 (file)
@@ -153,7 +153,7 @@ if(NOT WIN32)
   target_link_libraries(ceph_bench_log rt)
 endif()
 
-if(HAVE_MSGHDR)
+if(WITH_SYSTEMD)
   add_executable(ceph_bench_journald_logger
     bench_journald_logger.cc)
   target_link_libraries(ceph_bench_journald_logger ceph-common)
index 28b226addc317ab661a048e15dd3369d26333235..679acd24c82f1f58606ef960dca02f03c5b51abb 100644 (file)
@@ -361,7 +361,7 @@ target_link_libraries(unittest_blocked_completion Boost::system GTest::GTest)
 add_executable(unittest_allocate_unique test_allocate_unique.cc)
 add_ceph_unittest(unittest_allocate_unique)
 
-if(HAVE_MSGHDR)
+if(WITH_SYSTEMD)
   add_executable(unittest_journald_logger test_journald_logger.cc)
   target_link_libraries(unittest_journald_logger ceph-common)
   add_ceph_unittest(unittest_journald_logger)