From a35fcf29e13a82aa1cf26edca9df5eb704b0dede Mon Sep 17 00:00:00 2001 From: Yves Arrouye Date: Fri, 15 Sep 2000 05:07:43 +0000 Subject: [PATCH] ICU-208 changes for versioned libraries. X-SVN-Rev: 2434 --- icu4c/source/Makefile.in | 3 ++- icu4c/source/common/Makefile.in | 22 +++++++++++++++------- icu4c/source/config/Makefile.inc.in | 4 +++- icu4c/source/config/mh-aix | 3 +++ icu4c/source/config/mh-aix-va | 3 +++ icu4c/source/config/mh-darwin | 4 ++++ icu4c/source/config/mh-freebsd | 4 ++++ icu4c/source/config/mh-hpux-acc | 4 ++++ icu4c/source/config/mh-hpux-cc | 4 ++++ icu4c/source/config/mh-irix | 6 ++++-- icu4c/source/config/mh-linux | 14 ++++++++++++++ icu4c/source/config/mh-os390 | 4 ++++ icu4c/source/config/mh-os400 | 4 ++++ icu4c/source/config/mh-ptx | 4 ++++ icu4c/source/config/mh-solaris | 4 ++++ icu4c/source/config/mh-solaris-gcc | 18 ++++++++++++++++++ icu4c/source/config/mh-solaris-sparcv9 | 4 ++++ icu4c/source/extra/ustdio/Makefile.in | 21 ++++++++++++++------- icu4c/source/i18n/Makefile.in | 19 +++++++++++++------ icu4c/source/tools/toolutil/Makefile.in | 20 +++++++++++++------- 20 files changed, 138 insertions(+), 31 deletions(-) diff --git a/icu4c/source/Makefile.in b/icu4c/source/Makefile.in index 965a75c79ba..b23304025fc 100644 --- a/icu4c/source/Makefile.in +++ b/icu4c/source/Makefile.in @@ -28,6 +28,7 @@ pkgincludedir = $(includedir)/@PACKAGE@ ## Build directory information top_builddir = . +subdir = . ## Install program information mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -44,7 +45,7 @@ AUTOCONF = @AUTOCONF@ @host_frag@ -## Pacakge information +## Package information PACKAGE = @PACKAGE@ VERSION = @VERSION@ UNICODE_VERSION = @UNICODE_VERSION@ diff --git a/icu4c/source/common/Makefile.in b/icu4c/source/common/Makefile.in index 95e19e99aa2..46ce948aae1 100644 --- a/icu4c/source/common/Makefile.in +++ b/icu4c/source/common/Makefile.in @@ -37,6 +37,8 @@ INSTALL_DATA = @INSTALL_DATA@ CC = @CC@ CXX = @CXX@ PACKAGE = @PACKAGE@ +SO_TARGET_VERSION = @VERSION@ +SO_TARGET_VERSION_MAJOR = @VERSION_MAJOR@ VERSION = @VERSION@ ## Platform-specific setup @@ -50,10 +52,11 @@ subdir = common CLEANFILES = *~ ## Target information -TARGET = $(LIBICU)uc.$(SO) +SO_TARGET = $(LIBICU)uc.$(SO) +ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) DEFS = @DEFS@ -CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir) -DICU_DATA_DIR=\"$(pkgdatadir)/$(VERSION)/\" -DUDATA_SO_SUFFIX=\".$(SO)\" -DU_COMMON_LIBNAME=\"$(TARGET)\" +CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir) -DICU_DATA_DIR=\"$(pkgdatadir)/$(VERSION)/\" -DUDATA_SO_SUFFIX=\".$(SO)\" -DU_COMMON_LIBNAME=\"$(FINAL_SO_TARGET)\" CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ LDFLAGS = @LDFLAGS@ @@ -98,13 +101,18 @@ distclean : distclean-local dist: dist-local check: all check-local -all-local: $(TARGET) +all-local: $(ALL_SO_TARGETS) install-local: install-headers install-library install-library: all-local $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL-S) $(TARGET) $(DESTDIR)$(libdir)/$(TARGET) + $(INSTALL-S) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)/$(FINAL_SO_TARGET) + $(INSTALL-S) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)/$(FINAL_SO_TARGET) +ifneq ($(FINAL_SO_TARGET),$(SO_TARGET)) + cd $(DESTDIR)$(libdir) && $(RM) $(MIDDLE_SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(MIDDLE_SO_TARGET) + cd $(DESTDIR)$(libdir) && $(RM) $(SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(SO_TARGET) +endif install-headers: $(mkinstalldirs) $(DESTDIR)$(includedir)/unicode @@ -117,7 +125,7 @@ dist-local: clean-local: test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) - $(RMV) $(OBJECTS) $(TARGET) + $(RMV) $(OBJECTS) $(ALL_SO_TARGETS) distclean-local: clean-local $(RMV) Makefile $(DEPS) @@ -132,8 +140,8 @@ unicode/platform.h: $(srcdir)/unicode/platform.h.in $(top_builddir)/config.statu cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -$(TARGET) : $(OBJECTS) - $(SHLIB.cc) -o $@ $^ $(LIBS) +$(FINAL_SO_TARGET): $(OBJECTS) + $(SHLIB.cc) $(LD_SONAME) -o $@ $^ $(LIBS) ifeq (,$(MAKECMDGOALS)) -include $(DEPS) diff --git a/icu4c/source/config/Makefile.inc.in b/icu4c/source/config/Makefile.inc.in index af6d46e1a39..ad51113b213 100644 --- a/icu4c/source/config/Makefile.inc.in +++ b/icu4c/source/config/Makefile.inc.in @@ -2,7 +2,7 @@ #****************************************************************************** # Copyright (C) 1999, International Business Machines # Corporation and others. All Rights Reserved. -# $Revision: 1.4 $ +# $Revision: 1.5 $ #****************************************************************************** # This Makefile is designed to be included into projects which make use # of the ICU. @@ -33,6 +33,8 @@ oldincludedir=@oldincludedir@ infodir=@infodir@ mandir=@mandir@ PACKAGE=@PACKAGE@ +VERSION_MAJOR=@VERSION_MAJOR@ +VERSION_MINOR=@VERSION_MINOR@ VERSION=@VERSION@ CC=@CC@ CXX=@CXX@ diff --git a/icu4c/source/config/mh-aix b/icu4c/source/config/mh-aix index c38f5c26321..d0ace8e1b0e 100644 --- a/icu4c/source/config/mh-aix +++ b/icu4c/source/config/mh-aix @@ -26,6 +26,9 @@ SHLIB.cc= makeC++SharedLib_r -p 5000 LD_RPATH= -I LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names diff --git a/icu4c/source/config/mh-aix-va b/icu4c/source/config/mh-aix-va index 710ca6ef212..bf6c6106a31 100644 --- a/icu4c/source/config/mh-aix-va +++ b/icu4c/source/config/mh-aix-va @@ -26,6 +26,9 @@ SHLIB.cc= xlC_r -qmkshrobj LD_RPATH= -I LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names diff --git a/icu4c/source/config/mh-darwin b/icu4c/source/config/mh-darwin index f9d5468acc3..a40ffcf29a5 100644 --- a/icu4c/source/config/mh-darwin +++ b/icu4c/source/config/mh-darwin @@ -24,6 +24,10 @@ SHLIB.cc= $(CXX) -dynamiclib -dynamic $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) LD_RPATH= -L LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-freebsd b/icu4c/source/config/mh-freebsd index 6b60253760f..33d3d5cdcd9 100644 --- a/icu4c/source/config/mh-freebsd +++ b/icu4c/source/config/mh-freebsd @@ -23,6 +23,10 @@ SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared LD_RPATH= LD_RPATH_PRE= -Wl,-rpath, +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-hpux-acc b/icu4c/source/config/mh-hpux-acc index 5149d895c78..a82e3cacfd3 100644 --- a/icu4c/source/config/mh-hpux-acc +++ b/icu4c/source/config/mh-hpux-acc @@ -26,6 +26,10 @@ SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -b LD_RPATH= -Wl,+b, LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-hpux-cc b/icu4c/source/config/mh-hpux-cc index d12b3926cfe..14dc79538cb 100644 --- a/icu4c/source/config/mh-hpux-cc +++ b/icu4c/source/config/mh-hpux-cc @@ -33,6 +33,10 @@ SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -b LD_RPATH= -Wl,+b, LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-irix b/icu4c/source/config/mh-irix index 8245bcfc67c..8ca65789db2 100644 --- a/icu4c/source/config/mh-irix +++ b/icu4c/source/config/mh-irix @@ -27,12 +27,14 @@ LINK.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) SHLIB.c= $(CC) -shared $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) SHLIB.cc= $(CXX) -shared $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) - - ## Compiler switch to embed a runtime search path LD_RPATH= -I LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-linux b/icu4c/source/config/mh-linux index a168d6f2d89..12ed00436c5 100644 --- a/icu4c/source/config/mh-linux +++ b/icu4c/source/config/mh-linux @@ -23,6 +23,13 @@ SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared LD_RPATH= LD_RPATH_PRE= -Wl,-rpath, +## Compiler switch to embed a library name +LD_SONAME = -Wl,-soname -Wl,$(MIDDLE_SO_TARGET) + +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION) +MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR) + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- @@ -64,4 +71,11 @@ LIBUSTDIO= -L$(top_builddir)/extra/ustdio -lustdio | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' +## Versioned libraries rules + +%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) + $(RM) $@ && ln -s $< $@ +%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) + $(RM) $@ && ln -s $*.$(SO).$(SO_TARGET_VERSION) $@ + ## End Linux-specific setup diff --git a/icu4c/source/config/mh-os390 b/icu4c/source/config/mh-os390 index af3d03007c8..3a800e0e59d 100644 --- a/icu4c/source/config/mh-os390 +++ b/icu4c/source/config/mh-os390 @@ -55,6 +55,10 @@ SHLIB.cc= $(LINK.cc) -Wl,dll ## Compiler switch to embed a runtime search path LD_RPATH= -I +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-os400 b/icu4c/source/config/mh-os400 index b5fe911ce98..ac8570fd504 100644 --- a/icu4c/source/config/mh-os400 +++ b/icu4c/source/config/mh-os400 @@ -26,6 +26,10 @@ ARFLAGS = -cuv LD_RPATH= -I LD_RPATH_PRE= -I +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names [Note - no hyphen for 400] LIBICU = libicu diff --git a/icu4c/source/config/mh-ptx b/icu4c/source/config/mh-ptx index 8d6cf7d0be6..5e09d17d9e4 100644 --- a/icu4c/source/config/mh-ptx +++ b/icu4c/source/config/mh-ptx @@ -24,6 +24,10 @@ SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DPTX -G LD_RPATH= -R LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-solaris b/icu4c/source/config/mh-solaris index 1d8caf753b0..1322dd17b92 100644 --- a/icu4c/source/config/mh-solaris +++ b/icu4c/source/config/mh-solaris @@ -25,6 +25,10 @@ SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -G LD_RPATH= -R LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/config/mh-solaris-gcc b/icu4c/source/config/mh-solaris-gcc index abf9231b99e..3b809ca4773 100644 --- a/icu4c/source/config/mh-solaris-gcc +++ b/icu4c/source/config/mh-solaris-gcc @@ -23,6 +23,17 @@ SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -G LD_RPATH= -R LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + +## Compiler switch to embed a library name +LD_SONAME = -h $(MIDDLE_SO_TARGET) + +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION) +MIDDLE_SO_TARGET = $(SO_TARGET) + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- @@ -64,4 +75,11 @@ LIBUSTDIO= -L$(top_builddir)/extra/ustdio -lustdio | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' +## Versioned libraries rules + +%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) + $(RM) $@ && ln -s $< $@ +%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) + $(RM) $@ && ln -s $*.$(SO).$(SO_TARGET_VERSION) $@ + ## End Solaris-specific setup diff --git a/icu4c/source/config/mh-solaris-sparcv9 b/icu4c/source/config/mh-solaris-sparcv9 index d5b71c8be02..b10c25f9556 100644 --- a/icu4c/source/config/mh-solaris-sparcv9 +++ b/icu4c/source/config/mh-solaris-sparcv9 @@ -24,6 +24,10 @@ SHLIB.cc= $(CXX) -xtarget=ultra -xarch=v9 $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFL LD_RPATH= -R LD_RPATH_PRE= +## Versioned target for a shared library. +FINAL_SO_TARGET = $(SO_TARGET) +MIDDLE_SO_TARGET = + ### How ICU libraries are named... ex. $(LIBICU)uc$(SO) ## Prefix for the ICU library names LIBICU = libicu- diff --git a/icu4c/source/extra/ustdio/Makefile.in b/icu4c/source/extra/ustdio/Makefile.in index d0e034d8653..bcdb1d284cf 100644 --- a/icu4c/source/extra/ustdio/Makefile.in +++ b/icu4c/source/extra/ustdio/Makefile.in @@ -38,6 +38,8 @@ CC = @CC@ CXX = @CXX@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +SO_TARGET_VERSION = @VERSION@ +SO_TARGET_VERSION_MAJOR = @VERSION_MAJOR@ ## Platform-specific setup @host_frag@ @@ -50,7 +52,8 @@ subdir = extra/ustdio CLEANFILES = *~ ## Target information -TARGET = libustdio.$(SO) +SO_TARGET = libustdio.$(SO) +ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) DEFS = @DEFS@ CPPFLAGS = @CPPFLAGS@ -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n @@ -82,13 +85,17 @@ distclean : distclean-local dist: dist-local check: all check-local -all-local: $(TARGET) +all-local: $(ALL_SO_TARGETS) install-local: all-local install-headers install-library install-library: all-local - $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL-S) $(TARGET) $(DESTDIR)$(libdir)/$(TARGET) + $(INSTALL-S) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)/$(FINAL_SO_TARGET) + $(INSTALL-S) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)/$(FINAL_SO_TARGET) +ifneq ($(FINAL_SO_TARGET),$(SO_TARGET)) + cd $(DESTDIR)$(libdir) && $(RM) $(MIDDLE_SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(MIDDLE_SO_TARGET) + cd $(DESTDIR)$(libdir) && $(RM) $(SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(SO_TARGET) +endif install-headers: $(mkinstalldirs) $(DESTDIR)$(includedir)/unicode @@ -102,7 +109,7 @@ dist-local: clean-local: test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) - $(RMV) $(OBJECTS) $(TARGET) + $(RMV) $(OBJECTS) $(ALL_SO_TARGETS) distclean-local: clean-local $(RMV) Makefile $(DEPS) @@ -113,8 +120,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -$(TARGET) : $(OBJECTS) - $(SHLIB.c) -o $@ $^ $(LIBS) +$(FINAL_SO_TARGET): $(OBJECTS) + $(SHLIB.c) $(LD_SONAME) -o $@ $^ $(LIBS) ifeq (,$(MAKECMDGOALS)) -include $(DEPS) diff --git a/icu4c/source/i18n/Makefile.in b/icu4c/source/i18n/Makefile.in index 18a0e95e264..45fb7c2d8eb 100644 --- a/icu4c/source/i18n/Makefile.in +++ b/icu4c/source/i18n/Makefile.in @@ -32,6 +32,8 @@ CC = @CC@ CXX = @CXX@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +SO_TARGET_VERSION = @VERSION@ +SO_TARGET_VERSION_MAJOR = @VERSION_MAJOR@ ## Platform-specific setup @host_frag@ @@ -44,7 +46,8 @@ subdir = i18n CLEANFILES = *~ ## Target information -TARGET = $(LIBICU)i18n.$(SO) +SO_TARGET = $(LIBICU)i18n.$(SO) +ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) DEFS = @DEFS@ CPPFLAGS = @CPPFLAGS@ -I$(srcdir) -I$(top_builddir)/common -I$(top_srcdir)/common @@ -85,13 +88,17 @@ distclean : distclean-local dist: dist-local check: all check-local -all-local: $(TARGET) +all-local: $(ALL_SO_TARGETS) install-local: install-headers install-library install-library: all-local $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL-S) $(TARGET) $(DESTDIR)$(libdir)/$(TARGET) + $(INSTALL-S) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)/$(FINAL_SO_TARGET) +ifneq ($(FINAL_SO_TARGET),$(SO_TARGET)) + cd $(DESTDIR)$(libdir) && $(RM) $(MIDDLE_SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(MIDDLE_SO_TARGET) + cd $(DESTDIR)$(libdir) && $(RM) $(SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(SO_TARGET) +endif install-headers: $(mkinstalldirs) $(DESTDIR)$(includedir)/unicode @@ -104,7 +111,7 @@ dist-local: clean-local: test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) - $(RMV) $(OBJECTS) $(TARGET) + $(RMV) $(OBJECTS) $(ALL_SO_TARGETS) distclean-local: clean-local $(RMV) Makefile $(DEPS) @@ -115,8 +122,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -$(TARGET) : $(OBJECTS) - $(SHLIB.cc) -o $@ $^ $(LIBS) +$(FINAL_SO_TARGET): $(OBJECTS) + $(SHLIB.cc) $(LD_SONAME) -o $@ $^ $(LIBS) ifeq (,$(MAKECMDGOALS)) -include $(DEPS) diff --git a/icu4c/source/tools/toolutil/Makefile.in b/icu4c/source/tools/toolutil/Makefile.in index e118c3a87ac..83c37e69037 100644 --- a/icu4c/source/tools/toolutil/Makefile.in +++ b/icu4c/source/tools/toolutil/Makefile.in @@ -32,6 +32,8 @@ CC = @CC@ CXX = @CXX@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +SO_TARGET_VERSION = @VERSION@ +SO_TARGET_VERSION_MAJOR = @VERSION_MAJOR@ ## Platform-specific setup @host_frag@ @@ -44,7 +46,8 @@ subdir = tools/toolutil CLEANFILES = *~ ## Target information -TARGET = $(LIBICU)toolutil.$(SO) +SO_TARGET = $(LIBICU)toolutil.$(SO) +ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) DEFS = @DEFS@ CPPFLAGS = @CPPFLAGS@ -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw @@ -72,20 +75,23 @@ distclean : distclean-local dist: dist-local check: all check-local -all-local: $(TARGET) +all-local: $(ALL_SO_TARGETS) install-local: install-library install-library: all-local $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL-S) $(TARGET) $(DESTDIR)$(libdir)/$(TARGET) - + $(INSTALL-S) $(TARGET_FULLNAME) $(DESTDIR)$(libdir)/$(TARGET_FULLNAME) +ifneq ($(FINAL_SO_TARGET),$(SO_TARGET)) + cd $(DESTDIR)$(libdir) && $(RM) $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR) && ln -s $(SO_TARGET) $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR) + cd $(DESTDIR)$(libdir) && $(RM) $(SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(SO_TARGET) +endif dist-local: clean-local: test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) - $(RMV) $(OBJECTS) $(TARGET) + $(RMV) $(OBJECTS) $(ALL_SO_TARGETS) distclean-local: clean-local $(RMV) Makefile $(DEPS) @@ -96,8 +102,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -$(TARGET) : $(OBJECTS) - $(SHLIB.cc) -o $@ $^ $(LIBS) +$(FINAL_SO_TARGET): $(OBJECTS) + $(SHLIB.cc) $(LD_SONAME) -o $@ $^ $(LIBS) ifeq (,$(MAKECMDGOALS)) -include $(DEPS)