summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-04-29 19:40:14 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-05-05 21:16:23 +0200
commit27cc1d10421777469c89cd1ec30229643b1a03ea (patch)
tree79c7df8c90970a04f71962172ad42ae1914015ad
parentd7e5d19e4617e41765db758778503501bfa8fdcf (diff)
Add --enable-wasm-strip
Will just set enable wasm strip for cross-target Change-Id: I0840b843794e4fab694df26608619a7bf06f5e5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114981 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.ac13
-rw-r--r--solenv/gbuild/gbuild.mk4
3 files changed, 18 insertions, 0 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 5cc02e393589..d45511061037 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -200,6 +200,7 @@ export ENABLE_SKIA=@ENABLE_SKIA@
export ENABLE_SKIA_DEBUG=@ENABLE_SKIA_DEBUG@
export ENABLE_SYMBOLS_FOR=@ENABLE_SYMBOLS_FOR@
export ENABLE_VALGRIND=@ENABLE_VALGRIND@
+export ENABLE_WASM_STRIP=@ENABLE_WASM_STRIP@
export ENABLE_WERROR=@ENABLE_WERROR@
export ENDIANNESS=@ENDIANNESS@
export EPM=@EPM@
diff --git a/configure.ac b/configure.ac
index 9a9e42031ae1..44ea1276283c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1895,6 +1895,12 @@ AC_ARG_ENABLE(curl,
[Disable CURL support.]),
,enable_curl=yes)
+AC_ARG_ENABLE(wasm-strip,
+ AS_HELP_STRING([--enable-wasm-strip],
+ [Strip the static build like for WASM/emscripten platform.]),
+,enable_wasm_strip=yes)
+
+
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
@@ -3721,13 +3727,19 @@ if test "$_os" = "iOS" -o "$build_cpu" != "$host_cpu"; then
cross_compiling="yes"
fi
fi
+
+ENABLE_WASM_STRIP=''
if test "$cross_compiling" = "yes"; then
export CROSS_COMPILING=TRUE
+ if test "$enable_dynamic_loading" != yes -a "$enable_wasm_strip" = yes; then
+ ENABLE_WASM_STRIP=TRUE
+ fi
else
CROSS_COMPILING=
BUILD_TYPE="$BUILD_TYPE NATIVE"
fi
AC_SUBST(CROSS_COMPILING)
+AC_SUBST(ENABLE_WASM_STRIP)
# Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
# NOTE: must _not_ be used for bundled external libraries!
@@ -5302,6 +5314,7 @@ if test "$cross_compiling" = "yes"; then
test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
test "$with_galleries" = "no" -o -z "$WITH_GALLERY_BUILD" && sub_conf_opts="$sub_conf_opts --with-galleries=no"
+ test "$enable_wasm_strip" = "yes" && sub_conf_opts="$sub_conf_opts --enable-wasm-strip"
sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
# Don't bother having configure look for stuff not needed for the build platform anyway
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 1afa9e0451af..08c82f5e8d1f 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -220,6 +220,10 @@ gb_GLOBALDEFS := \
$(gb_COMPILERDEFS) \
$(gb_CPUDEFS) \
+ifeq ($(ENABLE_WASM_STRIP),TRUE)
+gb_GLOBALDEFS += -DENABLE_WASM_STRIP
+endif
+
ifeq ($(gb_ENABLE_DBGUTIL),$(true))
gb_GLOBALDEFS += -DDBG_UTIL