barbieri pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f74ca08be9b78e5ac9a2f302ba2607db94872085

commit f74ca08be9b78e5ac9a2f302ba2607db94872085
Author: Gustavo Sverzut Barbieri <[email protected]>
Date:   Wed Jan 25 19:21:06 2017 -0200

    cmake/eina: check more required functions and link with unwind if found.
    
    unwind is needed for debug, thus link to that.
---
 cmake/config/common.cmake   | 8 +++++++-
 src/lib/eina/CMakeLists.txt | 4 ++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/cmake/config/common.cmake b/cmake/config/common.cmake
index b06fd6c..5056928 100644
--- a/cmake/config/common.cmake
+++ b/cmake/config/common.cmake
@@ -32,13 +32,13 @@ EFL_OPTION(ENABLE_VALGRIND "Enable valgrind support" 
"${SUGGEST_VALGRIND}" DEPEN
 HEADER_CHECK(asm/hwcap.h)
 HEADER_CHECK(dirent.h)
 HEADER_CHECK(execinfo.h)
-HEADER_CHECK(libunwind.h NAME HAVE_UNWIND)
 HEADER_CHECK(mcheck.h)
 HEADER_CHECK(stdlib.h)
 HEADER_CHECK(sys/auxv.h)
 HEADER_CHECK(sys/mman.h)
 HEADER_CHECK(sys/types.h)
 
+FUNC_CHECK(backtrace INCLUDE_FILES execinfo.h)
 FUNC_CHECK(clock_gettime INCLUDE_FILES time.h)
 FUNC_CHECK(dirfd INCLUDE_FILES dirent.h sys/types.h)
 FUNC_CHECK(dladdr INCLUDE_FILES dlfcn.h LIBRARIES dl DEFINITIONS 
"-D_GNU_SOURCE=1")
@@ -53,6 +53,8 @@ FUNC_CHECK(getuid INCLUDE_FILES unistd.h)
 FUNC_CHECK(getxattr INCLUDE_FILES sys/types.h sys/xattr.h)
 FUNC_CHECK(iconv INCLUDE_FILES iconv.h)
 FUNC_CHECK(listxattr INCLUDE_FILES sys/types.h sys/xattr.h)
+FUNC_CHECK(mallinfo INCLUDE_FILES malloc.h)
+FUNC_CHECK(malloc_info INCLUDE_FILES malloc.h)
 FUNC_CHECK(mmap INCLUDE_FILES sys/mman.h)
 FUNC_CHECK(mtrace INCLUDE_FILES mcheck.h)
 FUNC_CHECK(prctl INCLUDE_FILES sys/prctl.h)
@@ -67,6 +69,10 @@ TYPE_CHECK(siginfo_t INCLUDE_FILES signal.h)
 
 # END: HEADER, TYPE and FUNCTION CHECKS
 
+# TODO: move to a FindUnwind.cmake?
+# or is pkg-config enough these days?
+pkg_check_modules(UNWIND libunwind libunwind-generic)
+CHECK_APPEND_DEFINE(HAVE_UNWIND ${UNWIND_FOUND})
 
 CHECK_APPEND_DEFINE(EFL_BETA_API_SUPPORT 1)
 if(CMAKE_THREAD_LIBS_INIT)
diff --git a/src/lib/eina/CMakeLists.txt b/src/lib/eina/CMakeLists.txt
index 3323470..bd23e78 100644
--- a/src/lib/eina/CMakeLists.txt
+++ b/src/lib/eina/CMakeLists.txt
@@ -8,6 +8,10 @@ if(ENABLE_VALGRIND)
   list(APPEND PKG_CONFIG_REQUIRES_PRIVATE valgrind)
 endif()
 
+if(UNWIND_FOUND)
+  list(APPEND PKG_CONFIG_REQUIRES_PRIVATE libunwind libunwind-generic)
+endif()
+
 set(PUBLIC_LIBRARIES
   pthread
 )

-- 


Reply via email to