config_host.mk.in                           |    1 +
 configure.ac                                |   16 ++++++++++++++++
 external/openssl/ExternalProject_openssl.mk |    3 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit c3ed6e5a2cb7823f131d733c2014c9ea41126559
Author:     Christian Lohmaier <[email protected]>
AuthorDate: Tue Dec 3 16:38:49 2024 +0100
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Tue Dec 3 18:07:38 2024 +0100

    windows: use jom instead of nmake to build openssl if available
    
    jom (https://wiki.qt.io/Jom) is a parallel version of nmake that
    especially helps with building openssl since everything is compiled
    individually/the compiler cannot use parallelism either.
    Also in a LibreOffice build there's not much else that can be done in
    parallel/other stuff requires openssl to be built to continue.
    
    Change-Id: Ib16b0f947991a1d3255aeae7dc5d9bdee0b157a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177743
    Reviewed-by: Christian Lohmaier <[email protected]>
    Tested-by: Jenkins

diff --git a/config_host.mk.in b/config_host.mk.in
index 4b7bf923a4b9..7ce742cf3987 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -383,6 +383,7 @@ export JDK_FOR_BUILD=@JDK_FOR_BUILD@
 export 
JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD=@JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD@
 export JFREEREPORT_JAR=@JFREEREPORT_JAR@
 export JITC_PROCESSOR_TYPE=@JITC_PROCESSOR_TYPE@
+JOM=@JOM@
 export JQ=@JQ@
 export JVM_ONE_PATH_CHECK=@JVM_ONE_PATH_CHECK@
 export KF5_CFLAGS=$(gb_SPACE)@KF5_CFLAGS@
diff --git a/configure.ac b/configure.ac
index f3ee46436bdf..3af3e6373b35 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15646,6 +15646,22 @@ else
 fi
 AC_SUBST(KEEP_AWAKE_CMD)
 
+dnl =========================================
+dnl Check for Jom (parallel nmake)
+dnl =========================================
+if test "$_os" = "WINNT"; then
+    AC_MSG_CHECKING([for jom (parallel nmake)])
+    AC_PATH_PROG([JOM], [jom.exe])
+    if test -z "$JOM"; then
+        AC_MSG_NOTICE([jom can help accelerate your build, but is completely 
optional. Get it from https://wiki.qt.io/Jom])
+        AC_MSG_NOTICE([and put it in PATH or add 
JOM=/unix/style/path/to/jom.exe to your autogen.input to use it])
+    else
+        PathFormat "$JOM"
+        JOM="$formatted_path"
+    fi
+    AC_SUBST(JOM)
+fi
+
 dnl ===================================================================
 dnl Setting up the environment.
 dnl ===================================================================
diff --git a/external/openssl/ExternalProject_openssl.mk 
b/external/openssl/ExternalProject_openssl.mk
index 910c957484c4..a31945fab0db 100644
--- a/external/openssl/ExternalProject_openssl.mk
+++ b/external/openssl/ExternalProject_openssl.mk
@@ -64,11 +64,12 @@ $(eval $(call gb_ExternalProject_use_nmake,openssl,build))
 
 $(call gb_ExternalProject_get_state_target,openssl,build): export PERL:=$(if 
$(MSYSTEM),$(STRAWBERRY_PERL),$(shell cygpath -m $(PERL)))
 
+# PARALLELISM_OPTION might be -j 16 -l 24, for jom ignore the load limit/only 
use the job limit
 $(call gb_ExternalProject_get_state_target,openssl,build):
        $(call gb_Trace_StartRange,openssl,EXTERNAL)
        $(call gb_ExternalProject_run,build,\
                CONFIGURE_INSIST=1 $(PERL) Configure $(OPENSSL_PLATFORM) 
no-tests no-multilib \
-               && nmake -f makefile \
+               && $(if $(JOM),$(JOM) $(wordlist 
1,2,$(PARALLELISM_OPTION)),nmake) -f makefile \
                        $(if $(call 
gb_Module__symbols_enabled,openssl),DEBUG_FLAGS_VALUE="$(gb_DEBUGINFO_FLAGS)") \
        )
        $(call gb_Trace_EndRange,openssl,EXTERNAL)

Reply via email to