Bug 1091087 - Disable MOZ_NATIVE_DEVICES when MOZ_ANDROID_RESOURCE_CONSTRAINED is set. r=glandium
authorNick Alexander <nalexander@mozilla.com>
Mon, 03 Nov 2014 20:04:19 -0800
changeset 213844 72f0d9f6d5f1c99c4970ef59acea4c3bd779cf1a
parent 213843 53c21e42a5ec54547914ca1d8df7645fa9f43980
child 213845 25449ca505b45574f1acc1d23c6d92f25e8d9441
push id27766
push usercbook@mozilla.com
push dateTue, 04 Nov 2014 12:18:09 +0000
treeherdermozilla-central@cadcd47db610 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1091087
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1091087 - Disable MOZ_NATIVE_DEVICES when MOZ_ANDROID_RESOURCE_CONSTRAINED is set. r=glandium This saves dexing and shipping the Google Play Services and other Google libraries, which add resources and about 3megs of code. Due to ordering issues, the relevant flags and toggles were moved to configure.in and exposed early enough to be used by confvars.sh.
build/autoconf/android.m4
configure.in
mobile/android/confvars.sh
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -407,36 +407,16 @@ case "$target" in
       AC_MSG_ERROR([The program aidl was not found.  Use --with-android-sdk={android-sdk-dir}.])
     fi
     if test -z "$ADB" -o "$ADB" = ":"; then
       AC_MSG_ERROR([The program adb was not found.  Use --with-android-sdk={android-sdk-dir}.])
     fi
     ;;
 esac
 
-MOZ_ARG_DISABLE_BOOL(android-include-fonts,
-[  --disable-android-include-fonts
-                          disable the inclusion of fonts into the final APK],
-    MOZ_ANDROID_EXCLUDE_FONTS=1)
-
-if test -n "$MOZ_ANDROID_EXCLUDE_FONTS"; then
-    AC_DEFINE(MOZ_ANDROID_EXCLUDE_FONTS, $MOZ_ANDROID_EXCLUDE_FONTS)
-    AC_SUBST(MOZ_ANDROID_EXCLUDE_FONTS)
-fi
-
-MOZ_ARG_ENABLE_BOOL(android-resource-constrained,
-[  --enable-android-resource-constrained
-                          exclude hi-res images and similar from the final APK],
-    MOZ_ANDROID_RESOURCE_CONSTRAINED=1)
-
-if test -n "$MOZ_ANDROID_RESOURCE_CONSTRAINED"; then
-    AC_DEFINE(MOZ_ANDROID_RESOURCE_CONSTRAINED, $MOZ_ANDROID_RESOURCE_CONSTRAINED)
-    AC_SUBST(MOZ_ANDROID_RESOURCE_CONSTRAINED)
-fi
-
 MOZ_ARG_WITH_STRING(android-min-sdk,
 [  --with-android-min-sdk=[VER]     Impose a minimum Firefox for Android SDK version],
 [ MOZ_ANDROID_MIN_SDK_VERSION=$withval ])
 
 MOZ_ARG_WITH_STRING(android-max-sdk,
 [  --with-android-max-sdk=[VER]     Impose a maximum Firefox for Android SDK version],
 [ MOZ_ANDROID_MAX_SDK_VERSION=$withval ])
 
--- a/configure.in
+++ b/configure.in
@@ -4089,16 +4089,40 @@ MOZ_ARG_WITH_STRING(bing-api-keyfile,
   MOZ_BING_API_KEY=`cat $withval | cut -f 2 -d " "`])
 if test -z "$MOZ_BING_API_CLIENTID"; then
     MOZ_BING_API_CLIENTID=no-bing-api-clientid
     MOZ_BING_API_KEY=no-bing-api-key
 fi
 AC_SUBST(MOZ_BING_API_CLIENTID)
 AC_SUBST(MOZ_BING_API_KEY)
 
+# Whether to include optional-but-large font files in the final APK.
+# We want this in mobile/android/confvars.sh, so it goes early.
+MOZ_ARG_DISABLE_BOOL(android-include-fonts,
+[  --disable-android-include-fonts
+                          Disable the inclusion of fonts into the final APK],
+    MOZ_ANDROID_EXCLUDE_FONTS=1)
+
+if test -n "$MOZ_ANDROID_EXCLUDE_FONTS"; then
+    AC_DEFINE(MOZ_ANDROID_EXCLUDE_FONTS)
+fi
+AC_SUBST(MOZ_ANDROID_EXCLUDE_FONTS)
+
+# Whether this APK is destined for resource constrained devices.
+# We want this in mobile/android/confvars.sh, so it goes early.
+MOZ_ARG_ENABLE_BOOL(android-resource-constrained,
+[  --enable-android-resource-constrained
+                          Exclude hi-res images and similar from the final APK],
+    MOZ_ANDROID_RESOURCE_CONSTRAINED=1)
+
+if test -n "$MOZ_ANDROID_RESOURCE_CONSTRAINED"; then
+    AC_DEFINE(MOZ_ANDROID_RESOURCE_CONSTRAINED)
+fi
+AC_SUBST(MOZ_ANDROID_RESOURCE_CONSTRAINED)
+
 # Allow the application to influence configure with a confvars.sh script.
 AC_MSG_CHECKING([if app-specific confvars.sh exists])
 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
   AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
   . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
 else
   AC_MSG_RESULT([no])
 fi
--- a/mobile/android/confvars.sh
+++ b/mobile/android/confvars.sh
@@ -61,18 +61,21 @@ MOZ_DATA_REPORTING=1
 fi
 
 # Enable runtime locale switching.
 MOZ_LOCALE_SWITCHER=1
 
 # Enable second screen and casting support for external devices.
 MOZ_DEVICES=1
 
-# Enable second screen using native Android libraries
-MOZ_NATIVE_DEVICES=1
+# Enable second screen using native Android libraries, provided we're
+# not resource constrained.
+if test -z "$MOZ_ANDROID_RESOURCE_CONSTRAINED"; then
+  MOZ_NATIVE_DEVICES=1
+fi
 
 # Mark as WebGL conformant
 MOZ_WEBGL_CONFORMANT=1
 
 # Enable the Search Activity.
 MOZ_ANDROID_SEARCH_ACTIVITY=1
 
 # Enable the new tablet UI in pre-release builds