diff options
author | Thomas Haller <thaller@redhat.com> | 2015-01-23 14:12:02 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-01-30 22:20:13 +0100 |
commit | 5439fbd77cd245b0a69cede67280767f6ffdc996 (patch) | |
tree | 83c00f6883084a62eaf33527a3642fe4a3b453d0 | |
parent | b3944cfc712564ebd03e1b88e12cba205c71914c (diff) | |
download | NetworkManager-5439fbd77cd245b0a69cede67280767f6ffdc996.tar.gz |
build: add compile option to disable building of Wi-Fi plugin
Before, the Wi-Fi plugin was always build. Users who didn't want
to use it would simply drop "libnm-device-plugin-wifi.so".
Add a compile time option to disable needlessly building the plugin.
https://bugzilla.gnome.org/show_bug.cgi?id=743388
-rw-r--r-- | configure.ac | 50 | ||||
-rw-r--r-- | contrib/fedora/rpm/NetworkManager.spec | 7 | ||||
-rw-r--r-- | src/Makefile.am | 5 |
3 files changed, 44 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index cd609d4c12..3e23728e33 100644 --- a/configure.ac +++ b/configure.ac @@ -145,11 +145,26 @@ if ! test x"$ac_distver" = x""; then AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string]) fi +AC_ARG_ENABLE(wifi, AS_HELP_STRING([--enable-wifi], [enable Wi-Fi support])) +if test "${enable_wifi}" != "no"; then + enable_wifi='yes' + AC_DEFINE(WITH_WIFI, 1, [Define if you have Wi-Fi support]) +else + AC_DEFINE(WITH_WIFI, 0, [Define if you have Wi-Fi support]) +fi +AM_CONDITIONAL(WITH_WIFI, test "${enable_wifi}" = "yes") + dnl dnl Default to using WEXT but allow it to be disabled dnl -AC_ARG_WITH(wext, AS_HELP_STRING([--with-wext=yes], [Enable or disable Linux Wireless Extensions]), ac_with_wext=$withval, ac_with_wext="yes") +AC_ARG_WITH(wext, AS_HELP_STRING([--with-wext=yes], [Enable or disable Linux Wireless Extensions]), ac_with_wext=$withval, ac_with_wext="$enable_wifi") +if test "$ac_with_wext" != 'no'; then + ac_with_wext='yes' +fi if test x"$ac_with_wext" = x"yes"; then + if test "$enable_wifi" != "yes"; then + AC_MSG_ERROR(Enabling WEXT support and disabling Wi-Fi makes no sense) + fi AC_MSG_CHECKING([Linux kernel WEXT headers]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -193,20 +208,24 @@ if test "$ac_have_nl80211" = no; then AC_MSG_ERROR(Linux kernel development header linux/nl80211.h not installed or not functional) fi -AC_MSG_CHECKING([Linux kernel nl80211 Critical Protocol Start/Stop]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#ifndef __user - #define __user - #endif - #include <sys/types.h> - #include <linux/types.h> - #include <sys/socket.h> - #include <linux/nl80211.h>]], - [[unsigned int a = NL80211_CMD_CRIT_PROTOCOL_START; a++;]])], - [ac_have_nl80211_critproto=yes], - [ac_have_nl80211_critproto=no]) -AC_MSG_RESULT($ac_have_nl80211_critproto) +if test "$with_wifi" = "yes"; then + AC_MSG_CHECKING([Linux kernel nl80211 Critical Protocol Start/Stop]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __user + #define __user + #endif + #include <sys/types.h> + #include <linux/types.h> + #include <sys/socket.h> + #include <linux/nl80211.h>]], + [[unsigned int a = NL80211_CMD_CRIT_PROTOCOL_START; a++;]])], + [ac_have_nl80211_critproto=yes], + [ac_have_nl80211_critproto=no]) + AC_MSG_RESULT($ac_have_nl80211_critproto) +else + ac_have_nl80211_critproto='no' +fi if test "$ac_have_nl80211_critproto" = yes; then AC_DEFINE(HAVE_NL80211_CRITICAL_PROTOCOL_CMDS, 1, [Define if nl80211 has critical protocol support]) else @@ -1066,6 +1085,7 @@ echo echo "Features:" echo " wext: $ac_with_wext" +echo " wifi: $enable_wifi" echo " wimax: $enable_wimax" echo " ppp: $enable_ppp" echo " modemmanager-1: $with_modem_manager_1" diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 0b3f702710..f88ce95892 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -389,6 +389,11 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %else --with-modem-manager-1=no \ %endif +%if 0%{?with_wifi} + --enable-wifi=yes \ +%else + --enable-wifi=no \ +%endif %if 0%{?with_wimax} --enable-wimax=yes \ %else @@ -576,8 +581,6 @@ fi %files wifi %defattr(-,root,root,0755) %{_libdir}/%{name}/libnm-device-plugin-wifi.so -%else -%exclude %{_libdir}/%{name}/libnm-device-plugin-wifi.so %endif %if 0%{?with_wwan} diff --git a/src/Makefile.am b/src/Makefile.am index b8e4c36b38..a5a40fba35 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,6 @@ include $(GLIB_MAKEFILE) SUBDIRS = \ . \ devices/adsl \ - devices/wifi \ dhcp-manager \ ppp-manager \ settings/plugins @@ -16,6 +15,10 @@ SUBDIRS += \ devices/bluetooth endif +if WITH_WIFI +SUBDIRS += devices/wifi +endif + if WITH_WIMAX SUBDIRS += devices/wimax endif |