Repository.mk               |    8 ++++----
 configure.ac                |   25 ++++++++++++++-----------
 registry/Module_registry.mk |   12 +++++-------
 solenv/gbuild/Conditions.mk |    4 ++++
 4 files changed, 27 insertions(+), 22 deletions(-)

New commits:
commit af4c5d3ea1ec5d140b9477feea2cb9487977a6c4
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Tue Dec 21 02:44:53 2021 +0100
Commit:     Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Dec 24 02:15:03 2021 +0100

    Enforce cross-compilation for static builds
    
    ... AKA DISABLE_DYNLOADING, except for oss-fuzz, which will be
    converted to a cross build in a follow-up patch.
    
    This includes skipping the static registry and help tooling and
    aborts configure when the ODK is selected to be build.
    
    Change-Id: Ifae32e91acf5e9ffa234d8f915ee459b197091fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127287
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <[email protected]>

diff --git a/Repository.mk b/Repository.mk
index 1d0f3111a7bd..dddb180f589c 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -230,10 +230,10 @@ endif
 
 $(eval $(call gb_Helper_register_executables_for_install,UREBIN,ure,\
        $(if $(and $(ENABLE_JAVA),$(filter-out HAIKU MACOSX WNT,$(OS)),$(filter 
DESKTOP,$(BUILD_TYPE))),javaldx) \
-       $(if $(ENABLE_MACOSX_SANDBOX),, \
-               regmerge \
-               regview \
-       ) \
+    $(call gb_CondBuildRegistryTools, \
+        regmerge \
+        regview \
+    ) \
        $(if $(filter DESKTOP,$(BUILD_TYPE)),uno) \
 ))
 
diff --git a/configure.ac b/configure.ac
index a33f91557e5e..2d50a9907469 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3799,9 +3799,9 @@ if test -n "$WIN_MULTI_ARCH" -a -n "$WIN_OTHER_ARCH"; then
 fi
 
 
-if test "$_os" = "iOS" -o "$build_cpu" != "$host_cpu"; then
+if test "$build_cpu" != "$host_cpu" -o \( "$DISABLE_DYNLOADING" = TRUE -a 
"$enable_fuzzers" != yes \); then
     # To allow building Windows multi-arch releases without cross-tooling
-    if test -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH"; then
+    if test "$DISABLE_DYNLOADING" = TRUE -o \( -z "$WIN_MULTI_ARCH" -a -z 
"$WIN_OTHER_ARCH" \); then
         cross_compiling="yes"
     fi
 fi
@@ -5372,7 +5372,7 @@ else
 fi
 
 AC_MSG_CHECKING([if we need to build the help index tooling])
-if test "$with_help" = yes -o "$enable_extension_integration" != no; then
+if test \( "$with_help" = yes -o "$enable_extension_integration" != no \) -a 
-z "$DISABLE_DYNLOADING"; then
     BUILD_TYPE="$BUILD_TYPE HELPTOOLS"
     test_clucene=yes
     AC_MSG_RESULT([yes])
@@ -9005,6 +9005,17 @@ AC_SUBST(ENABLE_LWP)
 dnl ===================================================================
 dnl Check for building ODK
 dnl ===================================================================
+AC_MSG_CHECKING([whether to build the ODK])
+if test "$enable_odk" = yes; then
+    if test "$DISABLE_DYNLOADING" = TRUE; then
+        AC_MSG_ERROR([can't build ODK for --disable-dynamic-loading builds])
+    fi
+    AC_MSG_RESULT([yes])
+    BUILD_TYPE="$BUILD_TYPE ODK"
+else
+    AC_MSG_RESULT([no])
+fi
+
 if test "$enable_odk" != yes; then
     unset DOXYGEN
 else
@@ -9039,14 +9050,6 @@ else
 fi
 AC_SUBST([DOXYGEN])
 
-AC_MSG_CHECKING([whether to build the ODK])
-if test "$enable_odk" = yes; then
-    AC_MSG_RESULT([yes])
-    BUILD_TYPE="$BUILD_TYPE ODK"
-else
-    AC_MSG_RESULT([no])
-fi
-
 dnl ==================================================================
 dnl libfuzzer
 dnl ==================================================================
diff --git a/registry/Module_registry.mk b/registry/Module_registry.mk
index 58de136de877..e5969171e005 100644
--- a/registry/Module_registry.mk
+++ b/registry/Module_registry.mk
@@ -11,13 +11,11 @@ $(eval $(call gb_Module_Module,registry))
 
 $(eval $(call gb_Module_add_targets,registry,\
        Library_reg \
-       $(if $(filter-out $(OS),iOS), \
-               $(if $(ENABLE_MACOSX_SANDBOX),, \
-                       Executable_regmerge \
-                       Executable_regview \
-               ) \
-               StaticLibrary_registry_helper \
-       ) \
+    $(call gb_CondBuildRegistryTools, \
+        Executable_regmerge \
+        Executable_regview \
+        StaticLibrary_registry_helper \
+    ) \
 ))
 
 # vim:set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Conditions.mk b/solenv/gbuild/Conditions.mk
index 88e705524d65..fb92e14bcef6 100644
--- a/solenv/gbuild/Conditions.mk
+++ b/solenv/gbuild/Conditions.mk
@@ -11,6 +11,10 @@ define gb_CondBuildLockfile
 $(if $(and $(filter-out ANDROID MACOSX iOS WNT,$(OS))),$(1),$(2))
 endef
 
+define gb_CondBuildRegistryTools
+$(if $(or $(DISABLE_DYNLOADING),$(ENABLE_MACOSX_SANDBOX)),$(2),$(1))
+endef
+
 define gb_CondSalTextEncodingLibrary
 $(if $(filter ANDROID,$(OS)),,$(if $(DISABLE_DYNLOADING),$(2),$(1)))
 endef

Reply via email to