[Libreoffice-commits] .: 2 commits - configure.in Module_tail_build.mk Repository.mk scp2/source set_soenv.in solenv/gbuild

Michael Meeks michael at kemper.freedesktop.org
Wed Aug 24 06:26:02 PDT 2011


 Module_tail_build.mk                  |    6 ++++++
 Repository.mk                         |    1 +
 configure.in                          |   18 ++++++++++++++++++
 scp2/source/ooo/file_library_ooo.scp  |    4 ++++
 scp2/source/ooo/makefile.mk           |    4 ++++
 scp2/source/ooo/module_hidden_ooo.scp |    1 +
 set_soenv.in                          |    1 +
 solenv/gbuild/Library.mk              |    4 +++-
 solenv/gbuild/LinkTarget.mk           |   23 ++++++++++++++++++++---
 9 files changed, 58 insertions(+), 4 deletions(-)

New commits:
commit 87610049f8a1690598b84b0bf984cfa487ce1074
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Wed Aug 24 14:23:13 2011 +0100

    misc cleanups of mergelibs functionality

diff --git a/Module_tail_build.mk b/Module_tail_build.mk
index 8408cd8..e5c010b 100644
--- a/Module_tail_build.mk
+++ b/Module_tail_build.mk
@@ -51,7 +51,7 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\
     writerperfect \
 ))
 
-ifeq ($(MERGELIBS),YES)
+ifeq ($(MERGELIBS),TRUE)
 $(eval $(call gb_Module_add_targets,tail_end,\
 	Library_merged \
 ))
diff --git a/configure.in b/configure.in
index ad5f63f..77e7bc4 100755
--- a/configure.in
+++ b/configure.in
@@ -9072,8 +9072,9 @@ AC_SUBST(BUILD_NCPUS)
 # Creating bigger shared library to link against
 # ===================================================================
 AC_MSG_CHECKING([whether to create a big library for better performance])
-if test "$enable_mergelibs" != "no"; then
-    MERGELIBS="YES"
+MERGELIBS=
+if test "$enable_mergelibs" = "yes"; then
+    MERGELIBS="TRUE"
     AC_MSG_RESULT([yes])
 else
     AC_MSG_RESULT([no])
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 975ec15..b210026 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -1292,7 +1292,9 @@ STD_LIB_FILE( gid_File_Lib_Swui, swui)
 
 STD_LIB_FILE( gid_File_Lib_Msword, msword )
 
+#ifdef MERGELIBS
 STD_LIB_FILE( gid_File_Lib_Merged, merged )
+#endif
 
 #if ! defined UNX
 File gid_File_Lib_Sysdtrans
diff --git a/scp2/source/ooo/makefile.mk b/scp2/source/ooo/makefile.mk
index 0e988b2..7d6aba5 100644
--- a/scp2/source/ooo/makefile.mk
+++ b/scp2/source/ooo/makefile.mk
@@ -72,6 +72,10 @@ SCPDEFS+=-DENABLE_GTK3
 .ENDIF
 .ENDIF			# "$(GUI)"=="UNX"
 
+.IF "$(MERGELIBS)" == "TRUE"
+SCPDEFS+=-DMERGELIBS
+.ENDIF
+
 .IF "$(ENABLE_KDE)" != ""
 SCPDEFS+=-DENABLE_KDE
 .ENDIF
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 325a37d..69683c5 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -44,8 +44,10 @@ CXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
 OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
 endif
 
-# if enabled we can create one library instead of more smaller
-ifeq ($(MERGELIBS),YES)
+# if enabled we link all of these libraries into one larger, merged library
+# for which we can do a lot more optimisation, and which is faster to read
+# from disk.
+ifeq ($(MERGELIBS),TRUE)
 # list of libraries which are always loaded, thus we can merge them into one
 # they have to be from tail_build, so we could link against merged library
 gb_CORE_LIBS := \
@@ -733,7 +735,7 @@ $$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Librar
 $$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk))
 endif
 
-ifeq ($(MERGELIBS),YES)
+ifeq ($(MERGELIBS),TRUE)
 gb_LINKED_LIBS := $(if $(filter $(gb_CORE_LIBS),$(2)),merged $(filter-out $(gb_CORE_LIBS),$(2)),$(2))
 else
 gb_LINKED_LIBS := $(2)
commit 75fac9839793f73c9833489f1d70bf4136881cbf
Author: Matúš Kukan <matus.kukan at gmail.com>
Date:   Wed Aug 24 12:17:31 2011 +0100

    Add support for creating merged library.
    
    This commit allows to set which libraries to merge
    and creates merged library in tail_build if enabled.
    This should save time when loading libraries in application
    and also makes more sense for link-time optimization.
    
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/Module_tail_build.mk b/Module_tail_build.mk
index 2cf5cdb..8408cd8 100644
--- a/Module_tail_build.mk
+++ b/Module_tail_build.mk
@@ -51,4 +51,10 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\
     writerperfect \
 ))
 
+ifeq ($(MERGELIBS),YES)
+$(eval $(call gb_Module_add_targets,tail_end,\
+	Library_merged \
+))
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/Repository.mk b/Repository.mk
index 38a777e..eaa4ed1 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -89,6 +89,7 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \
     i18nregexp \
     lng \
     lwpft \
+    merged \
     msfilter \
     msword \
 	msworks \
diff --git a/configure.in b/configure.in
index 4775833..ad5f63f 100755
--- a/configure.in
+++ b/configure.in
@@ -116,6 +116,11 @@ AC_ARG_ENABLE(ext-wiki-publisher,
 
 dnl ---------- *** ----------
 
+AC_ARG_ENABLE(mergelibs,
+    AS_HELP_STRING([--enable-mergelibs],
+        [Enables linking of big merged library used for better performance.]),
+,)
+
 AC_ARG_ENABLE(graphite,
     AS_HELP_STRING([--enable-graphite],
         [Enables the compilation of Graphite smart font rendering.]),
@@ -9063,6 +9068,18 @@ fi
 AC_MSG_RESULT([$BUILD_NCPUS])
 AC_SUBST(BUILD_NCPUS)
 
+# ===================================================================
+# Creating bigger shared library to link against
+# ===================================================================
+AC_MSG_CHECKING([whether to create a big library for better performance])
+if test "$enable_mergelibs" != "no"; then
+    MERGELIBS="YES"
+    AC_MSG_RESULT([yes])
+else
+    AC_MSG_RESULT([no])
+fi
+AC_SUBST(MERGELIBS)
+
 dnl ===================================================================
 dnl Number of parallel jobs to be executed by dmake
 dnl ===================================================================
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index f937671..975ec15 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -1292,6 +1292,8 @@ STD_LIB_FILE( gid_File_Lib_Swui, swui)
 
 STD_LIB_FILE( gid_File_Lib_Msword, msword )
 
+STD_LIB_FILE( gid_File_Lib_Merged, merged )
+
 #if ! defined UNX
 File gid_File_Lib_Sysdtrans
     TXT_FILE_BODY;
diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp
index 1f79ee3..b718738 100644
--- a/scp2/source/ooo/module_hidden_ooo.scp
+++ b/scp2/source/ooo/module_hidden_ooo.scp
@@ -253,6 +253,7 @@ Module gid_Module_Root_Files_4
 	gid_File_Lib_AVMediaWin,
     gid_File_Lib_AVMediaGStreamer,
 	gid_File_Lib_BaseGfx,
+    gid_File_Lib_Merged,
 	gid_File_Lib_Sysdtrans,
 	gid_File_Lib_Sw,
 	gid_File_Lib_TextConversionDlgs,
diff --git a/set_soenv.in b/set_soenv.in
index 53ef4ce..a54c351 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -2062,6 +2062,7 @@ ToFile( "SYSTEM_LIBTEXTCAT_DATA","@SYSTEM_LIBTEXTCAT_DATA@","e" );
 ToFile( "XAU_LIBS",          "@XAU_LIBS@",         "e" );
 ToFile( "GXX_INCLUDE_PATH",  PathFormat("@GXX_INCLUDE_PATH@"), "e" );
 ToFile( "COMMON_BUILD_TOOLS",$COMMON_BUILD_TOOLS,  "e" );
+ToFile( "MERGELIBS",         "@MERGELIBS@",           "e" );
 
 if ($platform !~ m/cygwin/) {
    if ( !defined $ENV{"TMPDIR"} || $ENV{"TMPDIR"} eq "" ) {
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 798af8b..db6d961 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -80,7 +80,8 @@ $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_L
 endef
 
 define gb_Library_set_componentfile
-$(call gb_ComponentTarget_ComponentTarget,$(or $(strip $(3)),$(strip $(2))),$(call gb_Library__get_componentprefix,$(1)),$(call gb_Library_get_runtime_filename,$(1)),$(2))
+$(call gb_ComponentTarget_ComponentTarget,$(or $(strip $(3)),$(strip $(2))),$(call gb_Library__get_componentprefix,$(1)),\
+	$(call gb_Library_get_runtime_filename,$(if $(MERGELIBS),$(if $(filter $(gb_MERGED_LIBS),$(1)),merged,$(1)),$(1))),$(2))
 $(call gb_Library_get_target,$(1)) : $(call gb_ComponentTarget_get_outdir_target,$(2)) $(call gb_ComponentTarget_get_outdir_inbuild_target,$(2))
 $(call gb_Library_get_clean_target,$(1)) : $(call gb_ComponentTarget_get_clean_target,$(or $(strip $(3)),$(strip $(2))))
 
@@ -120,6 +121,7 @@ $(eval $(foreach method,\
 	add_generated_cobjects \
 	add_generated_cxxobjects \
 	add_generated_exception_objects \
+	add_library_objects \
 	add_grammar \
 	add_grammars \
 	add_cflags \
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 990f4be..325a37d 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -44,6 +44,15 @@ CXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
 OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
 endif
 
+# if enabled we can create one library instead of more smaller
+ifeq ($(MERGELIBS),YES)
+# list of libraries which are always loaded, thus we can merge them into one
+# they have to be from tail_build, so we could link against merged library
+gb_CORE_LIBS := \
+	uui \
+
+endif
+
 # Overview of dependencies and tasks of LinkTarget
 #
 # target                      task                         depends on
@@ -724,11 +733,17 @@ $$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Librar
 $$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk))
 endif
 
-$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $(2)
+ifeq ($(MERGELIBS),YES)
+gb_LINKED_LIBS := $(if $(filter $(gb_CORE_LIBS),$(2)),merged $(filter-out $(gb_CORE_LIBS),$(2)),$(2))
+else
+gb_LINKED_LIBS := $(2)
+endif
+
+$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $$(gb_LINKED_LIBS)
 
-$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$(2),$$(call gb_Library_get_target,$$(lib)))
+$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$$(gb_LINKED_LIBS),$$(call gb_Library_get_target,$$(lib)))
 $(call gb_LinkTarget_get_external_headers_target,$(1)) : \
-$$(foreach lib,$(2),$$(call gb_Library_get_headers_target,$$(lib)))
+$$(foreach lib,$$(gb_LINKED_LIBS),$$(call gb_Library_get_headers_target,$$(lib)))
 
 endef
 


More information about the Libreoffice-commits mailing list