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)
#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)
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)
}"
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
+)