diff options
author | Jörg Mayer <jmayer@loplof.de> | 2013-08-13 09:58:09 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2013-08-13 09:58:09 +0000 |
commit | bae2eee028334f658363709fb65b79eff1a8ecb5 (patch) | |
tree | c87b9982fab265b9e283b027a1e296f72ce78aea | |
parent | 9ef54f5ea25eb56ef923cb4eefadfdf3a301455c (diff) |
Implement in cmake:
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=51322
> User: guy
> Date: 2013/08/12 01:01 PM
>
> Log:
> Just check whether dladdr() is available; we check in the code whether
> it succeeds, so there's no point in checking whether it succeeds in a
> sample program.
svn path=/trunk/; revision=51334
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 7 | ||||
-rw-r--r-- | cmakeconfig.h.in | 3 |
3 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 048b4f925c..2991099b1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -943,6 +943,7 @@ if(BUILD_mergecap) set(mergecap_LIBS wiretap ${ZLIB_LIBRARIES} + ${CMAKE_DL_LIBS} ) set(mergecap_FILES mergecap.c @@ -960,6 +961,7 @@ if(BUILD_reordercap) set(reordercap_LIBS wiretap ${ZLIB_LIBRARIES} + ${CMAKE_DL_LIBS} ) set(reordercap_FILES reordercap.c @@ -979,6 +981,7 @@ if(BUILD_capinfos) wsutil ${ZLIB_LIBRARIES} ${GCRYPT_LIBRARIES} + ${CMAKE_DL_LIBS} ) set(capinfos_FILES capinfos.c @@ -995,6 +998,7 @@ if(BUILD_editcap) set(editcap_LIBS wiretap ${ZLIB_LIBRARIES} + ${CMAKE_DL_LIBS} ) set(editcap_FILES editcap.c diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index f36ada153b..a8d319bd75 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -65,7 +65,14 @@ check_include_file("winsock2.h" HAVE_WINSOCK2_H) #Functions include(CheckFunctionExists) +include(CMakePushCheckState) check_function_exists("chown" HAVE_CHOWN) + +cmake_push_check_state() +set(CMAKE_REQUIRED_LIBRARIES ¼{CMAKE_DL_LIBS}) +check_function_exists("dladdr" HAVE_DLADDR) +cmake_pop_check_state() + check_function_exists("gethostbyname2" HAVE_GETHOSTBYNAME2) check_function_exists("getopt" HAVE_GETOPT) check_function_exists("getprotobynumber" HAVE_GETPROTOBYNUMBER) diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 42d9342592..76a24b54f4 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -45,6 +45,9 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H 1 +/* Define to 1 if you have the dladdr function */ +#cmakedefine HAVE_DLADDR 1 + /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H 1 |