Copy over r51462 from trunk:
[metze/wireshark/wip.git] / ConfigureChecks.cmake
index 1b453e46e25ef1880cf1dcc6f8fbb9ccb5ea7171..a8d319bd75c944ab01174189c694a068cbd639f5 100644 (file)
@@ -31,6 +31,7 @@ check_include_file("direct.h"            HAVE_DIRECT_H)
 check_include_file("dirent.h"            HAVE_DIRENT_H)
 check_include_file("dlfcn.h"             HAVE_DLFCN_H)
 check_include_file("fcntl.h"             HAVE_FCNTL_H)
+check_include_file("getopt.h"            HAVE_GETOPT_H)
 check_include_file("grp.h"               HAVE_GRP_H)
 check_include_file("g_ascii_strtoull.h"  NEED_G_ASCII_STRTOULL_H)
 check_include_file("inet/aton.h"         NEED_INET_ATON_H)
@@ -64,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)
@@ -76,9 +84,13 @@ check_function_exists("mkdtemp"          HAVE_MKDTEMP)
 check_function_exists("mkstemp"          HAVE_MKSTEMP)
 check_function_exists("sysconf"          HAVE_SYSCONF)
 
+#Struct members
+include(CheckStructHasMember)
+check_struct_has_member("struct tm"  tm_zone  time.h  HAVE_TM_ZONE)
+
 #Symbols but NOT enums or types
-#include(CheckSymbolExists)
-#check_symbol_exists(NL80211_CMD_SET_CHANNEL "linux/nl80211.h" HAVE_NL80211_CMD_SET_CHANNEL)
+include(CheckSymbolExists)
+check_symbol_exists(tzname "time.h" HAVE_TZNAME)
 
 # Check for stuff that isn't testable via the tests above
 #include(CheckCSourceCompiles)
@@ -89,5 +101,15 @@ check_c_source_compiles(
        }"
        HAVE_NL80211_CMD_SET_CHANNEL
 )
-
+check_c_source_compiles(
+       "#include <linux/nl80211.h>
+       int main() {
+               int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER;
+               x = NL80211_ATTR_SUPPORTED_IFTYPES;
+               x = NL80211_ATTR_SUPPORTED_COMMANDS;
+               x = NL80211_ATTR_WIPHY_FREQ;
+               x = NL80211_CHAN_NO_HT;
+       }"
+       HAVE_NL80211
+)