Bug 1175555 - Build flag to exclude hyphenation dictionaries from Android builds r?nalexander draft
authorJonathan Almeida [:jonalmeida] <jonalmeida942@gmail.com>
Wed, 23 Sep 2015 22:28:59 -0400
changeset 302497 1f9ad77be2930e3831152f137dc0b40bcd998ab6
parent 302157 0416fbbd3a63280eab7738c1246acd4b0104b619
child 510398 a067a45fad4bb44a7514443115831117d9696c85
push id6630
push userjonalmeida942@gmail.com
push dateWed, 21 Oct 2015 23:07:40 +0000
reviewersnalexander
bugs1175555
milestone44.0a1
Bug 1175555 - Build flag to exclude hyphenation dictionaries from Android builds r?nalexander
configure.in
intl/locales/Makefile.in
mobile/android/base/AppConstants.java.in
--- a/configure.in
+++ b/configure.in
@@ -3751,16 +3751,17 @@ MOZ_ANDROID_HISTORY=
 MOZ_WEBSMS_BACKEND=
 MOZ_ANDROID_BEAM=
 MOZ_LOCALE_SWITCHER=
 MOZ_ANDROID_READING_LIST_SERVICE=
 MOZ_ANDROID_SEARCH_ACTIVITY=
 MOZ_ANDROID_DOWNLOADS_INTEGRATION=
 MOZ_ANDROID_MLS_STUMBLER=
 MOZ_ANDROID_SHARE_OVERLAY=
+MOZ_EXCLUDE_HYPHENATION_DICTIONARIES=
 MOZ_INSTALL_TRACKING=
 MOZ_SWITCHBOARD=
 ACCESSIBILITY=1
 MOZ_TIME_MANAGER=
 MOZ_SIMPLEPUSH=
 MOZ_PAY=
 MOZ_AUDIO_CHANNEL_MANAGER=
 MOZ_CONTENT_SANDBOX=
@@ -4855,16 +4856,23 @@ fi
 
 dnl = Include Tab Queue on Android
 dnl = Temporary build flag to allow development in Nightly
 dnl ========================================================
 if test -n "$MOZ_ANDROID_TAB_QUEUE"; then
     AC_DEFINE(MOZ_ANDROID_TAB_QUEUE)
 fi
 
+dnl =========================================================
+dnl = Whether to exclude hyphenations files in the final APK.
+dnl =========================================================
+if test -n "$MOZ_EXCLUDE_HYPHENATION_DICTIONARIES"; then
+    AC_DEFINE(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
+fi
+
 dnl ========================================================
 dnl = Include install tracking on Android
 dnl ========================================================
 if test -n "$MOZ_INSTALL_TRACKING"; then
     AC_DEFINE(MOZ_INSTALL_TRACKING)
 fi
 
 dnl ========================================================
@@ -8591,16 +8599,17 @@ AC_SUBST(MOZ_ANDROID_SEARCH_ACTIVITY)
 AC_SUBST(MOZ_ANDROID_SHARE_OVERLAY)
 AC_SUBST(MOZ_ANDROID_FIREFOX_ACCOUNT_PROFILES)
 AC_SUBST(MOZ_ANDROID_TAB_QUEUE)
 AC_SUBST(MOZ_ANDROID_MLS_STUMBLER)
 AC_SUBST(MOZ_ANDROID_DOWNLOADS_INTEGRATION)
 AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
 AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
 AC_SUBST(MOZ_ANDROID_SEARCH_INTENT_CLASS)
+AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
 AC_SUBST(MOZ_INSTALL_TRACKING)
 AC_SUBST(MOZ_SWITCHBOARD)
 AC_SUBST(ENABLE_STRIP)
 AC_SUBST(PKG_SKIP_STRIP)
 AC_SUBST(STRIP_FLAGS)
 AC_SUBST(USE_ELF_HACK)
 AC_SUBST(INCREMENTAL_LINKER)
 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
--- a/intl/locales/Makefile.in
+++ b/intl/locales/Makefile.in
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 include $(topsrcdir)/config/rules.mk
 
-PATTERN_FILES = $(strip $(wildcard $(srcdir)/*/hyphenation/*.dic))
+ifndef MOZ_EXCLUDE_HYPHENATION_DICTIONARIES
+    PATTERN_FILES = $(strip $(wildcard $(srcdir)/*/hyphenation/*.dic))
 
 ifneq (,$(PATTERN_FILES))
 libs::
 	$(INSTALL)  $(PATTERN_FILES) $(FINAL_TARGET)/hyphenation
 endif
+endif
--- a/mobile/android/base/AppConstants.java.in
+++ b/mobile/android/base/AppConstants.java.in
@@ -149,16 +149,26 @@ public class AppConstants {
     public static final String MOZ_PKG_SPECIAL =
 //#ifdef MOZ_PKG_SPECIAL
     "@MOZ_PKG_SPECIAL@";
 //#else
     null;
 //#endif
 
     /**
+     * Whether this APK was built with hyphenations files included
+     */
+    public static final boolean MOZ_EXCLUDE_HYPHENATION_DICTIONARIES =
+//#ifdef MOZ_EXCLUDE_HYPHENATION_DICTIONARIES
+    true;
+//#else
+    false;
+//#endif
+
+    /**
      * Whether this APK was built with constrained resources --
      * no xhdpi+ images, for example.
      */
     public static final boolean MOZ_ANDROID_RESOURCE_CONSTRAINED =
 //#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
     true;
 //#else
     false;