diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-11-16 12:47:54 -0500 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-11-18 10:59:16 +0000 |
commit | 976ccaa9223740c743d18824f12a521ed5a5601b (patch) | |
tree | bcae91cb897085a3e595182c6321d7f2a9273a01 | |
parent | 8b3375e2c202c04935ca056cc8dc389a08e47bb6 (diff) | |
download | uxp-976ccaa9223740c743d18824f12a521ed5a5601b.tar.gz |
Issue #251 - Move chrome packaging options to ac configure
Also adds options for new functionality in #1683
-rw-r--r-- | build/moz.configure/old.configure | 3 | ||||
-rw-r--r-- | config/config.mk | 2 | ||||
-rw-r--r-- | config/tests/src-simple/Makefile.in | 2 | ||||
-rw-r--r-- | old-configure.in | 79 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/test/backend/test_build.py | 4 | ||||
-rw-r--r-- | toolkit/moz.configure | 30 |
6 files changed, 86 insertions, 34 deletions
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 525129d344..559e24a740 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -162,6 +162,8 @@ def old_configure_options(*options): '--enable-b2g-camera', '--enable-b2g-ril', '--enable-bundled-fonts', + '--enable-chrome-compression', + '--enable-chrome-format', '--enable-clang-plugin', '--enable-content-sandbox', '--enable-cookies', @@ -263,6 +265,7 @@ def old_configure_options(*options): '--with-app-name', '--with-arch', '--with-branding', + '--with-chrome-name', '--with-crashreporter-enable-percent', '--with-cross-lib', '--with-debug-label', diff --git a/config/config.mk b/config/config.mk index 5a352e5296..6208d124e1 100644 --- a/config/config.mk +++ b/config/config.mk @@ -216,7 +216,7 @@ endif # NO_PROFILE_GUIDED_OPTIMIZE MAKE_JARS_FLAGS = \ -t $(topsrcdir) \ - -f $(MOZ_JAR_MAKER_FILE_FORMAT) \ + -f $(MOZ_CHROME_FILE_FORMAT) \ $(NULL) ifdef USE_EXTENSION_MANIFEST diff --git a/config/tests/src-simple/Makefile.in b/config/tests/src-simple/Makefile.in index 55fdfd8677..96f9a41540 100644 --- a/config/tests/src-simple/Makefile.in +++ b/config/tests/src-simple/Makefile.in @@ -22,7 +22,7 @@ REF_MANIFEST = $(if $(USE_EXTENSION_MANIFEST),chrome.manifest,test.manifest) check-%:: if test -d $(FINAL_TARGET); then rm -rf $(FINAL_TARGET); fi; - $(MAKE) realchrome MOZ_JAR_MAKER_FILE_FORMAT=$* + $(MAKE) realchrome MOZ_CHROME_FILE_FORMAT=$* @echo 'Comparing manifests...' @if ! sort $(MY_MANIFEST) | diff --text -U 0 $(srcdir)/../$(REF_MANIFEST).$* - ; then \ echo 'TEST-UNEXPECTED-FAIL | config/tests/$(REF_MANIFEST).$* | differing content in manifest!' ; \ diff --git a/old-configure.in b/old-configure.in index d34f722048..ade675e956 100644 --- a/old-configure.in +++ b/old-configure.in @@ -4315,6 +4315,85 @@ dnl = dnl ======================================================== MOZ_ARG_HEADER(Misc. Options) +dnl ========================================================= +dnl = Chrome format +dnl ========================================================= +MOZ_ARG_ENABLE_STRING([chrome-format], +[ --enable-chrome-format=jar|flat|omni + Select FORMAT of chrome files during packaging], + MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`) + +if test -z "$MOZ_CHROME_FILE_FORMAT"; then + MOZ_CHROME_FILE_FORMAT=omni +fi + +if test "$MOZ_CHROME_FILE_FORMAT" = "symlink"; then + AC_MSG_ERROR([--enable-chrome-format=symlink has been deprecated. It is now used by default in $DIST/bin on platforms that support it]) +fi + +if test "$MOZ_CHROME_FILE_FORMAT" != "jar" && + test "$MOZ_CHROME_FILE_FORMAT" != "flat" && + test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then + AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, or omni]) +fi + +dnl ========================================================= +dnl = Chrome compression +dnl ========================================================= +MOZ_ARG_ENABLE_STRING([chrome-compression], +[ --enable-chrome-compression=none|deflate|brotli + Select COMPRESSION type of chrome files during packaging], + JAR_COMPRESSION=`echo $enableval | tr A-Z a-z`) + +if test -z "$JAR_COMPRESSION"; then + JAR_COMPRESSION=deflate +fi + +if test "$JAR_COMPRESSION" != "none" && + test "$JAR_COMPRESSION" != "deflate" && + test "$JAR_COMPRESSION" != "brotli"; then + AC_MSG_ERROR([--enable-chrome-compression must be set to either none, deflate, or brotli]) +fi + +dnl ========================================================= +dnl Omnijar packaging (bug 552121) +dnl ========================================================= +dnl Omnijar packaging is compatible with flat packaging. +dnl In unpackaged builds, omnijar looks for files as if +dnl things were flat packaged. After packaging, all files +dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT +dnl is set to flat since putting files into jars is only +dnl done during packaging with omnijar. +if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then + MOZ_OMNIJAR=1 + AC_DEFINE(MOZ_OMNIJAR) +fi + +# Allow someone to change OMNIJAR_NAME in mozconfig +MOZ_ARG_WITH_STRING(chrome-name, +[ --with-chrome-name=CHROMENAME + Set chrome jar name (default=omni.ja)], +[ val=`echo $withval` + OMNIJAR_NAME="$val"]) + +# Default Omni Jar Name +if test -z "$OMNIJAR_NAME" ; then + OMNIJAR_NAME=omni.ja +fi + +MOZ_PACKAGER_FORMAT="$MOZ_CHROME_FILE_FORMAT" +if test "$OS_ARCH" = "WINNT"; then + MOZ_CHROME_FILE_FORMAT=flat +else + MOZ_CHROME_FILE_FORMAT=symlink +fi + +AC_SUBST(JAR_COMPRESSION) +AC_SUBST(OMNIJAR_NAME) +AC_SUBST(MOZ_OMNIJAR) +AC_SUBST(MOZ_PACKAGER_FORMAT) +AC_SUBST(MOZ_CHROME_FILE_FORMAT) + dnl ======================================================== dnl = Disable Jetpack dnl ======================================================== diff --git a/python/mozbuild/mozbuild/test/backend/test_build.py b/python/mozbuild/mozbuild/test/backend/test_build.py index d3f5fb6a9d..d6111d85f7 100644 --- a/python/mozbuild/mozbuild/test/backend/test_build.py +++ b/python/mozbuild/mozbuild/test/backend/test_build.py @@ -84,7 +84,7 @@ class TestBuild(unittest.TestCase): config.topobjdir) overrides = [ 'install_manifest_depends=', - 'MOZ_JAR_MAKER_FILE_FORMAT=flat', + 'MOZ_CHROME_FILE_FORMAT=flat', 'TEST_MOZBUILD=1', ] with self.line_handler() as handle_make_line: @@ -108,7 +108,7 @@ class TestBuild(unittest.TestCase): config.topobjdir) overrides = [ 'install_manifest_depends=', - 'MOZ_JAR_MAKER_FILE_FORMAT=flat', + 'MOZ_CHROME_FILE_FORMAT=flat', 'TEST_MOZBUILD=1', ] with self.line_handler() as handle_make_line: diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 8633277514..8d399be67d 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -345,36 +345,6 @@ set_config('MOZ_FMP4', fmp4) set_define('MOZ_FMP4', fmp4) add_old_configure_assignment('MOZ_FMP4', fmp4) -# Miscellaneous -# ============================================================== -option(name='--enable-chrome-format', - help='Select FORMAT of chrome files during packaging.', - nargs=1, - choices=('omni', 'jar', 'flat'), - default='omni') - -@depends('--enable-chrome-format') -def packager_format(value): - return value[0] - -set_config('MOZ_PACKAGER_FORMAT', packager_format) - -@depends(host, build_project) -def jar_maker_format(host, build_project): - # Multilocales for mobile/android use the same mergedirs for all locales, - # so we can't use symlinks for those builds. - if host.os == 'WINNT': - return 'flat' - return 'symlink' - -set_config('MOZ_JAR_MAKER_FILE_FORMAT', jar_maker_format) - -@depends(toolkit) -def omnijar_name(toolkit): - return 'omni.ja' - -set_config('OMNIJAR_NAME', omnijar_name) - # Permissions system # ============================================================== option(name='--disable-permissions', |