diff options
author | Job Bautista <jobbautista9@aol.com> | 2023-03-19 00:08:48 +0800 |
---|---|---|
committer | Job Bautista <jobbautista9@aol.com> | 2023-03-19 00:16:46 +0800 |
commit | eac34369607620a9c80e0472a627ae8a7ec095be (patch) | |
tree | 7aeeacf67346a912bc4cb3ef56d38cd8f5b63fb9 /build | |
parent | 972e0410ca7df3b66d1675c8ed10a2a547a4ecbf (diff) | |
download | uxp-eac34369607620a9c80e0472a627ae8a7ec095be.tar.gz |
Issue #2165 - Build ICU as a shared library if we're building Spidermonkey shared.
It seems that if we're going to enable JS_SHARED_LIBRARY, we need ICU to be a
shared library too in order to prevent code duplication in mozjs.dll bloating
it to a whopping 21 MB.
This unfortunately means we have to fold icudata back to icu itself. But since
icudata is still separated from libxul (which is what really matters for #1451),
I think this is a fair compromise.
Building ICU as shared is offered as an option via --enable-shared-icu. But
technically you really need --enable-shared-icu if you're going to use
--enable-shared-js. Unfortunately I can't make configure exit with an error if
MOZ_SHARED_ICU is not defined when JS_SHARED_LIBRARY is enabled, because options
are controlled by different configure scripts (icu is based on bash, while js is
based on python), and I have no idea how to pass MOZ_SHARED_ICU to js's
moz.configure.
Tag #62
Diffstat (limited to 'build')
-rw-r--r-- | build/autoconf/icu.m4 | 15 | ||||
-rw-r--r-- | build/moz.configure/old.configure | 1 |
2 files changed, 9 insertions, 7 deletions
diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 index 090d6c0a2d..2530f6a69c 100644 --- a/build/autoconf/icu.m4 +++ b/build/autoconf/icu.m4 @@ -34,11 +34,10 @@ if test -n "$USE_ICU"; then ICU_DATA_FILE="icudt${version}l.dat" dnl We won't build ICU data as a separate file when building - dnl JS standalone so that embedders don't have to deal with it. - dnl We also don't do it on Windows because sometimes the file goes - dnl missing -- possibly due to overzealous antivirus software? -- - dnl which prevents the browser from starting up :( - if test -z "$JS_STANDALONE"; then + dnl ICU as a shared library, as we need to fold the data into + dnl the shared library in order for consumers like Spidermonkey + dnl to use it without code duplication. + if test -z "$MOZ_SHARED_ICU"; then MOZ_ICU_DATA_ARCHIVE=1 else MOZ_ICU_DATA_ARCHIVE= @@ -50,13 +49,15 @@ AC_SUBST(ENABLE_INTL_API) AC_SUBST(USE_ICU) AC_SUBST(ICU_DATA_FILE) AC_SUBST(MOZ_ICU_DATA_ARCHIVE) +AC_SUBST(MOZ_SHARED_ICU) if test -n "$USE_ICU"; then if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then AC_MSG_ERROR([Building ICU requires either yasm or a GNU assembler. If you do not have either of those available for this platform you must use --without-intl-api]) fi - dnl We build ICU as a static library. - AC_DEFINE(U_STATIC_IMPLEMENTATION) + if test -z "$MOZ_SHARED_ICU"; then + AC_DEFINE(U_STATIC_IMPLEMENTATION) + fi dnl Source files that use ICU should have control over which parts of the ICU dnl namespace they want to use. AC_DEFINE(U_USING_ICU_NAMESPACE,0) diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 527384839a..64e91e1f31 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -227,6 +227,7 @@ def old_configure_options(*options): '--enable-safe-browsing', '--enable-sandbox', '--enable-security-sqlstore', + '--enable-shared-icu', '--enable-shared-media', '--enable-signmar', '--enable-simulator', |