Bug 803480 - Enable NeckoWifi by default only on platforms where it's actually supported. r=ted
authorJan Beich <jbeich@tormail.org>
Wed, 17 Jul 2013 09:57:28 -0400
changeset 139195 b794c01d9e70e43329db333ce75cfc7067698ce7
parent 139194 0ded4854067b24c0c2019781eb41bbc6981f0ba6
child 139196 ab8b01fae7e1ee77013b8bc000cd9b0cbf21cc85
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersted
bugs803480
milestone25.0a1
Bug 803480 - Enable NeckoWifi by default only on platforms where it's actually supported. r=ted
configure.in
netwerk/wifi/Makefile.in
netwerk/wifi/moz.build
--- a/configure.in
+++ b/configure.in
@@ -4288,17 +4288,16 @@ MOZ_UI_LOCALE=en-US
 MOZ_UNIVERSALCHARDET=1
 MOZ_URL_CLASSIFIER=
 MOZ_XUL=1
 MOZ_ZIPWRITER=1
 NS_PRINTING=1
 MOZ_PDF_PRINTING=
 MOZ_DISABLE_CRYPTOLEGACY=
 NSS_DISABLE_DBM=
-NECKO_WIFI=1
 NECKO_COOKIES=1
 NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
 USE_ARM_KUSER=
 BUILD_CTYPES=1
 MOZ_USE_NATIVE_POPUP_WINDOWS=
 MOZ_ANDROID_HISTORY=
 MOZ_WEBSMS_BACKEND=
 MOZ_ANDROID_WALLPAPER=
@@ -4318,21 +4317,16 @@ esac
 
 case "${target}" in
     *-android*|*-linuxandroid*)
         if test "$CPU_ARCH" = "arm" ; then
           USE_ARM_KUSER=1
         fi
 
         NSS_DISABLE_DBM=1
-        if test -z "$gonkdir"; then
-          NECKO_WIFI=
-        else
-          NECKO_WIFI=1
-        fi
         MOZ_THEME_FASTSTRIPE=1
         MOZ_TREE_FREETYPE=1
         MOZ_MEMORY=1
         MOZ_RAW=1
         ;;
 
 esac
 
@@ -8473,38 +8467,46 @@ AC_SUBST(NECKO_PROTOCOLS)
 for p in $NECKO_PROTOCOLS; do
     AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
     _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_PROTOCOL_$p"
 done
 
 dnl
 dnl option to disable necko's wifi scanner
 dnl
+
+case "$OS_TARGET" in
+  Android)
+    if test -n "$gonkdir"; then
+      NECKO_WIFI=1
+    fi
+    ;;
+  Darwin|SunOS|WINNT)
+    NECKO_WIFI=1
+    ;;
+  Linux)
+    if test -z "$MOZ_ENABLE_DBUS"; then
+      AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
+    fi
+    NECKO_WIFI=1
+    NECKO_WIFI_DBUS=1
+    ;;
+esac
+
 MOZ_ARG_DISABLE_BOOL(necko-wifi,
 [  --disable-necko-wifi    Disable necko wifi scanner],
     NECKO_WIFI=,
     NECKO_WIFI=1)
 
-if test "$OS_ARCH" = "OS2"; then
-  dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
-  NECKO_WIFI=
-fi
-if test "$NECKO_WIFI" -a \
-        "$OS_ARCH" != "Linux" -a \
-        "$OS_ARCH" != "Darwin" -a \
-        "$OS_ARCH" != "SunOS" -a \
-        "$OS_ARCH" != "WINNT"; then
-  AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
-fi
-
 if test "$NECKO_WIFI"; then
   AC_DEFINE(NECKO_WIFI)
   _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
 fi
 AC_SUBST(NECKO_WIFI)
+AC_SUBST(NECKO_WIFI_DBUS)
 
 dnl
 dnl option to disable cookies
 dnl
 MOZ_ARG_DISABLE_BOOL(cookies,
 [  --disable-cookies       Disable cookie support],
     NECKO_COOKIES=,
     NECKO_COOKIES=1)
--- a/netwerk/wifi/Makefile.in
+++ b/netwerk/wifi/Makefile.in
@@ -15,14 +15,14 @@ ifneq ($(OS_ARCH),Darwin)
 # osx_corewlan.mm has warnings I don't understand.
 FAIL_ON_WARNINGS := 1
 endif
 
 ifeq ($(OS_ARCH),SunOS)
 OS_INCLUDES += $(GLIB_CFLAGS)
 endif
 
-ifdef MOZ_ENABLE_DBUS
+ifdef NECKO_WIFI_DBUS
 OS_INCLUDES += $(MOZ_DBUS_GLIB_CFLAGS)
 endif
 
 include $(topsrcdir)/config/rules.mk
 
--- a/netwerk/wifi/moz.build
+++ b/netwerk/wifi/moz.build
@@ -38,14 +38,14 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
     CPP_SOURCES += [
         'nsWifiScannerWin.cpp',
     ]
 elif CONFIG['OS_ARCH'] == 'SunOS':
     CPP_SOURCES += [
         'nsWifiScannerSolaris.cpp',
     ]
 
-if CONFIG['MOZ_ENABLE_DBUS']:
+if CONFIG['NECKO_WIFI_DBUS']:
     CPP_SOURCES += [
         'nsWifiScannerDBus.cpp',
     ]
 
 LIBRARY_NAME = 'neckowifi_s'