Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi there,

I'm trying to allow using one bigger shared library instead of more,
often used small ones.
Something like described here:
http://tools.openoffice.org/build_env_param.html
search for BIG_SVX parameter at the top. Was it ever possible to do
one shared library?

I'm attaching diff (against gbuild branch in core), not something to
apply but to look into if the way I'm doing that is at least partially
right.
Probably there will be different names for variables, also I'm not
sure about change in configure.in ...

That way is possible to merge just libraries from gbuildized modules.

I have changed creating services.rdb (uri parameter to load merged
library if possible)
and gb_LIST_LIBS is to control which libraries can link against the merged one.
They have to be build in tail_build, now sc, sd, sw.
It would be nice to gbuildize desktop (I'm not working on it, it's
huge and mess) for this and change linking of sofficeapp library, or
even replace it.
But this could be also possible if we were just building desktop after
tail_build.

Of course there are problems:
- I had to disable unit test in sc (sc_test_filters) when trying
changes because I was getting error which I was not able to debug yet.
    hmm, but I can't see this problem now, never mind.
more serious one:
- There are more objects with the same name in different modules.
   So, is it possible to create one object file for each module and
make these variables, classes.. invisible outside object file and then
create big library from them?
I would guess it's not possible and we have to rename or get rid of
them somehow?

It is not much to merge now but easy to add when more modules will be
gbuildized, so at least something.

and gbuild status: I have pushed change of some modules, there were
things to repair (my mistakes), thanks goes to Caolán, David and
others.
Problems are with: sal, salhelper, cppu, cppuhelper, scripting,
i18npool, avmedia (still not pushed) (some of them could be merged
then)
I have began with these when I thought it would be easy to finish, it
was not clever but hopefully I will finish that after GSoC.

that's all for now,
Thanks

Matúš
diff --git a/Library_merged.mk b/Library_merged.mk
new file mode 100644
index 0000000..a72cc3a
--- /dev/null
+++ b/Library_merged.mk
@@ -0,0 +1,91 @@
+# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# Matúš Kukan <matus.kukan@gmail.com> (C) 2011, All Rights Reserved.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+
+$(eval $(call gb_Library_Library,merged))
+
+$(eval $(call gb_Library_add_linked_libs,merged,$(filter-out $(gb_MERGED_LIBS),\
+       avmedia \
+       basegfx \
+       comphelper \
+       cppu \
+       cppuhelper \
+       drawinglayer \
+       editeng \
+       fwe \
+       i18nisolang1 \
+       i18npaper \
+       i18nutil \
+       jvmfwk \
+       lng \
+       fwe \
+       sal \
+       salhelper \
+       sax \
+       sb \
+       sfx \
+       sot \
+       svl \
+       svt \
+       svx \
+       svxcore \
+       tk \
+       tl \
+       ucbhelper \
+       utl \
+       vcl \
+       xo \
+       xcr \
+       $(gb_STDLIBS) \
+)))
+
+$(eval $(call gb_Library_use_externals,merged,\
+       icuuc \
+       jpeg \
+       libxml2 \
+))
+
+$(eval $(call gb_Library_add_library_objects,merged,\
+       $(gb_MERGED_LIBS) \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_linked_libs,merged,\
+       advapi32 \
+       gdi32 \
+       ole32 \
+       oleaut32 \
+       shell32 \
+       user32 \
+       uuid \
+))
+endif
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_linked_libs,merged,\
+       objc \
+       Cocoa \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/Module_tail_build.mk b/Module_tail_build.mk
index 6002046..4dde97d 100644
--- a/Module_tail_build.mk
+++ b/Module_tail_build.mk
@@ -44,4 +44,10 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\
     writerfilter \
 ))
 
+ifeq ($(BIGSVX),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 590fd7f..4a47ef6 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -149,6 +149,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_URE, \
 ))
 
 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
+       merged \
        test \
     fileacc \
 ))
diff --git a/configure.in b/configure.in
index bf35d5d..4a7c6f1 100755
--- a/configure.in
+++ b/configure.in
@@ -116,6 +116,11 @@ AC_ARG_ENABLE(ext-wiki-publisher,
 
 dnl ---------- *** ----------
 
+AC_ARG_ENABLE(bigsvx,
+    AS_HELP_STRING([--enable-bigsvx],
+        [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.]),
@@ -8965,6 +8970,18 @@ fi
 AC_MSG_RESULT([$BUILD_MAX_JOBS])
 AC_SUBST(BUILD_MAX_JOBS)
 
+# ===================================================================
+# Creating bigger shared library to link against
+# ===================================================================
+AC_MSG_CHECKING([whether to create a big library])
+if test "$enable_bigsvx" != "no"; then
+    BIGSVX="YES"
+    AC_MSG_RESULT([yes])
+else
+    AC_MSG_RESULT([no])
+fi
+AC_SUBST(BIGSVX)
+
 dnl ===================================================================
 dnl Setting up the environment.
 dnl ===================================================================
diff --git a/set_soenv.in b/set_soenv.in
index 729241c..4d91278 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -2060,6 +2060,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( "BIGSVX",            "@BIGSVX@",           "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 455bd8f..d92dd11 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 $(BIGSVX),$(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))))
 
@@ -117,6 +118,7 @@ $(eval $(foreach method,\
        add_noexception_objects \
        add_generated_cxxobjects \
        add_generated_exception_objects \
+       add_library_objects \
        add_cflags \
        set_cflags \
        add_cxxflags \
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 25f9737..b15744c 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -33,6 +33,20 @@
 # OBJCXXFLAGS
 # LDFLAGS
 
+ifeq ($(BIGSVX),YES)
+gb_MERGED_LIBS := \
+       comphelper \
+       sot \
+       sfx \
+       svt \
+       svx \
+       svxcore
+gb_LIST_LIBS := \
+       sc \
+       sd \
+       sw
+endif
+
 # CFLAGS from environment override debug/optimization flags
 ifeq ($(gb_DEBUGLEVEL),2)
 CFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS)
@@ -629,11 +643,20 @@ $$(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)
+lcl_LINKED_LIBS := $(2)
+
+ifeq ($(BIGSVX),YES)
+ifneq (,$(filter $(foreach lib,$(gb_LIST_LIBS),$(call gb_Library_get_linktargetname,$(lib))),$(1)))
+lcl_LINKED_LIBS := merged \
+       $(filter-out $(gb_MERGED_LIBS),$(2))
+endif
+endif
+
+$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $$(lcl_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,$$(lcl_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,$$(lcl_LINKED_LIBS),$$(call gb_Library_get_headers_target,$$(lib)))
 
 endef
 

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.