summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--README.md4
-rw-r--r--Repository.mk10
-rwxr-xr-xautogen.sh12
-rw-r--r--bridges/Module_bridges.mk2
-rw-r--r--config_host.mk.in13
-rw-r--r--configure.ac140
-rw-r--r--desktop/Library_sofficeapp.mk4
-rw-r--r--external/apr/ExternalProject_apr.mk2
-rw-r--r--external/apr/ExternalProject_apr_util.mk2
-rw-r--r--external/boost/UnpackedTarball_boost.mk1
-rw-r--r--external/boost/boost-emscripten-noshm.patch.011
-rw-r--r--external/breakpad/ExternalProject_breakpad.mk2
-rw-r--r--external/cairo/ExternalProject_cairo.mk9
-rw-r--r--external/cairo/ExternalProject_pixman.mk3
-rw-r--r--external/coinmp/ExternalProject_coinmp.mk2
-rw-r--r--external/cppunit/ExternalProject_cppunit.mk5
-rw-r--r--external/cppunit/disable-dynloading.patch2
-rw-r--r--external/curl/ExternalProject_curl.mk2
-rw-r--r--external/epm/ExternalProject_epm.mk2
-rw-r--r--external/expat/ExternalProject_expat.mk2
-rw-r--r--external/firebird/ExternalProject_firebird.mk2
-rw-r--r--external/fontconfig/ExternalProject_fontconfig.mk5
-rw-r--r--external/freetype/ExternalProject_freetype.mk2
-rw-r--r--external/gpgmepp/ExternalProject_gpgmepp.mk4
-rw-r--r--external/harfbuzz/ExternalProject_harfbuzz.mk2
-rw-r--r--external/hunspell/ExternalProject_hunspell.mk4
-rw-r--r--external/hyphen/ExternalProject_hyphen.mk2
-rw-r--r--external/icu/ExternalProject_icu.mk8
-rw-r--r--external/icu/UnpackedTarball_icu.mk1
-rw-r--r--external/icu/icu4c-emscripten-cross.patch.199
-rw-r--r--external/lcms2/ExternalProject_lcms2.mk2
-rw-r--r--external/libabw/ExternalProject_libabw.mk2
-rw-r--r--external/libassuan/ExternalProject_libassuan.mk4
-rw-r--r--external/libatomic_ops/ExternalProject_libatomic_ops.mk2
-rw-r--r--external/libcdr/ExternalProject_libcdr.mk2
-rw-r--r--external/libebook/ExternalProject_libebook.mk2
-rw-r--r--external/libeot/ExternalProject_libeot.mk2
-rw-r--r--external/libepubgen/ExternalProject_libepubgen.mk2
-rw-r--r--external/libetonyek/ExternalProject_libetonyek.mk2
-rw-r--r--external/libexttextcat/ExternalProject_libexttextcat.mk2
-rw-r--r--external/libffi/ExternalProject_libffi.mk2
-rw-r--r--external/libfreehand/ExternalProject_libfreehand.mk2
-rw-r--r--external/libgpg-error/ExternalProject_libgpg-error.mk4
-rw-r--r--external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk2
-rw-r--r--external/liblangtag/ExternalProject_liblangtag.mk4
-rw-r--r--external/libmspub/ExternalProject_libmspub.mk2
-rw-r--r--external/libmwaw/ExternalProject_libmwaw.mk2
-rw-r--r--external/libnumbertext/ExternalProject_libnumbertext.mk2
-rw-r--r--external/libodfgen/ExternalProject_libodfgen.mk2
-rw-r--r--external/liborcus/ExternalProject_liborcus.mk4
-rw-r--r--external/libpagemaker/ExternalProject_libpagemaker.mk2
-rw-r--r--external/libqxp/ExternalProject_libqxp.mk2
-rw-r--r--external/librevenge/ExternalProject_librevenge.mk2
-rw-r--r--external/libstaroffice/ExternalProject_libstaroffice.mk2
-rw-r--r--external/libvisio/ExternalProject_libvisio.mk2
-rw-r--r--external/libwpd/ExternalProject_libwpd.mk2
-rw-r--r--external/libwpg/ExternalProject_libwpg.mk2
-rw-r--r--external/libwps/ExternalProject_libwps.mk2
-rw-r--r--external/libxml2/ExternalProject_libxml2.mk6
-rw-r--r--external/libxslt/ExternalProject_libxslt.mk2
-rw-r--r--external/libzmf/ExternalProject_libzmf.mk2
-rw-r--r--external/mythes/ExternalProject_mythes.mk2
-rw-r--r--external/openldap/ExternalProject_openldap.mk2
-rw-r--r--external/openssl/ExternalProject_openssl.mk2
-rw-r--r--external/postgresql/ExternalProject_postgresql.mk2
-rw-r--r--external/python3/ExternalProject_python3.mk2
-rw-r--r--external/redland/ExternalProject_raptor.mk2
-rw-r--r--external/redland/ExternalProject_rasqal.mk2
-rw-r--r--external/redland/ExternalProject_redland.mk2
-rw-r--r--external/xmlsec/ExternalProject_xmlsec.mk4
-rw-r--r--i18nutil/source/utility/paper.cxx2
-rw-r--r--idl/source/objects/types.cxx2
-rw-r--r--include/osl/endian.h2
-rw-r--r--include/sal/alloca.h2
-rw-r--r--include/sal/config.h11
-rw-r--r--sal/osl/unx/system.hxx22
-rw-r--r--sc/source/core/tool/math.cxx5
-rwxr-xr-xsolenv/bin/run-configure9
-rw-r--r--solenv/gbuild/gbuild.mk2
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk64
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk9
-rw-r--r--xmlsecurity/Library_xsec_xmlsec.mk50
-rw-r--r--xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx2
84 files changed, 522 insertions, 119 deletions
diff --git a/.gitignore b/.gitignore
index d89e5b12035f..1e210142c8a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -175,3 +175,9 @@ LibreOffice.VC.VC.opendb
# vim-ide-integration
/compile_commands.json
+
+# Some emscripten configure artifacts
+/a.out
+/a.wasm
+/a.out.js
+/a.out.wasm
diff --git a/README.md b/README.md
index 35a68bcf4795..20912732da3d 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,10 @@ run and compile LibreOffice, also used by the TDF builds:
* Build: Xcode 9.3 and iPhone SDK 11.4
* Android:
* Build: NDK r19c and SDK 22.6.2
+* Emscripten / WASM:
+ * Runtime: a browser with SharedMemory support (threads + atomics)
+ * Build: Qt 5.15 with Qt supported Emscripten 1.39.8
+ * See README.wasm
If you want to use Clang with the LibreOffice compiler plugins, the minimal
version of Clang is 5.0.2. Since Xcode doesn't provide the compiler plugin
diff --git a/Repository.mk b/Repository.mk
index 6af72d71058e..db52290e90c7 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -552,9 +552,13 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_URE,ure, \
) \
log_uno_uno \
unsafe_uno_uno \
- $(if $(filter MSC,$(COM)), \
- $(if $(filter INTEL,$(CPUNAME)),msci, \
- $(if $(filter AARCH64,$(CPUNAME)),msca,mscx)),gcc3)_uno \
+ $(if $(filter EMSCRIPTEN,$(OS)),, \
+ $(if $(filter MSC,$(COM)), \
+ $(if $(filter INTEL,$(CPUNAME)),msci_uno) \
+ $(if $(filter X86_64,$(CPUNAME)),mscx_uno) \
+ $(if $(filter AARCH64,$(CPUNAME)),msca_uno) \
+ , gcc3_uno) \
+ ) \
))
$(eval $(call gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \
diff --git a/autogen.sh b/autogen.sh
index 1779de77e6f3..bef1f7faf561 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -295,15 +295,21 @@ if (defined $ENV{NOCONFIGURE}) {
push @args, "--srcdir=$src_path";
push @args, "--enable-option-checking=$option_checking";
- print "Running ./configure with '" . join (" ", @args), "'\n";
-
# When running a shell script from Perl on WSL, weirdly named
# environment variables like the "ProgramFiles(x86)" one don't get
# imported by the shell. So export it as PROGRAMFILESX86 instead.
my $building_for_linux = 0;
+ my $building_with_emscripten = 0;
foreach my $arg (@args) {
$building_for_linux = 1 if ($arg =~ /--host=x86_64.*linux/);
+ $building_with_emscripten = 1 if ($arg =~ /^--host=wasm.*-emscripten$/);
}
+
+ unshift @args, "./configure";
+ unshift @args, "emconfigure" if ($building_with_emscripten);
+
+ print "Running '" . join (" ", @args), "'\n";
+
if (`wslsys 2>/dev/null` ne "" && !$building_for_linux) {
if (!$ENV{"ProgramFiles(x86)"}) {
print STDERR "To build for Windows on WSL, you need to set the WSLENV environment variable in the Control Panel to 'ProgramFiles(x86)'\n";
@@ -313,7 +319,7 @@ if (defined $ENV{NOCONFIGURE}) {
$ENV{"PROGRAMFILESX86"} = $ENV{"ProgramFiles(x86)"};
}
- system ("./configure", @args) && die "Error running configure";
+ system (@args) && die "Error running configure";
}
# Local Variables:
diff --git a/bridges/Module_bridges.mk b/bridges/Module_bridges.mk
index 3016bf2c404f..1c7fb1789b8e 100644
--- a/bridges/Module_bridges.mk
+++ b/bridges/Module_bridges.mk
@@ -9,6 +9,7 @@
$(eval $(call gb_Module_Module,bridges))
+ifneq ($(OS),EMSCRIPTEN)
$(eval $(call gb_Module_add_targets,bridges,\
Library_cpp_uno \
$(if $(ENABLE_JAVA),\
@@ -29,5 +30,6 @@ else ifneq ($(words $(bridges_SELECTED_BRIDGE)),1)
$(call gb_Output_error,multiple bridges selected for build: $(bridges_SELECTED_BRIDGE))
endif
endif
+endif
# vim: set noet sw=4 ts=4:
diff --git a/config_host.mk.in b/config_host.mk.in
index b6012d793893..5cc02e393589 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -325,6 +325,7 @@ export KF5_LIBS=$(gb_SPACE)@KF5_LIBS@
export KRB5_LIBS=@KRB5_LIBS@
export LCMS2_CFLAGS=$(gb_SPACE)@LCMS2_CFLAGS@
export LCMS2_LIBS=$(gb_SPACE)@LCMS2_LIBS@
+export LD=@LD@
export LD_GC_SECTIONS=@LD_GC_SECTIONS@
export LD_PLUGIN=@LD_PLUGIN@
@x_LDFLAGS@ export LDFLAGS=@LDFLAGS@
@@ -474,6 +475,16 @@ export PERL=@PERL@
export PKGFORMAT=@PKGFORMAT@
export PKGMK=@PKGMK@
export PKG_CONFIG=@PKG_CONFIG@
+ifneq (@PKG_CONFIG_PATH@,)
+export PKG_CONFIG_PATH=@PKG_CONFIG_PATH@
+else
+unexport PKG_CONFIG_PATH
+endif
+ifneq (@PKG_CONFIG_LIBDIR@,)
+export PKG_CONFIG_LIBDIR=@PKG_CONFIG_LIBDIR@
+else
+unexport PKG_CONFIG_LIBDIR
+endif
export PLATFORMID=@PLATFORMID@
export POPPLER_CFLAGS=$(gb_SPACE)@POPPLER_CFLAGS@
export POPPLER_LIBS=$(gb_SPACE)@POPPLER_LIBS@
@@ -506,6 +517,7 @@ export QT5_LIBS=$(gb_SPACE)@QT5_LIBS@
export QT5_GOBJECT_CFLAGS=$(gb_SPACE)@QT5_GOBJECT_CFLAGS@
export QT5_GOBJECT_LIBS=$(gb_SPACE)@QT5_GOBJECT_LIBS@
export QT5_HAVE_GOBJECT=@QT5_HAVE_GOBJECT@
+export QT5_PLATFORMS_SRCDIR=@QT5_PLATFORMS_SRCDIR@
export QXP_CFLAGS=$(gb_SPACE)@QXP_CFLAGS@
export QXP_LIBS=$(gb_SPACE)@QXP_LIBS@
export RANLIB=@RANLIB@
@@ -639,6 +651,7 @@ export USE_XINERAMA=@USE_XINERAMA@
export UPDATE_CONFIG=@UPDATE_CONFIG@
export UUIDGEN=@UUIDGEN@
export VALGRIND_CFLAGS=$(gb_SPACE)@VALGRIND_CFLAGS@
+export VCL_PLUGIN_INFO=@VCL_PLUGIN_INFO@
export VCVER=@VCVER@
export DEVENV=@DEVENV@
export VISIO_CFLAGS=$(gb_SPACE)@VISIO_CFLAGS@
diff --git a/configure.ac b/configure.ac
index 1b0521624ac2..e5ce5560c661 100644
--- a/configure.ac
+++ b/configure.ac
@@ -804,6 +804,8 @@ dnl Sequential to keep the logic very simple
dnl These values may be checked and reset later.
dnl ===================================================================
#defaults unless the os test overrides this:
+test_cmis=yes
+test_curl=yes
test_randr=yes
test_xrender=yes
test_cups=yes
@@ -957,6 +959,7 @@ darwin*|macos*) # macOS
;;
ios*) # iOS
+ test_cmis=no
test_randr=no
test_xrender=no
test_freetype=no
@@ -1104,6 +1107,29 @@ haiku*)
_os=Haiku
;;
+emscripten)
+ build_gstreamer_1_0=no
+ enable_lpsolve=no
+ enable_report_builder=no
+ with_theme="breeze"
+ test_cmis=no
+ test_cups=no
+ test_curl=no
+ test_dbus=no
+ test_fontconfig=no
+ test_freetype=no
+ test_gtk=no
+ test_randr=no
+ test_xrender=no
+ enable_postgresql_sdbc=no
+ enable_firebird_sdbc=no
+ enable_mariadb_sdbc=no
+ with_system_zlib=no
+ _os=Emscripten
+
+ BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
+ ;;
+
*)
AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
;;
@@ -1254,10 +1280,24 @@ if test $_os != "WINNT"; then
fi
AC_SUBST(DLOPEN_LIBS)
-AC_ARG_ENABLE(ios-simulator,
- AS_HELP_STRING([--enable-ios-simulator],
- [build for iOS simulator])
-)
+dnl ===================================================================
+dnl Sanity checks for Emscripten SDK setup
+dnl ===================================================================
+
+if test "$_os" = "Emscripten"; then
+ EMSCRIPTEN_ERROR=0
+ if ! which emconfigure >/dev/null 2>&1; then
+ AC_MSG_WARN([emconfigure must be in your \$PATH])
+ EMSCRIPTEN_ERROR=1
+ fi
+ if test -z "$EMMAKEN_JUST_CONFIGURE"; then
+ AC_MSG_WARN(["\$EMMAKEN_JUST_CONFIGURE wasn't set by emconfigure. Prefix configure or use autogen.sh])
+ EMSCRIPTEN_ERROR=1
+ fi
+ if test $EMSCRIPTEN_ERROR -ne 0; then
+ AC_MSG_ERROR(["Please fix your EMSDK setup to build with Emscripten!"])
+ fi
+fi
###############################################################################
# Extensions switches --enable/--disable
@@ -1272,6 +1312,11 @@ AC_ARG_ENABLE(ios-simulator,
# if you use --disable-extension-integration. Is that really the
# case?
+AC_ARG_ENABLE(ios-simulator,
+ AS_HELP_STRING([--enable-ios-simulator],
+ [build for iOS simulator])
+)
+
libo_FUZZ_ARG_ENABLE(extension-integration,
AS_HELP_STRING([--disable-extension-integration],
[Disable integration of the built extensions in the installer of the
@@ -1462,7 +1507,8 @@ libo_FUZZ_ARG_ENABLE(optimized,
[Whether to compile with optimization flags.
By default, disabled for --enable-debug and --enable-dbgutil, enabled
otherwise. Using 'debug' will try to use only optimizations that should
- not interfere with debugging.]))
+ not interfere with debugging. For Emscripten we default to optimized (-O1)
+ debug build, as otherwise biaries become too large.]))
libo_FUZZ_ARG_ENABLE(runtime-optimizations,
AS_HELP_STRING([--disable-runtime-optimizations],
@@ -1789,6 +1835,13 @@ libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
[Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
Requires --enable-openssl.]))
+AC_ARG_ENABLE(nss,
+ AS_HELP_STRING([--disable-nss],
+ [Disable using NSS. If disabled,
+ components will either use GNUTLS or openssl. Work in progress,
+ use only if you are hacking on it.]),
+,enable_nss=yes)
+
AC_ARG_ENABLE(library-bin-tar,
AS_HELP_STRING([--enable-library-bin-tar],
[Enable the building and reused of tarball of binary build for some 'external' libraries.
@@ -1832,6 +1885,16 @@ libo_FUZZ_ARG_ENABLE(librelogo,
[Do not build LibreLogo.]),
,enable_librelogo=yes)
+AC_ARG_ENABLE(cmis,
+ AS_HELP_STRING([--disable-cmis],
+ [Disable CMIS support.]),
+,enable_cmis=yes)
+
+AC_ARG_ENABLE(curl,
+ AS_HELP_STRING([--disable-curl],
+ [Disable CURL support.]),
+,enable_curl=yes)
+
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
@@ -2817,7 +2880,7 @@ dnl "desktop" one but a "mobile" one, we are always cross-compiling.
dnl Note the direction of the implication; there is no assumption that
dnl cross-compiling would imply a non-desktop OS.
-if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
+if test $_os != iOS -a $_os != Android -a $_os != Emscripten -a "$enable_fuzzers" != "yes"; then
BUILD_TYPE="$BUILD_TYPE DESKTOP"
AC_DEFINE(HAVE_FEATURE_DESKTOP)
AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
@@ -2868,7 +2931,7 @@ fi
if test -z "$enable_scripting"; then
# Disable scripting for iOS unless specifically overridden
# with --enable-scripting.
- if test $_os != iOS; then
+ if test $_os != iOS -o $_os = Emscripten; then
enable_scripting=yes
fi
fi
@@ -2882,7 +2945,7 @@ else
SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
fi
-if test $_os = iOS -o $_os = Android; then
+if test $_os = iOS -o $_os = Android -o $_os = Emscripten; then
# Disable dynamic_loading always for iOS and Android
enable_dynamic_loading=no
elif test -z "$enable_dynamic_loading"; then
@@ -4105,6 +4168,8 @@ if test "$COM_IS_CLANG" = TRUE; then
[my_apple_clang=yes],[my_apple_clang=])
if test "$my_apple_clang" = yes; then
AC_MSG_RESULT([assumed yes (Apple Clang)])
+ elif test "$_os" = Emscripten; then
+ AC_MSG_RESULT([assumed yes (Emscripten Clang)])
else
if test "$_os" = WINNT; then
dnl In which case, assume clang-cl:
@@ -4186,7 +4251,7 @@ fi
# ===================================================================
HAVE_GCC_GGDB2=
-if test "$GCC" = "yes"; then
+if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -ggdb2"
@@ -4414,7 +4479,7 @@ fi
AC_SUBST(USE_LD)
HAVE_LD_BSYMBOLIC_FUNCTIONS=
-if test "$GCC" = "yes"; then
+if test "$GCC" = "yes" -a "$_os" != Emscripten ; then
AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
bsymbolic_functions_ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
@@ -4600,7 +4665,7 @@ elif test "$enable_optimized" = debug; then
ENABLE_OPTIMIZED_DEBUG=TRUE
AC_MSG_RESULT([yes (debug)])
HAVE_GCC_OG=
- if test "$GCC" = "yes"; then
+ if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
AC_MSG_CHECKING([whether $CC_BASE supports -Og])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -Og"
@@ -4612,7 +4677,7 @@ elif test "$enable_optimized" = debug; then
AC_MSG_RESULT([no])
fi
fi
- if test -z "$HAVE_GCC_OG"; then
+ if test -z "$HAVE_GCC_OG" -a "$_os" != "Emscripten"; then
AC_MSG_ERROR([The compiler does not support optimizations suitable for debugging.])
fi
else
@@ -5055,6 +5120,25 @@ solaris*)
SOLARINC="$SOLARINC -I/usr/local/include"
;;
+emscripten*)
+ COM=GCC
+ USING_X11=
+ OS=EMSCRIPTEN
+ RTL_OS=Emscripten
+ P_SEP=:
+
+ case "$host_cpu" in
+ wasm32|wasm64)
+ ;;
+ *)
+ AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
+ ;;
+ esac
+ CPUNAME=INTEL
+ RTL_ARCH=x86
+ PLATFORMID=linux_x86
+ ;;
+
*)
AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
;;
@@ -5179,9 +5263,10 @@ if test "$cross_compiling" = "yes"; then
(
unset COM USING_X11 OS CPUNAME
unset CC CXX SYSBASE CFLAGS
- unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
+ unset AR LD NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
unset CPPUNIT_CFLAGS CPPUNIT_LIBS
- unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
+ unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
+ unset PKG_CONFIG_LIBDIR PKG_CONFIG_PATH
if test -n "$CC_FOR_BUILD"; then
export CC="$CC_FOR_BUILD"
CC_BASE=`first_arg_basename "$CC"`
@@ -5193,6 +5278,7 @@ if test "$cross_compiling" = "yes"; then
test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
cd CONF-FOR-BUILD
+ # Handle host configuration, which affects the cross-toolset too
sub_conf_opts=""
test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
@@ -5227,6 +5313,7 @@ if test "$cross_compiling" = "yes"; then
--disable-gstreamer-1-0 \
--disable-gtk3 \
--disable-mariadb-sdbc \
+ --disable-nss \
--disable-online-update \
--disable-opencl \
--disable-pdfimport \
@@ -5249,7 +5336,9 @@ if test "$cross_compiling" = "yes"; then
PERMITTED_BUILD_TARGETS="
AVMEDIA
BOOST
+ CAIRO
CLUCENE
+ CURL
DBCONNECTIVITY
DESKTOP
DYNLOADING
@@ -6062,9 +6151,12 @@ if test "$_os" != "WINNT"; then
fi
AC_SUBST(AR)
AC_SUBST(DLLTOOL)
+AC_SUBST(LD)
AC_SUBST(NM)
AC_SUBST(OBJDUMP)
AC_SUBST(PKG_CONFIG)
+AC_SUBST(PKG_CONFIG_PATH)
+AC_SUBST(PKG_CONFIG_LIBDIR)
AC_SUBST(RANLIB)
AC_SUBST(READELF)
AC_SUBST(STRIP)
@@ -7054,7 +7146,7 @@ dnl ===================================================================
dnl Check for system libcmis
dnl ===================================================================
# libcmis requires curl and we can't build curl for iOS
-if test $_os != iOS; then
+if test "$test_cmis" = "yes" -a "$enable_cmis" = "yes"; then
libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2])
ENABLE_LIBCMIS=TRUE
else
@@ -9207,6 +9299,9 @@ if test "$with_system_libxml" = "auto"; then
WINNT|iOS|Android)
with_system_libxml="$with_system_libs"
;;
+ Emscripten)
+ with_system_libxml=no
+ ;;
*)
if test "$enable_fuzzers" != "yes"; then
with_system_libxml=yes
@@ -9349,7 +9444,11 @@ no|disable)
# Python is required to build LibreOffice. In theory we could separate the build-time Python
# requirement from the choice whether to include Python stuff in the installer, but why
# bother?
- AC_MSG_ERROR([Python is required at build time.])
+ if test "$cross_compiling" = yes; then
+ enable_python=system
+ else
+ AC_MSG_ERROR([Python is required at build time.])
+ fi
fi
enable_python=no
AC_MSG_RESULT([none])
@@ -10037,7 +10136,7 @@ if test "$with_system_curl" = "auto"; then
with_system_curl="$with_system_libs"
fi
-if test "$with_system_curl" = "yes"; then
+if test "$test_curl" = "yes" -a "$enable_curl" = "yes" -a "$with_system_curl" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_CURL=TRUE
@@ -10069,6 +10168,8 @@ if test "$with_system_curl" = "yes"; then
fi
ENABLE_CURL=TRUE
+elif test "$test_curl" = "no"; then
+ AC_MSG_RESULT([none])
else
AC_MSG_RESULT([internal])
SYSTEM_CURL=
@@ -10211,7 +10312,7 @@ AC_SUBST(SYSTEM_OPENLDAP)
dnl ===================================================================
dnl Check for system NSS
dnl ===================================================================
-if test "$enable_fuzzers" != "yes"; then
+if test "$enable_fuzzers" != "yes" -a "$enable_nss" = "yes"; then
libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
AC_DEFINE(HAVE_FEATURE_NSS)
ENABLE_NSS="TRUE"
@@ -11372,6 +11473,8 @@ if test -z "$build_vcl_plugins"; then
build_vcl_plugins="none"
fi
AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
+VCL_PLUGIN_INFO=$R
+AC_SUBST([VCL_PLUGIN_INFO])
dnl ===================================================================
dnl check for dbus support
@@ -12412,6 +12515,7 @@ MOC5="moc"
QT5_GOBJECT_CFLAGS=""
QT5_GOBJECT_LIBS=""
QT5_HAVE_GOBJECT=""
+QT5_PLATFORMS_SRCDIR=""
if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
\( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
\( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 33deef07a69a..fd4dc5ccaa33 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -30,8 +30,8 @@ $(eval $(call gb_Library_use_externals,sofficeapp, \
icu_headers \
icui18n \
icuuc \
- $(if $(filter-out iOS,$(OS)), \
- curl \
+ $(if $(filter-out EMSCRIPTEN iOS,$(OS)), \
+ curl \
)\
$(if $(ENABLE_ONLINE_UPDATE_MAR),\
orcus-parser \
diff --git a/external/apr/ExternalProject_apr.mk b/external/apr/ExternalProject_apr.mk
index 1c94480e5ab7..7f3a631e933e 100644
--- a/external/apr/ExternalProject_apr.mk
+++ b/external/apr/ExternalProject_apr.mk
@@ -30,7 +30,7 @@ $(call gb_ExternalProject_get_state_target,apr,build):
$(call gb_Trace_StartRange,apr,EXTERNAL)
+$(call gb_ExternalProject_run,build,\
$(if $(ENABLE_MACOSX_SANDBOX),ac_cv_func_fdatasync=no) \
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--enable-static --disable-shared \
--with-pic \
$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
diff --git a/external/apr/ExternalProject_apr_util.mk b/external/apr/ExternalProject_apr_util.mk
index a311f32e8e01..a94b0e38d43b 100644
--- a/external/apr/ExternalProject_apr_util.mk
+++ b/external/apr/ExternalProject_apr_util.mk
@@ -31,7 +31,7 @@ else
$(call gb_ExternalProject_get_state_target,apr_util,build):
$(call gb_Trace_StartRange,apr_util,EXTERNAL)
+$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--enable-static --disable-shared \
--with-pic \
$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index bdacdcd9856e..c10ed5a55048 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -46,6 +46,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,boost,3))
$(eval $(call gb_UnpackedTarball_add_patches,boost,\
$(foreach patch,$(boost_patches),external/boost/$(patch)) \
+ external/boost/boost-emscripten-noshm.patch.0 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/boost/boost-emscripten-noshm.patch.0 b/external/boost/boost-emscripten-noshm.patch.0
new file mode 100644
index 000000000000..f9d27b0b6e11
--- /dev/null
+++ b/external/boost/boost-emscripten-noshm.patch.0
@@ -0,0 +1,11 @@
+--- boost/interprocess/detail/workaround.hpp.orig 2020-12-15 06:31:51.037665526 +0100
++++ boost/interprocess/detail/workaround.hpp 2020-12-15 06:32:39.741281893 +0100
+@@ -31,7 +31,7 @@
+ //////////////////////////////////////////////////////
+ //Check for XSI shared memory objects. They are available in nearly all UNIX platforms
+ //////////////////////////////////////////////////////
+- #if !defined(__QNXNTO__) && !defined(__ANDROID__) && !defined(__HAIKU__) && !(__VXWORKS__)
++ #if !defined(__QNXNTO__) && !defined(__ANDROID__) && !defined(__HAIKU__) && !(__VXWORKS__) && !defined(__EMSCRIPTEN__)
+ #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
+ #endif
+
diff --git a/external/breakpad/ExternalProject_breakpad.mk b/external/breakpad/ExternalProject_breakpad.mk
index 9e7e72485849..56a7be987837 100644
--- a/external/breakpad/ExternalProject_breakpad.mk
+++ b/external/breakpad/ExternalProject_breakpad.mk
@@ -21,7 +21,7 @@ else # !ifeq($(COM),MSC)
$(call gb_ExternalProject_get_state_target,breakpad,build) :
$(call gb_Trace_StartRange,breakpad,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure CXXFLAGS="-O2 $(gb_VISIBILITY_FLAGS)" \
+ $(gb_RUN_CONFIGURE) ./configure CXXFLAGS="-O2 $(gb_VISIBILITY_FLAGS)" \
&& $(MAKE) \
)
$(call gb_Trace_EndRange,breakpad,EXTERNAL)
diff --git a/external/cairo/ExternalProject_cairo.mk b/external/cairo/ExternalProject_cairo.mk
index 41e7621c789f..471ae6104361 100644
--- a/external/cairo/ExternalProject_cairo.mk
+++ b/external/cairo/ExternalProject_cairo.mk
@@ -64,14 +64,15 @@ else
$(call gb_ExternalProject_get_state_target,cairo,build) :
$(call gb_Trace_StartRange,cairo,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
$(if $(debug),STRIP=" ") \
$(if $(filter ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS) $(gb_VISIBILITY_FLAGS)") \
- $(if $(filter-out ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS)" ) \
+ $(if $(filter EMSCRIPTEN,$(OS)),CFLAGS=" $(ZLIB_CFLAGS)" --enable-pthread=yes PTHREAD_LIBS="") \
+ $(if $(filter-out EMSCRIPTEN ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS)" ) \
$(if $(filter ANDROID iOS,$(OS)),PKG_CONFIG=./dummy_pkg_config) \
LIBS="$(ZLIB_LIBS)" \
$(if $(filter -fsanitize=%,$(LDFLAGS)),LDFLAGS="$(LDFLAGS) -fuse-ld=bfd") \
- pixman_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,pixman)/pixman" \
+ pixman_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,pixman)/pixman -pthread" \
pixman_LIBS="-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \
$(if $(filter LINUX,$(OS)),-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\\\$$\$$ORIGIN) \
@@ -84,7 +85,7 @@ $(call gb_ExternalProject_get_state_target,cairo,build) :
$(if $(SYSTEM_FONTCONFIG),,FONTCONFIG_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,fontconfig)") \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,$(if $(filter ANDROID,$(OS)),--disable-shared,--disable-static)) \
- $(if $(filter ANDROID iOS,$(OS)),--disable-xlib --disable-xcb,$(if $(filter TRUE,$(DISABLE_GUI)),--disable-xlib --disable-xcb,--enable-xlib --enable-xcb)) \
+ $(if $(filter EMSCRIPTEN ANDROID iOS,$(OS)),--disable-xlib --disable-xcb,$(if $(filter TRUE,$(DISABLE_GUI)),--disable-xlib --disable-xcb,--enable-xlib --enable-xcb)) \
$(if $(filter iOS,$(OS)),--enable-quartz --enable-quartz-font) \
--disable-valgrind \
$(if $(filter iOS,$(OS)),--disable-ft,--enable-ft --enable-fc) \
diff --git a/external/cairo/ExternalProject_pixman.mk b/external/cairo/ExternalProject_pixman.mk
index fec943762df8..03dffbd01312 100644
--- a/external/cairo/ExternalProject_pixman.mk
+++ b/external/cairo/ExternalProject_pixman.mk
@@ -34,11 +34,12 @@ else
$(call gb_ExternalProject_get_state_target,pixman,build) :
$(call gb_Trace_StartRange,pixman,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,$(if $(filter ANDROID,$(OS)),--disable-shared,--disable-static)) \
$(if $(filter ANDROID,$(OS)),--disable-arm-simd --disable-arm-neon --disable-arm-iwmmxt) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \
+ $(if $(filter EMSCRIPTEN,$(OS)),CFLAGS="-pthread") \
&& $(MAKE) \
)
$(call gb_Trace_EndRange,pixman,EXTERNAL)
diff --git a/external/coinmp/ExternalProject_coinmp.mk b/external/coinmp/ExternalProject_coinmp.mk
index e1484e656619..9bd5a4cd2685 100644
--- a/external/coinmp/ExternalProject_coinmp.mk
+++ b/external/coinmp/ExternalProject_coinmp.mk
@@ -29,7 +29,7 @@ else
$(call gb_ExternalProject_get_state_target,coinmp,build) :
$(call gb_Trace_StartRange,coinmp,EXTERNAL)
+$(call gb_ExternalProject_run,build,\
- ./configure COIN_SKIP_PROJECTS="Data/Sample" \
+ $(gb_RUN_CONFIGURE) ./configure COIN_SKIP_PROJECTS="Data/Sample" \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(DISABLE_DYNLOADING),--disable-shared) \
diff --git a/external/cppunit/ExternalProject_cppunit.mk b/external/cppunit/ExternalProject_cppunit.mk
index 1c5ac725af59..92db8a1953f3 100644
--- a/external/cppunit/ExternalProject_cppunit.mk
+++ b/external/cppunit/ExternalProject_cppunit.mk
@@ -43,7 +43,7 @@ endif
$(call gb_ExternalProject_get_state_target,cppunit,build) :
$(call gb_Trace_StartRange,cppunit,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--disable-dependency-tracking \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
--disable-doxygen \
@@ -55,7 +55,8 @@ $(call gb_ExternalProject_get_state_target,cppunit,build) :
$(if $(filter WNT,$(OS)),LDFLAGS="-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2") \
$(if $(filter SOLARIS,$(OS)),LIBS="-lm") \
$(if $(filter ANDROID,$(OS)),LIBS="$(gb_STDLIBS)") \
- CXXFLAGS="$(cppunit_CXXFLAGS)" \
+ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(cppunit_CXXFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)" \
&& cd src \
&& $(MAKE) \
)
diff --git a/external/cppunit/disable-dynloading.patch b/external/cppunit/disable-dynloading.patch
index a9aa37f6f45d..62ed1deeb635 100644
--- a/external/cppunit/disable-dynloading.patch
+++ b/external/cppunit/disable-dynloading.patch
@@ -17,7 +17,7 @@
+// Actually this is for iOS and Android where we build the cppunit tests libraries
+// as plain archives and just link them statically into test fixture programs,
+// and don't want any stinking duplicate main(), but shouldn't hurt for MacOSX either.
-+#elif defined(__APPLE__) || defined(__ANDROID__)
++#elif defined(__APPLE__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
+ typedef char __CppUnitPlugInImplementMainDummyTypeDef
// Unix
diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk
index 138b50afd0e0..11d1fcc57d4a 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -40,7 +40,7 @@ endif
$(call gb_ExternalProject_get_state_target,curl,build):
$(call gb_Trace_StartRange,curl,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
$(if $(filter iOS MACOSX,$(OS)),\
--with-darwinssl,\
$(if $(ENABLE_NSS),--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out"),--without-nss)) \
diff --git a/external/epm/ExternalProject_epm.mk b/external/epm/ExternalProject_epm.mk
index 68a61a78a744..7b0dde219e4b 100644
--- a/external/epm/ExternalProject_epm.mk
+++ b/external/epm/ExternalProject_epm.mk
@@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,epm,\
$(call gb_ExternalProject_get_state_target,epm,build) :
$(call gb_Trace_StartRange,epm,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure --disable-fltk \
+ $(gb_RUN_CONFIGURE) ./configure --disable-fltk \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________NONE) \
&& $(MAKE) \
&& touch $@ \
diff --git a/external/expat/ExternalProject_expat.mk b/external/expat/ExternalProject_expat.mk
index 4f4f0301c1bc..b69e6544f55f 100644
--- a/external/expat/ExternalProject_expat.mk
+++ b/external/expat/ExternalProject_expat.mk
@@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,expat,\
$(call gb_ExternalProject_get_state_target,expat,configure) :
$(call gb_Trace_StartRange,expat,EXTERNAL)
$(call gb_ExternalProject_run,configure,\
- ./configure --without-docbook \
+ $(gb_RUN_CONFIGURE) ./configure --without-docbook \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \
,,expat_configure.log)
diff --git a/external/firebird/ExternalProject_firebird.mk b/external/firebird/ExternalProject_firebird.mk
index 2a491d965699..94a62e418124 100644
--- a/external/firebird/ExternalProject_firebird.mk
+++ b/external/firebird/ExternalProject_firebird.mk
@@ -66,7 +66,7 @@ $(call gb_ExternalProject_get_state_target,firebird,build):
" \
&& export LIBREOFFICE_ICU_LIB="$(call gb_UnpackedTarball_get_dir,icu)/source/lib" \
&& export MSVC_USE_INDIVIDUAL_PDBS=TRUE \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--without-editline \
--with-wire-compress=no \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
diff --git a/external/fontconfig/ExternalProject_fontconfig.mk b/external/fontconfig/ExternalProject_fontconfig.mk
index b82c7657395b..fdcb80a38363 100644
--- a/external/fontconfig/ExternalProject_fontconfig.mk
+++ b/external/fontconfig/ExternalProject_fontconfig.mk
@@ -21,14 +21,15 @@ $(eval $(call gb_ExternalProject_register_targets,fontconfig,\
$(call gb_ExternalProject_get_state_target,fontconfig,build) :
$(call gb_Trace_StartRange,fontconfig,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS)" $(if $(filter ANDROID,$(OS)),LIBS="-lm") \
- ./configure \
+ CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS) $(if $(filter EMSCRIPTEN,$(OS)),-pthread)" $(if $(filter ANDROID,$(OS)),LIBS="-lm") \
+ $(gb_RUN_CONFIGURE) ./configure \
--disable-shared \
--disable-silent-rules \
$(if $(filter ANDROID,$(OS)),--with-arch=arm) \
--with-expat-includes=$(call gb_UnpackedTarball_get_dir,expat)/lib \
--with-expat-lib=$(gb_StaticLibrary_WORKDIR) \
--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ $(if $(filter EMSCRIPTEN,$(OS)),ac_cv_func_fstatfs=no ac_cv_func_fstatvfs=no) \
&& $(MAKE) -C src \
)
$(call gb_Trace_EndRange,fontconfig,EXTERNAL)
diff --git a/external/freetype/ExternalProject_freetype.mk b/external/freetype/ExternalProject_freetype.mk
index 3f4a719d5663..8b49abbab13a 100644
--- a/external/freetype/ExternalProject_freetype.mk
+++ b/external/freetype/ExternalProject_freetype.mk
@@ -25,7 +25,7 @@ else
$(call gb_ExternalProject_get_state_target,freetype,build) :
$(call gb_Trace_StartRange,freetype,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--disable-shared \
--without-zlib \
--without-bzip2 \
diff --git a/external/gpgmepp/ExternalProject_gpgmepp.mk b/external/gpgmepp/ExternalProject_gpgmepp.mk
index 1ba51cfb3bce..92348e426c80 100644
--- a/external/gpgmepp/ExternalProject_gpgmepp.mk
+++ b/external/gpgmepp/ExternalProject_gpgmepp.mk
@@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_
$(call gb_ExternalProject_run,build, \
$(gb_WIN_GPG_cross_setup_exports) \
&& autoreconf \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--disable-shared \
--disable-languages \
--disable-gpgconf-test \
@@ -48,7 +48,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build):
$(call gb_Trace_StartRange,gpgmepp,EXTERNAL)
$(call gb_ExternalProject_run,build,\
autoreconf \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--disable-gpgconf-test \
--disable-gpg-test \
--disable-gpgsm-test \
diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk b/external/harfbuzz/ExternalProject_harfbuzz.mk
index 7219d402df3c..caf6bcd5f922 100644
--- a/external/harfbuzz/ExternalProject_harfbuzz.mk
+++ b/external/harfbuzz/ExternalProject_harfbuzz.mk
@@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) :
$(if $(SYSTEM_ICU),,ICU_CONFIG=$(SRCDIR)/external/icu/cross-bin/icu-config) \
GRAPHITE2_CFLAGS="$(GRAPHITE_CFLAGS)" \
GRAPHITE2_LIBS="$(GRAPHITE_LIBS)" \
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--enable-static \
--disable-shared \
--disable-gtk-doc \
diff --git a/external/hunspell/ExternalProject_hunspell.mk b/external/hunspell/ExternalProject_hunspell.mk
index 43da1c254e34..91fd5c431ef8 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -24,11 +24,11 @@ endif
$(call gb_ExternalProject_get_state_target,hunspell,build):
$(call gb_Trace_StartRange,hunspell,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure --disable-shared --disable-nls --with-pic \
+ $(gb_RUN_CONFIGURE) ./configure --disable-shared --disable-nls --with-pic \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
$(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
$(if $(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \
- CXXFLAGS="$(CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS))" \
+ CXXFLAGS="$(CXXFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS))" \
&& cd src/hunspell && $(MAKE) \
)
$(call gb_Trace_EndRange,hunspell,EXTERNAL)
diff --git a/external/hyphen/ExternalProject_hyphen.mk b/external/hyphen/ExternalProject_hyphen.mk
index 21cef66d85d0..63d167f7804b 100644
--- a/external/hyphen/ExternalProject_hyphen.mk
+++ b/external/hyphen/ExternalProject_hyphen.mk
@@ -18,7 +18,7 @@ $(eval $(call gb_ExternalProject_register_targets,hyphen,\
$(call gb_ExternalProject_get_state_target,hyphen,build):
$(call gb_Trace_StartRange,hyphen,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure --disable-shared \
+ $(gb_RUN_CONFIGURE) ./configure --disable-shared \
$(if $(filter-out iOS,$(OS)),--with-pic) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \
&& $(MAKE) \
diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk
index 4ff8370ebd50..18a8f3838834 100644
--- a/external/icu/ExternalProject_icu.mk
+++ b/external/icu/ExternalProject_icu.mk
@@ -25,7 +25,7 @@ $(call gb_ExternalProject_get_state_target,icu,build) :
gb_ICU_XFLAGS="-FS $(SOLARINC) $(gb_DEBUGINFO_FLAGS) $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD -Gy)" \
&& CFLAGS="$${gb_ICU_XFLAGS}" CPPFLAGS="$(SOLARINC)" CXXFLAGS="$${gb_ICU_XFLAGS}" \
INSTALL=`cygpath -m /usr/bin/install` $(if $(MSVC_USE_DEBUG_RUNTIME),LDFLAGS="-DEBUG") \
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
$(if $(MSVC_USE_DEBUG_RUNTIME),--enable-debug --disable-release) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
--with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source \
@@ -70,11 +70,10 @@ $(call gb_ExternalProject_get_state_target,icu,build) :
CPPFLAGS=$(icu_CPPFLAGS) CFLAGS=$(icu_CFLAGS) \
CXXFLAGS=$(icu_CXXFLAGS) LDFLAGS=$(icu_LDFLAGS) \
PYTHONWARNINGS="default" \
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--disable-layout --disable-samples \
$(if $(filter FUZZERS,$(BUILD_TYPE)),--disable-release) \
- $(if $(filter iOS ANDROID,$(OS)),--disable-dyload) \
- $(if $(filter ANDROID,$(OS)),--disable-strict ac_cv_c_bigendian=no) \
+ $(if $(filter EMSCRIPTEN ANDROID,$(OS)),--disable-strict ac_cv_c_bigendian=no) \
$(if $(filter SOLARIS AIX,$(OS)),--disable-64bit-libs) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),\
--with-data-packaging=static --enable-static --disable-shared --disable-dyload,\
@@ -82,6 +81,7 @@ $(call gb_ExternalProject_get_state_target,icu,build) :
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)\
--with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source \
--disable-tools --disable-extras) \
+ AR="$(AR)" RANLIB="$(RANLIB)" \
&& $(MAKE) $(if $(CROSS_COMPILING),DATASUBDIR=data) $(if $(verbose),VERBOSE=1) \
$(if $(filter MACOSX,$(OS)), \
&& $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl \
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index 435382fa7988..a59d6e8b97d7 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/icu4c-windows-cygwin-cross.patch.1 \
external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch.1 \
$(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
+ external/icu/icu4c-emscripten-cross.patch.1 \
))
$(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
diff --git a/external/icu/icu4c-emscripten-cross.patch.1 b/external/icu/icu4c-emscripten-cross.patch.1
new file mode 100644
index 000000000000..84c88a68a87d
--- /dev/null
+++ b/external/icu/icu4c-emscripten-cross.patch.1
@@ -0,0 +1,99 @@
+--- icu/source/acinclude.m4.orig 2020-04-22 22:04:20.000000000 +0200
++++ icu/source/acinclude.m4 2020-11-04 06:10:29.993070072 +0100
+@@ -84,6 +84,7 @@
+ *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;;
+ *-*-nto*) icu_cv_host_frag=mh-qnx ;;
+ *-ncr-*) icu_cv_host_frag=mh-mpras ;;
++wasm*-*-emscripten*) icu_cv_host_frag=mh-emscripten ;;
+ *) icu_cv_host_frag=mh-unknown ;;
+ esac
+ ]
+--- /dev/null
++++ icu/source/config/mh-emscripten 2015-10-06 12:01:00.497972406 +0200
+@@ -0,0 +1,86 @@
++## Emscripten-specific setup
++## Copyright (c) 1999-2013, International Business Machines Corporation and
++## others. All Rights Reserved.
++## Commands to generate dependency files
++GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
++GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
++
++## Flags for position independent code
++SHAREDLIBCFLAGS = -fPIC
++SHAREDLIBCXXFLAGS = -fPIC
++SHAREDLIBCPPFLAGS = -DPIC
++
++## Additional flags when building libraries and with threads
++THREADSCPPFLAGS = -D_REENTRANT
++LIBCPPFLAGS =
++
++## Compiler switch to embed a runtime search path
++LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
++LD_RPATH_PRE = -Wl,-rpath,
++
++## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH:
++ENABLE_RPATH=YES
++RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN'
++
++## These are the library specific LDFLAGS
++#LDFLAGSICUDT=-nodefaultlibs -nostdlib
++# Debian change: linking icudata as data only causes too many problems.
++LDFLAGSICUDT=
++
++## Compiler switch to embed a library name
++# The initial tab in the next line is to prevent icu-config from reading it.
++ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
++#SH# # We can't depend on MIDDLE_SO_TARGET being set.
++#SH# LD_SONAME=
++
++## Shared library options
++LD_SOOPTIONS= -Wl,-Bsymbolic-functions
++
++## Shared object suffix
++SO = so
++## Non-shared intermediate object suffix
++STATIC_O = o
++
++## Compilation rules
++# WASM needs -pthread for atomics support
++%.$(STATIC_O): $(srcdir)/%.c
++ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -pthread -o $@ $<)
++
++%.$(STATIC_O): $(srcdir)/%.cpp
++ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -pthread -o $@ $<)
++
++
++## Dependency rules
++%.d: $(srcdir)/%.c
++ $(call ICU_MSG,(deps)) $<
++ @$(SHELL) -ec '$(GEN_DEPS.c) $< \
++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
++ [ -s $@ ] || rm -f $@'
++
++%.d: $(srcdir)/%.cpp
++ $(call ICU_MSG,(deps)) $<
++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
++ [ -s $@ ] || rm -f $@'
++
++## Versioned libraries rules
++
++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
++ $(RM) $@ && ln -s ${<F} $@
++%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
++ $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
++
++## Bind internal references
++
++# LDflags that pkgdata will use
++BIR_LDFLAGS= -Wl,-Bsymbolic
++
++# Dependencies [i.e. map files] for the final library
++BIR_DEPS=
++
++## Remove shared library 's'
++STATIC_PREFIX_WHEN_USED =
++STATIC_PREFIX =
++
++## without assembly
++PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc -w
diff --git a/external/lcms2/ExternalProject_lcms2.mk b/external/lcms2/ExternalProject_lcms2.mk
index 4bed4a5b705d..35dce1bcc03e 100644
--- a/external/lcms2/ExternalProject_lcms2.mk
+++ b/external/lcms2/ExternalProject_lcms2.mk
@@ -27,7 +27,7 @@ else
$(call gb_ExternalProject_get_state_target,lcms2,build):
$(call gb_Trace_StartRange,lcms2,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure --without-jpeg --without-tiff --with-pic \
+ $(gb_RUN_CONFIGURE) ./configure --without-jpeg --without-tiff --with-pic \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \
CPPFLAGS=" $(SOLARINC)" \
diff --git a/external/libabw/ExternalProject_libabw.mk b/external/libabw/ExternalProject_libabw.mk
index 50e66fdb76ca..a21835062b90 100644
--- a/external/libabw/ExternalProject_libabw.mk
+++ b/external/libabw/ExternalProject_libabw.mk
@@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,libabw,build) :
$(call gb_Trace_StartRange,libabw,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libassuan/ExternalProject_libassuan.mk b/external/libassuan/ExternalProject_libassuan.mk
index e4e24aeac7fd..8ee96826cd69 100644
--- a/external/libassuan/ExternalProject_libassuan.mk
+++ b/external/libassuan/ExternalProject_libassuan.mk
@@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,libassuan,build): $(call gb_Executabl
$(call gb_ExternalProject_run,build,\
$(gb_WIN_GPG_cross_setup_exports) \
&& autoreconf \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--enable-static \
--disable-shared \
--disable-doc \
@@ -44,7 +44,7 @@ $(call gb_ExternalProject_get_state_target,libassuan,build):
$(call gb_Trace_StartRange,libassuan,EXTERNAL)
$(call gb_ExternalProject_run,build,\
autoreconf \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--disable-doc \
GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \
GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
diff --git a/external/libatomic_ops/ExternalProject_libatomic_ops.mk b/external/libatomic_ops/ExternalProject_libatomic_ops.mk
index 20cefa39b4fe..47f2da68c005 100644
--- a/external/libatomic_ops/ExternalProject_libatomic_ops.mk
+++ b/external/libatomic_ops/ExternalProject_libatomic_ops.mk
@@ -19,7 +19,7 @@ $(call gb_ExternalProject_get_state_target,libatomic_ops,build) :
$(call gb_Trace_StartRange,libatomic_ops,EXTERNAL)
$(call gb_ExternalProject_run,build,\
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))") \
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
&& $(MAKE) \
)
diff --git a/external/libcdr/ExternalProject_libcdr.mk b/external/libcdr/ExternalProject_libcdr.mk
index b3e78f469cbf..48a21afd24a4 100644
--- a/external/libcdr/ExternalProject_libcdr.mk
+++ b/external/libcdr/ExternalProject_libcdr.mk
@@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libcdr,build) :
$(call gb_Trace_StartRange,libcdr,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libebook/ExternalProject_libebook.mk b/external/libebook/ExternalProject_libebook.mk
index 8ee2c7293e11..15c9689b3cbd 100644
--- a/external/libebook/ExternalProject_libebook.mk
+++ b/external/libebook/ExternalProject_libebook.mk
@@ -28,7 +28,7 @@ $(call gb_ExternalProject_get_state_target,libebook,build) :
$(call gb_Trace_StartRange,libebook,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libeot/ExternalProject_libeot.mk b/external/libeot/ExternalProject_libeot.mk
index 75e8054a0a4c..98c7d2eb403d 100644
--- a/external/libeot/ExternalProject_libeot.mk
+++ b/external/libeot/ExternalProject_libeot.mk
@@ -18,7 +18,7 @@ $(call gb_ExternalProject_get_state_target,libeot,build) :
$(call gb_ExternalProject_run,build,\
touch Makefile.in \
&& export PKG_CONFIG="" \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libepubgen/ExternalProject_libepubgen.mk b/external/libepubgen/ExternalProject_libepubgen.mk
index 54a9a3d68bdc..096f0f6e534b 100644
--- a/external/libepubgen/ExternalProject_libepubgen.mk
+++ b/external/libepubgen/ExternalProject_libepubgen.mk
@@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libepubgen,build) :
$(call gb_Trace_StartRange,libepubgen,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libetonyek/ExternalProject_libetonyek.mk b/external/libetonyek/ExternalProject_libetonyek.mk
index 0eabfe5f4ffb..14773214be48 100644
--- a/external/libetonyek/ExternalProject_libetonyek.mk
+++ b/external/libetonyek/ExternalProject_libetonyek.mk
@@ -29,7 +29,7 @@ $(call gb_ExternalProject_get_state_target,libetonyek,build) :
$(call gb_Trace_StartRange,libetonyek,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--enable-static --disable-shared \
diff --git a/external/libexttextcat/ExternalProject_libexttextcat.mk b/external/libexttextcat/ExternalProject_libexttextcat.mk
index 1d729a103b33..e73948e68fb2 100644
--- a/external/libexttextcat/ExternalProject_libexttextcat.mk
+++ b/external/libexttextcat/ExternalProject_libexttextcat.mk
@@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,libexttextcat,\
$(call gb_ExternalProject_get_state_target,libexttextcat,build):
$(call gb_Trace_StartRange,libexttextcat,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure --disable-shared --with-pic \
+ $(gb_RUN_CONFIGURE) ./configure --disable-shared --with-pic \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(ENABLE_WERROR),--enable-werror,--disable-werror) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
diff --git a/external/libffi/ExternalProject_libffi.mk b/external/libffi/ExternalProject_libffi.mk
index b9e4254d9b2c..a495db9af11c 100644
--- a/external/libffi/ExternalProject_libffi.mk
+++ b/external/libffi/ExternalProject_libffi.mk
@@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libffi,build):
$(call gb_Trace_StartRange,libffi,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export LIB="$(ILIB)" && \
- MAKE=$(MAKE) ./configure \
+ MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--enable-option-checking=fatal \
--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
$(if $(filter LINUX,$(OS)), \
diff --git a/external/libfreehand/ExternalProject_libfreehand.mk b/external/libfreehand/ExternalProject_libfreehand.mk
index be3a478485aa..09f8187a08a3 100644
--- a/external/libfreehand/ExternalProject_libfreehand.mk
+++ b/external/libfreehand/ExternalProject_libfreehand.mk
@@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libfreehand,build) :
$(call gb_Trace_StartRange,libfreehand,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libgpg-error/ExternalProject_libgpg-error.mk b/external/libgpg-error/ExternalProject_libgpg-error.mk
index 736079c77aec..0bcd9d5f7bbc 100644
--- a/external/libgpg-error/ExternalProject_libgpg-error.mk
+++ b/external/libgpg-error/ExternalProject_libgpg-error.mk
@@ -20,7 +20,7 @@ $(call gb_ExternalProject_get_state_target,libgpg-error,build): $(call gb_Execut
$(call gb_Trace_StartRange,libgpg-error,EXTERNAL)
$(call gb_ExternalProject_run,build,\
$(gb_WIN_GPG_cross_setup_exports) \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--enable-static \
--disable-shared \
--disable-rpath \
@@ -35,7 +35,7 @@ else
$(call gb_ExternalProject_get_state_target,libgpg-error,build):
$(call gb_Trace_StartRange,libgpg-error,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- MAKE=$(MAKE) ./configure \
+ MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--disable-rpath \
--disable-languages \
--disable-doc \
diff --git a/external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk b/external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk
index a5cd4c57ddc7..c5e0556748b4 100644
--- a/external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk
+++ b/external/libjpeg-turbo/ExternalProject_libjpeg-turbo.mk
@@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libjpeg-turbo,build) : $(call gb_Exte
$(call gb_ExternalProject_get_state_target,libjpeg-turbo,configure) :
$(call gb_Trace_StartRange,libjpeg-turbo,EXTERNAL)
$(call gb_ExternalProject_run,configure,\
- MAKE=$(MAKE) ./configure \
+ MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--build=$(BUILD_PLATFORM) \
--host=$(HOST_PLATFORM) \
--with-pic \
diff --git a/external/liblangtag/ExternalProject_liblangtag.mk b/external/liblangtag/ExternalProject_liblangtag.mk
index 51dc4f4b0c68..7c52820286cb 100644
--- a/external/liblangtag/ExternalProject_liblangtag.mk
+++ b/external/liblangtag/ExternalProject_liblangtag.mk
@@ -23,13 +23,13 @@ $(eval $(call gb_ExternalProject_register_targets,liblangtag,\
$(call gb_ExternalProject_get_state_target,liblangtag,build):
$(call gb_Trace_StartRange,liblangtrag,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- MAKE=$(MAKE) ./configure --disable-modules --disable-test --disable-introspection --with-pic \
+ MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure --disable-modules --disable-test --disable-introspection --with-pic \
$(if $(or $(DISABLE_DYNLOADING),$(filter MSC,$(COM))), \
--disable-shared --enable-static, \
--enable-shared --disable-static) \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(filter TRUE,$(HAVE_GCC_BUILTIN_ATOMIC)),"lt_cv_has_atomic=yes","lt_cv_has_atomic=no") \
- CFLAGS='$(CFLAGS) \
+ CFLAGS='$(CFLAGS) -pthread \
$(if $(ENABLE_OPTIMIZED), \
$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
$(if $(call gb_Module__symbols_enabled,liblangtag),$(gb_DEBUGINFO_FLAGS))' \
diff --git a/external/libmspub/ExternalProject_libmspub.mk b/external/libmspub/ExternalProject_libmspub.mk
index 21121f091279..82bc4132f23b 100644
--- a/external/libmspub/ExternalProject_libmspub.mk
+++ b/external/libmspub/ExternalProject_libmspub.mk
@@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,libmspub,build) :
$(call gb_Trace_StartRange,libmspub,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libmwaw/ExternalProject_libmwaw.mk b/external/libmwaw/ExternalProject_libmwaw.mk
index 067de69002bd..0fc2cc4e3958 100644
--- a/external/libmwaw/ExternalProject_libmwaw.mk
+++ b/external/libmwaw/ExternalProject_libmwaw.mk
@@ -23,7 +23,7 @@ $(call gb_ExternalProject_get_state_target,libmwaw,build) :
$(call gb_Trace_StartRange,libmwaw,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--enable-static --disable-shared \
diff --git a/external/libnumbertext/ExternalProject_libnumbertext.mk b/external/libnumbertext/ExternalProject_libnumbertext.mk
index f4dbe5f655c3..3094351aebf2 100644
--- a/external/libnumbertext/ExternalProject_libnumbertext.mk
+++ b/external/libnumbertext/ExternalProject_libnumbertext.mk
@@ -28,7 +28,7 @@ $(call gb_ExternalProject_get_state_target,libnumbertext,build):
$(call gb_Trace_StartRange,libnumbertext,EXTERNAL)
$(call gb_ExternalProject_run,build,\
LIBS="$(gb_STDLIBS) $(LIBS)" \
- $(SHELL) ./configure --disable-shared --with-pic \
+ $(SHELL) $(gb_RUN_CONFIGURE) ./configure --disable-shared --with-pic \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(ENABLE_WERROR),--enable-werror,--disable-werror) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
diff --git a/external/libodfgen/ExternalProject_libodfgen.mk b/external/libodfgen/ExternalProject_libodfgen.mk
index a32e3786e7f6..658e43873e3e 100644
--- a/external/libodfgen/ExternalProject_libodfgen.mk
+++ b/external/libodfgen/ExternalProject_libodfgen.mk
@@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libodfgen,build) :
$(call gb_Trace_StartRange,libodfgen,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--enable-static --disable-shared \
diff --git a/external/liborcus/ExternalProject_liborcus.mk b/external/liborcus/ExternalProject_liborcus.mk
index c2a8cdcbe4a3..c7dd76ebfee5 100644
--- a/external/liborcus/ExternalProject_liborcus.mk
+++ b/external/liborcus/ExternalProject_liborcus.mk
@@ -95,11 +95,11 @@ $(call gb_ExternalProject_get_state_target,liborcus,build) :
$(call gb_ExternalProject_run,build,\
$(if $(liborcus_LIBS),LIBS='$(liborcus_LIBS)') \
$(if $(liborcus_CXXFLAGS),CXXFLAGS='$(liborcus_CXXFLAGS)') \
- $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS)') \
+ $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)') \
$(if $(liborcus_LDFLAGS),LDFLAGS='$(liborcus_LDFLAGS)') \
MDDS_CFLAGS='$(MDDS_CFLAGS)' \
MDDS_LIBS=' ' \
- MAKE=$(MAKE) ./configure \
+ MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--enable-static --disable-shared \
diff --git a/external/libpagemaker/ExternalProject_libpagemaker.mk b/external/libpagemaker/ExternalProject_libpagemaker.mk
index 34254b872713..ca74086b5a2a 100644
--- a/external/libpagemaker/ExternalProject_libpagemaker.mk
+++ b/external/libpagemaker/ExternalProject_libpagemaker.mk
@@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libpagemaker,build) :
$(call gb_Trace_StartRange,libpagemaker,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libqxp/ExternalProject_libqxp.mk b/external/libqxp/ExternalProject_libqxp.mk
index f1b63f6bfa38..f428693126aa 100644
--- a/external/libqxp/ExternalProject_libqxp.mk
+++ b/external/libqxp/ExternalProject_libqxp.mk
@@ -25,7 +25,7 @@ $(call gb_ExternalProject_get_state_target,libqxp,build) :
$(call gb_Trace_StartRange,libqxp,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/librevenge/ExternalProject_librevenge.mk b/external/librevenge/ExternalProject_librevenge.mk
index 7c3e36761e22..9bc9141b1fc5 100644
--- a/external/librevenge/ExternalProject_librevenge.mk
+++ b/external/librevenge/ExternalProject_librevenge.mk
@@ -23,7 +23,7 @@ $(call gb_ExternalProject_get_state_target,librevenge,build) :
$(call gb_Trace_StartRange,librevenge,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--disable-shared --enable-static, \
diff --git a/external/libstaroffice/ExternalProject_libstaroffice.mk b/external/libstaroffice/ExternalProject_libstaroffice.mk
index 8aad471e5d24..3d264a75498a 100644
--- a/external/libstaroffice/ExternalProject_libstaroffice.mk
+++ b/external/libstaroffice/ExternalProject_libstaroffice.mk
@@ -23,7 +23,7 @@ $(call gb_ExternalProject_get_state_target,libstaroffice,build) :
$(call gb_Trace_StartRange,libstaroffice,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--enable-static --disable-shared \
diff --git a/external/libvisio/ExternalProject_libvisio.mk b/external/libvisio/ExternalProject_libvisio.mk
index ea2f09688fff..9a348f8687d4 100644
--- a/external/libvisio/ExternalProject_libvisio.mk
+++ b/external/libvisio/ExternalProject_libvisio.mk
@@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,libvisio,build) :
$(call gb_Trace_StartRange,libvisio,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/libwpd/ExternalProject_libwpd.mk b/external/libwpd/ExternalProject_libwpd.mk
index c3b810c6acd7..bae99dcdfbc2 100644
--- a/external/libwpd/ExternalProject_libwpd.mk
+++ b/external/libwpd/ExternalProject_libwpd.mk
@@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libwpd,build) :
$(call gb_Trace_StartRange,libwpd,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--disable-shared --enable-static, \
diff --git a/external/libwpg/ExternalProject_libwpg.mk b/external/libwpg/ExternalProject_libwpg.mk
index 01f31c55d771..e6dd423b92c2 100644
--- a/external/libwpg/ExternalProject_libwpg.mk
+++ b/external/libwpg/ExternalProject_libwpg.mk
@@ -24,7 +24,7 @@ $(call gb_ExternalProject_get_state_target,libwpg,build) :
$(call gb_Trace_StartRange,libwpg,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--disable-shared --enable-static, \
diff --git a/external/libwps/ExternalProject_libwps.mk b/external/libwps/ExternalProject_libwps.mk
index 0bcfc5ceb72d..12e3c8719a47 100644
--- a/external/libwps/ExternalProject_libwps.mk
+++ b/external/libwps/ExternalProject_libwps.mk
@@ -46,7 +46,7 @@ $(call gb_ExternalProject_get_state_target,libwps,build) :
$(call gb_Trace_StartRange,libwps,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
$(if $(DISABLE_DYNLOADING), \
--enable-static --disable-shared \
diff --git a/external/libxml2/ExternalProject_libxml2.mk b/external/libxml2/ExternalProject_libxml2.mk
index 778befade47f..77d040b4b2c5 100644
--- a/external/libxml2/ExternalProject_libxml2.mk
+++ b/external/libxml2/ExternalProject_libxml2.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_ExternalProject_register_targets,libxml2,\
build \
))
+ifeq ($(OS),EMSCRIPTEN)
+$(call gb_ExternalProject_use_external_project,libxml2,icu)
+endif
+
ifeq ($(OS),WNT)
$(call gb_ExternalProject_use_external_project,libxml2,icu)
@@ -31,7 +35,7 @@ else # OS!=WNT
$(call gb_ExternalProject_get_state_target,libxml2,build):
$(call gb_Trace_StartRange,libxml2,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure --disable-ipv6 --without-python --without-zlib --with-sax1 \
+ $(gb_RUN_CONFIGURE) ./configure --disable-ipv6 --without-python --without-zlib --with-sax1 \
--without-lzma \
$(if $(debug),--with-run-debug) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
diff --git a/external/libxslt/ExternalProject_libxslt.mk b/external/libxslt/ExternalProject_libxslt.mk
index 0602c320ea7d..21c53f340714 100644
--- a/external/libxslt/ExternalProject_libxslt.mk
+++ b/external/libxslt/ExternalProject_libxslt.mk
@@ -32,7 +32,7 @@ else # OS!=WNT
$(call gb_ExternalProject_get_state_target,libxslt,build):
$(call gb_Trace_StartRange,libxslt,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure --without-crypto --without-python \
+ $(gb_RUN_CONFIGURE) ./configure --without-crypto --without-python \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
LDFLAGS="$(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN" -Wl$(COMMA)-noinhibit-exec) \
diff --git a/external/libzmf/ExternalProject_libzmf.mk b/external/libzmf/ExternalProject_libzmf.mk
index c6593899f2c0..695cb2ee5d34 100644
--- a/external/libzmf/ExternalProject_libzmf.mk
+++ b/external/libzmf/ExternalProject_libzmf.mk
@@ -27,7 +27,7 @@ $(call gb_ExternalProject_get_state_target,libzmf,build) :
$(call gb_Trace_StartRange,libzmf,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
- && MAKE=$(MAKE) ./configure \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--with-pic \
--enable-static \
--disable-shared \
diff --git a/external/mythes/ExternalProject_mythes.mk b/external/mythes/ExternalProject_mythes.mk
index b352e9b594d3..298607f0aa73 100644
--- a/external/mythes/ExternalProject_mythes.mk
+++ b/external/mythes/ExternalProject_mythes.mk
@@ -18,7 +18,7 @@ $(eval $(call gb_ExternalProject_register_targets,mythes,\
$(call gb_ExternalProject_get_state_target,mythes,build):
$(call gb_Trace_StartRange,mythes,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- LIBS="$(gb_STDLIBS) $(LIBS)" ./configure --disable-shared --with-pic \
+ LIBS="$(gb_STDLIBS) $(LIBS)" $(gb_RUN_CONFIGURE) ./configure --disable-shared --with-pic \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \
&& $(MAKE) \
)
diff --git a/external/openldap/ExternalProject_openldap.mk b/external/openldap/ExternalProject_openldap.mk
index 46e9168f5a91..8a102d0028a9 100644
--- a/external/openldap/ExternalProject_openldap.mk
+++ b/external/openldap/ExternalProject_openldap.mk
@@ -29,7 +29,7 @@ endif
$(call gb_ExternalProject_get_state_target,openldap,build) :
$(call gb_Trace_StartRange,openldap,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--disable-slapd \
--with-pic \
--with-tls=moznss \
diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk
index a6082932b8f8..4c5d630721c8 100644
--- a/external/openssl/ExternalProject_openssl.mk
+++ b/external/openssl/ExternalProject_openssl.mk
@@ -49,6 +49,8 @@ OPENSSL_PLATFORM := \
$(if $(filter MACOSX,$(OS)),\
$(if $(filter X86_64,$(CPUNAME)),darwin64-x86_64-cc)\
$(if $(filter AARCH64,$(CPUNAME)),darwin64-arm64-cc)\
+ ,\
+ $(if $(filter EMSCRIPTEN,$(OS)),no-engine no-dso no-dgram no-srtp no-err no-ocsp no-psk no-ts no-asm) \
)\
)\
)\
diff --git a/external/postgresql/ExternalProject_postgresql.mk b/external/postgresql/ExternalProject_postgresql.mk
index ea822ebe3208..b491301c73b4 100644
--- a/external/postgresql/ExternalProject_postgresql.mk
+++ b/external/postgresql/ExternalProject_postgresql.mk
@@ -65,7 +65,7 @@ endif
$(call gb_ExternalProject_get_state_target,postgresql,build) :
$(call gb_Trace_StartRange,postgresql,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
--without-readline \
--without-zlib \
--with-ldap \
diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk
index 7ff7040e03bd..8766b1e3e9cb 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -84,7 +84,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
ac_cv_func_clock_gettime=no \
) \
) \
- ./configure \
+ $(gb_RUN_CONFIGURE) ./configure \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(ENABLE_VALGRIND),--with-valgrind) \
$(if $(ENABLE_DBGUTIL),--with-pydebug) \
diff --git a/external/redland/ExternalProject_raptor.mk b/external/redland/ExternalProject_raptor.mk
index 4bc91c375b85..ea14077f3029 100644
--- a/external/redland/ExternalProject_raptor.mk
+++ b/external/redland/ExternalProject_raptor.mk
@@ -25,7 +25,7 @@ $(call gb_ExternalProject_get_state_target,raptor,build):
$(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN") \
$(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \
CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include)" \
- ./configure --disable-gtk-doc \
+ $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \
--enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \
--with-www=xml \
--without-xslt-config \
diff --git a/external/redland/ExternalProject_rasqal.mk b/external/redland/ExternalProject_rasqal.mk
index 0e765e098eb9..5348e37294a9 100644
--- a/external/redland/ExternalProject_rasqal.mk
+++ b/external/redland/ExternalProject_rasqal.mk
@@ -30,7 +30,7 @@ $(call gb_ExternalProject_get_state_target,rasqal,build):
PKG_CONFIG="" \
RAPTOR2_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,raptor)/src" \
RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2" \
- ./configure --disable-gtk-doc \
+ $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \
--with-regex-library=posix \
--with-decimal=none \
--with-uuid-library=internal \
diff --git a/external/redland/ExternalProject_redland.mk b/external/redland/ExternalProject_redland.mk
index f6101f0d288e..f908b550625b 100644
--- a/external/redland/ExternalProject_redland.mk
+++ b/external/redland/ExternalProject_redland.mk
@@ -33,7 +33,7 @@ $(call gb_ExternalProject_get_state_target,redland,build):
RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 $(LIBXML_LIBS)" \
RASQAL_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,rasqal)/src" \
RASQAL_LIBS="-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal" \
- ./configure --disable-gtk-doc \
+ $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \
--disable-modular \
--without-threads \
--without-bdb --without-sqlite --without-mysql \
diff --git a/external/xmlsec/ExternalProject_xmlsec.mk b/external/xmlsec/ExternalProject_xmlsec.mk
index 3db17c769c8c..4fa4aea834b1 100644
--- a/external/xmlsec/ExternalProject_xmlsec.mk
+++ b/external/xmlsec/ExternalProject_xmlsec.mk
@@ -41,7 +41,7 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) :
$(if $(filter iOS MACOSX,$(OS_FOR_BUILD)),ACLOCAL="aclocal -I $(SRCDIR)/m4/mac") \
$(if $(filter AIX,$(OS)),ACLOCAL="aclocal -I /opt/freeware/share/aclocal") \
autoreconf \
- && ./configure \
+ && $(gb_RUN_CONFIGURE) ./configure \
--with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls --without-gcrypt --disable-apps --disable-docs \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CFLAGS="$(CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(gb_VISIBILITY_FLAGS)" \
@@ -52,7 +52,7 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) :
$(if $(filter MACOSX,$(OS_FOR_BUILD)),--disable-pkgconfig) \
NSPR_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" NSPR_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lnspr4" \
NSS_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss" NSS_LIBS="-L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lsmime3 -lnss3 -lnssutil3" \
- ), \
+ ), \
$(if $(ENABLE_OPENSSL), \
$(if $(SYSTEM_OPENSSL),, \
OPENSSL_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,openssl)/include" \
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx
index 74c9fd35e9f4..042a82e72f93 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -237,7 +237,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
if (bInitialized)
return aInstance;
-#ifndef MACOSX
+#if ! defined(MACOSX) && ! defined(EMSCRIPTEN)
// try libpaper
// #i78617# workaround missing paperconf command
FILE* pPipe = popen( "paperconf 2>/dev/null", "r" );
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 9622d85aebf5..57d62c49c24c 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -251,7 +251,7 @@ void SvMetaType::WriteSfxItem(
// write the implementation part
rOutStm.WriteCharPtr( "#ifdef SFX_TYPEMAP" ) << endl;
- rOutStm.WriteCharPtr( "#if !defined(_WIN32) && (defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || defined(LINUX)))" ) << endl;
+ rOutStm.WriteCharPtr( "#if !defined(_WIN32) && (defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || defined(EMSCRIPTEN) || defined(LINUX)))" ) << endl;
rOutStm.WriteCharPtr( "__attribute__((__weak__))" ) << endl;
rOutStm.WriteCharPtr( "#endif" ) << endl;
rOutStm.WriteOString( aTypeName ).WriteOString( aVarName )
diff --git a/include/osl/endian.h b/include/osl/endian.h
index c3a2344f77fb..fb9b514c128a 100644
--- a/include/osl/endian.h
+++ b/include/osl/endian.h
@@ -74,6 +74,8 @@ extern "C" {
# elif defined _BIG_ENDIAN
# define OSL_BIGENDIAN
# endif
+#elif defined EMSCRIPTEN
+# define OSL_LITENDIAN
#else
# error "Target platform not specified !"
#endif
diff --git a/include/sal/alloca.h b/include/sal/alloca.h
index a8edc5af2872..ce6b60cc9f8f 100644
--- a/include/sal/alloca.h
+++ b/include/sal/alloca.h
@@ -25,7 +25,7 @@
#define INCLUDED_SAL_ALLOCA_H
#if defined(__sun) || defined(LINUX) || defined(AIX) || defined(ANDROID) || defined(HAIKU) \
- || defined(MACOSX) || defined(IOS)
+ || defined(MACOSX) || defined(IOS) || defined(EMSCRIPTEN)
#ifndef INCLUDED_ALLOCA_H
#include <alloca.h>
diff --git a/include/sal/config.h b/include/sal/config.h
index 74d482fc7631..bf5958519426 100644
--- a/include/sal/config.h
+++ b/include/sal/config.h
@@ -83,6 +83,17 @@
#define SAL_CONFIGFILE(name) name "rc"
#endif
+#ifdef EMSCRIPTEN
+#define SAL_UNX
+#define SAL_DLLEXTENSION ".bc"
+#define SAL_EXEEXTENSION ""
+#define SAL_DLLPREFIX "lib"
+#define SAL_PATHSEPARATOR ':'
+#define SAL_PATHDELIMITER '/'
+#define SAL_NEWLINE_STRING "\n"
+#define SAL_CONFIGFILE(name) name "rc"
+#endif
+
/* The following spell is for Solaris and its descendants.
* See the "Solaris" section of
* <http://sourceforge.net/p/predef/wiki/OperatingSystems/>, and
diff --git a/sal/osl/unx/system.hxx b/sal/osl/unx/system.hxx
index a8b0e10cd163..8b1f1dccced4 100644
--- a/sal/osl/unx/system.hxx
+++ b/sal/osl/unx/system.hxx
@@ -269,13 +269,33 @@ int macxp_resolveAlias(char *path, int buflen);
# define NO_PTHREAD_RTL
#endif
+#ifdef EMSCRIPTEN
+# ifndef ETIME
+# define ETIME ETIMEDOUT
+# endif
+# include <pthread.h>
+# include <sys/file.h>
+# include <sys/ioctl.h>
+# include <sys/uio.h>
+# include <sys/un.h>
+# include <netinet/tcp.h>
+# include <dlfcn.h>
+# include <endian.h>
+# include <sys/time.h>
+# define IORESOURCE_TRANSFER_BSD
+# define IOCHANNEL_TRANSFER_BSD_RENO
+# define pthread_testcancel()
+# define NO_PTHREAD_PRIORITY
+# define INIT_GROUPS(name, gid) false
+#endif
+
#if !defined(_WIN32) && \
!defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) && \
!defined(AIX) && \
!defined(__sun) && !defined(MACOSX) && \
!defined(OPENBSD) && !defined(DRAGONFLY) && \
!defined(IOS) && !defined(ANDROID) && \
- !defined(HAIKU)
+ !defined(HAIKU) && !defined(EMSCRIPTEN)
# error "Target platform not specified!"
#endif
diff --git a/sc/source/core/tool/math.cxx b/sc/source/core/tool/math.cxx
index a077d5c3521a..3c496f83833c 100644
--- a/sc/source/core/tool/math.cxx
+++ b/sc/source/core/tool/math.cxx
@@ -53,8 +53,13 @@ double power(const double& fVal1, const double& fVal2)
}
// The pow() call must had been the most recent call to check errno or exception.
if ((((math_errhandling & MATH_ERRNO) != 0) && (errno == EDOM || errno == ERANGE))
+// emscripten is currently broken by https://github.com/emscripten-core/emscripten/pull/11087
+// While the removal is correct for C99, it's not for C++11 (see http://www.cplusplus.com/reference/cfenv/FE_INEXACT/)
+// But since emscripten currently doesn't support any math exceptions, we simply ignore them
+#ifndef __EMSCRIPTEN__
|| (((math_errhandling & MATH_ERREXCEPT) != 0)
&& std::fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW))
+#endif
|| !std::isfinite(fPow))
{
fPow = CreateDoubleError(FormulaError::IllegalFPOperation);
diff --git a/solenv/bin/run-configure b/solenv/bin/run-configure
new file mode 100755
index 000000000000..9758ff1d86c6
--- /dev/null
+++ b/solenv/bin/run-configure
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# We could run emconfigure here, but LO's gbuild should have set up everything
+# correctly. If something breaks because of this, we likely have mre problems.
+if test "$OS" = "EMSCRIPTEN"; then
+ export EMMAKEN_JUST_CONFIGURE=1
+fi
+
+exec "$@"
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index fa5c767271b7..1afa9e0451af 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -191,6 +191,7 @@ include $(SRCDIR)/RepositoryExternal.mk
$(eval $(call gb_Helper_collect_knownlibs))
gb_Library_DLLPOSTFIX := lo
+gb_RUN_CONFIGURE :=
# Include platform/cpu/compiler specific config/definitions
@@ -278,6 +279,7 @@ gb_TEST_ENV_VARS += SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION=1
ifeq (,$(SAL_USE_VCLPLUGIN))
gb_TEST_ENV_VARS += SAL_USE_VCLPLUGIN=svp
endif
+gb_TEST_ENV_VARS += UNO_HOME=file://$$I/program
# This is used to detect whether LibreOffice is being built (as opposed to building
# 3rd-party code). Used for tag deprecation for API we want to
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
new file mode 100644
index 000000000000..3131bbec0959
--- /dev/null
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -0,0 +1,64 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+
+gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
+
+include $(GBUILDDIR)/platform/unxgcc.mk
+
+gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
+# avoid -s SAFE_HEAP=1 - c.f. gh#8584 this breaks source maps
+gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=2 -s EXIT_RUNTIME=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
+gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
+
+gb_Executable_EXT := .html
+gb_EMSCRIPTEN_EXCEPT := -s DISABLE_EXCEPTION_CATCHING=0
+
+gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS)
+gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS) $(gb_EMSCRIPTEN_EXCEPT)
+gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_EXCEPT)
+
+# Linker and compiler optimize + debug flags are handled in LinkTarget.mk
+gb_LINKEROPTFLAGS :=
+gb_LINKERSTRIPDEBUGFLAGS :=
+# This maps to g4, AKA sorce maps. The LO default would otherwise be g2!
+gb_DEBUGINFO_FLAGS = -g
+# We need at least code elimination, otherwise linking OOMs even with 64GB.
+# So we "fake" -Og support to mean -O1 for Emscripten and always enable it for debug in configure.
+gb_COMPILERDEBUGOPTFLAGS := -O1
+gb_COMPILERNOOPTFLAGS := -O1 -fstrict-aliasing -fstrict-overflow
+
+# cleanup addition JS and wasm files for binaries
+define gb_Executable_Executable_platform
+$(call gb_LinkTarget_add_auxtargets,$(2),\
+ $(patsubst %.lib,%.wasm,$(3)) \
+ $(patsubst %.lib,%.js,$(3)) \
+ $(patsubst %.lib,%.worker.js,$(3)) \
+)
+
+endef
+
+define gb_CppunitTest_CppunitTest_platform
+$(call gb_LinkTarget_add_auxtargets,$(2),\
+ $(patsubst %.lib,%.wasm,$(3)) \
+ $(patsubst %.lib,%.js,$(3)) \
+ $(patsubst %.lib,%.worker.js,$(3)) \
+)
+
+endef
+
+gb_SUPPRESS_TESTS := $(true)
+
+define gb_Library_get_rpath
+endef
+
+define gb_Executable_get_rpath
+endef
+
+# vim: set noet sw=4 ts=4
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index e07bd2824ff5..fe99e98ea4c4 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -49,6 +49,7 @@ gb_COMPILERDEFS := \
-DBOOST_ERROR_CODE_HEADER_ONLY \
-DBOOST_SYSTEM_NO_DEPRECATED \
-DCPPU_ENV=$(gb_CPPU_ENV) \
+ $(if $(filter EMSCRIPTEN,$(OS)),-U_FORTIFY_SOURCE) \
gb_CFLAGS_COMMON := \
-Wall \
@@ -63,7 +64,7 @@ gb_CFLAGS_COMMON := \
-fmessage-length=0 \
-fno-common \
-pipe \
- -fstack-protector-strong \
+ $(if $(filter EMSCRIPTEN,$(OS)),-fno-stack-protector,-fstack-protector-strong) \
$(if $(gb_COLOR),-fdiagnostics-color=always) \
gb_CXXFLAGS_COMMON := \
@@ -80,7 +81,7 @@ gb_CXXFLAGS_COMMON := \
-fmessage-length=0 \
-fno-common \
-pipe \
- -fstack-protector-strong \
+ $(if $(filter EMSCRIPTEN,$(OS)),-fno-stack-protector,-fstack-protector-strong) \
$(if $(gb_COLOR),-fdiagnostics-color=always) \
ifeq ($(HAVE_WDEPRECATED_COPY_DTOR),TRUE)
@@ -109,8 +110,10 @@ endif
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_CFLAGS_COMMON += -ffunction-sections -fdata-sections
gb_CXXFLAGS_COMMON += -ffunction-sections -fdata-sections
+ifneq ($(OS),EMSCRIPTEN)
gb_LinkTarget_LDFLAGS += -Wl,--gc-sections
endif
+endif
ifeq ($(COM_IS_CLANG),TRUE)
gb_CXXFLAGS_COMMON += \
@@ -143,7 +146,7 @@ endif
gb_VISIBILITY_FLAGS_CXX := -fvisibility-inlines-hidden
gb_CXXFLAGS_COMMON += $(gb_VISIBILITY_FLAGS_CXX)
-gb_LinkTarget_LDFLAGS += -fstack-protector-strong
+gb_LinkTarget_LDFLAGS += $(if $(filter EMSCRIPTEN,$(OS)),-fno-stack-protector,-fstack-protector-strong)
ifneq ($(gb_ENABLE_PCH),)
ifeq ($(COM_IS_CLANG),TRUE)
diff --git a/xmlsecurity/Library_xsec_xmlsec.mk b/xmlsecurity/Library_xsec_xmlsec.mk
index bd2cb6abef20..450e19b3267b 100644
--- a/xmlsecurity/Library_xsec_xmlsec.mk
+++ b/xmlsecurity/Library_xsec_xmlsec.mk
@@ -51,7 +51,7 @@ endif
$(eval $(call gb_Library_use_externals,xsec_xmlsec,\
boost_headers \
- gpgmepp \
+ $(if $(ENABLE_GPGMEPP),gpgmepp) \
libxml2 \
xmlsec \
))
@@ -65,9 +65,6 @@ $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl \
xmlsecurity/source/xmlsec/xmlsec_init \
xmlsecurity/source/xmlsec/xmlstreamio \
- xmlsecurity/source/xmlsec/nss/ciphercontext \
- xmlsecurity/source/xmlsec/nss/digestcontext \
- xmlsecurity/source/xmlsec/nss/nssinitializer \
))
ifeq ($(ENABLE_GPGMEPP),TRUE)
@@ -110,24 +107,36 @@ $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl \
))
-else
+ifeq ($(ENABLE_NSS),TRUE)
-$(eval $(call gb_Library_add_defs,xsec_xmlsec,\
- -DXMLSEC_CRYPTO_NSS \
+$(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
+ xmlsecurity/source/xmlsec/nss/ciphercontext \
+ xmlsecurity/source/xmlsec/nss/digestcontext \
+ xmlsecurity/source/xmlsec/nss/nssinitializer \
))
+# nss3 after static libs to appease --as-needed linkers
+$(eval $(call gb_Library_use_externals,xsec_xmlsec,\
+ nss3 \
+))
+
+endif
+
+else # !$(OS),WNT
+
ifeq ($(SYSTEM_XMLSEC),)
$(eval $(call gb_Library_add_libs,xsec_xmlsec,\
- $(call gb_UnpackedTarball_get_dir,xmlsec)/src/nss/.libs/libxmlsec1-nss.a \
- $(call gb_UnpackedTarball_get_dir,xmlsec)/src/.libs/libxmlsec1.a \
+ $(call gb_UnpackedTarball_get_dir,xmlsec)/src/nss/.libs/libxmlsec1-nss.a \
+ $(call gb_UnpackedTarball_get_dir,xmlsec)/src/.libs/libxmlsec1.a \
))
endif
-$(eval $(call gb_Library_use_externals,xsec_xmlsec,\
- plc4 \
-))
+ifeq ($(ENABLE_NSS),TRUE)
$(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
+ xmlsecurity/source/xmlsec/nss/ciphercontext \
+ xmlsecurity/source/xmlsec/nss/digestcontext \
+ xmlsecurity/source/xmlsec/nss/nssinitializer \
xmlsecurity/source/xmlsec/nss/sanextension_nssimpl \
xmlsecurity/source/xmlsec/nss/secerror \
xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl \
@@ -137,17 +146,32 @@ $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl \
))
-endif
+$(eval $(call gb_Library_add_defs,xsec_xmlsec,\
+ -DXMLSEC_CRYPTO_NSS \
+))
+$(eval $(call gb_Library_use_externals,xsec_xmlsec,\
+ plc4 \
+))
# nss3 after static libs to appease --as-needed linkers
$(eval $(call gb_Library_use_externals,xsec_xmlsec,\
nss3 \
))
+else # ! $(ENABLE_NSS)
+
+ifeq ($(ENABLE_OPENSSL),TRUE)
+$(eval $(call gb_Library_use_external,xsec_xmlsec,openssl))
+endif
+
+endif # !$(ENABLE_NSS)
+
ifeq ($(OS),SOLARIS)
$(eval $(call gb_Library_add_libs,xsec_xmlsec,\
-ldl \
))
endif
+endif # !$(OS),WNT
+
# vim: set noet sw=4 ts=4:
diff --git a/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx b/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx
index 31365ab4bb53..3ed7749687d1 100644
--- a/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx
+++ b/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx
@@ -33,7 +33,9 @@
#include <memory>
#include <new>
#include <ostream>
+#ifdef XMLSEC_CRYPTO_NSS
#include <pk11pub.h>
+#endif
#include <stddef.h>
#include <string.h>
#include <string>