[Libreoffice-commits] .: 3 commits - salhelper/Library_salhelper.mk solenv/gbuild
Michael Stahl
mst at kemper.freedesktop.org
Thu Dec 15 13:15:45 PST 2011
salhelper/Library_salhelper.mk | 26 +-------------------------
solenv/gbuild/Deliver.mk | 4 ++--
solenv/gbuild/Library.mk | 14 ++++++++++++++
solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk | 5 ++++-
solenv/gbuild/platform/macosx.mk | 6 ++++--
solenv/gbuild/platform/solaris.mk | 4 +++-
solenv/gbuild/platform/unxgcc.mk | 5 ++++-
7 files changed, 32 insertions(+), 32 deletions(-)
New commits:
commit f3b7bfcef472ed31b341c008793d96ed2bafae4b
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 15 22:11:59 2011 +0100
salhelper: s/hack/gb_Library_set_soversion_script/
diff --git a/salhelper/Library_salhelper.mk b/salhelper/Library_salhelper.mk
index c77d1f0..d98cd22 100644
--- a/salhelper/Library_salhelper.mk
+++ b/salhelper/Library_salhelper.mk
@@ -52,30 +52,6 @@ $(eval $(call gb_Library_add_exception_objects,salhelper,\
# Solaris would need something like this, too. Its backwards compatibility is
# broken for now:
-ifeq ($(OS),LINUX)
-
-$(eval $(call gb_Library_add_ldflags,salhelper, \
- -Wl$(COMMA)--soname=libuno_salhelpergcc3.so.3 \
- -Wl$(COMMA)--version-script=$(SRCDIR)/salhelper/source/gcc3.map \
-))
-
-$(call gb_LinkTarget_get_target,$(call \
-gb_Library_get_linktargetname,salhelper)): $(SRCDIR)/salhelper/source/gcc3.map
-
-endif
-
-# A hack to generate the soname symlink in the solver:
-
-ifneq ($(OS),WNT)
-
-$(call gb_Library_get_target,salhelper): | \
- $(call gb_Library_get_target,salhelper).3
-
-$(call gb_Library_get_target,salhelper).3:
- $(call gb_Helper_abbreviate_dirs,rm -f $@)
- $(call gb_Helper_abbreviate_dirs, \
- ln -s $(notdir $(call gb_Library_get_target,salhelper)) $@)
-
-endif
+$(eval $(call gb_Library_set_soversion_script,salhelper,3,$(SRCDIR)/salhelper/source/gcc3.map))
# vim: set noet sw=4 ts=4:
commit 039cdb19e69b59b95609025c2d23cdb84f5c73c0
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 15 22:09:51 2011 +0100
gbuild: add gb_Library_set_soversion_script:
This allows for setting a SONAME and version script, which is required
for UNO runtime libraries where we want to maintain a stable ABI.
The old build system did apparently not set an SONAME on MacOSX or
Solaris, so don't do that here either.
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 82daae1..d491dd2 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -77,6 +77,20 @@ $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_L
endef
+define gb_Library_set_soversion_script
+$(if $(2),,$(call gb_Output_error,gb_Library_set_soversion_script: no version))
+$(if $(3),,$(call gb_Output_error,gb_Library_set_soversion_script: no script))
+$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : \
+ $(3)
+$(call gb_Library_get_target,$(1)) : SOVERSION := $(2)
+$(call gb_Library_get_target,$(1)) : SOVERSIONSCRIPT := $(3)
+$(call gb_Library_get_target,$(1)) \
+$(call gb_Library_get_clean_target,$(1)) : \
+ AUXTARGETS += $(call gb_Library_get_target,$(1)).$(2)
+$(call gb_LinkTarget_set_auxtargets,$(call gb_Library_get_linktargetname,$(1)),\
+ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).$(2))
+endef
+
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))))
diff --git a/solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk b/solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk
index 17b2715..b9a47da 100644
--- a/solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk
@@ -40,6 +40,8 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(if $(SOVERSION),-Wl$(COMMA)--soname=$(notdir $(1)).$(SOVERSION)) \
+ $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
@@ -50,7 +52,8 @@ mkdir -p $(dir $(1)) && \
-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
$(LIBS) \
$(subst -lpthread,$(PTHREAD_LIBS),$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
- -o $(1))
+ -o $(if $(SOVERSION),$(1).$(SOVERSION),$(1)))
+ $(if $(SOVERSION),ln -sf $(notdir $(1)).$(SOVERSION) $(1))
endef
# vim: set noet sw=4:
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index e061c6d..ea576f3 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -197,6 +197,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \
+ $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)-exported_symbols_list$(COMMA)$(SOVERSIONSCRIPT)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \
@@ -209,13 +210,14 @@ $(call gb_Helper_abbreviate_dirs,\
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
$(LIBS) \
- -o $(1) \
+ -o $(if $(SOVERSION),$(1).$(SOVERSION),$(1)) \
`cat $${DYLIB_FILE}` && \
+ $(if $(SOVERSION),ln -sf $(notdir $(1)).$(SOVERSION) $(1),:) && \
$(if $(filter Executable,$(TARGETTYPE)), \
$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Executable \
$(LAYER) $(1) &&) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),\
- $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Library $(LAYER) $(1) && \
+ $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Library $(LAYER) $(if $(SOVERSION),$(1).$(SOVERSION),$(1)) && \
ln -sf $(1) $(patsubst %.dylib,%.jnilib,$(1)) &&) \
rm -f $${DYLIB_FILE})
endef
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index a51edbf..ed3f164 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -213,6 +213,7 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(if $(SOVERSIONSCRIPT),-M $(SOVERSIONSCRIPT)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
@@ -223,7 +224,8 @@ $(call gb_Helper_abbreviate_dirs,\
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \
$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
$(LIBS) \
- -o $(1))
+ -o $(if $(SOVERSION),$(1).$(SOVERSION),$(1)))
+ $(if $(SOVERSION),ln -sf $(notdir $(1)).$(SOVERSION) $(1))
endef
define gb_LinkTarget__command_staticlink
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 4b80cee..d08deb9 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -216,6 +216,8 @@ $(call gb_Helper_abbreviate_dirs,\
$(gb_CXX) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \
+ $(if $(SOVERSION),-Wl$(COMMA)--soname=$(notdir $(1)).$(SOVERSION)) \
+ $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT))\
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
@@ -227,7 +229,8 @@ $(call gb_Helper_abbreviate_dirs,\
-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
$(LIBS) \
$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))))) \
- -o $(1))
+ -o $(if $(SOVERSION),$(1).$(SOVERSION),$(1)))
+ $(if $(SOVERSION),ln -sf $(notdir $(1)).$(SOVERSION) $(1))
endef
define gb_LinkTarget__command_staticlink
commit 817a7f6b86aa4fd5f3e267dbce7b8fbc96ec5639
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 15 22:04:38 2011 +0100
gbuild: Deliver.mk: preserve symlinks on deliver
The option -P seems to be supported by a lot of ancient cp
implementations, let's hope it actually works.
diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk
index 165d330..1387892 100644
--- a/solenv/gbuild/Deliver.mk
+++ b/solenv/gbuild/Deliver.mk
@@ -56,11 +56,11 @@ endef
ifeq ($(strip $(gb_Deliver_GNUCOPY)),)
define gb_Deliver__deliver
-mkdir -p $(dir $(2)) && $(if $(gb_Deliver_CLEARONDELIVER),rm -f $(2) &&) $(if $(gb_Deliver_HARDLINK),ln,cp -f) $(1) $(2) && touch -r $(1) $(2)
+mkdir -p $(dir $(2)) && $(if $(gb_Deliver_CLEARONDELIVER),rm -f $(2) &&) $(if $(gb_Deliver_HARDLINK),ln,cp -P -f) $(1) $(2) && touch -r $(1) $(2)
endef
else
define gb_Deliver__deliver
-mkdir -p $(dir $(2)) && $(gb_Deliver_GNUCOPY) $(if $(gb_Deliver_CLEARONDELIVER),--remove-destination) $(if $(gb_Deliver_HARDLINK),--link) --force --preserve=timestamps $(1) $(2)
+mkdir -p $(dir $(2)) && $(gb_Deliver_GNUCOPY) $(if $(gb_Deliver_CLEARONDELIVER),--remove-destination) $(if $(gb_Deliver_HARDLINK),--link) --no-dereference --force --preserve=timestamps $(1) $(2)
endef
endif
More information about the Libreoffice-commits
mailing list