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


On Wednesday 18 of April 2012, Stephan Bergmann wrote:
On 04/17/2012 02:38 PM, Lubos Lunak wrote:
  But maybe gbuild could be changed to include target-specific LDFLAGS?
That way it'd be possible to build as 'make
sc_ucalc_LDFLAGS=-Wl,--strip-all' . Probably even Bjoern's --enable-debug
extension can do.

But how would that help for the problem at hand?

 make gb_CppunitTest_sc_ucalc_LDFLAGS=-Wl,--strip-all

 and even with my change reverted, the unittest lib is still tiny, even if 
libsc.so is a huge lib because of all the debuginfo  (well, relatively 
speaking "tiny" of course, it'd still include the whole lib, but at least 
stripped).

 Does somebody see a problem with this?

-- 
 Lubos Lunak
 l.lunak@suse.cz
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 258fc52..361b02c 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -100,7 +100,7 @@ $(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest__get_linktarg
 endef
 
 define gb_CppunitTest__CppunitTest_impl
-$(call gb_LinkTarget_LinkTarget,$(2))
+$(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1))
 $(call gb_LinkTarget_set_targettype,$(2),CppunitTest)
 $(call gb_LinkTarget_add_defs,$(2),\
        $(gb_CppunitTest_DEFS) \
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index b0ba4c9..51cd690 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -53,7 +53,7 @@ endef
 
 define gb_Executable__Executable_impl
 $(call gb_Executable_set_targettype_gui,$(2))
-$(call gb_LinkTarget_LinkTarget,$(2))
+$(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1))
 $(call gb_LinkTarget_set_targettype,$(2),Executable)
 $(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
        | $(dir $(call gb_Executable_get_target,$(1))).dir
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index a9c1720..f508aa3 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -66,7 +66,7 @@ $(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(1)))
 endef
 
 define gb_Library__Library_impl
-$(call gb_LinkTarget_LinkTarget,$(2))
+$(call gb_LinkTarget_LinkTarget,$(2),Library_$(1))
 $(call gb_LinkTarget_set_targettype,$(2),Library)
 $(call gb_LinkTarget_add_defs,$(2),\
        $(gb_Library_DEFS) \
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index cde46b0..571f2be 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -53,6 +53,9 @@ gb_LinkTarget__get_debugcflags=$(if $(filter $(1),$(foreach lib,$(ENABLE_DEBUG_O
 gb_LinkTarget__get_debugcxxflags=$(if $(filter $(1),$(foreach lib,$(ENABLE_DEBUG_ONLY),$(call 
gb_Library_get_linktargetname,$(lib)))),$(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS))
 endif
 
+# this allows adding LDFLAGS to specific targets (e.g. 'make gb_Library_sm_LDLAGS=-foo')
+gb_LinkTarget__get_specificldflags=$(gb_$(1)_LDFLAGS)
+
 # Overview of dependencies and tasks of LinkTarget
 #
 # target                      task                         depends on
@@ -444,7 +447,7 @@ $(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)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
-$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(LDFLAGS)
+$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(LDFLAGS) $(call 
gb_LinkTarget__get_specificldflags,$(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 :=
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index 3bf411b..1a41040 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -61,7 +61,7 @@ $(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_lin
 endef
 
 define gb_StaticLibrary__StaticLibrary_impl
-$(call gb_LinkTarget_LinkTarget,$(2))
+$(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1))
 $(call gb_LinkTarget_set_targettype,$(2),StaticLibrary)
 $(call gb_LinkTarget_add_defs,$(2),\
        $(gb_StaticLibrary_DEFS) \

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.