diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-01-06 10:48:43 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-01-10 14:25:03 +0100 |
commit | a74627d53eea219ceb26ce0d341cdf218ed0dd0a (patch) | |
tree | 33beadd766307b56a6c54227072aa9b099ea9eed /solenv/gbuild | |
parent | 0ffc8c0d70860e1da3b71eb3ffbb30a0d463ddef (diff) |
improve support for merging libraries
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/Library.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 23 | ||||
-rw-r--r-- | solenv/gbuild/extensions/pre_MergedLibsList.mk | 50 |
3 files changed, 57 insertions, 18 deletions
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index b9173ea74645..13258b8c3438 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 e4dbd469a96d..e8f9babb4b54 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 000000000000..e39e6f428cb0 --- /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@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: |