summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--ConfigureChecks.cmake7
-rw-r--r--cmakeconfig.h.in3
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