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
This commit is contained in:
28
configure.ac
28
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])
|
AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
|
||||||
fi
|
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
|
||||||
dnl Default to using WEXT but allow it to be disabled
|
dnl Default to using WEXT but allow it to be disabled
|
||||||
dnl
|
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 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_MSG_CHECKING([Linux kernel WEXT headers])
|
||||||
AC_COMPILE_IFELSE(
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
@@ -193,8 +208,9 @@ if test "$ac_have_nl80211" = no; then
|
|||||||
AC_MSG_ERROR(Linux kernel development header linux/nl80211.h not installed or not functional)
|
AC_MSG_ERROR(Linux kernel development header linux/nl80211.h not installed or not functional)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([Linux kernel nl80211 Critical Protocol Start/Stop])
|
if test "$with_wifi" = "yes"; then
|
||||||
AC_COMPILE_IFELSE(
|
AC_MSG_CHECKING([Linux kernel nl80211 Critical Protocol Start/Stop])
|
||||||
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[[#ifndef __user
|
[[#ifndef __user
|
||||||
#define __user
|
#define __user
|
||||||
@@ -206,7 +222,10 @@ AC_COMPILE_IFELSE(
|
|||||||
[[unsigned int a = NL80211_CMD_CRIT_PROTOCOL_START; a++;]])],
|
[[unsigned int a = NL80211_CMD_CRIT_PROTOCOL_START; a++;]])],
|
||||||
[ac_have_nl80211_critproto=yes],
|
[ac_have_nl80211_critproto=yes],
|
||||||
[ac_have_nl80211_critproto=no])
|
[ac_have_nl80211_critproto=no])
|
||||||
AC_MSG_RESULT($ac_have_nl80211_critproto)
|
AC_MSG_RESULT($ac_have_nl80211_critproto)
|
||||||
|
else
|
||||||
|
ac_have_nl80211_critproto='no'
|
||||||
|
fi
|
||||||
if test "$ac_have_nl80211_critproto" = yes; then
|
if test "$ac_have_nl80211_critproto" = yes; then
|
||||||
AC_DEFINE(HAVE_NL80211_CRITICAL_PROTOCOL_CMDS, 1, [Define if nl80211 has critical protocol support])
|
AC_DEFINE(HAVE_NL80211_CRITICAL_PROTOCOL_CMDS, 1, [Define if nl80211 has critical protocol support])
|
||||||
else
|
else
|
||||||
@@ -1066,6 +1085,7 @@ echo
|
|||||||
|
|
||||||
echo "Features:"
|
echo "Features:"
|
||||||
echo " wext: $ac_with_wext"
|
echo " wext: $ac_with_wext"
|
||||||
|
echo " wifi: $enable_wifi"
|
||||||
echo " wimax: $enable_wimax"
|
echo " wimax: $enable_wimax"
|
||||||
echo " ppp: $enable_ppp"
|
echo " ppp: $enable_ppp"
|
||||||
echo " modemmanager-1: $with_modem_manager_1"
|
echo " modemmanager-1: $with_modem_manager_1"
|
||||||
|
@@ -389,6 +389,11 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
|
|||||||
%else
|
%else
|
||||||
--with-modem-manager-1=no \
|
--with-modem-manager-1=no \
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?with_wifi}
|
||||||
|
--enable-wifi=yes \
|
||||||
|
%else
|
||||||
|
--enable-wifi=no \
|
||||||
|
%endif
|
||||||
%if 0%{?with_wimax}
|
%if 0%{?with_wimax}
|
||||||
--enable-wimax=yes \
|
--enable-wimax=yes \
|
||||||
%else
|
%else
|
||||||
@@ -576,8 +581,6 @@ fi
|
|||||||
%files wifi
|
%files wifi
|
||||||
%defattr(-,root,root,0755)
|
%defattr(-,root,root,0755)
|
||||||
%{_libdir}/%{name}/libnm-device-plugin-wifi.so
|
%{_libdir}/%{name}/libnm-device-plugin-wifi.so
|
||||||
%else
|
|
||||||
%exclude %{_libdir}/%{name}/libnm-device-plugin-wifi.so
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?with_wwan}
|
%if 0%{?with_wwan}
|
||||||
|
@@ -5,7 +5,6 @@ include $(GLIB_MAKEFILE)
|
|||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
. \
|
. \
|
||||||
devices/adsl \
|
devices/adsl \
|
||||||
devices/wifi \
|
|
||||||
dhcp-manager \
|
dhcp-manager \
|
||||||
ppp-manager \
|
ppp-manager \
|
||||||
settings/plugins
|
settings/plugins
|
||||||
@@ -16,6 +15,10 @@ SUBDIRS += \
|
|||||||
devices/bluetooth
|
devices/bluetooth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if WITH_WIFI
|
||||||
|
SUBDIRS += devices/wifi
|
||||||
|
endif
|
||||||
|
|
||||||
if WITH_WIMAX
|
if WITH_WIMAX
|
||||||
SUBDIRS += devices/wimax
|
SUBDIRS += devices/wimax
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user