Kaydet (Commit) 3fdb77f0 authored tarafından Matúš Kukan's avatar Matúš Kukan

add new urelibs library merging some libraries from ure/lib/

There is no configure switch for this, URELIBS must be set.

This commit changes strategy to link also libraries being merged.
We need them for build tools like idlc, cppumaker, .., so the tools can
link against them now. This avoids circular dependencies.

Change-Id: Ic49e18ecbeaff84d4f5a7fafe8b1fbf45ed18c9b
üst 2c8cc6e5
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Library_Library,urelibs))
# gb_URELIBS is defined in solenv/gbuild/extensions/pre_MergedLibsList.mk
$(eval $(call gb_Library_use_library_objects,urelibs,\
$(gb_URELIBS) \
))
$(eval $(call gb_Library_use_static_libraries,urelibs,\
findsofficepath \
))
$(eval $(call gb_Library_use_externals,urelibs,\
libxml2 \
))
$(eval $(call gb_Library_add_libs,urelibs,\
$(if $(filter $(OS),LINUX), \
-ldl \
-lpthread \
) \
))
# vim: set noet sw=4 ts=4:
......@@ -442,6 +442,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_URE, \
sunpro5_uno \
unoidl \
unsafe_uno \
urelibs \
xmlreader \
))
......
......@@ -240,6 +240,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
ifeq ($(MERGELIBS),TRUE)
$(eval $(call gb_Module_add_targets,libreoffice,\
Library_merged \
Library_urelibs \
))
endif
......
......@@ -528,6 +528,7 @@ export TYPO_EXTENSION_PACK=@TYPO_EXTENSION_PACK@
export UNIXWRAPPERNAME=@UNIXWRAPPERNAME@
export UNOWINREG_DLL=@UNOWINREG_DLL@
export UPD=@UPD@
export URELIBS=@URELIBS@
export USE_FT_EMBOLDEN=@USE_FT_EMBOLDEN@
export USE_XINERAMA=@USE_XINERAMA@
export use_shl_version=@use_shl_version@
......
......@@ -11642,6 +11642,7 @@ else
AC_MSG_RESULT([no])
fi
AC_SUBST(MERGELIBS)
AC_SUBST([URELIBS])
# ===================================================================
# Create hardlinks on deliver instead of copying for smaller size and speed up
......
......@@ -30,6 +30,7 @@ $(eval $(call gb_Pagein_Pagein,common))
# sorted in approx. reverse load order (ld.so.1)
$(eval $(call gb_Pagein_add_objects,common,\
$(if $(MERGELIBS),merged) \
$(if $(URELIBS),urelibs) \
i18nlangtag \
$(if $(findstring YES,$(SYSTEM_ICU)),,\
icui18n \
......
......@@ -29,6 +29,7 @@ $(eval $(call gb_InstallModule_InstallModule,scp2/ure))
$(eval $(call gb_InstallModule_define_if_set,scp2/ure,\
SYSTEM_LIBXML \
URELIBS \
))
$(eval $(call gb_InstallModule_define_value_if_set,scp2/ure,\
......
......@@ -291,7 +291,14 @@ File gid_File_Dl_Xmlreader
Styles = (PACKED);
End
#ifdef URELIBS
File gid_File_Dl_Urelibs
LIB_FILE_BODY;
Dir = SCP2_URE_DL_DIR;
Name = SCP2_URE_DL_NORMAL("urelibs");
Styles = (PACKED);
End
#endif
#ifdef AIX
Unixlink gid_Unixlink_File_Dl_Store
......@@ -1007,6 +1014,9 @@ Module gid_Module_Root_Ure_Hidden
gid_Unixlink_File_Dl_Store,
gid_File_Dl_Unoidl,
gid_File_Dl_Xmlreader,
#ifdef URELIBS
gid_File_Dl_Urelibs,
#endif
gid_File_Dl_Jvmaccess,
gid_Unixlink_File_Dl_Jvmaccess,
gid_File_Dl_Jvmfwk,
......
......@@ -116,7 +116,7 @@ endef
# gb_Library__get_final_target has been invented for that purpose...
define gb_Library_set_componentfile
$(call gb_Library_get_target,$(gb_Library__get_name)) : \
COMPONENT := $$(if $$(and $$(COMPONENT),$(filter-out $(gb_MERGEDLIBS),$(1))),\
COMPONENT := $$(if $$(and $$(COMPONENT),$(filter-out $(gb_MERGEDLIBS) $(gb_URELIBS),$(1))),\
$$(call gb_Output_error,$(1) already has a component file $$(COMPONENT)))$(2)
$(call gb_ComponentTarget_ComponentTarget,$(2),\
$(call gb_Library__get_componentprefix,$(gb_Library__get_name)),\
......@@ -129,7 +129,7 @@ $(call gb_Library_get_clean_target,$(gb_Library__get_name)) : \
$(call gb_ComponentTarget_get_clean_target,$(2))
endef
gb_Library__get_name = $(if $(filter $(1),$(gb_MERGEDLIBS)),merged,$(1))
gb_Library__get_name = $(if $(filter $(1),$(gb_MERGEDLIBS)),merged,$(if $(filter $(1),$(gb_URELIBS)),urelibs,$(1)))
gb_Library__get_componentprefix = \
$(call gb_Library__get_layer_componentprefix,$(call \
......
......@@ -442,10 +442,8 @@ 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)
$(if $(filter $*,$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktargetname,$(lib)))), \
echo > $@, $(call gb_LinkTarget__command,$@,$*))
$(call gb_LinkTarget__command,$@,$*)
$(call gb_LinkTarget__command_objectlist,$@,$*)
ifeq ($(gb_FULLDEPS),$(true))
......@@ -824,8 +822,8 @@ define gb_LinkTarget__use_libraries
# used by bin/module-deps.pl
ifneq ($(ENABLE_PRINT_DEPS),)
# exclude libraries in Library_merged
ifeq ($(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktargetname,$(lib)))),)
# exclude libraries in Library_merged Librery_urelibs
ifeq ($(filter $(1),$(foreach lib,$(gb_MERGEDLIBS) $(gb_URELIBS),$(call gb_Library_get_linktargetname,$(lib)))),)
$$(eval $$(call gb_PrintDeps_info,$(4),$(3)))
endif
endif
......@@ -838,18 +836,31 @@ $(call gb_LinkTarget_get_external_headers_target,$(1)) : \
endef
define gb_Linktarget__is_build_tool
$(if $(filter $(1),$(addprefix Executable/,cppumaker idlc regcompare regmerge)),$(true),$(false))
endef
define gb_LinkTarget_use_libraries
ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2)))
$$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL))
$$(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 ($(call gb_Linktarget__is_build_tool,$(1)),$(true))
$(call gb_LinkTarget__use_libraries,$(1),$(2),$(2),$(4))
else
$(call gb_LinkTarget__use_libraries,$(1),$(2),$(strip \
$(if $(filter $(gb_MERGEDLIBS),$(2)), \
$(if $(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktargetname,$(lib)))),, merged)) \
$(filter-out $(gb_MERGEDLIBS),$(2)) \
$(if $(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktargetname,$(lib)))), \
$(filter $(gb_MERGEDLIBS),$(2)), merged)) \
$(if $(filter $(gb_URELIBS),$(2)), \
$(if $(filter $(1),$(foreach lib,$(gb_URELIBS),$(call gb_Library_get_linktargetname,$(lib)))), \
$(filter $(gb_URELIBS),$(2)), urelibs)) \
$(filter-out $(gb_MERGEDLIBS) $(gb_URELIBS),$(2)) \
),$(4))
endif
endef
define gb_LinkTarget_add_linked_static_libs
......
......@@ -66,7 +66,7 @@ $(call gb_Pagein_get_outdir_target,$(1)) :| $(dir $(call gb_Pagein_get_outdir_ta
endef
define gb_Pagein_add_object
$(call gb_Pagein_get_target,$(1)) : OBJECTS += $(filter-out $(gb_MERGEDLIBS),$(2))
$(call gb_Pagein_get_target,$(1)) : OBJECTS += $(filter-out $(gb_URELIBS) $(gb_MERGEDLIBS),$(2))
endef
......
......@@ -143,6 +143,21 @@ gb_MERGEDLIBS := \
xo \
xstor \
ifneq (,$(URELIBS))
gb_URELIBS := \
cppu \
cppuhelper \
$(if $(filter TRUE,$(SOLAR_JAVA)),jvmaccess) \
$(if $(filter TRUE,$(SOLAR_JAVA)),jvmfwk) \
reg \
sal \
salhelper \
store \
unoidl \
xmlreader \
endif
endif
# vim: set noet sw=4 ts=4:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment