If a core Wireshark developer repeatedly can't remember that the
[metze/wireshark/wip.git] / ConfigureChecks.cmake
index b81cc47fb6d46a9393e50d679502b9e129e66dfc..f36ada153bc6dc2f5d623fbac66c4a2bbc0422ad 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)
@@ -75,3 +76,33 @@ check_function_exists("mprotect"         HAVE_MPROTECT)
 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(tzname "time.h" HAVE_TZNAME)
+
+# Check for stuff that isn't testable via the tests above
+#include(CheckCSourceCompiles)
+check_c_source_compiles(
+       "#include <linux/nl80211.h>
+       int main() {
+               enum nl80211_commands x = NL80211_CMD_SET_CHANNEL;
+       }"
+       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
+)
+