Rebased ref, commits from common ancestor:
commit 6c49b67619e09365856a3fb2e7e21084a0cddd57
Author: Jan-Marek Glogowski <[email protected]>
AuthorDate: Fri Feb 5 14:21:43 2021 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:21:43 2021 +0100
catchall
Change-Id: I2b10b0c78e81ac9332a0665037dbdaddec395bc4
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 0831846c3392..d9a348a42910 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -27,10 +27,9 @@ gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS)
$(gb_EMSCRIPTEN_CPPFLAGS) $(gb
# 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
-gb_SUPPRESS_TESTS := $(true)
-
# cleanup addition JS and wasm files for binaries
define gb_Executable_Executable_platform
$(call gb_LinkTarget_add_auxtargets,$(2),\
@@ -50,6 +49,8 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
endef
+gb_SUPPRESS_TESTS := $(true)
+
define gb_Library_get_rpath
endef
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index fc38ed5b481a..3cf84ac21210 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -31,19 +31,13 @@ $(eval $(call gb_Module_add_targets,vcl,\
Package_skia_denylist ) \
$(if $(filter DESKTOP,$(BUILD_TYPE))$(filter EMSCRIPTEN,$(OS)), \
StaticLibrary_vclmain \
- $(if $(ENABLE_MACOSX_SANDBOX),, \
- $(if $(DISABLE_GUI),, \
- Executable_ui-previewer)) \
$(if $(filter EMSCRIPTEN LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
$(if $(DISABLE_GUI),, \
- Executable_vcldemo \
- Executable_icontest \
- Executable_visualbackendtest \
- Executable_mtfdemo ))) \
+ Executable_vcldemo ))) \
))
$(eval $(call gb_Module_add_targets,vcl,\
- $(if $(filter-out ANDROID iOS WNT,$(OS)), \
+ $(if $(filter-out EMSCRIPTEN ANDROID iOS WNT,$(OS)), \
Executable_svdemo \
Executable_fftester \
Executable_svptest \
commit 8ef7404c83b12824fa596960f9853d7aa15cbfaa
Author: Jan-Marek Glogowski <[email protected]>
AuthorDate: Tue Jan 26 14:47:11 2021 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:47 2021 +0100
catchall
Change-Id: I94dbe94eed80bfb82a404db83249572caed7f715
diff --git a/configure.ac b/configure.ac
index 8bd2985d3966..2411e02a870b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4226,7 +4226,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"
diff --git a/external/hunspell/ExternalProject_hunspell.mk
b/external/hunspell/ExternalProject_hunspell.mk
index 09a0680367fb..91fd5c431ef8 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -28,7 +28,7 @@ $(call gb_ExternalProject_get_state_target,hunspell,build):
$(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/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/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 66b44e156904..72378956794e 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -47,8 +47,7 @@ $(call gb_Executable_get_runtime_target,%) :
$(call gb_Executable_get_clean_target,%) :
$(call gb_Helper_abbreviate_dirs,\
rm -f $(call gb_Executable_get_target,$*) \
- $(call gb_Executable_get_runtime_target,$*) \
- $(AUXTARGETS))
+ $(call gb_Executable_get_runtime_target,$*))
gb_Executable__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(call
gb_Executable_LAYER_DIRS)))
gb_Executable__get_dir_for_layer_for_build = $(patsubst $(1):%,%,$(filter
$(1):%,$(call gb_Executable_LAYER_DIRS_FOR_BUILD)))
@@ -73,7 +72,6 @@ $(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS))
$(call gb_Executable_get_runtime_target,$(1)) :| $(dir $(call
gb_Executable_get_runtime_target,$(1))).dir
$(call gb_Executable_get_runtime_target,$(1)) : $(call
gb_Executable_get_target_for_build,$(1))
$(call gb_Executable_get_clean_target,$(1)) : $(call
gb_LinkTarget_get_clean_target,$(2))
-$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS :=
$(call
gb_Executable_Executable_platform,$(1),$(2),$(gb_Executable_BINDIR)/$(1).lib)
$$(eval $$(call gb_Module_register_target,$(call
gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index df5bb9a39834..eab38bd528a4 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -50,11 +50,16 @@ $(if $(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS),
\
$(gb_COMPILERNOOPTFLAGS))) \
$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUGINFO_FLAGS))
+# T_LDFLAGS is just expanded once. Override the flags here, so that the linker
and compiler use the same.
+ifeq (EMSCRIPTEN,$(OS))
+gb_LinkTarget__get_debugldflags=$(call gb_LinkTarget__get_debugflags,$1)
+else
# similar for LDFLAGS, use linker optimization flags in non-debug case,
# but moreover strip debug from libraries for which debuginfo is not wanted
# (some libraries reuse .o files from other libraries, notably unittests)
gb_LinkTarget__get_stripldflags=$(if $(strip
$(CFLAGS)$(CXXFLAGS)$(OBJCFLAGS)$(OBJCXXFLAGS)$(LDFLAGS)),,$(gb_LINKERSTRIPDEBUGFLAGS))
gb_LinkTarget__get_debugldflags=$(if $(call
gb_LinkTarget__symbols_enabled,$(1)),$(gb_LINKER_DEBUGINFO_FLAGS),$(gb_LINKEROPTFLAGS)
$(call gb_LinkTarget__get_stripldflags,$(1)))
+endif
# generic cflags/cxxflags to use (optimization flags, debug flags)
# user supplied CFLAGS/CXXFLAGS override default debug/optimization flags
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 8642c4469afe..0831846c3392 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -22,19 +22,33 @@ 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)
-# WASM is also optimized at link time, but ignores linker flags, so wants
$(gb_COMPILEROPTFLAGS)
-#gb_LINKEROPTFLAGS :=
+# Linker and compiler optimize + debug flags are handled in LinkTarget.mk
+gb_LINKEROPTFLAGS :=
gb_LINKERSTRIPDEBUGFLAGS :=
+gb_DEBUGINFO_FLAGS = -g
-gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT)
-gb_LinkTarget_LDFLAGS += $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS), \
- $(if
$(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS),$(gb_COMPILERNOOPTFLAGS)))
+gb_SUPPRESS_TESTS := $(true)
-#gb_COMPILEROPTFLAGS := -O0 -g
-#gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT) $(gb_COMPILEROPTFLAGS)
+# 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)) \
+)
-gb_SUPPRESS_TESTS := $(true)
+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
define gb_Library_get_rpath
endef
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 3cf84ac21210..fc38ed5b481a 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -31,13 +31,19 @@ $(eval $(call gb_Module_add_targets,vcl,\
Package_skia_denylist ) \
$(if $(filter DESKTOP,$(BUILD_TYPE))$(filter EMSCRIPTEN,$(OS)), \
StaticLibrary_vclmain \
+ $(if $(ENABLE_MACOSX_SANDBOX),, \
+ $(if $(DISABLE_GUI),, \
+ Executable_ui-previewer)) \
$(if $(filter EMSCRIPTEN LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
$(if $(DISABLE_GUI),, \
- Executable_vcldemo ))) \
+ Executable_vcldemo \
+ Executable_icontest \
+ Executable_visualbackendtest \
+ Executable_mtfdemo ))) \
))
$(eval $(call gb_Module_add_targets,vcl,\
- $(if $(filter-out EMSCRIPTEN ANDROID iOS WNT,$(OS)), \
+ $(if $(filter-out ANDROID iOS WNT,$(OS)), \
Executable_svdemo \
Executable_fftester \
Executable_svptest \
commit 7f31778459d53d233417cf1773f23faeb1c29411
Author: Jan-Marek Glogowski <[email protected]>
AuthorDate: Mon Jan 25 15:00:53 2021 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:47 2021 +0100
catchall
Change-Id: If41abaa40cf6aef38400083d3afa3d82d446df43
diff --git a/Makefile.in b/Makefile.in
index f56845c16a82..e7da159f8d8e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -101,7 +101,7 @@ $(1).clean $(1).showdeliverables:
cd $(SRCDIR)/$(2) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
$$(patsubst $(1).%,%,$$@)
$(1).all: bootstrap fetch
- $$(MAKE) $(PARALLELISM_OPTION) $(IWYU_OPTION) $(GMAKE_OPTIONS) -f
$(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if
$(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1)
$(WORKDIR)/Module/slowcheck/$(1))
+ $$(MAKE) $(PARALLELISM_OPTION) $(IWYU_OPTION) $(GMAKE_OPTIONS) -f
$(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1)
$(WORKDIR)/Module/slowcheck/$(1)
endef
diff --git a/Repository.mk b/Repository.mk
index 7edcc5ca5c02..fc40d0819ad6 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -555,6 +555,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE, \
$(if $(filter MSC,$(COM)),cli_cppuhelper) \
$(if $(filter $(OS),ANDROID),lo-bootstrap) \
$(if $(filter $(OS),MACOSX),OOoSpotlightImporter) \
+ cppunitmain \
))
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_URE,ure, \
@@ -594,7 +595,6 @@ $(eval $(call
gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \
proxyfac \
reflection \
reg \
- sal_textenc \
stocservices \
store \
unoidl \
@@ -602,6 +602,10 @@ $(eval $(call
gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \
xmlreader \
))
+$(eval $(call gb_Helper_register_plugins_for_install,PRIVATELIBS_URE,ure, \
+ sal_textenc \
+))
+
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
$(if $(ENABLE_GSTREAMER_1_0),avmediagst) \
$(if $(filter WNT,$(OS)),avmediawin) \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index f8061d75e3f7..035c09df417f 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3871,7 +3871,7 @@ endif # SYSTEM_JFREEREPORT
# FIXME: the library target should be for build too
define gb_Executable__register_bestreversemap
$(call gb_Executable_add_runtime_dependencies,bestreversemap,\
- $(if $(filter $(OS),ANDROID),,$(if $(filter
TRUE,$(DISABLE_DYNLOADING)),,$(call gb_Library_get_target,sal_textenc))) \
+ $(call gb_Library_get_target,sal_textenc)) \
)
endef
@@ -3889,7 +3889,7 @@ endef
define gb_Executable__register_cppumaker
$(call gb_Executable_add_runtime_dependencies,cppumaker,\
- $(if $(filter $(OS),ANDROID),,$(if $(filter
TRUE,$(DISABLE_DYNLOADING)),,$(call gb_Library_get_target,sal_textenc))) \
+ $(call gb_Library_get_target,sal_textenc)) \
)
endef
diff --git a/configure.ac b/configure.ac
index 9d408641528c..8bd2985d3966 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12473,7 +12473,11 @@ then
fi
dnl Check for qmake5
- AC_PATH_PROGS( QMAKE5, [qmake], no, [$QT5DIR/bin:$PATH])
+ if test -n "$QT5DIR"; then
+ AC_PATH_PROG(QMAKE5, [qmake], no, [$QT5DIR/bin])
+ else
+ AC_PATH_PROGS(QMAKE5, [qmake-qt5 qmake], no)
+ fi
if test "$QMAKE5" = "no"; then
AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5
installation by exporting QT5DIR before running "configure".])
else
diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk
index 49bd9d202c7f..55937faeaf9b 100644
--- a/dbaccess/Module_dbaccess.mk
+++ b/dbaccess/Module_dbaccess.mk
@@ -53,6 +53,7 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\
))
endif
+ifneq ($(filter SCRIPTING,$(BUILD_TYPE)),)
$(eval $(call gb_Module_add_check_targets,dbaccess,\
CppunitTest_dbaccess_dialog_save \
CppunitTest_dbaccess_empty_stdlib_save \
@@ -60,6 +61,7 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\
CppunitTest_dbaccess_macros_test \
CppunitTest_dbaccess_hsqlschema_import \
))
+endif
# this test fails 50% of the time on the mac jenkins buildbots
ifeq ($(ENABLE_JAVA),TRUE)
diff --git a/external/cppunit/ExternalProject_cppunit.mk
b/external/cppunit/ExternalProject_cppunit.mk
index 63116af294d1..92db8a1953f3 100644
--- a/external/cppunit/ExternalProject_cppunit.mk
+++ b/external/cppunit/ExternalProject_cppunit.mk
@@ -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/openssl/ExternalProject_openssl.mk
b/external/openssl/ExternalProject_openssl.mk
index 5918cfdcb096..6913df4e4f85 100644
--- a/external/openssl/ExternalProject_openssl.mk
+++ b/external/openssl/ExternalProject_openssl.mk
@@ -50,7 +50,7 @@ OPENSSL_PLATFORM := \
$(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-sock
no-srtp no-err no-ocsp no-psk no-ts no-asm) \
+ $(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/idlc/Module_idlc.mk b/idlc/Module_idlc.mk
index a20d105cd829..c97e4a56463e 100644
--- a/idlc/Module_idlc.mk
+++ b/idlc/Module_idlc.mk
@@ -16,10 +16,6 @@ $(eval $(call gb_Module_add_targets,idlc,\
Executable_idlc \
))
-$(eval $(call gb_Module_add_check_targets,idlc,\
- CustomTarget_parser_test \
-))
-
endif
# vim:set noet sw=4 ts=4:
diff --git a/include/vcl/glxtestprocess.hxx b/include/vcl/glxtestprocess.hxx
index c8668a69d50f..83f6cb778d25 100644
--- a/include/vcl/glxtestprocess.hxx
+++ b/include/vcl/glxtestprocess.hxx
@@ -13,7 +13,7 @@
#include <config_features.h>
#if defined(UNX) && !defined MACOSX && !defined IOS && !defined ANDROID &&
HAVE_FEATURE_UI \
- && HAVE_FEATURE_OPENGL
+ && HAVE_FEATURE_OPENGL && !defined EMSCRIPTEN
/* Run test for OpenGL support in own process to avoid crash with broken
* OpenGL drivers. Start process as early as possible.
* The process will be reaped late in Desktop::Main
(desktop/source/app/app.cxx).
diff --git a/registry/Module_registry.mk b/registry/Module_registry.mk
index aa7ec1ab3ecc..358addddcc8f 100644
--- a/registry/Module_registry.mk
+++ b/registry/Module_registry.mk
@@ -20,8 +20,8 @@ $(eval $(call gb_Module_add_targets,registry,\
) \
))
-ifneq (,$(DISABLE_DYNLOADING))
-ifeq ($(ENABLE_MACOSX_SANDBOX),)
+ifeq (,$(DISABLE_DYNLOADING))
+ifneq (,$(ENABLE_MACOSX_SANDBOX))
$(eval $(call gb_Module_add_check_targets,registry, \
CustomTarget_regcompare_test \
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index fbc02f26d6da..3327b9cb7034 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -127,32 +127,6 @@ $(eval $(call gb_Library_add_cxxflags,sal,\
))
endif
-sal_textenc_code= \
- sal/textenc/context \
- sal/textenc/convertbig5hkscs \
- sal/textenc/converteuctw \
- sal/textenc/convertgb18030 \
- sal/textenc/convertisciidevangari \
- sal/textenc/convertiso2022cn \
- sal/textenc/convertiso2022jp \
- sal/textenc/convertiso2022kr \
- sal/textenc/convertsinglebytetobmpunicode \
- sal/textenc/tables \
- sal/textenc/tcvtbyte \
- sal/textenc/tcvtmb \
- sal/textenc/tcvtutf7 \
-
-ifeq ($(OS),ANDROID)
-$(eval $(call gb_Library_add_exception_objects,sal,\
- $(sal_textenc_code) \
-))
-else ifeq ($(DISABLE_DYNLOADING),TRUE)
-
-$(eval $(call gb_Library_add_exception_objects,sal,\
- $(sal_textenc_code) \
-))
-endif
-
ifneq ($(OS),WNT)
$(eval $(call gb_Library_add_exception_objects,sal,\
sal/osl/unx/backtraceapi \
diff --git a/sal/Library_sal_textenc.mk b/sal/Library_sal_textenc.mk
index 15546ba4969e..0fba5d083499 100644
--- a/sal/Library_sal_textenc.mk
+++ b/sal/Library_sal_textenc.mk
@@ -10,11 +10,9 @@
$(eval $(call gb_Library_Library,sal_textenc))
-$(eval $(call gb_Library_use_external,sal_textenc,boost_headers))
+$(eval $(call gb_Library_set_plugin_for,sal_textenc,sal))
-$(eval $(call gb_Library_use_libraries,sal_textenc,\
- sal \
-))
+$(eval $(call gb_Library_use_external,sal_textenc,boost_headers))
$(eval $(call gb_Library_add_exception_objects,sal_textenc,\
sal/textenc/context \
diff --git a/sal/Module_sal.mk b/sal/Module_sal.mk
index 7611bc950f07..49d15fe17b31 100644
--- a/sal/Module_sal.mk
+++ b/sal/Module_sal.mk
@@ -10,11 +10,11 @@
$(eval $(call gb_Module_Module,sal))
$(eval $(call gb_Module_add_targets,sal,\
- $(if $(CROSS_COMPILING),,$(if $(filter
TRUE,$(DISABLE_DYNLOADING)),,Executable_cppunittester)) \
+ $(if $(or
$(CROSS_COMPILING),$(DISABLE_DYNLOADING)),StaticLibrary_cppunitmain,Executable_cppunittester)
\
$(if $(filter $(OS),ANDROID), \
Library_lo-bootstrap) \
Library_sal \
- $(if $(filter $(OS),ANDROID),,$(if $(filter
TRUE,$(DISABLE_DYNLOADING)),,Library_sal_textenc)) \
+ Library_sal_textenc \
))
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
@@ -23,6 +23,8 @@ $(eval $(call gb_Module_add_targets,sal,\
Executable_osl_process_child \
))
+endif
+
$(eval $(call gb_Module_add_check_targets,sal,\
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,CppunitTest_Module_DLL) \
$(if $(filter WNT,$(OS)),CppunitTest_sal_comtools) \
@@ -34,6 +36,4 @@ $(eval $(call gb_Module_add_check_targets,sal,\
CompilerTest_sal_rtl_oustring)) \
))
-endif
-
# vim: set noet sw=4 ts=4:
diff --git a/sal/StaticLibrary_cppunitmain.mk b/sal/StaticLibrary_cppunitmain.mk
new file mode 100644
index 000000000000..30c64d7b3980
--- /dev/null
+++ b/sal/StaticLibrary_cppunitmain.mk
@@ -0,0 +1,40 @@
+# -*- 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/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,cppunitmain))
+
+$(eval $(call gb_StaticLibrary_set_include,cppunitmain,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/sal/inc \
+))
+
+$(eval $(call gb_StaticLibrary_use_libraries,cppunitmain,\
+ sal \
+ unoexceptionprotector \
+))
+
+$(eval $(call gb_StaticLibrary_use_externals,cppunitmain,\
+ boost_headers \
+ cppunit \
+))
+
+$(eval $(call gb_StaticLibrary_add_exception_objects,cppunitmain,\
+ sal/cppunittester/cppunittester \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_StaticLibrary_add_ldflags,cppunitmain,\
+ /STACK:10000000 \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index ea4fc94b8e9e..86b1d25f9670 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_Module_add_targets,sc,\
endif
ifneq ($(OS),iOS)
+ifneq ($(filter SCRIPTING,$(BUILD_TYPE)),)
$(eval $(call gb_Module_add_check_targets,sc,\
Library_scqahelper \
$(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \
@@ -50,6 +51,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\
CppunitTest_sc_cache_test \
CppunitTest_sc_shapetest \
))
+endif
ifneq ($(DISABLE_GUI),TRUE)
ifeq ($(OS),LINUX)
diff --git a/sccomp/Module_sccomp.mk b/sccomp/Module_sccomp.mk
index 8babadc3e41e..e211ee26f958 100644
--- a/sccomp/Module_sccomp.mk
+++ b/sccomp/Module_sccomp.mk
@@ -29,7 +29,7 @@ $(eval $(call gb_Module_add_l10n_targets,sccomp,\
$(eval $(call gb_Module_add_check_targets,sccomp,\
CppunitTest_sccomp_solver \
- $(if $(and $(filter INTEL,$(CPUNAME)),$(filter
-fsanitize=%,$(gb_CXX))),,CppunitTest_sccomp_swarmsolvertest) \
+ $(if $(and $(filter INTEL,$(CPUNAME)),$(filter
-fsanitize=%,$(gb_CXX))),,$(if $(filter
SCRIPTING,$(BUILD_TYPE)),CppunitTest_sccomp_swarmsolvertest)) \
))
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index a296ef73a932..6255fc0544c8 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -205,6 +205,10 @@ $(call gb_CppunitTest_get_target,$(1)) : HEADLESS :=
--headless
$(call gb_CppunitTest_get_target,$(1)) : EXTRA_ENV_VARS :=
$$(eval $$(call gb_Module_register_target,$(call
gb_CppunitTest_get_target,$(1)),$(call gb_CppunitTest_get_clean_target,$(1))))
$(call gb_Helper_make_userfriendly_targets,$(1),CppunitTest)
+ifneq (,$(DISABLE_DYNLOADING))
+$$(eval $$(call gb_CppunitTest_use_static_libraries,$(1),cppunitmain))
+endif
+$(if $(filter $(1),$(gb_CppunitTest_KNOWN)),,gb_CppunitTest_KNOWN += $(1))
endef
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 185c2f55b283..df5bb9a39834 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -686,12 +686,13 @@ endef
# call gb_LinkTarget__command_impl,linktargettarget,linktargetname
define gb_LinkTarget__command_impl
$(if $(gb_FULLDEPS),
- $(if $(DISABLE_DYNLOADING),
- $(if $(gb_PARTIAL_BUILD),,
- $(call
gb_LinkTarget__command_dep_libraries,$(call
gb_LinkTarget_get_dep_libraries_target,$(2)).tmp,$(2))
- mv $(call
gb_LinkTarget_get_dep_libraries_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_libraries_target,$(2))
- $(call
gb_LinkTarget__command_dep_externals,$(call
gb_LinkTarget_get_dep_externals_target,$(2)).tmp,$(2))
- mv $(call
gb_LinkTarget_get_dep_externals_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_externals_target,$(2))))
+ $(if $(DISABLE_DYNLOADING),$(if $(gb_PARTIAL_BUILD),,
+ $(call gb_LinkTarget__command_dep_libraries,$(call
gb_LinkTarget_get_dep_libraries_target,$(2)).tmp,$(2))
+ mv $(call
gb_LinkTarget_get_dep_libraries_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_libraries_target,$(2))
+ $(call gb_LinkTarget__command_dep_externals,$(call
gb_LinkTarget_get_dep_externals_target,$(2)).tmp,$(2))
+ mv $(call
gb_LinkTarget_get_dep_externals_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_externals_target,$(2))
+ $(call gb_LinkTarget__command_dep_statics,$(call
gb_LinkTarget_get_dep_statics_target,$(2)).tmp,$(2))
+ mv $(call
gb_LinkTarget_get_dep_statics_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_statics_target,$(2))))
$(if $(findstring concat-deps,$(2)),,
$(call gb_LinkTarget__command_dep,$(call
gb_LinkTarget_get_dep_target,$(2)).tmp,$(2))
mv $(call gb_LinkTarget_get_dep_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_target,$(2))))
@@ -712,7 +713,7 @@ $(call gb_LinkTarget_get_dep_target,%) : $(call
gb_Executable_get_runtime_depend
ifneq (,$(DISABLE_DYNLOADING))
ifeq (,$(gb_PARTIAL_BUILD))
-define gb_LinkTarget__statics_rules_template
+define gb_LinkTarget__static_dep_x_template
define gb_LinkTarget__command_dep_$(1)
$$(call gb_Output_announce,LNK:$$(2).d.$(1),$$(true),DEP,1)
@@ -728,13 +729,14 @@ $$(call gb_LinkTarget_get_dep_target,%) : $$(call
gb_LinkTarget_get_dep_$(1)_tar
$$(call gb_LinkTarget_get_dep_$(1)_target,%) : | $$(dir $$(call
gb_LinkTarget_get_dep_target,%)).dir
$$(call gb_LinkTarget__command_dep_$(1),$$@,$$*)
-endef # gb_LinkTarget__statics_rules_template
+endef # gb_LinkTarget__static_dep_x_template
$(dir $(call gb_LinkTarget_get_dep_target,%))/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
-$(eval $(call gb_LinkTarget__statics_rules_template,libraries))
-$(eval $(call gb_LinkTarget__statics_rules_template,externals))
+$(eval $(call gb_LinkTarget__static_dep_x_template,libraries))
+$(eval $(call gb_LinkTarget__static_dep_x_template,externals))
+$(eval $(call gb_LinkTarget__static_dep_x_template,statics))
endif
endif
@@ -1071,18 +1073,19 @@ $(call gb_Library_get_target,$(1)) :| $(call
gb_Library_get_headers_target,$(1))
endef
-define gb_LinkTarget__all_x_accessors
+define gb_LinkTarget__generate_all_x_accessors
gb_LinkTarget__get_all_$(1)_var = $$(call
gb_LinkTarget__get_workdir_linktargetname,$$(1))<>ALL_$(2)
gb_LinkTarget__get_all_$(1) = $$($$(call
gb_LinkTarget__get_all_$(1)_var,$$(1)))
gb_Library__get_all_$(1) = $$($$(call gb_LinkTarget__get_all_$(1)_var,$$(call
gb_Library_get_linktarget,$$(1))))
gb_Executable__get_all_$(1) = $$($$(call
gb_LinkTarget__get_all_$(1)_var,$$(call gb_Executable_get_linktarget,$$(1))))
gb_ExternalProject__get_all_$(1) = $$($$(call
gb_LinkTarget__get_all_$(1)_var,$$(call
gb_ExternalProject__get_workdir_linktargetname,$$(1))))
+gb_CppunitTest__get_all_$(1) = $$($$(call
gb_LinkTarget__get_all_$(1)_var,$$(call
gb_CppunitTest__get_workdir_linktargetname,$$(1))))
endef
-$(eval $(call gb_LinkTarget__all_x_accessors,libraries,LIBRARIES))
-$(eval $(call gb_LinkTarget__all_x_accessors,externals,EXTERNALS))
-$(eval $(call gb_LinkTarget__all_x_accessors,statics,STATICS))
+$(eval $(call gb_LinkTarget__generate_all_x_accessors,libraries,LIBRARIES))
+$(eval $(call gb_LinkTarget__generate_all_x_accessors,externals,EXTERNALS))
+$(eval $(call gb_LinkTarget__generate_all_x_accessors,statics,STATICS))
# call
gb_LinkTarget__use_libraries,linktarget,requestedlibs,actuallibs,linktargetmakefilename
define gb_LinkTarget__use_libraries
@@ -1099,12 +1102,13 @@ $(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS +=
$(3)
# depend on the exports of the library, not on the library itself
# for faster incremental builds when the ABI is unchanged
-ifeq ($(DISABLE_DYNLOADING),)
+ifeq (,$(DISABLE_DYNLOADING))
$(call gb_LinkTarget_get_target,$(1)) : \
$(foreach lib,$(3),$(call gb_Library_get_exports_target,$(lib)))
else
-$(if $(gb_DEBUG_STATIC),$(info $(call
gb_LinkTarget__get_all_libraries_var,$(1)) += $(3)))
-$(call gb_LinkTarget__get_all_libraries_var,$(1)) += $(3)
+$(foreach lib,$(3),$(if $(filter $(lib),$(call
gb_LinkTarget__get_all_libraries,$(1))),,\
+ $(if $(gb_DEBUG_STATIC),$$(info $$(call
gb_LinkTarget__get_all_libraries_var,$(1)) += $(lib))) \
+ $$(eval $$(call gb_LinkTarget__get_all_libraries_var,$(1)) += $(lib))))
endif
$(call gb_LinkTarget_get_headers_target,$(1)) : \
@@ -1193,11 +1197,12 @@ $(if $(call gb_LinkTarget__is_merged,$(1)),\
$(call gb_LinkTarget_get_target,$(call
gb_Library_get_linktarget,merged)) : \
LINKED_STATIC_LIBS += $$(if $$(filter-out
StaticLibrary,$$(TARGETTYPE)),$(2)))
-ifeq ($(DISABLE_DYNLOADING),)
+ifeq (,$(DISABLE_DYNLOADING))
$(call gb_LinkTarget_get_target,$(1)) : $(foreach lib,$(2),$(call
gb_StaticLibrary_get_target,$(lib)))
else
-$(if $(gb_DEBUG_STATIC),$(info $(call gb_LinkTarget__get_all_statics_var,$(1))
+= $(2)))
-$(call gb_LinkTarget__get_all_statics_var,$(1)) += $(2)
+$(foreach static,$(2),$(if $(filter $(static),$(call
gb_LinkTarget__get_all_statics,$(1))),,\
+ $(if $(gb_DEBUG_STATIC),$$(info $$(call
gb_LinkTarget__get_all_statics_var,$(1)) += $(static))) \
+ $$(eval $$(call gb_LinkTarget__get_all_statics_var,$(1)) += $(static))))
endif
$(call gb_LinkTarget_get_headers_target,$(1)) : \
$(foreach lib,$(2),$(call gb_StaticLibrary_get_headers_target,$(lib)))
@@ -1810,8 +1815,9 @@ $(if $(filter undefined,$(origin
gb_LinkTarget__use_$(2))),\
$(call gb_LinkTarget__use_$(2),$(1)) \
)
ifneq (,$(DISABLE_DYNLOADING))
-$(if $(gb_DEBUG_STATIC),$(info $(call
gb_LinkTarget__get_all_externals_var,$(1)) += $(2)))
-$(eval $(call gb_LinkTarget__get_all_externals_var,$(1)) += $(2))
+$(foreach extern,$(2),$(if $(filter $(extern),$(call
gb_LinkTarget__get_all_externals,$(1))),,\
+ $(if $(gb_DEBUG_STATIC),$$(info $$(call
gb_LinkTarget__get_all_externals_var,$(1)) += $(extern))) \
+ $$(eval $$(call gb_LinkTarget__get_all_externals_var,$(1)) +=
$(extern))))
endif
endef
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 67b960747676..79e9a0811726 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -118,6 +118,8 @@ gb_LinkTarget__get_workdir_linktargetname = $(firstword
$(subst <>, ,$(1)))
gb_LinkTarget__get_workdir_linktargetclass = $(firstword $(subst /, ,$(call
gb_LinkTarget__get_workdir_linktargetname,$(1))))
gb_LinkTarget__get_workdir_linktargetobject = $(lastword $(subst /, ,$(call
gb_LinkTarget__get_workdir_linktargetname,$(1))))
gb_LinkTarget_get_target = $(lastword $(subst <>, ,$(1)))
+gb_Executable_get_linktargetfile = $(call gb_LinkTarget_get_target,$(call
gb_Executable_get_linktarget,$1))
+gb_CppunitTest_get_linktargetfile = $(call gb_LinkTarget_get_target,$(call
gb_CppunitTest_get_linktarget,$1))
gb_LinkTarget_get_headers_target = \
$(WORKDIR)/Headers/$(call gb_LinkTarget__get_workdir_linktargetname,$(1))
@@ -129,6 +131,8 @@ gb_LinkTarget_get_dep_libraries_target = \
$(WORKDIR)/Dep/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)).d.libraries
gb_LinkTarget_get_dep_externals_target = \
$(WORKDIR)/Dep/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)).d.externals
+gb_LinkTarget_get_dep_statics_target = \
+ $(WORKDIR)/Dep/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)).d.statics
gb_LinkTarget_get_clean_target = \
$(WORKDIR)/Clean/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1))
gb_LinkTarget_get_pch_timestamp = $(WORKDIR)/PrecompiledHeader/$(call
gb_PrecompiledHeader__get_debugdir,$(1))/Timestamps/$(1)
diff --git a/solenv/gbuild/extensions/post_SpeedUpTargets.mk
b/solenv/gbuild/extensions/post_SpeedUpTargets.mk
index 3db6355ab90d..cd475133a82c 100644
--- a/solenv/gbuild/extensions/post_SpeedUpTargets.mk
+++ b/solenv/gbuild/extensions/post_SpeedUpTargets.mk
@@ -9,7 +9,7 @@
ifneq ($(CROSS_COMPILING),)
gb_Module_add_targets_for_build :=
-gb_Module_SKIPTARGETS := check slowcheck screenshot subsequentcheck uicheck
+gb_Module_SKIPTARGETS := slowcheck screenshot subsequentcheck uicheck
endif
ifeq ($(gb_Side),build)
@@ -52,7 +52,6 @@ endif
endif
-
ifneq (,$(filter build,$(gb_Module_SKIPTARGETS)))
gb_Module_add_target =
endif
diff --git a/solenv/gbuild/partial_build.mk b/solenv/gbuild/partial_build.mk
index 3b4478f23154..b4fb84c8ebfd 100644
--- a/solenv/gbuild/partial_build.mk
+++ b/solenv/gbuild/partial_build.mk
@@ -37,4 +37,8 @@ include $(SRCDIR)/solenv/gbuild/gbuild.mk
$(eval $(call gb_Module_make_global_targets,$(wildcard
$(module_directory)Module*.mk)))
+ifneq (,$(DISABLE_DYNLOADING))
+include $(SRCDIR)/solenv/gbuild/static.mk
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index a3c52e782554..8642c4469afe 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -24,12 +24,17 @@ gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_QTDEFS)
gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS)
$(gb_EMSCRIPTEN_EXCEPT)
# WASM is also optimized at link time, but ignores linker flags, so wants
$(gb_COMPILEROPTFLAGS)
-gb_LINKEROPTFLAGS :=
+#gb_LINKEROPTFLAGS :=
gb_LINKERSTRIPDEBUGFLAGS :=
-gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT) \
- $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS), \
- $(if $(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS), \
- $(gb_COMPILERNOOPTFLAGS)))
+
+gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT)
+gb_LinkTarget_LDFLAGS += $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS), \
+ $(if
$(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS),$(gb_COMPILERNOOPTFLAGS)))
+
+#gb_COMPILEROPTFLAGS := -O0 -g
+#gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT) $(gb_COMPILEROPTFLAGS)
+
+gb_SUPPRESS_TESTS := $(true)
define gb_Library_get_rpath
endef
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 771f6ef6264a..33beba33f9dd 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -292,12 +292,18 @@ endef
gb_CppunitTest_CPPTESTPRECOMMAND := \
$(call
gb_Helper_extend_ld_path,$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs)
-gb_CppunitTest_get_filename = libtest_$(1).so
+ifeq (,$(DISABLE_DYNLOADING))
+gb_CppunitTest_get_filename = libtest_$(1)$(gb_Library_PLAINEXT)
+else
+gb_CppunitTest_get_filename = test_$(1)$(gb_Executable_EXT)
+endif
gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename)
gb_CppunitTest_malloc_check := -ex 'set environment MALLOC_CHECK_=2; set
environment MALLOC_PERTURB_=153'
define gb_CppunitTest_CppunitTest_platform
+ifeq (,$(DISABLE_DYNLOADING))
$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call
gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,NONE))
+endif
endef
diff --git a/solenv/gbuild/static.mk b/solenv/gbuild/static.mk
index c2b359378eed..da16724520d2 100644
--- a/solenv/gbuild/static.mk
+++ b/solenv/gbuild/static.mk
@@ -67,33 +67,25 @@
# P.S. remeber to keep the $(info ...) and $(eval ...) blocks in sync (maybe
add a function?)
#
ifeq ($(true),$(gb_FULLDEPS))
-ifeq (,$(gb_PARTIAL_BUILD))
-
-ifeq ($(OS),EMSCRIPTEN)
-$(foreach lib,$(gb_Library_KNOWNLIBS),$(if $(call
gb_Library__get_component,$(lib)),$(eval $(call
gb_Library_use_libraries,components,$(lib)))))
-endif
-
-define gb_Executable__add_x_template
-define gb_Executable__add_$(2)
-$$(foreach item,$$(2),
- $$(foreach dep,$$(call gb_$(1)__get_all_$(2),$$(item)),
- $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call
gb_Executable__get_all_$(2),$$(1))),,
- $$(eval $$(call gb_LinkTarget__add_$(2),$$(call
gb_Executable__get_workdir_linktargetname,$$(1)),$$(dep)))))
- $$(foreach dep,$$(call gb_$(1)__get_all_$(3),$$(item)),
- $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call
gb_Executable__get_all_$(3),$$(1))),,
- $$(eval $$(call gb_LinkTarget__add_$(3),$$(call
gb_Executable__get_workdir_linktargetname,$$(1)),$$(dep))))))
+# strip doesn't remove newlines, so this must be a single line (no define!),
otherwise empty tests fail!
+gb_Executable__has_any_dependencies = \
+$(if $(strip $(filter-out GBUILD_TOUCHED, \
+ $(call gb_Executable__get_all_libraries,$(1)) \
+ $(call gb_Executable__get_all_externals,$(1)) \
+ $(call gb_Executable__get_all_statics,$(1)))),$(1))
-endef
+gb_CppunitTest__has_any_dependencies = \
+$(if $(strip $(filter-out GBUILD_TOUCHED, \
+ $(call gb_CppunitTest__get_all_libraries,$(1)) \
+ $(call gb_CppunitTest__get_all_externals,$(1)) \
+ $(call gb_CppunitTest__get_all_statics,$(1)))),$(1))
-endef # gb_Executable__add_x_template
+ifeq (,$(gb_PARTIAL_BUILD))
-ifneq (,$(gb_DEBUG_STATIC))
-$(info $(call
gb_Executable__add_x_template,ExternalProject,externals,libraries))
-$(info $(call gb_Executable__add_x_template,Library,libraries,externals))
+ifeq ($(OS),EMSCRIPTEN)
+$(foreach lib,$(gb_Library_KNOWNLIBS),$(if $(call
gb_Library__get_component,$(lib)),$(eval $(call
gb_Library_use_libraries,components,$(lib)))))
endif
-$(eval $(call
gb_Executable__add_x_template,ExternalProject,externals,libraries))
-$(eval $(call gb_Executable__add_x_template,Library,libraries,externals))
define gb_LinkTarget__add_x_template
@@ -114,6 +106,34 @@ $(eval $(call gb_LinkTarget__add_x_template,libraries))
$(eval $(call gb_LinkTarget__add_x_template,externals))
$(eval $(call gb_LinkTarget__add_x_template,statics))
+
+define gb_Class__add_x_template
+
+define gb_$(1)__add_$(3)
+$$(foreach item,$$(2),
+ $$(foreach dep,$$(call gb_$(2)__get_all_$(3),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call
gb_$(1)__get_all_$(3),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(3),$$(call
gb_$(1)__get_workdir_linktargetname,$$(1)),$$(dep)))))
+ $$(foreach dep,$$(call gb_$(2)__get_all_$(4),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call
gb_$(1)__get_all_$(4),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(4),$$(call
gb_$(1)__get_workdir_linktargetname,$$(1)),$$(dep))))))
+
+endef
+
+endef # gb_Class__add_x_template
+
+ifneq (,$(gb_DEBUG_STATIC))
+$(info $(call
gb_Class__add_x_template,Executable,ExternalProject,externals,libraries))
+$(info $(call gb_Class__add_x_template,Executable,Library,libraries,externals))
+$(info $(call
gb_Class__add_x_template,CppunitTest,ExternalProject,externals,libraries))
+$(info $(call
gb_Class__add_x_template,CppunitTest,Library,libraries,externals))
+endif
+$(eval $(call
gb_Class__add_x_template,Executable,ExternalProject,externals,libraries))
+$(eval $(call gb_Class__add_x_template,Executable,Library,libraries,externals))
+$(eval $(call
gb_Class__add_x_template,CppunitTest,ExternalProject,externals,libraries))
+$(eval $(call
gb_Class__add_x_template,CppunitTest,Library,libraries,externals))
+
+
# contains the list of all touched workdir_linktargetname(s)
gb_LinkTarget__ALL_TOUCHED =
@@ -171,19 +191,23 @@ ifneq (,$(gb_DEBUG_STATIC))
$(info $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject))
$(info $(call
gb_LinkTarget__fill_all_x_template,externals,ExternalProject,libraries,Library))
$(info $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject,executable,Executable))
+$(info $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject,cppunit,CppunitTest))
endif
$(eval $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject))
$(eval $(call
gb_LinkTarget__fill_all_x_template,externals,ExternalProject,libraries,Library))
$(eval $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject,executable,Executable))
+$(eval $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject,cppunit,CppunitTest))
+
+# contains the last known executable workdir targetname
gb_Executable__LAST_KNOWN =
-gb_Executable__has_any_dependencies = $(if $(filter-out GBUILD_TOUCHED,$(call
gb_Executable__get_all_libraries,$(1)) $(call
gb_Executable__get_all_externals,$(1))),$(1))
+gb_CppunitTest__LAST_KNOWN =
# The comment exists To help decipering / verifying the following block. Most
later items depends on previous one(s).
#
# * Expand all libraries. It's not strictly needed, as we only need the info
for the executables,
# but this way we can implement updating single gbuild-module dependencies
as needed.
-# * For all executables:
+# * For all executables (incl. CppunitTest(s)):
# * For EMSCRIPTEN, add components library to any cppuhelper user, as it
contains the call to the mapper functions
# * Find any loader libraries and add the needed plugin dependences
# * Add all statics to the executables
@@ -191,41 +215,62 @@ gb_Executable__has_any_dependencies = $(if $(filter-out
GBUILD_TOUCHED,$(call gb
# * Serialize the linking of executables for EMSCRIPTEN, because wasm-opt is
multi-threaded using all cores.
# * Remove "touch" mark from all touched targets
$(foreach lib,$(gb_Library_KNOWNLIBS),$(eval $(call
gb_LinkTarget__fill_all_libraries,$(lib))))
-$(foreach exec,$(gb_Executable_KNOWN), \
- $(if $(and $(filter EMSCRIPTEN,$(OS)),$(filter cppuhelper,$(call
gb_Executable__get_all_libraries,$(exec)))), \
- $(eval $(call gb_Executable_use_libraries,$(exec),components)))
\
- $(eval $(call gb_LinkTarget__fill_all_executable,$(exec))) \
- $(foreach loader,$(filter $(gb_Library_KNOWNLOADERS),$(call
gb_Executable__get_all_libraries,$(exec))), \
- $(eval $(call gb_Executable_use_libraries,$(exec),$(call
gb_Library__get_plugins,$(loader)))) \
- $(eval $(call gb_Executable__add_libraries,$(exec),$(call
gb_Library__get_plugins,$(loader))))) \
- $(if $(filter-out GBUILD_TOUCHED,$(call
gb_Executable__get_all_libraries,$(exec))), \
- $(foreach lib,$(filter-out GBUILD_TOUCHED,$(call
gb_Executable__get_all_libraries,$(exec))), \
- $(if $(call gb_Library__get_all_statics,$(lib)), \
- $(eval $(call
gb_Executable_use_static_libraries,$(exec),$(call
gb_Library__get_all_statics,$(lib)))))) \
- $(eval $(call gb_Executable_use_libraries,$(exec),$(filter-out
GBUILD_TOUCHED,$(call gb_Executable__get_all_libraries,$(exec)))))) \
- $(if $(filter-out GBUILD_TOUCHED,$(call
gb_Executable__get_all_externals,$(exec))), \
- $(eval $(call gb_Executable_use_externals,$(exec),$(filter-out
GBUILD_TOUCHED,$(call gb_Executable__get_all_externals,$(exec)))))) \
- $(if $(filter icui18n icuuc,$(call
gb_Executable__get_all_externals,$(exec))), \
- $(eval $(call gb_Executable_use_externals,$(exec),icudata))) \
- $(if $(and $(filter EMSCRIPTEN,$(OS)),$(call
gb_Executable__has_any_dependencies,$(exec))), \
- $(if $(gb_Executable__LAST_KNOWN), \
- $(if $(gb_DEBUG_STATIC),$(info $(call
gb_Executable_get_target,$(exec)) => $(call
gb_Executable_get_target,$(gb_Executable__LAST_KNOWN))))) \
- $(eval $(call gb_Executable_get_target,$(exec)) :
$(call gb_Executable_get_target,$(gb_Executable__LAST_KNOWN))) \
- $(eval gb_Executable__LAST_KNOWN = $(exec))))
+
+define gb_LinkTarget__expand_executable
+$$(if $$(and $$(filter EMSCRIPTEN,$$(OS)),$$(filter cppuhelper,$$(call
gb_$(2)__get_all_libraries,$(3)))), \
+ $$(eval $$(call gb_$(2)_use_libraries,$(3),components))) \
+$$(eval $$(call gb_LinkTarget__fill_all_$(1),$(3))) \
+$$(foreach loader,$$(filter $$(gb_Library_KNOWNLOADERS),$$(call
gb_$(2)__get_all_libraries,$(3))), \
+ $$(eval $$(call gb_$(2)_use_libraries,$(3),$$(call
gb_Library__get_plugins,$$(loader)))) \
+ $$(eval $$(call gb_$(2)__add_libraries,$(3),$$(call
gb_Library__get_plugins,$$(loader))))) \
+$$(if $$(filter-out GBUILD_TOUCHED,$$(call gb_$(2)__get_all_libraries,$(3))), \
+ $$(foreach lib,$$(filter-out GBUILD_TOUCHED,$$(call
gb_$(2)__get_all_libraries,$(3))), \
+ $$(if $$(call gb_Library__get_all_statics,$$(lib)), \
+ $$(eval $$(call
gb_$(2)_use_static_libraries,$(3),$$(call
gb_Library__get_all_statics,$$(lib)))))) \
+ $$(eval $$(call gb_$(2)_use_libraries,$(3),$$(filter-out
GBUILD_TOUCHED,$$(call gb_$(2)__get_all_libraries,$(3)))))) \
+$$(if $$(filter-out GBUILD_TOUCHED,$$(call gb_$(2)__get_all_externals,$(3))), \
+ $$(eval $$(call gb_$(2)_use_externals,$(3),$$(filter-out
GBUILD_TOUCHED,$$(call gb_$(2)__get_all_externals,$(3)))))) \
+$$(if $$(filter icui28n icuuc,$$(call gb_$(2)__get_all_externals,$(3))), \
+ $$(eval $$(call gb_$(2)_use_externals,$(3),icudata))) \
+$$(if $$(and $$(filter EMSCRIPTEN,$$(OS)),$$(call
gb_$(2)__has_any_dependencies,$(3))), \
+ $$(if $$(gb_$(2)__LAST_KNOWN), \
+ $$(if $$(gb_DEBUG_STATIC),$$(info $$(call
gb_$(2)_get_linktargetfile,$(3)) => $$(call
gb_$(2)_get_linktargetfile,$$(gb_$(2)__LAST_KNOWN)))) \
+ $$(eval $$(call gb_$(2)_get_linktargetfile,$(3)) : $$(call
gb_$(2)_get_linktargetfile,$$(gb_$(2)__LAST_KNOWN)))) \
+ $$(eval gb_$(2)__LAST_KNOWN = $(3)))
+
+endef
+
+$(foreach exec,$(gb_Executable_KNOWN),$(eval $(call
gb_LinkTarget__expand_executable,executable,Executable,$(exec))))
+$(foreach cppunit,$(gb_CppunitTest_KNOWN),$(eval $(call
gb_LinkTarget__expand_executable,cppunit,CppunitTest,$(cppunit))))
$(foreach workdir_linktargetname,$(gb_LinkTarget__ALL_TOUCHED),$(eval $(call
gb_LinkTarget__remove_touch,$(workdir_linktargetname))))
else # $(gb_PARTIAL_BUILD)
gb_Executable__get_dep_libraries_target = $(call
gb_LinkTarget_get_dep_libraries_target,$(call
gb_Executable__get_workdir_linktargetname,$(1)))
gb_Executable__get_dep_externals_target = $(call
gb_LinkTarget_get_dep_externals_target,$(call
gb_Executable__get_workdir_linktargetname,$(1)))
+gb_Executable__get_dep_statics_target = $(call
gb_LinkTarget_get_dep_statics_target,$(call
gb_Executable__get_workdir_linktargetname,$(1)))
+gb_CppunitTest__get_dep_libraries_target = $(call
gb_LinkTarget_get_dep_libraries_target,$(call
gb_CppunitTest__get_workdir_linktargetname,$(1)))
+gb_CppunitTest__get_dep_externals_target = $(call
gb_LinkTarget_get_dep_externals_target,$(call
gb_CppunitTest__get_workdir_linktargetname,$(1)))
+gb_CppunitTest__get_dep_statics_target = $(call
gb_LinkTarget_get_dep_statics_target,$(call
gb_CppunitTest__get_workdir_linktargetname,$(1)))
+
+define gb_LinkTarget__expand_executable
+$$(if $$(call gb_$(1)__has_any_dependencies,$(2)), \
+ $$(if $$(shell cat $$(call gb_$(1)__get_dep_libraries_target,$(2))
2>/dev/null), \
+ $$(eval $$(call gb_$(1)_use_libraries,$(2),$$(shell cat $$(call
gb_$(1)__get_dep_libraries_target,$(2)))))) \
+ $$(if $$(shell cat $$(call gb_$(1)__get_dep_externals_target,$(2))
2>/dev/null), \
+ $$(eval $$(call gb_$(1)_use_externals,$(2),$$(shell cat $$(call
gb_$(1)__get_dep_externals_target,$(2)))))) \
+ $$(if $$(shell cat $$(call gb_$(1)__get_dep_statics_target,$(2))
2>/dev/null), \
+ $$(eval $$(call gb_$(1)_use_static_libraries,$(2),$$(shell cat
$$(call gb_$(1)__get_dep_statics_target,$(2)))))) \
+ $$(if $$(filter EMSCRIPTEN,$$(OS)), \
+ $$(if $$(gb_$(1)__LAST_KNOWN), \
+ $$(if $$(gb_DEBUG_STATIC),$$(info $$(call
gb_$(1)_get_linktargetfile,$(2)) => $$(call
gb_$(1)_get_linktargetfile,$$(gb_$(1)__LAST_KNOWN)))) \
+ $$(eval $$(call gb_$(1)_get_linktargetfile,$(2)) :
$$(call gb_$(1)_get_linktargetfile,$$(gb_$(1)__LAST_KNOWN)))) \
+ $$(eval gb_$(1)__LAST_KNOWN = $(2))))
+
+endef # gb_LinkTarget__expand_executable
-$(foreach exec,$(gb_Executable_KNOWN), \
- $(if $(shell cat $(call
gb_Executable__get_dep_libraries_target,$(exec)) 2>/dev/null), \
- $(eval $(call gb_Executable_use_libraries,$(exec),$(shell cat
$(call gb_Executable__get_dep_libraries_target,$(exec)))))) \
- $(if $(shell cat $(call
gb_Executable__get_dep_externals_target,$(exec)) 2>/dev/null), \
- $(eval $(call gb_Executable_use_externals,$(exec),$(shell cat
$(call gb_Executable__get_dep_externals_target,$(exec)))))) \
- $(if $(shell cat $(call gb_Executable__get_dep_statics_target,$(exec))
2>/dev/null), \
- $(eval $(call
gb_Executable_use_static_libraries,$(exec),$(shell cat $(call
gb_Executable__get_dep_statics_target,$(exec)))))))
+$(foreach exec,$(gb_Executable_KNOWN),$(eval $(call
gb_LinkTarget__expand_executable,Executable,$(exec))))
+$(foreach cppunit,$(gb_CppunitTest_KNOWN),$(eval $(call
gb_LinkTarget__expand_executable,CppunitTest,$(cppunit))))
endif # $(gb_PARTIAL_BUILD)
endif # $(gb_FULLDEPS)
diff --git a/test/Module_test.mk b/test/Module_test.mk
index 080cc855b28c..8a02197694b6 100644
--- a/test/Module_test.mk
+++ b/test/Module_test.mk
@@ -9,8 +9,6 @@
$(eval $(call gb_Module_Module,test))
-ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
-
$(eval $(call gb_Module_add_targets,test,\
Library_test \
Library_test_setupvcl \
@@ -23,6 +21,4 @@ $(eval $(call gb_Module_add_check_targets,test,\
CppunitTest_test_xpath \
))
-endif
-
# vim: set noet sw=4 ts=4:
diff --git a/unotest/Module_unotest.mk b/unotest/Module_unotest.mk
index bdffe8e8ac14..8a97069e1027 100644
--- a/unotest/Module_unotest.mk
+++ b/unotest/Module_unotest.mk
@@ -11,7 +11,6 @@
$(eval $(call gb_Module_Module,unotest))
ifeq ($(gb_Side),host)
-ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,unotest,\
Library_unobootstrapprotector \
Library_unoexceptionprotector \
@@ -30,6 +29,5 @@ $(eval $(call gb_Module_add_targets,unotest,\
))
endif
endif
-endif
# vim: set noet sw=4 ts=4:
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index fc38ed5b481a..3cf84ac21210 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -31,19 +31,13 @@ $(eval $(call gb_Module_add_targets,vcl,\
Package_skia_denylist ) \
$(if $(filter DESKTOP,$(BUILD_TYPE))$(filter EMSCRIPTEN,$(OS)), \
StaticLibrary_vclmain \
- $(if $(ENABLE_MACOSX_SANDBOX),, \
- $(if $(DISABLE_GUI),, \
- Executable_ui-previewer)) \
$(if $(filter EMSCRIPTEN LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
$(if $(DISABLE_GUI),, \
- Executable_vcldemo \
- Executable_icontest \
- Executable_visualbackendtest \
- Executable_mtfdemo ))) \
+ Executable_vcldemo ))) \
))
$(eval $(call gb_Module_add_targets,vcl,\
- $(if $(filter-out ANDROID iOS WNT,$(OS)), \
+ $(if $(filter-out EMSCRIPTEN ANDROID iOS WNT,$(OS)), \
Executable_svdemo \
Executable_fftester \
Executable_svptest \
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 2f6bfb4b5fcd..58149911fd4d 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -54,6 +54,11 @@
#include <mutex>
#include <condition_variable>
+#ifdef EMSCRIPTEN
+#include <QtCore/QtPlugin>
+Q_IMPORT_PLUGIN(QWasmIntegrationPlugin)
+#endif
+
namespace
{
/// TODO: not much Qt5 specific here? could be generalised, esp. for OSX...
diff --git a/writerperfect/Module_writerperfect.mk
b/writerperfect/Module_writerperfect.mk
index c24b0dd5bcc6..e511173fa1da 100644
--- a/writerperfect/Module_writerperfect.mk
+++ b/writerperfect/Module_writerperfect.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_Module_add_l10n_targets,writerperfect,\
$(eval $(call gb_Module_add_check_targets,writerperfect,\
CppunitTest_writerperfect_stream \
CppunitTest_writerperfect_wpftimport \
+ Library_wpftqahelper \
))
$(eval $(call gb_Module_add_slowcheck_targets,writerperfect,\
@@ -44,7 +45,6 @@ $(eval $(call gb_Module_add_slowcheck_targets,writerperfect,\
CppunitTest_writerperfect_import \
CppunitTest_writerperfect_impress \
CppunitTest_writerperfect_writer \
- Library_wpftqahelper \
))
$(eval $(call gb_Module_add_uicheck_targets,writerperfect,\
commit 94ce7db10fb493fba7b828187da0b2bad7290040
Author: Thorsten Behrens <[email protected]>
AuthorDate: Sun Jan 24 23:54:02 2021 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:46 2021 +0100
Get debug builds working
- source maps really don't like SAFE_HEAP=1
(c.f. https://github.com/emscripten-core/emscripten/issues/8584)
- get OptFlags passed on consistently while at it
Change-Id: I7d234de6b069877a558a2f3c7ab9dd5398d18ef2
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index b0e26432f173..a3c52e782554 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -12,7 +12,8 @@ gb_UnoApiHeadersTarget_select_variant = $(if $(filter
udkapi,$(1)),comprehensive
include $(GBUILDDIR)/platform/unxgcc.mk
gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
-gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s
PTHREAD_POOL_SIZE=4 -s SAFE_HEAP=1
+# 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
@@ -25,7 +26,10 @@ gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_QTDEFS) $(gb
# WASM is also optimized at link time, but ignores linker flags, so wants
$(gb_COMPILEROPTFLAGS)
gb_LINKEROPTFLAGS :=
gb_LINKERSTRIPDEBUGFLAGS :=
-gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT) $(gb_COMPILEROPTFLAGS)
+gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT) \
+ $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS), \
+ $(if $(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS), \
+ $(gb_COMPILERNOOPTFLAGS)))
define gb_Library_get_rpath
endef
commit 0127934cd0a0367bb3bb7c5909264d78a507f5de
Author: Thorsten Behrens <[email protected]>
AuthorDate: Sun Jan 24 22:29:38 2021 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:46 2021 +0100
Make qt5 src download options explicit
Change-Id: Id2e78f71e10b8736cb03e42b1d0ad52c851cadd3
diff --git a/README.wasm b/README.wasm
index cbc08a40a490..2dbe16010c8d 100644
--- a/README.wasm
+++ b/README.wasm
@@ -42,6 +42,12 @@ https://doc.qt.io/qt-5/wasm.html
I originally build the Qt 5.15 branch, but probably better to build a tag like
v5.15.2.
+So:
+
+git clone https://github.com/qt/qt5.git
+cd qt5
+git checkout v5.15.2
+./init-repository
./configure -xplatform wasm-emscripten -feature-thread -compile-examples
-prefix $PWD/qtbase
make -j<CORES> module-qtbase module-qtdeclarative
commit d50f2451b212d241d6d104c495aacdd726189d17
Author: Thorsten Behrens <[email protected]>
AuthorDate: Sun Jan 24 22:28:47 2021 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:46 2021 +0100
Change order of qmake search
Otherwise we'd find local, non-emscription installation before
the QT5DIR-provided one
Change-Id: I956431c3433932adf1bee04ff8ce1cadfa0a4d81
diff --git a/configure.ac b/configure.ac
index 9fcb33b4bf6e..9d408641528c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12473,7 +12473,7 @@ then
fi
dnl Check for qmake5
- AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH])
+ AC_PATH_PROGS( QMAKE5, [qmake], no, [$QT5DIR/bin:$PATH])
if test "$QMAKE5" = "no"; then
AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5
installation by exporting QT5DIR before running "configure".])
else
commit cc8966752856265b285a17d5abc9606838fcc682
Author: Thorsten Behrens <[email protected]>
AuthorDate: Sat Dec 19 22:50:49 2020 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:46 2021 +0100
Hack out vs-code config.in
Change-Id: If3b9a9684f43ffaeaebbccd1545e168d6b5f74b4
diff --git a/configure.ac b/configure.ac
index 345e4dd9d1e1..9fcb33b4bf6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14119,8 +14119,7 @@ AC_CONFIG_FILES([config_host.mk
bin/officeotron.sh
hardened_runtime.xcent
instsetoo_native/util/openoffice.lst
- sysui/desktop/macosx/Info.plist
-
vs-code-template.code-workspace:.vscode/vs-code-template.code-workspace.in])
+ sysui/desktop/macosx/Info.plist])
AC_CONFIG_HEADERS([config_host/config_buildid.h])
AC_CONFIG_HEADERS([config_host/config_box2d.h])
AC_CONFIG_HEADERS([config_host/config_clang.h])
commit f16343941bc06bd148f2946a71e96b8c7c834fca
Author: Jan-Marek Glogowski <[email protected]>
AuthorDate: Sat Jan 9 13:41:18 2021 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:46 2021 +0100
Enable some more tests and demos for static builds
Change-Id: I6372cd33db2fb72d417ca483d1324fca6947e077
diff --git a/Repository.mk b/Repository.mk
index 6c3aae767e62..7edcc5ca5c02 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -67,7 +67,7 @@ $(eval $(call gb_Helper_register_executables,NONE, \
svptest \
svpclient ) \
$(if $(filter LINUX %BSD SOLARIS,$(OS)), tilebench) \
- $(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)),icontest) \
+ icontest \
vcldemo \
tiledrendering \
mtfdemo \
diff --git a/registry/Module_registry.mk b/registry/Module_registry.mk
index 90f7833673d8..aa7ec1ab3ecc 100644
--- a/registry/Module_registry.mk
+++ b/registry/Module_registry.mk
@@ -11,7 +11,7 @@ $(eval $(call gb_Module_Module,registry))
$(eval $(call gb_Module_add_targets,registry,\
Library_reg \
- $(if $(filter-out $(OS),iOS), \
+ $(if $(DISABLE_DYNLOADING),, \
$(if $(ENABLE_MACOSX_SANDBOX),, \
Executable_regmerge \
Executable_regview \
@@ -20,9 +20,8 @@ $(eval $(call gb_Module_add_targets,registry,\
) \
))
-ifneq ($(OS),iOS) # missing regmerge (see above), needed within test
-
-ifeq ($(ENABLE_MACOSX_SANDBOX),) # ditto
+ifneq (,$(DISABLE_DYNLOADING))
+ifeq ($(ENABLE_MACOSX_SANDBOX),)
$(eval $(call gb_Module_add_check_targets,registry, \
CustomTarget_regcompare_test \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index a45b43be22bd..fc38ed5b481a 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -34,7 +34,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
$(if $(ENABLE_MACOSX_SANDBOX),, \
$(if $(DISABLE_GUI),, \
Executable_ui-previewer)) \
- $(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
+ $(if $(filter EMSCRIPTEN LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
$(if $(DISABLE_GUI),, \
Executable_vcldemo \
Executable_icontest \
@@ -42,8 +42,6 @@ $(eval $(call gb_Module_add_targets,vcl,\
Executable_mtfdemo ))) \
))
-ifeq ($(CROSS_COMPILING)$(DISABLE_DYNLOADING),)
-
$(eval $(call gb_Module_add_targets,vcl,\
$(if $(filter-out ANDROID iOS WNT,$(OS)), \
Executable_svdemo \
@@ -52,8 +50,6 @@ $(eval $(call gb_Module_add_targets,vcl,\
Executable_svpclient) \
))
-endif
-
$(eval $(call gb_Module_add_l10n_targets,vcl,\
AllLangMoTarget_vcl \
))
commit fd86712b51f398d3ba060b7f9b24cee59dc681ca
Author: Jan-Marek Glogowski <[email protected]>
AuthorDate: Tue Dec 29 11:49:50 2020 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:46 2021 +0100
Add a static components library
This adds all component implementing libraries as dependency to a
new components library, which otherwise just contains the "native"
code with the mapping of the component constructors.
Since there is no way to know, which components are actually used,
this has to include all build components.
The components lbrary is automatically added to all users of
cppuhelper, which contains the calls to the mapper functions of the
generated "native" code.
Change-Id: Ie78af06c3325c0f58226a4c4da85a1d64fb45dc6
diff --git a/Repository.mk b/Repository.mk
index 09cad9c3c157..6c3aae767e62 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -345,6 +345,7 @@ $(eval $(call
gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,OPENCL,clew) \
$(if $(filter $(OS),WNT),,cmdmail) \
cppcanvas \
+ $(if $(filter $(OS),EMSCRIPTEN),components) \
configmgr \
ctl \
cui \
diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk
index 6bbab747d462..da044da5b9b9 100644
--- a/i18npool/Library_i18npool.mk
+++ b/i18npool/Library_i18npool.mk
@@ -25,6 +25,17 @@ $(eval $(call gb_Library_use_libraries,i18npool,\
i18nlangtag \
i18nutil \
sal \
+ $(if $(DISABLE_DYNLOADING), \
+ collator_data \
+ dict_ja \
+ dict_zh \
+ index_data \
+ localedata_en \
+ localedata_es \
+ localedata_euro \
+ localedata_others \
+ textconv_dict \
+ ) \
))
$(eval $(call gb_Library_use_externals,i18npool,\
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 9cb1684caffc..52110127b842 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/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx
index 046be764ba19..4378ad2d2f84 100644
--- a/sd/source/core/typemap.cxx
+++ b/sd/source/core/typemap.cxx
@@ -95,7 +95,49 @@
#include <svx/galleryitem.hxx>
#include <svx/sdangitm.hxx>
+#ifdef DISABLE_DYNLOADING
+/* Avoid clash with the ones from svx/source/form/typemap.cxx */
+#define aSfxBoolItem_Impl sd_source_core_typemap_aSfxBoolItem_Impl
+#define aSfxInt32Item_Impl sd_source_core_typemap_aSfxInt32Item_Impl
+#define aSfxStringItem_Impl sd_source_core_typemap_aSfxStringItem_Impl
+#define aSfxUInt16Item_Impl sd_source_core_typemap_aSfxUInt16Item_Impl
+#define aSfxUInt32Item_Impl sd_source_core_typemap_aSfxUInt32Item_Impl
+#define aSfxVoidItem_Impl sd_source_core_typemap_aSfxVoidItem_Impl
+#define aSvxClipboardFormatItem_Impl
sd_source_core_typemap_aSvxClipboardFormatItem_Impl
+#define aSvxColorItem_Impl sd_source_core_typemap_aSvxColorItem_Impl
+#define aSvxContourItem_Impl sd_source_core_typemap_aSvxContourItem_Impl
+#define aSvxCrossedOutItem_Impl sd_source_core_typemap_aSvxCrossedOutItem_Impl
+#define aSvxFontHeightItem_Impl sd_source_core_typemap_aSvxFontHeightItem_Impl
+#define aSvxFontItem_Impl sd_source_core_typemap_aSvxFontItem_Impl
+#define aSvxLanguageItem_Impl sd_source_core_typemap_aSvxLanguageItem_Impl
+#define aSvxPostureItem_Impl sd_source_core_typemap_aSvxPostureItem_Impl
+#define aSvxShadowedItem_Impl sd_source_core_typemap_aSvxShadowedItem_Impl
+#define aSvxUnderlineItem_Impl sd_source_core_typemap_aSvxUnderlineItem_Impl
+#define aSvxOverlineItem_Impl sd_source_core_typemap_aSvxOverlineItem_Impl
+#define aSvxWeightItem_Impl sd_source_core_typemap_aSvxWeightItem_Impl
+#endif
+
#define SFX_TYPEMAP
#include <sdslots.hxx>
+#ifdef DISABLE_DYNLOADING
+#undef aSfxBoolItem_Impl
+#undef aSfxInt32Item_Impl
+#undef aSfxStringItem_Impl
+#undef aSfxUInt16Item_Impl
+#undef aSfxUInt32Item_Impl
+#undef aSfxVoidItem_Impl
+#undef aSvxClipboardFormatItem_Impl
+#undef aSvxColorItem_Impl
+#undef aSvxContourItem_Impl
+#undef aSvxCrossedOutItem_Impl
+#undef aSvxFontHeightItem_Impl
+#undef aSvxFontItem_Impl
+#undef aSvxLanguageItem_Impl
+#undef aSvxPostureItem_Impl
+#undef aSvxShadowedItem_Impl
+#undef aSvxTextLineItem_Impl
+#undef aSvxWeightItem_Impl
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 4f336cbb0007..685e5c249afc 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -119,6 +119,9 @@ $(if $(3),$(call
gb_Output_error,gb_Library_set_soversion_script: too many argum
$(call gb_Library__set_soversion_script_platform,$(1),$(2))
endef
+gb_Library__get_component_var = $(call
gb_Library__get_workdir_linktargetname,$(1))<>COMPONENTFILE
+gb_Library__get_component = $($(call gb_Library__get_component_var,$(1)))
+
# The dependency from workdir component target to outdir library should ensure
# that gb_CppunitTest_use_component can transitively depend on the library.
# But the component target also must be delivered; use the target
@@ -134,6 +137,7 @@ $(call gb_ComponentTarget_get_target,$(2)) :| \
$(call gb_Library_get_target,$(gb_Library__get_name))
$(call gb_Library_get_clean_target,$(gb_Library__get_name)) : \
$(call gb_ComponentTarget_get_clean_target,$(2))
+$(eval $(call gb_Library__get_component_var,$(1)) += $(2))
endef
gb_Library__get_name = $(if $(filter $(1),$(gb_MERGEDLIBS)),merged,$(1))
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index ba88eea92976..b0e26432f173 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -7,11 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_UnoApiHeadersTarget_select_variant = $(if $(filter
udkapi,$(1)),comprehensive,$(2))
-else
-gb_UnoApiHeadersTarget_select_variant = $(2)
-endif
include $(GBUILDDIR)/platform/unxgcc.mk
diff --git a/solenv/gbuild/static.mk b/solenv/gbuild/static.mk
index f71a042f7221..c2b359378eed 100644
--- a/solenv/gbuild/static.mk
+++ b/solenv/gbuild/static.mk
@@ -50,6 +50,13 @@
# doesn't seem to happen in any breaking way and it works to link multiple
Executable
# with large and small expanded dependency lists.
#
+# Then there is the special static "components" library, which simply depends
on all build
+# components. In theory these could be limited per-module (Writer, Calc,
etc.), but currently
+# this is not implemented and instead solenv/bin/native-code.py is used, so
actually
+# everything is build and "cleaned up" at link time, which is especially
expensive for WASM.
+# That library is currently just used for Emscripten, but could be used
generally for
+# static builds.
+#
# For WASM, this also serialize the linking, because the wasm-opt process is
multi-threaded,
# running on all available cores, using GB of memory. Extra parallelism is
counterproductive.
#
@@ -62,6 +69,10 @@
ifeq ($(true),$(gb_FULLDEPS))
ifeq (,$(gb_PARTIAL_BUILD))
+ifeq ($(OS),EMSCRIPTEN)
+$(foreach lib,$(gb_Library_KNOWNLIBS),$(if $(call
gb_Library__get_component,$(lib)),$(eval $(call
gb_Library_use_libraries,components,$(lib)))))
+endif
+
define gb_Executable__add_x_template
define gb_Executable__add_$(2)
@@ -173,6 +184,7 @@ gb_Executable__has_any_dependencies = $(if $(filter-out
GBUILD_TOUCHED,$(call gb
# * Expand all libraries. It's not strictly needed, as we only need the info
for the executables,
# but this way we can implement updating single gbuild-module dependencies
as needed.
# * For all executables:
+# * For EMSCRIPTEN, add components library to any cppuhelper user, as it
contains the call to the mapper functions
# * Find any loader libraries and add the needed plugin dependences
# * Add all statics to the executables
# * Add icudata as needed (it should be a plugin somehow declared in
RepositoryExternal.mk, but that didn't work)
@@ -180,6 +192,8 @@ gb_Executable__has_any_dependencies = $(if $(filter-out
GBUILD_TOUCHED,$(call gb
# * Remove "touch" mark from all touched targets
$(foreach lib,$(gb_Library_KNOWNLIBS),$(eval $(call
gb_LinkTarget__fill_all_libraries,$(lib))))
$(foreach exec,$(gb_Executable_KNOWN), \
+ $(if $(and $(filter EMSCRIPTEN,$(OS)),$(filter cppuhelper,$(call
gb_Executable__get_all_libraries,$(exec)))), \
+ $(eval $(call gb_Executable_use_libraries,$(exec),components)))
\
$(eval $(call gb_LinkTarget__fill_all_executable,$(exec))) \
$(foreach loader,$(filter $(gb_Library_KNOWNLOADERS),$(call
gb_Executable__get_all_libraries,$(exec))), \
$(eval $(call gb_Executable_use_libraries,$(exec),$(call
gb_Library__get_plugins,$(loader)))) \
diff --git a/vcl/Executable_ui-previewer.mk b/vcl/Executable_ui-previewer.mk
index 87a63182a0de..f853ce40864e 100644
--- a/vcl/Executable_ui-previewer.mk
+++ b/vcl/Executable_ui-previewer.mk
@@ -30,119 +30,6 @@ $(eval $(call gb_Executable_use_libraries,ui-previewer,\
tl \
ucbhelper \
vcl \
- $(if $(filter TRUE,$(DISABLE_DYNLOADING)), \
- acc \
- avmedia \
- basegfx \
- bib \
- bootstrap \
- cairocanvas \
- canvasfactory \
- canvastools \
- chartcontroller \
- chartcore \
- collator_data \
- configmgr \
- cppcanvas \
- ctl \
- cui \
- dba \
- dbtools \
- dict_ja \
- dict_zh \
- drawinglayer \
- editeng \
- embobj \
- emfio \
- epoxy \
- evtatt \
- expwrap \
- filterconfig \
- frm \
- fsstorage \
- fwk \
- gie \
- gie \
- graphicfilter \
- graphicfilter \
- guesslang \
- hyphen \
- i18nlangtag \
- i18npool \
- i18npool \
- i18nsearch \
- i18nutil \
- icg \
- index_data \
- introspection \
- invocadapt \
- invocation \
- lng \
- lnth \
- localebe1 \
- localedata_en \
- localedata_es \
- localedata_euro \
- localedata_others \
- msfilter \
- mtfrenderer \
- namingservice \
- numbertext \
- odfflatxml \
- oox \
- package2 \
- pdffilter \
- proxyfac \
- reflection \
- reg \
- salhelper \
- sax \
- sax \
- sb \
- sfx \
- simplecanvas \
- sot \
- spell \
- srtrs1 \
- stocservices \
- storagefd \
- store \
- svgfilter \
- svgio \
- svl \
- svt \
- svx \
- svxcore \
- t602filter \
- textconv_dict \
- textfd \
- tl \
- tk \
- ucb1 \
- ucbhelper \
- ucpdav1 \
- ucpfile1 \
- ucphier1 \
- ucppkg1 \
- ucptdoc1 \
- unoidl \
- unordf \
- unoxml \
- utl \
- uui \
- vclcanvas \
- xmlfa \
- xmlfd \
- xmlreader \
- xmlscript \
- xo \
- xof \
- xsltdlg \
- xsltfilter \
- xsltfilter \
- xstor \
- $(if $(filter EMSCRIPTEN,$(OS)),vclplug_qt5) \
- ) \
))
$(eval $(call gb_Executable_add_exception_objects,ui-previewer,\
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 2ce2ad477249..4ecf042b92ff 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -577,9 +577,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
$(vcl_headless_freetype_code) \
))
-$(eval $(call gb_Library_add_generated_exception_objects,vcl,\
- CustomTarget/vcl/wasm/native-code \
-))
$(eval $(call gb_Library_use_externals,vcl,\
cairo \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 34e0bd041583..a45b43be22bd 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -123,12 +123,6 @@ $(eval $(call gb_Module_add_targets,vcl,\
))
endif
-ifeq ($(OS),EMSCRIPTEN)
-$(eval $(call gb_Module_add_targets,vcl,\
- CustomTarget_wasm_native \
-))
-endif
-
ifneq ($(ENABLE_FUZZERS),)
$(eval $(call gb_Module_add_targets,vcl,\
CustomTarget_nativecore \
diff --git a/vcl/CustomTarget_wasm_native.mk b/wasm/CustomTarget_components.mk
similarity index 71%
rename from vcl/CustomTarget_wasm_native.mk
rename to wasm/CustomTarget_components.mk
index a9f702388500..cb188166d894 100644
--- a/vcl/CustomTarget_wasm_native.mk
+++ b/wasm/CustomTarget_components.mk
@@ -8,14 +8,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-$(eval $(call gb_CustomTarget_CustomTarget,vcl/wasm))
+$(eval $(call gb_CustomTarget_CustomTarget,wasm/components))
-wasm_WORKDIR := $(call gb_CustomTarget_get_workdir,vcl/wasm)
+wasm_WORKDIR := $(call gb_CustomTarget_get_workdir,wasm)
-$(call gb_CustomTarget_get_target,vcl/wasm): \
- $(wasm_WORKDIR)/native-code.cxx
+$(call gb_CustomTarget_get_target,wasm/components): \
+ $(wasm_WORKDIR)/component_maps.cxx
-$(wasm_WORKDIR)/native-code.cxx: \
+$(wasm_WORKDIR)/component_maps.cxx: \
$(SRCDIR)/solenv/bin/native-code.py \
| $(wasm_WORKDIR)/.dir
$(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2)
diff --git a/wasm/Library_components.mk b/wasm/Library_components.mk
new file mode 100644
index 000000000000..128a3c12c2df
--- /dev/null
+++ b/wasm/Library_components.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column:
100 -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_Library_Library,components))
+
+$(eval $(call gb_Library_add_generated_exception_objects,components,\
+ CustomTarget/wasm/component_maps \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/wasm/Module_wasm.mk b/wasm/Module_wasm.mk
index 0ef8c4c6aaf4..d6f507a005df 100644
--- a/wasm/Module_wasm.mk
+++ b/wasm/Module_wasm.mk
@@ -13,6 +13,8 @@ ifeq ($(OS),EMSCRIPTEN)
$(eval $(call gb_Module_add_targets,wasm,\
CustomTarget_wasm-qt5-mandelbrot_moc \
Executable_wasm-qt5-mandelbrot \
+ CustomTarget_components \
+ Library_components \
))
endif
commit 57c2caa07a645c80cd636d80aa1d6bdea574bf9e
Author: Jan-Marek Glogowski <[email protected]>
AuthorDate: Tue Dec 29 11:40:44 2020 +0100
Commit: Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Feb 5 14:15:45 2021 +0100
gbuild: handle Executable(s) for static build
See the (large) comment in solenv/gbuild/static.mk trying to
explain, why this implementation was chosen (spoiler: seems
there is no other way) and what is actually implemented. Yes,
I also think it's borderline maintainable (like gbuild in
general; complexity clashing with make "restrictions"). Feel
free to propose / implement anything easier, except expanding
the bin/lo-all-static-libs "concept" ;-)
Change-Id: Iceb73c05b163affc4385fd4f8f0f5a2ecb55b004
diff --git a/Makefile.gbuild b/Makefile.gbuild
index cd7fc973c287..f369c9e9fb4d 100644
--- a/Makefile.gbuild
+++ b/Makefile.gbuild
@@ -20,6 +20,10 @@ include $(SRCDIR)/solenv/gbuild/gbuild.mk
$(eval $(call
gb_Module_make_global_targets,$(SRCDIR)/RepositoryModule_$(gb_Side).mk))
+ifneq (,$(DISABLE_DYNLOADING))
+include $(SRCDIR)/solenv/gbuild/static.mk
+endif
+
upload-symbols:
bin/upload_symbols.py $(WORKDIR)/symbols.zip $(BREAKPAD_SYMBOL_CONFIG)
"$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)"
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 8883262025af..4f336cbb0007 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -171,7 +171,7 @@ endif
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(2))) :
PLUGINS += $(1)
$(eval $(call gb_LinkTarget__add_plugin,$(call
gb_Library_get_linktarget,$(2)),$(1)))
-$(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+$(eval $(call gb_LinkTarget__set_plugin_for,$(call
gb_Library_get_linktarget,$(1)),$(2),$(3)))
endef
# forward the call to the gb_LinkTarget implementation
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index fdd74c4887b8..185c2f55b283 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -597,6 +597,8 @@ $(WORKDIR)/Clean/LinkTarget/% :
$(foreach object,$(GENCXXCLROBJECTS),$(call
gb_GenCxxClrObject_get_dwo_target,$(object))) \
$(call gb_LinkTarget_get_target,$(LINKTARGET)) \
$(call gb_LinkTarget_get_dep_target,$(LINKTARGET)) \
+ $(call gb_LinkTarget_get_dep_libraries_target,$(LINKTARGET)) \
+ $(call gb_LinkTarget_get_dep_externals_target,$(LINKTARGET)) \
$(call gb_LinkTarget_get_headers_target,$(LINKTARGET)) \
$(call gb_LinkTarget_get_objects_list,$(LINKTARGET)) \
$(call
gb_LinkTarget_get_pch_timestamp,$(LINKTARGETMAKEFILENAME)) \
@@ -610,7 +612,7 @@ $(WORKDIR)/Clean/LinkTarget/% :
# cat the deps of all objects in one file, then we need only open that one file
# call gb_LinkTarget__command_dep,dep_target,linktargetname
define gb_LinkTarget__command_dep
-$(call gb_Output_announce,LNK:$(2),$(true),DEP,1)
+$(call gb_Output_announce,LNK:$(2).d,$(true),DEP,1)
$(call gb_Trace_StartRange,LNK:$(2),DEP)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
@@ -673,12 +675,23 @@ $(call gb_LinkTarget_get_target,$(1)) : $(call
gb_LinkTarget_get_headers_target,
endef
+define gb_LinkTarget__add_linked_libs
+$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $(2)
+
+endef
+
# it's not possible to use a pattern rule for files in INSTDIR because
# it would inevitably conflict with the pattern rule for Package
# (especially since external libraries are delivered via Package)
# call gb_LinkTarget__command_impl,linktargettarget,linktargetname
define gb_LinkTarget__command_impl
$(if $(gb_FULLDEPS),
+ $(if $(DISABLE_DYNLOADING),
+ $(if $(gb_PARTIAL_BUILD),,
+ $(call
gb_LinkTarget__command_dep_libraries,$(call
gb_LinkTarget_get_dep_libraries_target,$(2)).tmp,$(2))
+ mv $(call
gb_LinkTarget_get_dep_libraries_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_libraries_target,$(2))
+ $(call
gb_LinkTarget__command_dep_externals,$(call
gb_LinkTarget_get_dep_externals_target,$(2)).tmp,$(2))
+ mv $(call
gb_LinkTarget_get_dep_externals_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_externals_target,$(2))))
$(if $(findstring concat-deps,$(2)),,
$(call gb_LinkTarget__command_dep,$(call
gb_LinkTarget_get_dep_target,$(2)).tmp,$(2))
mv $(call gb_LinkTarget_get_dep_target,$(2)).tmp $(call
gb_LinkTarget_get_dep_target,$(2))))
@@ -695,7 +708,37 @@ endef
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_LinkTarget_get_dep_target,%) : $(call
gb_Executable_get_runtime_dependencies,concat-deps)
$(call gb_LinkTarget__command_dep,$@,$*)
+
+ifneq (,$(DISABLE_DYNLOADING))
+ifeq (,$(gb_PARTIAL_BUILD))
+
+define gb_LinkTarget__statics_rules_template
+
+define gb_LinkTarget__command_dep_$(1)
+$$(call gb_Output_announce,LNK:$$(2).d.$(1),$$(true),DEP,1)
+mkdir -p $$(dir $$(1)) && \
+TEMPFILE=$$(call var2file,$$(shell $$(gb_MKTEMP)),200,\
+ $$(call gb_LinkTarget__get_all_$(1),$$(2))) && \
+mv $$$${TEMPFILE} $$(1)
+
+endef
+
+$$(call gb_LinkTarget_get_dep_target,%) : $$(call
gb_LinkTarget_get_dep_$(1)_target,%)
+
+$$(call gb_LinkTarget_get_dep_$(1)_target,%) : | $$(dir $$(call
gb_LinkTarget_get_dep_target,%)).dir
+ $$(call gb_LinkTarget__command_dep_$(1),$$@,$$*)
+
+endef # gb_LinkTarget__statics_rules_template
+
+$(dir $(call gb_LinkTarget_get_dep_target,%))/.dir :
+ $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
+$(eval $(call gb_LinkTarget__statics_rules_template,libraries))
+$(eval $(call gb_LinkTarget__statics_rules_template,externals))
+
endif
+endif
+endif # $(gb_FULLDEPS)
# Ok, this is some dark voodoo: When declaring a linktarget with
# gb_LinkTarget_LinkTarget we set SELF in the headertarget to name of the
@@ -851,7 +894,13 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : GENCOBJECTS :=
$(call gb_LinkTarget_get_dep_target,$(1)) : GENCXXOBJECTS :=
$(call gb_LinkTarget_get_dep_target,$(1)) : GENCXXCLROBJECTS :=
$(call gb_LinkTarget_get_dep_target,$(1)) : YACCOBJECTS :=
+ifneq (,$(DISABLE_DYNLOADING))
+ifeq (,$(gb_PARTIAL_BUILD))
+$(call gb_LinkTarget_get_dep_target,$(1)) : $(call
gb_LinkTarget_get_dep_libraries_target,$(1))
+$(call gb_LinkTarget_get_dep_target,$(1)) : $(call
gb_LinkTarget_get_dep_externals_target,$(1))
+endif
endif
+endif # $(gb_FULLDEPS)
gb_LinkTarget_CXX_SUFFIX_$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)) := cxx
@@ -860,7 +909,7 @@ $(if $(findstring $(INSTDIR),$(1)),$(call
gb_LinkTarget__make_installed_rule,$(1
$(call gb_PrecompiledHeader_generate_timestamp_rule,$(2))
-endef
+endef # gb_LinkTarget_LinkTarget
# call gb_LinkTarget_set_soversion_script,linktarget,soversionscript
define gb_LinkTarget_set_soversion_script
@@ -1022,6 +1071,19 @@ $(call gb_Library_get_target,$(1)) :| $(call
gb_Library_get_headers_target,$(1))
endef
+define gb_LinkTarget__all_x_accessors
+gb_LinkTarget__get_all_$(1)_var = $$(call
gb_LinkTarget__get_workdir_linktargetname,$$(1))<>ALL_$(2)
+gb_LinkTarget__get_all_$(1) = $$($$(call
gb_LinkTarget__get_all_$(1)_var,$$(1)))
+gb_Library__get_all_$(1) = $$($$(call gb_LinkTarget__get_all_$(1)_var,$$(call
gb_Library_get_linktarget,$$(1))))
+gb_Executable__get_all_$(1) = $$($$(call
gb_LinkTarget__get_all_$(1)_var,$$(call gb_Executable_get_linktarget,$$(1))))
+gb_ExternalProject__get_all_$(1) = $$($$(call
gb_LinkTarget__get_all_$(1)_var,$$(call
gb_ExternalProject__get_workdir_linktargetname,$$(1))))
+
+endef
+
+$(eval $(call gb_LinkTarget__all_x_accessors,libraries,LIBRARIES))
+$(eval $(call gb_LinkTarget__all_x_accessors,externals,EXTERNALS))
+$(eval $(call gb_LinkTarget__all_x_accessors,statics,STATICS))
+
# call
gb_LinkTarget__use_libraries,linktarget,requestedlibs,actuallibs,linktargetmakefilename
define gb_LinkTarget__use_libraries
@@ -1040,6 +1102,9 @@ $(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS +=
$(3)
ifeq ($(DISABLE_DYNLOADING),)
$(call gb_LinkTarget_get_target,$(1)) : \
$(foreach lib,$(3),$(call gb_Library_get_exports_target,$(lib)))
+else
+$(if $(gb_DEBUG_STATIC),$(info $(call
gb_LinkTarget__get_all_libraries_var,$(1)) += $(3)))
+$(call gb_LinkTarget__get_all_libraries_var,$(1)) += $(3)
endif
$(call gb_LinkTarget_get_headers_target,$(1)) : \
@@ -1130,6 +1195,9 @@ $(if $(call gb_LinkTarget__is_merged,$(1)),\
ifeq ($(DISABLE_DYNLOADING),)
$(call gb_LinkTarget_get_target,$(1)) : $(foreach lib,$(2),$(call
gb_StaticLibrary_get_target,$(lib)))
+else
+$(if $(gb_DEBUG_STATIC),$(info $(call gb_LinkTarget__get_all_statics_var,$(1))
+= $(2)))
+$(call gb_LinkTarget__get_all_statics_var,$(1)) += $(2)
endif
$(call gb_LinkTarget_get_headers_target,$(1)) : \
$(foreach lib,$(2),$(call gb_StaticLibrary_get_headers_target,$(lib)))
@@ -1741,6 +1809,11 @@ $(if $(filter undefined,$(origin
gb_LinkTarget__use_$(2))),\
$(if $(call gb_LinkTarget__is_merged,$(1)),$(call
gb_LinkTarget__use_$(2),$(call gb_Library_get_linktarget,merged))) \
$(call gb_LinkTarget__use_$(2),$(1)) \
)
+ifneq (,$(DISABLE_DYNLOADING))
+$(if $(gb_DEBUG_STATIC),$(info $(call
gb_LinkTarget__get_all_externals_var,$(1)) += $(2)))
+$(eval $(call gb_LinkTarget__get_all_externals_var,$(1)) += $(2))
+endif
+
endef
# $(call gb_LinkTarget_use_externals,library,externals)
@@ -1813,13 +1886,14 @@ endif
ifeq (,$(filter $(1),$(foreach plugin,$(gb_Library_KNOWNPLUGINS),$(call
gb_Library_get_linktarget,$(plugin)))))
$$(eval $$(call gb_Output_error,Unknown plugin(s) '$(filter $(1),$(foreach
plugin,$(gb_Library_KNOWNPLUGINS),$(call
gb_Library_get_linktarget,$(plugin))))'. Plugins must be registered in
Repository.mk or RepositoryExternal.mk))
endif
-ifeq (,$(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call
gb_Library_get_linktarget,$(lib)))))
+ifneq (,$(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call
gb_Library_get_linktarget,$(lib)))))
$$(eval $$(call gb_Output_error,Plugins can't be in mergelibs))
endif
ifeq ($(call gb_LinkTarget__is_build_tool,$(1)),$(true))
$$(eval $$(call gb_Output_error,Plugin support for build tools not
implemented))
endif
+$(if $(filter $(2),$(gb_Library_KNOWNLOADERS)),,gb_Library_KNOWNLOADERS +=
$(2))
$(call gb_LinkTarget__use_libraries,$(1),$(2),$(2))
endef
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 801d188be737..67b960747676 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -111,16 +111,26 @@ gb_JunitTest_get_classsetname = JunitTest/$(1)
gb_JunitTest_get_target = $(WORKDIR)/JunitTest/$(1)/done
gb_JunitTest_get_userdir = $(WORKDIR)/JunitTest/$(1)/user
gb_PythonTest_get_target = $(WORKDIR)/PythonTest/$(1)/done
+
+# linktarget = class/object<>some_optional_target, like
Library/libswlo.so<>/.../instdir/program/libswlo.so
+# while the target is optional, the workdir functions will always work
correctly
gb_LinkTarget__get_workdir_linktargetname = $(firstword $(subst <>, ,$(1)))
+gb_LinkTarget__get_workdir_linktargetclass = $(firstword $(subst /, ,$(call
gb_LinkTarget__get_workdir_linktargetname,$(1))))
+gb_LinkTarget__get_workdir_linktargetobject = $(lastword $(subst /, ,$(call
gb_LinkTarget__get_workdir_linktargetname,$(1))))
+gb_LinkTarget_get_target = $(lastword $(subst <>, ,$(1)))
+
gb_LinkTarget_get_headers_target = \
$(WORKDIR)/Headers/$(call gb_LinkTarget__get_workdir_linktargetname,$(1))
gb_LinkTarget_get_objects_list = \
$(WORKDIR)/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)).objectlist
gb_LinkTarget_get_dep_target = \
$(WORKDIR)/Dep/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)).d
+gb_LinkTarget_get_dep_libraries_target = \
+ $(WORKDIR)/Dep/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)).d.libraries
+gb_LinkTarget_get_dep_externals_target = \
+ $(WORKDIR)/Dep/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1)).d.externals
gb_LinkTarget_get_clean_target = \
$(WORKDIR)/Clean/LinkTarget/$(call
gb_LinkTarget__get_workdir_linktargetname,$(1))
-gb_LinkTarget_get_target = $(lastword $(subst <>, ,$(1)))
gb_LinkTarget_get_pch_timestamp = $(WORKDIR)/PrecompiledHeader/$(call
gb_PrecompiledHeader__get_debugdir,$(1))/Timestamps/$(1)
gb_LinkTarget_get_pch_reuse_timestamp = $(WORKDIR)/PrecompiledHeader/$(call
gb_PrecompiledHeader__get_debugdir,$(1))/Timestamps/$(1)_reuse
gb_Module_get_nonl10n_target = $(WORKDIR)/Module/nonl10n/$(1)
@@ -387,6 +397,10 @@ define gb_Executable_get_linktarget
$(call gb_Executable__get_workdir_linktargetname,$(1))<>$(call
gb_Executable_get_target,$(1))
endef
+define gb_ExternalProject__get_workdir_linktargetname
+ExternalProject/$(1)
+endef
+
define gb_Library__get_workdir_linktargetname
Library/$(call gb_Library_get_filename,$(1))
endef
@@ -397,6 +411,9 @@ endef
define gb_Library_get_linktarget
$(call gb_Library__get_workdir_linktargetname,$(1))<>$(call
gb_Library_get_target,$(1))
endef
+define gb_Library_get_dep_libraries_target
+$(call gb_LinkTarget_get_dep_libraries_target,$(call
gb_Library_get_linktarget,$(1)))
+endef
define gb_StaticLibrary__get_workdir_linktargetname
StaticLibrary/$(call gb_StaticLibrary_get_filename,$(1))
diff --git a/solenv/gbuild/static.mk b/solenv/gbuild/static.mk
new file mode 100644
index 000000000000..f71a042f7221
--- /dev/null
+++ b/solenv/gbuild/static.mk
@@ -0,0 +1,219 @@
+# -*- 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/.
+#
+
+# "spezialgelagerter Sonderfall" :-(
+#
+# *******************************************
+# Use gb_DEBUG_STATIC=t to dump variuos debug info for the static build
preparation!
+# *******************************************
+#
+# "Generic" comment form the author:
+# My thought was: the dependency info is already there. Can't be too hard to
use it for
+# correct static linkage... well it took more then two weeks to hopefully
identify all
+# problems / edge cases. Now I can appreciate the usage bin/lo-all-static-libs
even more.
+#
+# This code moved a few times to the various gbuild / make phases: Makefile /
module
+# setup (in use_(libraries|externals)), post parsing (like now), make
"dependency" tree
+# processing. It currently looks like this is the only working option.
+#
+# For static linking, we must collect all depending libraries, externals and
statics to
+# be available at link time. And Libraries and externals can use each other.
This could
+# be done "in-line", while make processes the dependency tree and would have
the correct
+# order, so no separate tree-walking would be needed.
+# It can't be done while reading / processing the modules, as this happens in
no order, so
+# depending modules will be missing.
+#
+# Then there is the (gbuild new) concept of plugin libraries. These depend on
some loader
+# libraries, like vcl and vclplug_* or gie. For a shared library build, these
plugins are
+# just dlopen'ed, but for a static build, any linked binary must also link the
plugins, which
+# turns plugins + loaders into a dependency cycle. The implemented solution is
to just add
+# plugins to executables, if these depend on a loader library. This results in
the additional
+# rule: nothing non-plugin is allowed to depend on a plugins (see
gb_Library_set_plugin_for).
+#
+# And we can't add these dependencies while make is already processing the
Executables,
+# because these contain additional eval'ed targets, which we can't create in
make recipes.
+# This is especially true for externals (see gb_LinkTarget__use_* in
RepositoryExternal.mk).
+# We also can't add all plugins to all executables, as we have multiple helper
+# binaries, which are needed early and don't depend on plugins.
+#
+# So the only option left seems to be to walk the dependency tree ourself and
expand all
+# the libraries and externals and then add the plugins to the executables.
Statics are
+# handled after that, since these won't need extra dependencies not already
known.
+# It's a bit fragile in theory, as you can add "gbuild-undetectable"
dependencies to any
+# target in the modules, which would need some manual adjustment, but
currently that
+# doesn't seem to happen in any breaking way and it works to link multiple
Executable
+# with large and small expanded dependency lists.
+#
+# For WASM, this also serialize the linking, because the wasm-opt process is
multi-threaded,
+# running on all available cores, using GB of memory. Extra parallelism is
counterproductive.
+#
+# Best way to "debug" is to replace "eval" with "info" to see the expanded
template, which
+# doesn't look that horrible (both do the same expansion internally).
+# There is already a lot of $(info ...) protected by the already mentioned
$(gb_DEBUG_STATIC).
+#
+# P.S. remeber to keep the $(info ...) and $(eval ...) blocks in sync (maybe
add a function?)
+#
+ifeq ($(true),$(gb_FULLDEPS))
+ifeq (,$(gb_PARTIAL_BUILD))
+
+define gb_Executable__add_x_template
+
+define gb_Executable__add_$(2)
+$$(foreach item,$$(2),
+ $$(foreach dep,$$(call gb_$(1)__get_all_$(2),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call
gb_Executable__get_all_$(2),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(2),$$(call
gb_Executable__get_workdir_linktargetname,$$(1)),$$(dep)))))
+ $$(foreach dep,$$(call gb_$(1)__get_all_$(3),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call
gb_Executable__get_all_$(3),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(3),$$(call
gb_Executable__get_workdir_linktargetname,$$(1)),$$(dep))))))
+
+endef
+
+endef # gb_Executable__add_x_template
+
+ifneq (,$(gb_DEBUG_STATIC))
+$(info $(call
gb_Executable__add_x_template,ExternalProject,externals,libraries))
+$(info $(call gb_Executable__add_x_template,Library,libraries,externals))
+endif
+$(eval $(call
gb_Executable__add_x_template,ExternalProject,externals,libraries))
+$(eval $(call gb_Executable__add_x_template,Library,libraries,externals))
+
+define gb_LinkTarget__add_x_template
+
+define gb_LinkTarget__add_$(1)
+$$(if $(gb_DEBUG_STATIC),$$(info $$(call
gb_LinkTarget__get_all_$(1)_var,$$(call
gb_LinkTarget__get_workdir_linktargetname,$$(1))) += $$(2)))
+$$(call gb_LinkTarget__get_all_$(1)_var,$$(call
gb_LinkTarget__get_workdir_linktargetname,$$(1))) += $$(2)
+
+endef
+
+endef # gb_LinkTarget__add_x_template
+
+ifneq (,$(gb_DEBUG_STATIC))
+$(info $(call gb_LinkTarget__add_x_template,libraries))
+$(info $(call gb_LinkTarget__add_x_template,externals))
+$(info $(call gb_LinkTarget__add_x_template,statics))
+endif
+$(eval $(call gb_LinkTarget__add_x_template,libraries))
+$(eval $(call gb_LinkTarget__add_x_template,externals))
+$(eval $(call gb_LinkTarget__add_x_template,statics))
+
+# contains the list of all touched workdir_linktargetname(s)
+gb_LinkTarget__ALL_TOUCHED =
+
+define gb_LinkTarget__add_touch
+$(eval $(call gb_LinkTarget__add_libraries,$(1),GBUILD_TOUCHED))
+$(eval $(call gb_LinkTarget__add_externals,$(1),GBUILD_TOUCHED))
+gb_LinkTarget__ALL_TOUCHED += $(1)
+
+endef
+
+define gb_LinkTarget__remove_touch
+$(call gb_LinkTarget__get_all_libraries_var,$(1)) := $(filter-out
GBUILD_TOUCHED,$(call gb_LinkTarget__get_all_libraries,$(1)))
+$(call gb_LinkTarget__get_all_externals_var,$(1)) := $(filter-out
GBUILD_TOUCHED,$(call gb_LinkTarget__get_all_externals,$(1)))
+
+endef
+
+# The following code is a template, because libraries and externals can use
each others.
+# It recursively walks the dependency tree for all libraries and externals,
storing
+# the information in variables per workdir_linktargetname, filtered for
uniqueness. In the end
+# all of them have two variables, which you can get with
gb_LinkTarget__get_all_(libraries|externals).
+# Expanded lists have a GBUILD_TOUCHED entry to prevent processing them
multiple times
+#
+# eval call
gb_LinkTarget__fill_all_x_template,type,typeclassname,othertype,other
typeclassname,override,override typeclassname
+define gb_LinkTarget__fill_all_x_template
+
+define gb_LinkTarget__fill_all_$(if $(5),$(5),$(1))
+$$(if $$(filter GBUILD_TOUCHED,$$(call gb_$(2)__get_all_$(1),$$(1))),,
+ $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if
$(5),$(5),$(1)) $(1) for $$(1) in: $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(1),$$(1))))
+ $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if
$(5),$(5),$(1)) $(3) for $$(1) in: $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(3),$$(1))))
+ $$(foreach item,$$(call gb_$(if $(6),$(6),$(2))__get_all_$(1),$$(1)),
+ $$(call gb_LinkTarget__fill_all_$(1),$$(item))
+ $$(foreach dep,$$(call gb_$(2)__get_all_$(1),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(1),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(1),$$(call
gb_$(if $(6),$(6),$(2))__get_workdir_linktargetname,$$(1)),$$(dep)))))
+ $$(foreach dep,$$(call gb_$(2)__get_all_$(3),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(3),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(3),$$(call
gb_$(if $(6),$(6),$(2))__get_workdir_linktargetname,$$(1)),$$(dep))))))
+ $$(foreach item,$$(call gb_$(if $(6),$(6),$(2))__get_all_$(3),$$(1)),
+ $$(call gb_LinkTarget__fill_all_$(3),$$(item))
+ $$(foreach dep,$$(call gb_$(4)__get_all_$(1),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(1),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(1),$$(call
gb_$(if $(6),$(6),$(2))__get_workdir_linktargetname,$$(1)),$$(dep)))))
+ $$(foreach dep,$$(call gb_$(4)__get_all_$(3),$$(item)),
+ $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(3),$$(1))),,
+ $$(eval $$(call gb_LinkTarget__add_$(3),$$(call
gb_$(if $(6),$(6),$(2))__get_workdir_linktargetname,$$(1)),$$(dep))))))
+ $$(eval $$(call gb_LinkTarget__add_touch,$$(call gb_$(if
$(6),$(6),$(2))__get_workdir_linktargetname,$$(1))))
+ $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if
$(5),$(5),$(1)) $(1) for $$(1) out: $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(1),$$(1))))
+ $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if
$(5),$(5),$(1)) $(3) for $$(1) out: $$(call gb_$(if
$(6),$(6),$(2))__get_all_$(3),$$(1)))))
+
+endef
+
+endef # gb_LinkTarget__fill_all_x_template
+
+ifneq (,$(gb_DEBUG_STATIC))
+$(info $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject))
+$(info $(call
gb_LinkTarget__fill_all_x_template,externals,ExternalProject,libraries,Library))
+$(info $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject,executable,Executable))
+endif
+$(eval $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject))
+$(eval $(call
gb_LinkTarget__fill_all_x_template,externals,ExternalProject,libraries,Library))
+$(eval $(call
gb_LinkTarget__fill_all_x_template,libraries,Library,externals,ExternalProject,executable,Executable))
+
+gb_Executable__LAST_KNOWN =
+gb_Executable__has_any_dependencies = $(if $(filter-out GBUILD_TOUCHED,$(call
gb_Executable__get_all_libraries,$(1)) $(call
gb_Executable__get_all_externals,$(1))),$(1))
+
+# The comment exists To help decipering / verifying the following block. Most
later items depends on previous one(s).
+#
+# * Expand all libraries. It's not strictly needed, as we only need the info
for the executables,
+# but this way we can implement updating single gbuild-module dependencies
as needed.
+# * For all executables:
+# * Find any loader libraries and add the needed plugin dependences
+# * Add all statics to the executables
+# * Add icudata as needed (it should be a plugin somehow declared in
RepositoryExternal.mk, but that didn't work)
+# * Serialize the linking of executables for EMSCRIPTEN, because wasm-opt is
multi-threaded using all cores.
... etc. - the rest is truncated
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits