]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: musl libc does not implement backtrace. Added feature check and fallback to...
authorJohn Coyle <dx9err@gmail.com>
Thu, 15 Oct 2015 02:54:05 +0000 (22:54 -0400)
committerSage Weil <sage@redhat.com>
Fri, 29 Jan 2016 13:50:46 +0000 (08:50 -0500)
Signed-off-by: John Coyle <dx9err@gmail.com>
CMakeLists.txt
cmake/modules/Findexecinfo.cmake [new file with mode: 0644]
src/CMakeLists.txt
src/include/config-h.in.cmake

index b17e864c2958873ddaa09ae91936b90b8e46c165..674f4b00495920fd6c9f53688ed4c2ac7ee5ab17 100644 (file)
@@ -113,6 +113,8 @@ else(${ENABLE_SHARED})
  set(CEPH_SHARED STATIC)
 endif(${ENABLE_SHARED})
 
+find_package(execinfo)
+
 find_package(udev REQUIRED)
 set(HAVE_UDEV ${UDEV_FOUND})
 
diff --git a/cmake/modules/Findexecinfo.cmake b/cmake/modules/Findexecinfo.cmake
new file mode 100644 (file)
index 0000000..c6bf7c8
--- /dev/null
@@ -0,0 +1,28 @@
+# - Find execinfo
+# Find the execinfo headers and libraries.
+#
+#  EXECINFO_INCLUDE_DIRS - where to find execinfo.h, etc.
+#  EXECINFO_LIBRARIES    - List of libraries when using execinfo.
+#  EXECINFO_FOUND        - True if execinfo found.
+
+# Look for the header file.
+FIND_PATH(EXECINFO_INCLUDE_DIR NAMES execinfo.h)
+
+# Look for the library.
+FIND_LIBRARY(EXECINFO_LIBRARY NAMES execinfo)
+
+# handle the QUIETLY and REQUIRED arguments and set EXECINFO_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(execinfo DEFAULT_MSG EXECINFO_LIBRARY EXECINFO_INCLUDE_DIR)
+
+# Copy the results to the output variables.
+IF(EXECINFO_FOUND)
+  SET(EXECINFO_LIBRARIES ${EXECINFO_LIBRARY})
+  SET(EXECINFO_INCLUDE_DIRS ${EXECINFO_INCLUDE_DIR})
+ELSE(EXECINFO_FOUND)
+  SET(EXECINFO_LIBRARIES)
+  SET(EXECINFO_INCLUDE_DIRS)
+ENDIF(EXECINFO_FOUND)
+
+MARK_AS_ADVANCED(EXECINFO_INCLUDE_DIR EXECINFO_LIBRARY)
index 2c2de25d7c49db2c01a2c32ba5516c647c884573..62c8c0f8b2eea8f140b28fc9d26886776a955616 100644 (file)
@@ -361,7 +361,7 @@ endif(${HAVE_GPERFTOOLS})
 
 add_library(common_utf8 STATIC common/utf8.c)
 
-target_link_libraries(common json_spirit common_utf8 erasure_code rt uuid ${CRYPTO_LIBS} ${Boost_LIBRARIES} ${BLKID_LIBRARIES})
+target_link_libraries(common json_spirit common_utf8 erasure_code rt uuid ${CRYPTO_LIBS} ${Boost_LIBRARIES} ${BLKID_LIBRARIES} ${EXECINFO_LIBRARIES})
 
 if(${WITH_LTTNG})
   add_subdirectory(tracing)
index 89d7792ee8a988ef751ea81078f010b34a2b679e..8e23399306d82779fb6eb959511e55d9c8f16b65 100644 (file)
 /* Define to 1 if you have the <utime.h> header file. */
 #cmakedefine HAVE_UTIME_H
 
+/* Define if you have the <execinfo.h> header file. */
+#cmakedefine HAVE_EXECINFO_H
+
 /* Define to 1 if strerror_r returns char *. */
 #cmakedefine STRERROR_R_CHAR_P 1