[Libreoffice-commits] .: Library_merged.mk solenv/gbuild

Matus Kukan mkukan at kemper.freedesktop.org
Tue Jan 10 05:26:48 PST 2012


 Library_merged.mk                              |   32 ++--------------
 solenv/gbuild/Library.mk                       |    2 -
 solenv/gbuild/LinkTarget.mk                    |   23 +++--------
 solenv/gbuild/extensions/pre_MergedLibsList.mk |   50 +++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 45 deletions(-)

New commits:
commit a74627d53eea219ceb26ce0d341cdf218ed0dd0a
Author: Matúš Kukan <matus.kukan at gmail.com>
Date:   Fri Jan 6 10:48:43 2012 +0100

    improve support for merging libraries

diff --git a/Library_merged.mk b/Library_merged.mk
index 4a8ccaf..9fe9c2d 100644
--- a/Library_merged.mk
+++ b/Library_merged.mk
@@ -21,26 +21,16 @@
 # 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 \
+$(eval $(call gb_Library_add_linked_libs,merged,\
 	basegfx \
-	canvastools \
 	comphelper \
-	cppcanvas \
 	cppu \
 	cppuhelper \
-	drawinglayer \
-	editeng \
 	fwe \
 	i18nisolang1 \
 	i18npaper \
-	i18nutil \
-	jvmfwk \
-	lng \
-	fwe \
 	sal \
 	salhelper \
 	sax \
@@ -49,28 +39,24 @@ $(eval $(call gb_Library_add_linked_libs,merged,$(filter-out $(gb_MERGED_LIBS),\
 	sot \
 	svl \
 	svt \
-	svx \
-	svxcore \
 	tk \
 	tl \
 	ucbhelper \
 	utl \
 	vcl \
-	xo \
 	xcr \
 	$(gb_STDLIBS) \
-)))
+))
 
 $(eval $(call gb_Library_use_externals,merged,\
-	icui18n \
+	berkeleydb \
 	icuuc \
-	jpeg \
-	libxml2 \
 	zlib \
 ))
 
+# gb_MERGEDLIBS is defined in solenv/gbuild/extensions/pre_MergedLibsList.mk
 $(eval $(call gb_Library_add_library_objects,merged,\
-	$(gb_CORE_LIBS) \
+	$(gb_MERGEDLIBS) \
 ))
 
 ifeq ($(OS),WNT)
@@ -85,12 +71,4 @@ $(eval $(call gb_Library_add_linked_libs,merged,\
 ))
 endif
 
-# something is missing here for sure
-ifeq ($(OS),MACOSX)
-$(eval $(call gb_Library_add_linked_libs,merged,\
-	objc \
-	Cocoa \
-))
-endif
-
 # vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index b9173ea..13258b8 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -106,7 +106,7 @@ endef
 # gb_Library__get_final_target has been invented for that purpose...
 define gb_Library_set_componentfile
 $(call gb_ComponentTarget_ComponentTarget,$(2),$(call gb_Library__get_componentprefix,$(1)),\
-	$(call gb_Library_get_runtime_filename,$(if $(MERGELIBS),$(if $(filter $(gb_MERGED_LIBS),$(1)),merged,$(1)),$(1))))
+	$(call gb_Library_get_runtime_filename,$(if $(filter $(1),$(gb_MERGEDLIBS)),merged,$(1))))
 $(call gb_Library__get_final_target,$(1)) : \
 	$(call gb_ComponentTarget_get_outdir_target,$(2))
 $(call gb_ComponentTarget_get_target,$(2)) :| $(call gb_Library_get_target,$(1))
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index e4dbd46..e8f9bab 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -46,17 +46,6 @@ CXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
 OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
 endif
 
-# 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 := \
-	uui \
-
-endif
-
 # Overview of dependencies and tasks of LinkTarget
 #
 # target                      task                         depends on
@@ -357,8 +346,10 @@ mv $${TEMPFILE} $(call gb_LinkTarget_get_objects_list,$(2))
 
 endef
 
+# If object files from this library are merged, create just empty file
 $(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY)
-	$(call gb_LinkTarget__command,$@,$*)
+	$(if $(filter $*,$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktargetname,$(lib)))), \
+		touch $@, $(call gb_LinkTarget__command,$@,$*))
 	$(call gb_LinkTarget__command_objectlist,$@,$*)
 
 ifeq ($(gb_FULLDEPS),$(true))
@@ -639,11 +630,9 @@ $$(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),TRUE)
-gb_LINKED_LIBS := $(if $(filter $(gb_CORE_LIBS),$(2)),merged $(filter-out $(gb_CORE_LIBS),$(2)),$(2))
-else
-gb_LINKED_LIBS := $(2)
-endif
+gb_LINKED_LIBS := $(if $(filter $(gb_MERGEDLIBS),$(2)), \
+	$(if $(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktargetname,$(lib)))),, merged)) \
+	$(filter-out $(gb_MERGEDLIBS),$(2))
 
 $(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $$(gb_LINKED_LIBS)
 
diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk b/solenv/gbuild/extensions/pre_MergedLibsList.mk
new file mode 100644
index 0000000..e39e6f4
--- /dev/null
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -0,0 +1,50 @@
+# -*- 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 or as specified alternatively below. 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.
+#
+# Major Contributor(s):
+# Copyright (C) 2012 Matúš Kukan <matus.kukan at gmail.com> (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# 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.
+
+ifeq ($(MERGELIBS),TRUE)
+
+# we link all object files from these libraries into one, merged library
+gb_MERGEDLIBS := \
+	avmedia \
+	canvastools \
+	cppcanvas \
+	deploymentmisc \
+	drawinglayer \
+	editeng \
+	filterconfig \
+	lng \
+	package2 \
+	sofficeapp \
+	spl \
+	svx \
+	svxcore \
+	uui \
+	xo \
+
+endif
+
+# vim: set noet sw=4 ts=4:


More information about the Libreoffice-commits mailing list