Move chrome packaging options to ac configure.

master
Fedor 2020-11-26 05:41:52 +02:00
parent eefdf718e1
commit c346f00658
6 changed files with 102 additions and 41 deletions

View File

@ -161,6 +161,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',

View File

@ -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

View File

@ -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!' ; \

View File

@ -4313,6 +4313,101 @@ 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
# Fennec's static resources live in the assets/ folder of the
# APK. Adding a path to the name here works because we only
# have one omnijar file in the final package (which is not the
# case on desktop), and necessitates some contortions during
# packaging so that the resources in the omnijar are considered
# as rooted at / and not as rooted at assets/ (which again is
# not the case on desktop: there are omnijars rooted at webrtc/,
# etc). packager.mk handles changing the rooting of the single
# omnijar.
case "$target" in
*-android*|*-linuxandroid*)
OMNIJAR_NAME="assets/$OMNIJAR_NAME"
;;
esac
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 ========================================================

View File

@ -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:

View File

@ -372,43 +372,6 @@ 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' or build_project == 'mobile/android':
return 'flat'
return 'symlink'
set_config('MOZ_JAR_MAKER_FILE_FORMAT', jar_maker_format)
@depends(toolkit)
def omnijar_name(toolkit):
# Fennec's static resources live in the assets/ folder of the
# APK. Adding a path to the name here works because we only
# have one omnijar file in the final package (which is not the
# case on desktop), and necessitates some contortions during
# packaging so that the resources in the omnijar are considered
# as rooted at / and not as rooted at assets/ (which again is
# not the case on desktop: there are omnijars rooted at webrtc/,
# etc). packager.mk handles changing the rooting of the single
# omnijar.
return 'assets/omni.ja' if toolkit == 'android' else 'omni.ja'
set_config('OMNIJAR_NAME', omnijar_name)
project_flag('MOZ_ANDROID_HISTORY',
help='Enable Android History instead of Places',
set_as_define=True)