summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-09-18 15:03:50 +0200
committerMichael Stahl <mstahl@redhat.com>2013-09-21 19:23:43 +0200
commit1c3c00b2fd27b9ec6b9e96a48227ec43b9bd6904 (patch)
tree5132805829fa90885543fc87b0bb7459e645d68b
parent5dea81f27afd01e45efde596c9131cc80889f8a0 (diff)
gbuild: remove libraries from OUTDIR and WORKDIR
Refactor everything to find and link libraries directly in INSTDIR. - add gb_LinkTarget_get_linksearchpath_for_layer, and use it to set up -L paths for T_LDFLAGS in such a way that only allowed libraries can be linked against; i.e. it's not possible to link URE linktargets against OOO or not-installed libraries - gb_Library_get_target is now same as the gb_LinkTarget_get_target (TODO: this needs cleanup) - since a pattern rule won't work for linking libraries in INSTDIR, add a separate per-file rule for every INSTDIR lib - pattern rule can't find link target in the clean target any more so add a LINKTARGET variable - disable gb_Library_add_auxtarget, no auxtargets need to be copied - tweak the call to gb_Library_Library_platform to pass in a path in sdk/lib for the versioned URE libs - fix the Library clean target - add LAYER parameter to gb_LinkTarget_LinkTarget - adjust platform link commands - MSVC link command now uses explicit -manifestfile and -pdb parameters to keep misc. files out of INSTDIR - remove gb_Helper_OUTDIR_FOR_BUILDLIBDIR - adjust Extension, CppunitTest, JunitTest, PythonTest, Gallery, various CustomTargets to search INSTDIR - remove SDK library symlinks and import libs from odk/Package_lib - on Mac OS X, put .dylib symlinks into sdk/lib even though those are not packaged and would be created by the SDK configury; we need these to be somewhere for linking anyway - add a (unfortunately cyclic) dependency on Package ure_install to sal Change-Id: I70d88742f8c8232ad7b9521416275c67b64fe6cf
-rw-r--r--extensions/Package_OOoSpotlightImporter.mk2
-rw-r--r--i18npool/CustomTarget_localedata.mk2
-rw-r--r--odk/Package_lib.mk20
-rw-r--r--pyuno/source/module/pyuno_module.cxx12
-rw-r--r--sal/Library_sal.mk4
-rw-r--r--solenv/gbuild/CppunitTest.mk10
-rw-r--r--solenv/gbuild/Executable.mk2
-rw-r--r--solenv/gbuild/Extension.mk2
-rw-r--r--solenv/gbuild/ExternalPackage.mk6
-rw-r--r--solenv/gbuild/Gallery.mk4
-rw-r--r--solenv/gbuild/Helper.mk11
-rw-r--r--solenv/gbuild/JunitTest.mk2
-rw-r--r--solenv/gbuild/Library.mk52
-rw-r--r--solenv/gbuild/LinkTarget.mk43
-rw-r--r--solenv/gbuild/PythonTest.mk1
-rw-r--r--solenv/gbuild/StaticLibrary.mk2
-rw-r--r--solenv/gbuild/TargetLocations.mk14
-rw-r--r--solenv/gbuild/platform/com_GCC_class.mk8
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk3
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk44
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk3
-rw-r--r--solenv/gbuild/platform/macosx.mk16
-rw-r--r--solenv/gbuild/platform/mingw.mk14
-rw-r--r--solenv/gbuild/platform/solaris.mk19
-rw-r--r--solenv/gbuild/platform/unxgcc.mk19
-rw-r--r--testtools/CustomTarget_bridgetest.mk6
-rw-r--r--testtools/CustomTarget_uno_test.mk2
27 files changed, 159 insertions, 164 deletions
diff --git a/extensions/Package_OOoSpotlightImporter.mk b/extensions/Package_OOoSpotlightImporter.mk
index 5423645507fb..1eafe020514e 100644
--- a/extensions/Package_OOoSpotlightImporter.mk
+++ b/extensions/Package_OOoSpotlightImporter.mk
@@ -7,7 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-$(eval $(call gb_Package_Package,extensions_OOoSpotlightImporter,$(OUTDIR)/lib))
+$(eval $(call gb_Package_Package,extensions_OOoSpotlightImporter,$(gb_Library_DLLDIR)))
$(eval $(call gb_Package_set_outdir,extensions_OOoSpotlightImporter,$(gb_INSTROOT)))
diff --git a/i18npool/CustomTarget_localedata.mk b/i18npool/CustomTarget_localedata.mk
index b026f893a85f..9dfc764a4529 100644
--- a/i18npool/CustomTarget_localedata.mk
+++ b/i18npool/CustomTarget_localedata.mk
@@ -22,7 +22,7 @@ $(call gb_CustomTarget_get_workdir,i18npool/localedata)/localedata_$(1).cxx : \
$$(call gb_Output_announce,$$(subst $(WORKDIR)/,,$$@),$(true),SAX,1)
$$(call gb_Helper_abbreviate_dirs, \
$$(call gb_Helper_execute,saxparser) $(1) $$< $$@.tmp \
- -env:LO_LIB_DIR=$(call gb_Helper_make_url,$(gb_Helper_OUTDIR_FOR_BUILDLIBDIR)) \
+ -env:LO_LIB_DIR=$(call gb_Helper_make_url,$(gb_INSTROOT)/$(gb_PROGRAMDIRNAME)) \
-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target_for_build,saxparser)) \
$(if $(findstring s,$(MAKEFLAGS)),> /dev/null 2>&1) && \
sed 's/\(^.*get[^;]*$$$$\)/SAL_DLLPUBLIC_EXPORT \1/' $$@.tmp > $$@ && \
diff --git a/odk/Package_lib.mk b/odk/Package_lib.mk
index bd796beb7d55..d1dc1d6a2aab 100644
--- a/odk/Package_lib.mk
+++ b/odk/Package_lib.mk
@@ -12,27 +12,7 @@ $(eval $(call gb_Package_Package,odk_lib,$(OUTDIR)/lib))
$(eval $(call gb_Package_set_outdir,odk_lib,$(INSTDIR)))
$(eval $(call gb_Package_add_files,odk_lib,$(gb_Package_SDKDIRNAME)/lib,\
- $(if $(filter MSC,$(COM)),\
- $(foreach lib,\
- cppu \
- cppuhelper \
- purpenvhelper \
- sal \
- salhelper \
- ,$(call gb_Library_get_ilibfilename,$(lib)) \
- ) \
- ) \
$(if $(filter LINUX,$(OS)),$(notdir $(call gb_StaticLibrary_get_target,salcpprt))) \
))
-ifneq (,$(filter-out MACOSX WNT,$(OS)))
-define odk_add_sybolic_link
-$(call gb_Package_add_symbolic_link,odk_lib,$(gb_Package_SDKDIRNAME)/lib/$(basename $(1)),../../ure-link/lib/$(1))
-
-endef
-
-$(foreach lib,cppu cppuhelper purpenvhelper sal salhelper,\
-$(eval $(call odk_add_sybolic_link,$(call gb_Library_get_runtime_filename,$(lib)))))
-endif
-
# vim: set noet sw=4 ts=4:
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index fc6868ab70a4..d9d510a8086b 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -346,15 +346,13 @@ static PyObject* initPoniesMode(
xContext->getServiceManager(),
com::sun::star::uno::UNO_QUERY_THROW);
if (!xMSF.is()) { abort(); }
- char *const outdir = getenv("OUTDIR");
- if (!outdir) { abort(); }
- OString const libname = (OString(OString(outdir, strlen(outdir)) +
+ char *const testlib = getenv("TEST_LIB");
+ if (!testlib) { abort(); }
+ OString const libname = OString(testlib, strlen(testlib))
#ifdef _WIN32
- "/bin/")).replaceAll(OString('/'), OString('\\'))
-#else
- "/lib/"))
+ .replaceAll(OString('/'), OString('\\'))
#endif
- + SAL_MODULENAME("test");
+ ;
oslModule const mod( osl_loadModuleAscii(libname.getStr(),
SAL_LOADMODULE_LAZY | SAL_LOADMODULE_GLOBAL) );
if (!mod) { abort(); }
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 1bf549f308e3..f22bac2b0c69 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -33,6 +33,10 @@ $(eval $(call gb_Library_add_defs,sal,\
-DSRCDIR="\"$(SRCDIR)\"" \
))
+# need the "ure-link" symlink to exist in INSTDIR so it's possible to link sal
+# FIXME: this creates cyclic dependency between ure and sal modules
+$(eval $(call gb_Library_use_package,sal,ure_install))
+
$(eval $(call gb_Library_use_libraries,sal,\
$(if $(filter $(OS),ANDROID), \
lo-bootstrap \
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 6841110cf7c3..b372195109ad 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -59,10 +59,10 @@ $(if $(URE),\
"-env:UNO_TYPES=$(foreach item,$(UNO_TYPES),$(call gb_Helper_make_url,$(item)))") \
$(if $(strip $(UNO_SERVICES)),\
"-env:UNO_SERVICES=$(foreach item,$(UNO_SERVICES),$(call gb_Helper_make_url,$(item)))") \
- $(foreach dir,URE_INTERNAL_LIB_DIR LO_LIB_DIR,\
- -env:$(dir)=$(call gb_Helper_make_url,$(gb_CppunitTest_LIBDIR))) \
- --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
- --protector unobootstrapprotector$(gb_Library_DLLEXT) unobootstrapprotector \
+ -env:URE_INTERNAL_LIB_DIR=$(call gb_Helper_make_url,$(gb_INSTROOT)/$(LIBO_URE_LIB_FOLDER)) \
+ -env:LO_LIB_DIR=$(call gb_Helper_make_url,$(gb_INSTROOT)/$(gb_PROGRAMDIRNAME)) \
+ --protector $(call gb_Library_get_target,unoexceptionprotector) unoexceptionprotector \
+ --protector $(call gb_Library_get_target,unobootstrapprotector) unobootstrapprotector \
) $(ARGS)
endef
@@ -102,7 +102,7 @@ endef
# call gb_CppunitTest__CppunitTest_impl,cppunittest,linktarget
define gb_CppunitTest__CppunitTest_impl
-$(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1))
+$(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1),NONE)
$(call gb_LinkTarget_set_targettype,$(2),CppunitTest)
$(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS))
$(call gb_LinkTarget_add_defs,$(2),\
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index bb9358e82cb5..ca70437168b7 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -59,7 +59,7 @@ endef
# call gb_Executable__Executable_impl,exe,linktarget
define gb_Executable__Executable_impl
-$(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1))
+$(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1),$(call gb_Executable_get_layer,$(1)))
$(call gb_LinkTarget_set_targettype,$(2),Executable)
$(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS))
$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
diff --git a/solenv/gbuild/Extension.mk b/solenv/gbuild/Extension.mk
index 1f068848e131..7511747e2b84 100644
--- a/solenv/gbuild/Extension.mk
+++ b/solenv/gbuild/Extension.mk
@@ -161,7 +161,7 @@ endef
# add a library from the solver; DO NOT use gb_Library_get_target
define gb_Extension_add_library
$(call gb_Extension_add_file,$(1),$(call gb_Library_get_runtime_filename,$(2)),\
- $(gb_Helper_OUTDIRLIBDIR)/$(call gb_Library_get_runtime_filename,$(2)))
+ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(2))))
endef
diff --git a/solenv/gbuild/ExternalPackage.mk b/solenv/gbuild/ExternalPackage.mk
index 408eecf3879b..c52ffff334ac 100644
--- a/solenv/gbuild/ExternalPackage.mk
+++ b/solenv/gbuild/ExternalPackage.mk
@@ -199,7 +199,7 @@ define gb_ExternalPackage__add_file_for_install
$(call gb_ExternalPackage_add_file,$(1),$(2),$(4))
$(call gb_Helper_install,$(call gb_ExternalPackage_get_target,$(1)), \
- $(gb_INSTROOT)/$(3), \
+ $(3), \
$(call gb_UnpackedTarball_get_dir,$(gb_ExternalPackage_UNPACKED_$(1)))/$(4))
$(call gb_UnpackedTarball_get_dir,$(gb_ExternalPackage_UNPACKED_$(1)))/$(4) :| \
@@ -218,7 +218,7 @@ endef
#
# gb_ExternalPackage_add_library_for_install package dest src library?
define gb_ExternalPackage_add_library_for_install
-$(call gb_ExternalPackage__add_file_for_install,$(1),$(2),$(if $(4),$(call gb_Library_get_instdir,$(4)),$(gb_Package_PROGRAMDIRNAME))/$(notdir $(2)),$(3))
+$(call gb_ExternalPackage__add_file_for_install,$(1),$(2),$(if $(4),$(call gb_Library_get_instdir,$(4)),$(gb_INSTROOT)/$(gb_Package_PROGRAMDIRNAME))/$(notdir $(2)),$(3))
endef
@@ -238,7 +238,7 @@ endef
#
# gb_ExternalPackage_add_jar_for_install package dest src
define gb_ExternalPackage_add_jar_for_install
-$(call gb_ExternalPackage__add_file_for_install,$(1),$(2),$(gb_Package_PROGRAMDIRNAME)/classes/$(notdir $(2)),$(3))
+$(call gb_ExternalPackage__add_file_for_install,$(1),$(2),$(gb_INSTROOT)/$(gb_Package_PROGRAMDIRNAME)/classes/$(notdir $(2)),$(3))
endef
diff --git a/solenv/gbuild/Gallery.mk b/solenv/gbuild/Gallery.mk
index f70aba056ed5..ecf9cf9becdd 100644
--- a/solenv/gbuild/Gallery.mk
+++ b/solenv/gbuild/Gallery.mk
@@ -53,8 +53,8 @@ define gb_Gallery__make_env_args
$(call gb_Helper_make_url,$(call gb_ComponentTarget_get_target_for_build,$(item))))" \
"-env:UNO_TYPES=$(foreach item,$(gb_Gallery__UNO_TYPES),\
$(call gb_Helper_make_url,$(call gb_UnoApi_get_target,$(item))))" \
-$(foreach dir,URE_INTERNAL_LIB_DIR LO_LIB_DIR,\
- -env:$(dir)=$(call gb_Helper_make_url,$(gb_Helper_OUTDIR_FOR_BUILDLIBDIR)))
+-env:URE_INTERNAL_LIB_DIR=$(call gb_Helper_make_url,$(gb_INSTROOT)/$(LIBO_URE_LIB_FOLDER)) \
+-env:LO_LIB_DIR=$(call gb_Helper_make_url,$(gb_INSTROOT)/$(gb_PROGRAMDIRNAME))
endef
define gb_Gallery__command
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 727c4ea013f4..8a5457a07648 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -215,17 +215,6 @@ $(1) : $(2) | $(dir $(1)).dir
$(call gb_Deliver_add_deliverable,$(1),$(2),$(1))
endef
-# 4th parameter overrides 3rd for the dependency, necessary for Library
-# which needs to copy DLL but that must not be a real target...
-define gb_Library__install
-$(1) :| $(2)
-$(2) : $(4) | $(dir $(2)).dir
- cp $(3) $$@
-
-$(call gb_Deliver_add_deliverable,$(2),$(3),$(2))
-endef
-
-
# gb_Helper_OUTDIRLIBDIR is set by the platform to the path the dynamic linker need to use
# for libraries from the OUTDIR
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 6b86f6e7f3f6..ad3d5250d3dc 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -57,7 +57,7 @@ $(call gb_JunitTest_get_target,%) :
$(CLEAN_CMD)
define gb_JunitTest_JunitTest
-$(call gb_JunitTest_get_target,$(1)) : T_CP := $(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$$(gb_CLASSPATHSEP)$(OUTDIR)/lib
+$(call gb_JunitTest_get_target,$(1)) : T_CP := $(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$$(gb_CLASSPATHSEP)$(gb_INSTROOT)/$(LIBO_URE_LIB_FOLDER)
$(call gb_JunitTest_get_target,$(1)) : CLASSES :=
$(eval $(call gb_JunitTest_JunitTest_platform,$(1)))
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index fc5a258db24f..37c6fbf6a6d4 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -30,22 +30,26 @@
# gb_Library_Library_platform
gb_Library_LAYER_DIRS := \
- OOO:$(gb_PROGRAMDIRNAME) \
- URELIB:$(LIBO_URE_LIB_FOLDER)
+ URELIB:$(gb_INSTROOT)/$(LIBO_URE_LIB_FOLDER) \
+ OOO:$(gb_INSTROOT)/$(gb_PROGRAMDIRNAME) \
+ OXT:$(WORKDIR)/LinkTarget/ExtensionLibrary \
+ NONE:$(gb_Library_DLLDIR) \
# doesn't do anything, just used for hooking up component target
.PHONY: $(call gb_Library__get_final_target,%)
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
-.PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT)
-$(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) :
+.PHONY : $(WORKDIR)/Clean/Library/%
+$(WORKDIR)/Clean/Library/% :
$(call gb_Helper_abbreviate_dirs,\
- rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \
+ rm -f $(call gb_Library_get_exports_target,$*) \
$(AUXTARGETS))
gb_Library__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_LAYER_DIRS)))
gb_Library_get_instdir = $(call gb_Library__get_dir_for_layer,$(call gb_Library_get_layer,$(1)))
-gb_Library_get_install_target = $(gb_INSTROOT)/$(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))
+gb_Library_get_install_target = $(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))
+
+gb_Library_get_ilib_target = $(if $(filter $(1),$(gb_Library_RTVERLIBS) $(gb_Library_UNOVERLIBS)),$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib/$(call gb_Library_get_ilibfilename,$(1)),$(gb_Library_DLLDIR)/$(call gb_Library_get_ilibfilename,$(1)))
define gb_Library_Library
$(call gb_Postprocess_register_target,AllLibraries,Library,$(1))
@@ -73,63 +77,47 @@ endef
# call gb_Library__Library_impl,library,linktarget
define gb_Library__Library_impl
-$(call gb_LinkTarget_LinkTarget,$(2),Library_$(1))
+$(call gb_LinkTarget_LinkTarget,$(2),Library_$(1),$(call gb_Library_get_layer,$(1)))
$(call gb_LinkTarget_set_targettype,$(2),Library)
$(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS))
$(call gb_LinkTarget_add_defs,$(2),\
$(gb_Library_DEFS) \
)
$(call gb_Library__get_final_target,$(1)) : $(call gb_Library_get_target,$(1))
-$(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
- | $(dir $(call gb_Library_get_target,$(1))).dir
+$(call gb_Library_get_exports_target,$(1)) : $(call gb_Library_get_target,$(1))
+$(call gb_Library_get_target,$(1)) : \
+ | $(dir $(call gb_Library_get_target,$(1))).dir \
+ $(dir $(call gb_Library_get_ilib_target,$(1))).dir \
+ $(gb_Library_DLLDIR)/.dir
$(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS :=
-$(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Library_get_ilibfilename,$(1)))
-
-$(if $(and $(call gb_Library_get_instdir,$(1)),$(filter-out $(gb_MERGEDLIBS),$(1))),\
-$(call gb_Library__install,$(call gb_Library__get_final_target,$(1)), \
- $(call gb_Library_get_install_target,$(1)), \
- $(gb_Library_DLLDIR)/$(call gb_Library_get_runtime_filename,$(1)), \
- $(call gb_LinkTarget_get_target,$(2))) \
-)
+$(call gb_Library_Library_platform,$(1),$(2),$(call gb_Library_get_ilib_target,$(1)))
$$(eval $$(call gb_Module_register_target,$(call gb_Library__get_final_target,$(1)),$(call gb_Library_get_clean_target,$(1))))
$(call gb_Helper_make_userfriendly_targets,$(1),Library,$(call gb_Library__get_final_target,$(1)))
-$(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1))
endef
-# Custom definition that does not simply forward to LinkTarget,
-# because there are cases where the auxtargets are not delivered to solver...
-# The auxtarget is delivered via the rule in Package.mk.
-# gb_Library_add_auxtarget library outdirauxtarget
define gb_Library_add_auxtarget
-$(call gb_LinkTarget_add_auxtarget,$(call gb_Library_get_linktarget,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))))/$(notdir $(2)))
-$(call gb_Library_get_target,$(1)) : $(2)
-$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))))/$(notdir $(2))
-$(2) :| $(dir $(2)).dir
-$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += $(2)
-
+$(call gb_Output_error,gb_Library_add_auxtarget should no longer be necessary)
endef
define gb_Library_add_auxtargets
-$(foreach aux,$(2),$(call gb_Library_add_auxtarget,$(1),$(aux)))
-
+$(call gb_Output_error,gb_Library_add_auxtargets should no longer be necessary)
endef
# we actually (ab)use ILIBTARGET here to store the unversioned symlink -
# it serves a similar purpose to an MSVC import library, as input for linker
# call gb_Library__add_soversion_link,library,linkname
define gb_Library__add_soversion_link
-$(call gb_Library_add_auxtarget,$(1),$(OUTDIR)/lib/$(notdir $(2)))
$(call gb_LinkTarget_set_ilibtarget,$(call gb_Library_get_linktarget,$(1)),$(2))
endef
define gb_Library__set_soversion_script
$(call gb_LinkTarget_set_soversion_script,$(call gb_Library_get_linktarget,$(1)),$(2))
-$(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_workdir_target_versionlink,$(1)))
+$(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_versionlink_target,$(1)))
endef
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 21b4ab2c5601..18430daa2bfc 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -54,6 +54,15 @@ gb_LinkTarget__get_objcxxflags=$(if $(OBJCXXFLAGS),$(OBJCXXFLAGS),$(call gb_Link
# call gb_LinkTarget__get_ldflags,linktargetmakefilename
gb_LinkTarget__get_ldflags=$(if $(LDFLAGS),$(LDFLAGS),$(call gb_LinkTarget__get_debugldflags,$(1)))
+gb_LinkTarget_LAYER_LINKPATHS := \
+ URELIB:URELIB. \
+ UREBIN:URELIB. \
+ SDKBIN:URELIB. \
+ OOO:URELIB+OOO. \
+ OXT:OXT. \
+ NONE:URELIB+OOO+NONE. \
+
+
# Overview of dependencies and tasks of LinkTarget
#
# target task depends on
@@ -378,11 +387,10 @@ $(WORKDIR)/Clean/LinkTarget/% :
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_dep_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_dep_target,$(object))) \
- $(call gb_LinkTarget_get_target,$*) \
- $(call gb_LinkTarget_get_dep_target,$*) \
- $(call gb_LinkTarget_get_headers_target,$*) \
- $(call gb_LinkTarget_get_objects_list,$*) \
- $(call gb_LinkTarget_get_target,$*).exports \
+ $(call gb_LinkTarget_get_target,$(LINKTARGET)) \
+ $(call gb_LinkTarget_get_dep_target,$(LINKTARGET)) \
+ $(call gb_LinkTarget_get_headers_target,$(LINKTARGET)) \
+ $(call gb_LinkTarget_get_objects_list,$(LINKTARGET)) \
$(ILIBTARGET) \
$(AUXTARGETS)) && \
cat $${RESPONSEFILE} /dev/null | xargs -n 200 rm -fr && \
@@ -425,12 +433,15 @@ mv $${TEMPFILE} $(1)
endef
+$(WORKDIR)/LinkTarget/%/.dir :
+ $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
# Target for the .exports of the shared library, to speed up incremental build.
# This deliberately does nothing if the file exists; the file is actually
# written in gb_LinkTarget__command_dynamiclink.
# Put this pattern rule here so it overrides the one below.
# (this is rather ugly: because of % the functions cannot be used)
-$(WORKDIR)/LinkTarget/Library/%.exports : $(gb_Library_OUTDIRLOCATION)/%
+$(WORKDIR)/LinkTarget/Library/%.exports :
$(if $(wildcard $@),,mkdir -p $(dir $@) && touch $@)
# This recipe actually also builds the dep-target as a side-effect, which
@@ -439,6 +450,16 @@ $(WORKDIR)/LinkTarget/Library/%.exports : $(gb_Library_OUTDIRLOCATION)/%
$(WORKDIR)/LinkTarget/% : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY)
$(call gb_LinkTarget__command_impl,$@,$*)
+# call gb_LinkTarget__make_installed_rule,linktarget
+define gb_LinkTarget__make_installed_rule
+$(call gb_LinkTarget_get_target,$(1)) : $(call gb_LinkTarget_get_headers_target,$(1))
+ $$(call gb_LinkTarget__command_impl,$(call gb_LinkTarget_get_target,$(1)),$(call gb_LinkTarget__get_workdir_linktargetname,$(1)))
+
+endef
+
+# it's not possible to use a pattern rule for files in INSTDIR because
+# it would inevitably conflict with the pattern rule for Package
+# (especially since external libraries are delivered via Package)
# call gb_LinkTarget__command_impl,linktargettarget,linktargetname
define gb_LinkTarget__command_impl
$(if $(gb_FULLDEPS),\
@@ -448,7 +469,7 @@ define gb_LinkTarget__command_impl
$(if $(filter $(true),$(call gb_LinkTarget__is_build_lib,$(2))),\
$(call gb_LinkTarget__command,$(1),$(2)),\
mkdir -p $(dir $(1)) && echo invalid > $(1) \
- $(if $(SOVERSIONSCRIPT),&& echo invalid > $(basename $(1)))),\
+ $(if $(SOVERSIONSCRIPT),&& echo invalid > $(WORKDIR)/LinkTarget/$(2))),\
$(call gb_LinkTarget__command,$(1),$(2)))
$(call gb_LinkTarget__command_objectlist,$(WORKDIR)/LinkTarget/$(2).objectlist)
endef
@@ -515,8 +536,9 @@ $(call gb_LinkTarget_get_headers_target,%) :
# local variable of the same name is considered obscure, the target local
# variables have a T_ prefix.
#
-# call gb_LinkTarget_LinkTarget,linktarget,linktargetmakefilename
+# call gb_LinkTarget_LinkTarget,linktarget,linktargetmakefilename,layer
define gb_LinkTarget_LinkTarget
+$(call gb_LinkTarget_get_clean_target,$(1)) : LINKTARGET := $(1)
$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_LinkTarget_get_headers_target,$(1)) : SELF := $(call gb_LinkTarget__get_workdir_linktargetname,$(1))
$(call gb_LinkTarget_get_target,$(1)) : ILIBTARGET :=
@@ -563,7 +585,7 @@ $(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS := $$(gb_LinkTarget_DEFAULTDEFS
$(call gb_LinkTarget_get_headers_target,$(1)) \
$(call gb_LinkTarget_get_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
$(call gb_LinkTarget_get_headers_target,$(1)) \
-$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(call gb_LinkTarget__get_ldflags,$(2))
+$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(call gb_LinkTarget_get_linksearchpath_for_layer,$(3)) $(call gb_LinkTarget__get_ldflags,$(2))
$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS :=
$(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS :=
$(call gb_LinkTarget_get_target,$(1)) : LIBS :=
@@ -611,6 +633,9 @@ endif
gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(1)) := cxx
+# installed linktargets need a rule to build!
+$(if $(findstring $(INSTDIR),$(1)),$(call gb_LinkTarget__make_installed_rule,$(1)))
+
endef
# call gb_LinkTarget_set_soversion_script,linktarget,soversionscript
diff --git a/solenv/gbuild/PythonTest.mk b/solenv/gbuild/PythonTest.mk
index f6a94a065fa7..fb1b3d62b9ca 100644
--- a/solenv/gbuild/PythonTest.mk
+++ b/solenv/gbuild/PythonTest.mk
@@ -41,6 +41,7 @@ $(call gb_PythonTest_get_target,%) :
$(if $(G_SLICE),G_SLICE=$(G_SLICE)) \
$(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \
$(DEFS) \
+ TEST_LIB=$(call gb_Library_get_target,test) \
URE_BOOTSTRAP=vnd.sun.star.pathname:$(call gb_Helper_get_rcfile,$(gb_DEVINSTALLROOT)/$(LIBO_ETC_FOLDER)/fundamental) \
PYTHONPATH="$(PYPATH)" \
UserInstallation=$(call gb_Helper_make_url,$(dir $(call gb_PythonTest_get_target,$*))user) \
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index ea8c5d8635c4..0cc7177f76f5 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -42,7 +42,7 @@ endef
# call gb_StaticLibrary__StaticLibrary_impl,staticlib,linktarget
define gb_StaticLibrary__StaticLibrary_impl
-$(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1))
+$(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1),NONE)
$(call gb_LinkTarget_set_targettype,$(2),StaticLibrary)
$(call gb_StaticLibrary_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
| $(dir $(call gb_StaticLibrary_get_target,$(1))).dir
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index fb4eea368e97..6bcb3dfd3ac4 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -53,9 +53,8 @@ define gb_Executable_get_target_for_build
$(patsubst $(1):%,$(OUTDIR_FOR_BUILD)/bin/%,$(filter $(1):%,$(gb_Executable_FILENAMES_FOR_BUILD)))
endef
-define gb_Library_get_target
-$(patsubst $(1):%,$(gb_Library_OUTDIRLOCATION)/%,$(filter $(1):%,$(gb_Library_FILENAMES)))
-endef
+# FIXME: cleanup?
+gb_Library_get_target = $(gb_Library__get_linktarget_target)
define gb_StaticLibrary_get_target
$(gb_StaticLibrary_OUTDIRLOCATION)/$(call gb_StaticLibrary_get_filename,$(1))
@@ -232,8 +231,8 @@ define gb_Library_get_exports_target
$(WORKDIR)/LinkTarget/$(call gb_Library__get_workdir_linktargetname,$(1)).exports
endef
-define gb_Library_get_workdir_target_versionlink
-$(WORKDIR)/LinkTarget/$(basename $(call gb_Library__get_workdir_linktargetname,$(1)))
+define gb_Library_get_versionlink_target
+$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib/$(basename $(call gb_Library_get_filename,$(1)))
endef
gb_Library__get_final_target = $(WORKDIR)/Dummy/$(1)
@@ -280,6 +279,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
JavaClassSet \
Jar \
JunitTest \
+ Library \
Module \
PackagePart \
Package \
@@ -330,7 +330,6 @@ $(eval $(call gb_Helper_make_outdir_clean_targets,\
CliNativeLibrary \
CliUnoApi \
InstallScript \
- Library \
StaticLibrary \
UnoApi \
))
@@ -399,7 +398,7 @@ define gb_Library__get_workdir_linktargetname
Library/$(call gb_Library_get_filename,$(1))
endef
define gb_Library__get_linktarget_target
-$(WORKDIR)/LinkTarget/$(call gb_Library__get_workdir_linktargetname,$(1))
+$(if $(filter-out $(gb_MERGEDLIBS),$(1)),$(call gb_Library_get_install_target,$(1)),$(WORKDIR)/LinkTarget/$(call gb_Library__get_workdir_linktargetname,$(1)))
endef
# this returns a tuple of both the linktargetname, and the target file
define gb_Library_get_linktarget
@@ -430,6 +429,7 @@ endef
# static members declared here because they are used globally
+gb_Library_WORKDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Library
gb_Executable_BINDIR = $(WORKDIR)/LinkTarget/Executable
# FIXME move platform
gb_Library_OUTDIRLOCATION = $(if $(filter WNT,$(OS)),$(OUTDIR)/bin,$(OUTDIR)/lib)
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index af402b995543..a8cd146f715e 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -219,4 +219,12 @@ gb_StaticLibrary_get_filename = lib$(1).a
gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_StaticLibrary_platform :=
+gb_LinkTarget_get_linksearchpath_for_layer = \
+ -L$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \
+ $(foreach layer,\
+ $(subst +, ,$(patsubst $(1):%.,%,\
+ $(filter $(1):%.,$(gb_LinkTarget_LAYER_LINKPATHS)))),\
+ $(patsubst $(layer):%,-L%,\
+ $(filter $(layer):%,$(gb_Library_LAYER_DIRS))))
+
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 40f0def0a0e2..faba1705e0a6 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -181,7 +181,7 @@ else
gb_Helper_LIBRARY_PATH_VAR := LD_LIBRARY_PATH
endif
-gb_Helper_set_ld_path := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}"$(OUTDIR_FOR_BUILD)/lib:$(INSTDIR)/ure/lib:$(INSTDIR)/program"
+gb_Helper_set_ld_path := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}"$(OUTDIR_FOR_BUILD)/lib:$(gb_INSTROOT)/$(LIBO_URE_LIB_FOLDER):$(gb_INSTROOT)/$(gb_PROGRAMDIRNAME)"
# $(1): list of directory pathnames to append at the end of the ld path
define gb_Helper_extend_ld_path
@@ -194,6 +194,5 @@ file://$(strip $(1))
endef
gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib
-gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/lib
gb_Helper_get_rcfile = $(1)rc
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 6574b7c417b5..25284b93f5f7 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -138,6 +138,7 @@ gb_LinkTarget_INCLUDE :=\
gb_LinkTarget_get_pdbfile = \
$(WORKDIR)/LinkTarget/pdb/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).pdb
+# substitute .pyd here because pyuno has to follow python's crazy conventions
gb_LinkTarget_get_pdbfile2 = \
$(WORKDIR)/LinkTarget/$(patsubst %.dll,%.pdb,$(patsubst %.pyd,%.dll,$(call gb_LinkTarget__get_workdir_linktargetname,$(1))))
gb_LinkTarget_get_ilkfile = \
@@ -145,6 +146,12 @@ gb_LinkTarget_get_ilkfile = \
gb_LinkTarget_get_manifestfile = \
$(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).manifest
+gb_LinkTarget_get_linksearchpath_for_layer = \
+ -LIBPATH:$(INSTDIR)/$(gb_Package_SDKDIRNAME)/lib \
+ $(if $(filter OXT,$(1)),\
+ -LIBPATH:$(WORKDIR)/LinkTarget/ExtensionLibrary, \
+ -LIBPATH:$(WORKDIR)/LinkTarget/Library)
+
# avoid fatal error LNK1170 for Library_merged
define gb_LinkTarget_MergedResponseFile
cut -f -1000 -d ' ' $${RESPONSEFILE} > $${RESPONSEFILE}.1 && \
@@ -190,18 +197,22 @@ $(call gb_Helper_abbreviate_dirs,\
$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \
$(LIBS) \
$(if $(filter-out StaticLibrary,$(TARGETTYPE)),user32.lib) \
+ $(if $(filter-out StaticLibrary,$(TARGETTYPE)),-manifestfile:$(WORKDIR)/LinkTarget/$(2).manifest) \
+ -pdb:$(WORKDIR)/LinkTarget/$(2).pdb \
$(if $(ILIBTARGET),-out:$(1) -implib:$(ILIBTARGET),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \
- $(if $(ILIBTARGET),; if [ ! -f $(ILIBTARGET) ]; then rm -f $(1) && false; fi) \
- $(if $(filter Library,$(TARGETTYPE)),&& if [ -f $(1).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(1).manifest -outputresource:$(1)\;2 && touch -r $(1) $(1).manifest $(ILIBTARGET); fi) \
- $(if $(filter Executable,$(TARGETTYPE)),&& if [ -f $(1).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(1).manifest -outputresource:$(1)\;1 && touch -r $(1) $(1).manifest; fi) \
+ $(if $(filter Library,$(TARGETTYPE)),; if [ ! -f $(ILIBTARGET) ]; then rm -f $(1); exit 42; fi) \
+ $(if $(filter Library,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest -outputresource:$(1)\;2 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest $(ILIBTARGET); fi) \
+ $(if $(filter Executable,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest -outputresource:$(1)\;1 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest; fi) \
$(if $(filter YES,$(TARGETGUI)),&& if [ -f $(SRCDIR)/solenv/inc/DeclareDPIAware.manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(SRCDIR)/solenv/inc/DeclareDPIAware.manifest -updateresource:$(1)\;1 ; fi) \
$(if $(filter Library,$(TARGETTYPE)),&& \
- echo $(notdir $(1)) > $(1).exports.tmp && \
+ echo $(notdir $(1)) > $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
$(if $(filter YES,$(LIBRARY_X64)),$(LINK_X64_BINARY),$(gb_LINK)) \
- -dump -exports $(ILIBTARGET) >> $(1).exports.tmp && \
- if cmp -s $(1).exports.tmp $(1).exports; \
- then rm $(1).exports.tmp; \
- else mv $(1).exports.tmp $(1).exports; touch -r $(1) $(1).exports; \
+ -dump -exports $(ILIBTARGET) \
+ >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
+ if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
+ then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
+ else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
+ touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
fi) \
; exit $$RC)
endef
@@ -287,22 +298,9 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.exp,$(3)) \
$(call gb_LinkTarget_get_manifestfile,$(2)) \
$(call gb_LinkTarget_get_pdbfile,$(2)) \
-)
-
-$(call gb_Library_add_auxtarget,$(1),$(OUTDIR)/lib/$(notdir $(3)))
-
-# substitute .pyd here because pyuno has to follow python's crazy conventions
-ifneq ($(ENABLE_CRASHDUMP),)
-$(call gb_Library_add_auxtargets,$(1),\
- $(OUTDIR)/bin/$(patsubst %.dll,%.pdb,$(patsubst %.pyd,%.dll,$(call gb_Library_get_filename,$(1)))) \
- $(OUTDIR)/bin/$(patsubst %.dll,%.ilk,$(patsubst %.pyd,%.dll,$(call gb_Library_get_filename,$(1)))) \
-)
-else
-$(call gb_LinkTarget_add_auxtargets,$(2),\
$(call gb_LinkTarget_get_pdbfile2,$(2)) \
$(call gb_LinkTarget_get_ilkfile,$(2)) \
)
-endif
$(call gb_Library_add_default_nativeres,$(1),$(1)/default)
@@ -390,7 +388,7 @@ endef
gb_CppunitTest_DEFS := -D_DLL
# cppunittester.exe is in the cppunit subdirectory of ${OUTDIR}/bin,
# thus it won't find its DLLs unless ${OUTDIR}/bin is added to PATH.
-gb_CppunitTest_CPPTESTPRECOMMAND := $(gb_Helper_set_ld_path)
+gb_CppunitTest_CPPTESTPRECOMMAND := $(gb_Helper_set_ld_path):"$(shell cygpath -w $(gb_Library_DLLDIR))"
gb_CppunitTest_LIBDIR := $(gb_Helper_OUTDIRLIBDIR)
gb_CppunitTest_get_filename = test_$(1).dll
@@ -542,7 +540,7 @@ gb_InstallScript_EXT := .inf
# CliAssemblyTarget class
gb_CliAssemblyTarget_POLICYEXT := $(gb_Library_DLLEXT)
-gb_CliAssemblyTarget_get_dll = $(OUTDIR)/bin/$(1)$(gb_CliAssemblyTarget_POLICYEXT)
+gb_CliAssemblyTarget_get_dll = $(call gb_Library__get_dir_for_layer,URELIB)/$(1)$(gb_CliAssemblyTarget_POLICYEXT)
# Extension class
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 374ded054718..16d7de5f1393 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -303,9 +303,8 @@ gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
# Helper class
gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin
-gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/bin
# need windows path with backslashes here
-gb_Helper_set_ld_path := PATH="$(shell cygpath -w $(OUTDIR)/bin)"
+gb_Helper_set_ld_path := PATH="$(shell cygpath -w $(OUTDIR)/bin);$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(gb_PROGRAMDIRNAME))"
# vim: set noet sw=4:
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index c46e2f869dcf..5d601af0960f 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -153,7 +153,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(LIBS) \
$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
-o $(1) && \
- $(if $(SOVERSIONSCRIPT),ln -sf $(notdir $(1)) $(ILIBTARGET),:) && \
+ $(if $(SOVERSIONSCRIPT),ln -sf $(1) $(ILIBTARGET),:) && \
$(if $(filter Executable,$(TARGETTYPE)), \
$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl app $(LAYER) $(1) &&) \
$(if $(filter Library Bundle CppunitTest,$(TARGETTYPE)),\
@@ -162,12 +162,14 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter Executable,$(TARGETTYPE)), \
(codesign --identifier=$(MACOSX_BUNDLE_IDENTIFIER).$(notdir $(1)) --sign $(MACOSX_CODESIGNING_IDENTITY) --force $(1) || true) &&)) \
$(if $(filter Library,$(TARGETTYPE)),\
- otool -l $(1) | grep -A 5 LC_ID_DYLIB > $(1).exports.tmp && \
+ otool -l $(1) | grep -A 5 LC_ID_DYLIB \
+ > $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
$(NM) -g -P $(1) | cut -d' ' -f1-2 | grep -v U$$ \
- >> $(1).exports.tmp && \
- if cmp -s $(1).exports.tmp $(1).exports; \
- then rm $(1).exports.tmp; \
- else mv $(1).exports.tmp $(1).exports; touch -r $(1) $(1).exports; \
+ >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
+ if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
+ then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
+ else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
+ touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
fi &&) \
:)
endef
@@ -281,7 +283,7 @@ endef
# CppunitTest class
-gb_CppunitTest_CPPTESTPRECOMMAND := $(gb_Helper_set_ld_path)
+gb_CppunitTest_CPPTESTPRECOMMAND := $(gb_Helper_set_ld_path):"$(gb_Library_DLLDIR)"
gb_CppunitTest_LIBDIR := $(gb_Helper_OUTDIRLIBDIR)
gb_CppunitTest_get_filename = libtest_$(1).dylib
gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename)
diff --git a/solenv/gbuild/platform/mingw.mk b/solenv/gbuild/platform/mingw.mk
index 2b767a87338d..8a776fa59abd 100644
--- a/solenv/gbuild/platform/mingw.mk
+++ b/solenv/gbuild/platform/mingw.mk
@@ -111,7 +111,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(LINKED_STATIC_LIBS),-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group) \
$(patsubst lib%.a,-l%,$(patsubst lib%.dll.a,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_ilibfilename,$(lib))))) \
$(LIBS) \
- -Wl$(COMMA)-Map$(COMMA)$(basename $(1)).map \
+ -Wl$(COMMA)-Map$(COMMA)$(WORKDIR)/LinkTarget/$(2).map \
-o $(1)))
endef
@@ -131,7 +131,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(LINKED_STATIC_LIBS),-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group) \
$(patsubst lib%.a,-l%,$(patsubst lib%.dll.a,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_ilibfilename,$(lib))))) \
$(LIBS) \
- -Wl$(COMMA)-Map$(COMMA)$(dir $(1))$(notdir $(basename $(1)).map) \
+ -Wl$(COMMA)-Map$(COMMA)$(WORKDIR)/LinkTarget/$(2).map \
-Wl$(COMMA)--out-implib$(COMMA)$(ILIBTARGET) \
-o $(1) \
$(if $(findstring s,$(MAKEFLAGS)),> /dev/null))
@@ -161,6 +161,8 @@ define gb_LinkTarget_use_system_win32_libs
$(call gb_LinkTarget_add_libs,$(1),$(foreach lib,$(2),-l$(patsubst oldnames,moldname,$(lib))))
endef
+gb_LinkTarget_get_mapfile = \
+$(WORKDIR)/LinkTarget/$(patsubst %.dll,%.map,$(call gb_LinkTarget__get_workdir_linktargetname,$(1)))
# Library class
@@ -228,9 +230,9 @@ $(call gb_LinkTarget_set_ilibtarget,$(2),$(3))
$(call gb_Library_get_target,$(1)) :| $(OUTDIR)/bin/.dir
-$(call gb_Library_add_auxtargets,$(1), \
- $(OUTDIR)/bin/$(notdir $(3)) \
- $(OUTDIR)/bin/$(patsubst %.dll,%.map,$(call gb_Library_get_filename,$(1))) \
+$(call gb_LinkTarget_add_auxtargets,$(2), \
+ $(3) \
+ $(call gb_LinkTarget_get_mapfile,$(2)) \
)
$(call gb_Library_add_default_nativeres,$(1),$(1)/default)
@@ -289,7 +291,7 @@ $(call gb_LinkTarget_set_ilibtarget,$(2),$(3))
$(call gb_LinkTarget_add_auxtargets,$(2),\
$(3) \
- $(patsubst %.dll,%.map,$(call gb_LinkTarget_get_target,$(2))) \
+ $(call gb_LinkTarget_get_mapfile,$(2)) \
)
endef
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 185f92ea5f5b..5ff75ae7c7eb 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -154,7 +154,7 @@ gb_LinkTarget__RPATHS := \
OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
SDKBIN:\dORIGIN/../../ure-link/lib \
OXT: \
- NONE:\dORIGIN/../lib:\dORIGIN \
+ NONE:\dORIGIN/../Library \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
@@ -187,15 +187,16 @@ $(call gb_Helper_abbreviate_dirs,\
$(LIBS) \
$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
-o $(1) \
- $(if $(SOVERSIONSCRIPT),&& ln -sf $(notdir $(1)) $(ILIBTARGET)) \
- $(if $(filter Library,$(TARGETTYPE)),&& \
- readelf -d $(1) | grep SONAME > $(1).exports.tmp ; \
+ $(if $(SOVERSIONSCRIPT),&& ln -sf ../../ure-link/lib/$(notdir $(1)) $(ILIBTARGET)))
+ $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
+ readelf -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
$(NM) --dynamic --extern-only --defined-only --format=posix $(1) \
| cut -d' ' -f1-2 \
- >> $(1).exports.tmp && \
- if cmp -s $(1).exports.tmp $(1).exports; \
- then rm $(1).exports.tmp; \
- else mv $(1).exports.tmp $(1).exports; touch -r $(1) $(1).exports; \
+ >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
+ if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
+ then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
+ else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
+ touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
fi))
endef
@@ -311,7 +312,7 @@ gb_CppunitTest_get_filename = libtest_$(1).so
gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename)
define gb_CppunitTest_CppunitTest_platform
-$(call gb_LinkTarget_get_target,$(2)) : RPATH :=
+$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,NONE))
endef
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 88e70d0e9022..d8a690f16338 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -155,7 +155,7 @@ gb_LinkTarget__RPATHS := \
OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
SDKBIN:\dORIGIN/../../ure-link/lib \
OXT: \
- NONE:\dORIGIN/../lib:\dORIGIN \
+ NONE:\dORIGIN/../Library \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
@@ -189,15 +189,16 @@ $(call gb_Helper_abbreviate_dirs,\
$(LIBS) \
$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
-o $(1) \
- $(if $(SOVERSIONSCRIPT),&& ln -sf $(notdir $(1)) $(ILIBTARGET)) \
- $(if $(filter Library,$(TARGETTYPE)),&& \
- readelf -d $(1) | grep SONAME > $(1).exports.tmp ; \
+ $(if $(SOVERSIONSCRIPT),&& ln -sf ../../ure-link/lib/$(notdir $(1)) $(ILIBTARGET)))
+ $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
+ readelf -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
$(NM) --dynamic --extern-only --defined-only --format=posix $(1) \
| cut -d' ' -f1-2 \
- >> $(1).exports.tmp && \
- if cmp -s $(1).exports.tmp $(1).exports; \
- then rm $(1).exports.tmp; \
- else mv $(1).exports.tmp $(1).exports; touch -r $(1) $(1).exports; \
+ >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
+ if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
+ then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
+ else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
+ touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
fi))
endef
@@ -307,7 +308,7 @@ gb_CppunitTest_get_filename = libtest_$(1).so
gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename)
define gb_CppunitTest_CppunitTest_platform
-$(call gb_LinkTarget_get_target,$(2)) : RPATH :=
+$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,NONE))
endef
diff --git a/testtools/CustomTarget_bridgetest.mk b/testtools/CustomTarget_bridgetest.mk
index f7f3a1aceb2e..d80e6096e6da 100644
--- a/testtools/CustomTarget_bridgetest.mk
+++ b/testtools/CustomTarget_bridgetest.mk
@@ -32,7 +32,7 @@ $(testtools_BRIDGEDIR)/bridgetest_server$(testtools_BATCHSUFFIX) :| $(testtools_
"-s com.sun.star.test.bridge.CppTestObject" \
"-u 'uno:socket$(COMMA)host=127.0.0.1$(COMMA)port=2002;urp;test'" \
"--singleaccept" \
- "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Helper_OUTDIR_FOR_BUILDLIBDIR))" \
+ "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD))" \
"-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services))" \
"-env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb)" \
> $@)
@@ -62,7 +62,7 @@ $(testtools_BRIDGEDIR)/bridgetest_inprocess_java$(testtools_BATCHSUFFIX) :| $(te
"$(gb_Helper_LIBRARY_PATH_VAR)=\$${$(gb_Helper_LIBRARY_PATH_VAR):+\$$$(gb_Helper_LIBRARY_PATH_VAR):}$(OUTDIR)/lib" \
"$(call gb_Executable_get_target_for_build,uno)" \
"-s com.sun.star.test.bridge.BridgeTest" \
- "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Helper_OUTDIR_FOR_BUILDLIBDIR))" \
+ "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD))" \
"-env:URE_INTERNAL_JAVA_DIR=file://$(OUTDIR)/bin" \
"-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services))" \
"-env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb)" \
@@ -77,7 +77,7 @@ $(testtools_BRIDGEDIR)/bridgetest_client$(testtools_BATCHSUFFIX) :| $(testtools_
"$(call gb_Executable_get_target_for_build,uno)" \
"-s com.sun.star.test.bridge.BridgeTest --" \
"-u 'uno:socket$(COMMA)host=127.0.0.1$(COMMA)port=2002;urp;test'" \
- "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Helper_OUTDIR_FOR_BUILDLIBDIR))" \
+ "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD))" \
"-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services))" \
"-env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb)" \
> $@)
diff --git a/testtools/CustomTarget_uno_test.mk b/testtools/CustomTarget_uno_test.mk
index 1c04c9ac8beb..c355d22e87fd 100644
--- a/testtools/CustomTarget_uno_test.mk
+++ b/testtools/CustomTarget_uno_test.mk
@@ -22,7 +22,7 @@ $(call gb_CustomTarget_get_target,testtools/uno_test) : \
$(call gb_Executable_get_command,uno) \
-s com.sun.star.test.bridge.BridgeTest \
-- com.sun.star.test.bridge.CppTestObject \
- -env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Helper_OUTDIR_FOR_BUILDLIBDIR)) \
+ -env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD)) \
-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services)) \
-env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb))