config_host.mk.in                |    1 +
 config_host/config_features.h.in |    7 ++++++-
 configure.ac                     |   13 ++++++++++++-
 desktop/Executable_oosplash.mk   |    2 +-
 desktop/Module_desktop.mk        |   21 ++++++++-------------
 desktop/unx/source/pagein.h      |   10 +++++++++-
 6 files changed, 37 insertions(+), 17 deletions(-)

New commits:
commit 97e2dc2ed0c4602c7823bdd6c6d5376e8da60c62
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Thu Jan 6 08:19:41 2022 +0100
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Fri Jan 7 19:07:06 2022 +0100

    Disable oosplash pagein feature for static builds
    
    I'm not sure how useful this is today. Still hard-disabled on Mac
    and Win. Obviously unneeded for static builds.
    
    Change-Id: I3a95dede3c596ccdc0d15eba9edc072ad35f33fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128089
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>
    Tested-by: Jenkins

diff --git a/config_host.mk.in b/config_host.mk.in
index 92118880debc..27e2e2359241 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -185,6 +185,7 @@ export ENABLE_OPENGL_CANVAS=@ENABLE_OPENGL_CANVAS@
 export ENABLE_OPENSSL=@ENABLE_OPENSSL@
 export ENABLE_OPTIMIZED=@ENABLE_OPTIMIZED@
 export ENABLE_OPTIMIZED_DEBUG=@ENABLE_OPTIMIZED_DEBUG@
+export ENABLE_PAGEIN=@ENABLE_PAGEIN@
 export ENABLE_PCH=@ENABLE_PCH@
 export ENABLE_PDFIMPORT=@ENABLE_PDFIMPORT@
 export ENABLE_PDFIUM=@ENABLE_PDFIUM@
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index 0f610a5646bc..db4f7e1b28ae 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -153,7 +153,12 @@
  *
  * Can be turned off with --without-xmlhelp
  */
-
 #define HAVE_FEATURE_XMLHELP 0
 
+/*
+ * Whether oosplash calls pagein binaries to speed up library loading.
+ * Probably not useful nowadays with SSD based systems.
+ */
+#define HAVE_FEATURE_PAGEIN 0
+
 #endif
diff --git a/configure.ac b/configure.ac
index a7a0b220e0e3..88e75bf7ffa9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -912,6 +912,7 @@ cygwin*|wsl*)
     using_x11=no
     test_openldap=no
     test_eot=no
+    enable_pagein=no
     build_skia=yes
     _os=WINNT
 
@@ -930,6 +931,7 @@ darwin*|macos*) # macOS
     using_freetype_fontconfig=no
     using_x11=no
     build_skia=yes
+    enable_pagein=no
     test_eot=no
     if test -n "$LODE_HOME" ; then
         mac_sanitize_path
@@ -1977,7 +1979,6 @@ AC_ARG_ENABLE(customtarget-components,
     AS_HELP_STRING([--enable-customtarget-components],
         [This is WIP and probably just works together with 
--enable-wasm-strip.]))
 
-
 dnl ===================================================================
 dnl Optional Packages (--with/without-)
 dnl ===================================================================
@@ -5849,6 +5850,16 @@ if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; 
then
     fi
 fi
 
+AC_MSG_CHECKING([whether to build the pagein binaries for oosplash])
+if test "${enable_pagein}" != no -a -z "$DISABLE_DYNLOADING"; then
+    AC_MSG_RESULT([yes])
+    ENABLE_PAGEIN=TRUE
+    AC_DEFINE(HAVE_FEATURE_PAGEIN)
+else
+    AC_MSG_RESULT([no])
+fi
+AC_SUBST(ENABLE_PAGEIN)
+
 dnl ===================================================================
 dnl check for cups support
 dnl ===================================================================
diff --git a/desktop/Executable_oosplash.mk b/desktop/Executable_oosplash.mk
index a14acd626b74..5c7e4ac95bb4 100644
--- a/desktop/Executable_oosplash.mk
+++ b/desktop/Executable_oosplash.mk
@@ -18,7 +18,7 @@ $(eval $(call gb_Executable_use_libraries,oosplash,\
 $(eval $(call gb_Executable_add_cobjects,oosplash,\
     desktop/unx/source/args \
     desktop/unx/source/file_image_unx \
-    desktop/unx/source/pagein \
+    $(if $(ENABLE_PAGEIN),desktop/unx/source/pagein) \
     desktop/unx/source/splashx \
     desktop/unx/source/start \
 ))
diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk
index ce8f254d7af1..ef74bd87aab4 100644
--- a/desktop/Module_desktop.mk
+++ b/desktop/Module_desktop.mk
@@ -39,17 +39,14 @@ $(eval $(call gb_Module_add_targets,desktop,\
     Library_migrationoo3 \
     Library_unopkgapp \
     Package_scripts \
-))
-
-ifneq ($(OS),MACOSX)
-ifneq ($(OS),WNT)
-$(eval $(call gb_Module_add_targets,desktop,\
-    Pagein_calc \
-    Pagein_common \
-    Pagein_draw \
-    Pagein_impress \
-    Pagein_writer \
-    CustomTarget_soffice \
+    $(if $(ENABLE_PAGEIN), \
+        Pagein_calc \
+        Pagein_common \
+        Pagein_draw \
+        Pagein_impress \
+        Pagein_writer \
+    ) \
+    $(if $(filter-out MACOSX WNT,$(OS)),CustomTarget_soffice) \
 ))
 
 ifeq ($(USING_X11),TRUE)
@@ -64,8 +61,6 @@ $(eval $(call gb_Module_add_targets,desktop,\
 ))
 endif
 endif
-endif
-endif
 
 ifeq ($(OS),WNT)
 
diff --git a/desktop/unx/source/pagein.h b/desktop/unx/source/pagein.h
index f8820c76c961..7fb8b6a918a6 100644
--- a/desktop/unx/source/pagein.h
+++ b/desktop/unx/source/pagein.h
@@ -19,8 +19,16 @@
 
 #pragma once
 
-#include <sal/config.h>
+#include <config_features.h>
 
+#if HAVE_FEATURE_PAGEIN
 void pagein_execute(char const* path, char const* file);
+#else
+inline void pagein_execute(char const* path, char const* file)
+{
+    (void)path;
+    (void)file;
+}
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to