aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-01-04 16:31:49 -0800
committerGuy Harris <guy@alum.mit.edu>2015-01-05 00:32:10 +0000
commit533f85785b3149c13a68658294a5ec3f24f02143 (patch)
tree944492cb81c3fa0e1c80e638bedfe6760e9c5008
parent8fe6b04ba7d174b4a8ec43ac07dfa0d9a7c9b3b7 (diff)
Don't check for nl80211 stuff if we don't have libnl.
While we're at it, do the checks in the same order that we do in autotools. Change-Id: Ie253cdeb740a5be4a5817ce4f7ed683aeea868c8 Reviewed-on: https://code.wireshark.org/review/6316 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--ConfigureChecks.cmake56
1 files changed, 31 insertions, 25 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 14eb495344..fcf3535d49 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -116,28 +116,34 @@ 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() {
- enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP;
- }"
- HAVE_NL80211_SPLIT_WIPHY_DUMP
-)
-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
-)
+
+#
+# *If* we found libnl, check if we can use nl80211 stuff with it.
+#
+if (NL_FOUND)
+ 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
+ )
+ 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() {
+ enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP;
+ }"
+ HAVE_NL80211_SPLIT_WIPHY_DUMP
+ )
+endif()