From dad60278cfdf79018b85e44bf943c68b76b8eb41 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 11 May 2004 04:51:53 +0000 Subject: [PATCH] ICU-3389 Fix static library names X-SVN-Rev: 15248 --- icu4c/source/config/mh-os400 | 3 ++ icu4c/source/data/Makefile.in | 47 +++++++++++++++------------ icu4c/source/icudefs.mk.in | 4 +-- icu4c/source/stubdata/Makefile.in | 4 +-- icu4c/source/tools/pkgdata/sttcmode.c | 2 +- 5 files changed, 35 insertions(+), 25 deletions(-) diff --git a/icu4c/source/config/mh-os400 b/icu4c/source/config/mh-os400 index 0adbdca5b7..f77cbedb96 100644 --- a/icu4c/source/config/mh-os400 +++ b/icu4c/source/config/mh-os400 @@ -32,6 +32,9 @@ LD_RPATH_PRE= -I ## to the actual data versus the stub data POST_DATA_BUILD = os400-data-rebind +# The stubdata directory is the same directory as the normal data library. +STUBDATA_LIBDIR = $(LIBDIR)/ + ## Versioned target for a shared library. FINAL_SO_TARGET = $(SO_TARGET) MIDDLE_SO_TARGET = diff --git a/icu4c/source/data/Makefile.in b/icu4c/source/data/Makefile.in index e3d622f8b7..2e7e5f7388 100644 --- a/icu4c/source/data/Makefile.in +++ b/icu4c/source/data/Makefile.in @@ -17,7 +17,7 @@ include $(top_builddir)/icudefs.mk subdir = data #lib icu data for link -LIB_ICUDATA_NAME=$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX) +LIB_ICUDATA_NAME=$(LIBPREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) LIB_STATIC_ICUDATA_NAME=$(LIBSICU)$(DATA_STUBNAME)$(ICULIBSUFFIX) # Allow Windows to override these options @@ -28,9 +28,16 @@ ifeq ($(PKGDATA_VERSIONING),) PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION) endif +# This allows all the data to be in one directory +ifeq ($(PKGDATA_MODE),dll) +ICUPKGDATA_OUTDIR = $(LIBDIR) +else +ICUPKGDATA_OUTDIR = $(OUTDIR) +endif + top_builddir_from_tmp = $(patsubst ..%,../..%,$(top_builddir)) CURDIR:=$(CURR_FULL_DIR) -PKGDATA = $(BINDIR)/pkgdata $(PKGDATA_OPTS) -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(OUTDIR) +PKGDATA = $(BINDIR)/pkgdata $(PKGDATA_OPTS) -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) # OBJDATADIR must be a short path (with ..'s) to the data. @@ -105,22 +112,22 @@ check-local: # During this INVOKE we only want to use stubdata. # We don't want to try to write over files that we are using. -PKGDATA_INVOKE:=$(subst :$(top_builddir)/data/out,,$(INVOKE)) $(PKGDATA_INVOKE_OPTS) +PKGDATA_INVOKE:=$(subst $(LIBDIR):$(top_builddir)/stubdata,$(top_builddir)/stubdata:$(LIBDIR),$(INVOKE)) $(PKGDATA_INVOKE_OPTS) packagedata: icupkg.inc $(OUTTMPDIR)/icudata.lst build-local ifneq ($(ENABLE_STATIC),) # Move the shared library out of the way while creating the static library # to prevent name collisions. -ifeq ($(wildcard $(OUTDIR)/$(LIB_ICUDATA_NAME).$(SO)),$(OUTDIR)/$(LIB_ICUDATA_NAME).$(SO)) - mv -f $(OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) $(OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) +ifeq ($(wildcard $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(SO)),$(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(SO)) + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) endif -ifeq ($(wildcard $(OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)),$(OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)) - mv -f $(OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) $(OUTDIR)/$(LIB_ICUDATA_NAME).$(A) +ifeq ($(wildcard $(ICUPKGDATA_OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)),$(ICUPKGDATA_OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)) + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(A) endif - $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) -m static $(OUTTMPDIR)/icudata.lst - mv -f $(OUTDIR)/$(LIB_ICUDATA_NAME).$(A) $(OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) -ifeq ($(wildcard $(OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO)),$(OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO)) - mv -f $(OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) $(OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) + $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) -m static $(OUTTMPDIR)/icudata.lst + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(A) $(ICUPKGDATA_OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) +ifeq ($(wildcard $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO)),$(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO)) + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) endif endif $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst @@ -130,14 +137,14 @@ install-local: $(OUTTMPDIR)/icudata.lst ./icupkg.inc packagedata $(OS390INSTALL) $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR) ifneq ($(ENABLE_STATIC),) # It is done this way just in case the $(SO) == $(A) - mv -f $(OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) $(OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) - mv -f $(OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) $(OUTDIR)/$(LIB_ICUDATA_NAME).$(A) - $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst - mv -f $(OUTDIR)/$(LIB_ICUDATA_NAME).$(A) $(OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) - mv -f $(OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) $(OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) - $(INSTALL-L) $(OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) $(DESTDIR)$(ICUPKGDATA_DIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(A) + $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(A) $(ICUPKGDATA_OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) + mv -f $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)-temp.$(SO) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME).$(SO) + $(INSTALL-L) $(ICUPKGDATA_OUTDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) $(DESTDIR)$(ICUPKGDATA_DIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) endif - $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst -I $(DESTDIR)$(ICUPKGDATA_DIR) + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(OUTTMPDIR)/icudata.lst -I $(DESTDIR)$(ICUPKGDATA_DIR) #### @@ -147,14 +154,14 @@ install390: $(OUTTMPDIR)/icudata390.lst ./icupkg.inc $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(libdir) $(INVOKE) $(PKGDATA) -s $(BUILDDIR) -T $(OUTTMPDIR)/tmp3901 -p $(ICUDATA_NAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(OUTTMPDIR)/icudata390.lst -m dll $(PKGDATA_VERSIONING) -I $(DESTDIR)$(ICUPKGDATA_DIR) ifeq ($(PKGDATA_MODE),dll) - $(INSTALL-L) $(OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX)$(SO_TARGET_VERSION)$(IMPORT_LIB_EXT) $(DESTDIR)$(ICUPKGDATA_DIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX)$(SO_TARGET_VERSION)$(IMPORT_LIB_EXT) + $(INSTALL-L) $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX)$(SO_TARGET_VERSION)$(IMPORT_LIB_EXT) $(DESTDIR)$(ICUPKGDATA_DIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX)$(SO_TARGET_VERSION)$(IMPORT_LIB_EXT) endif #### $(LIB_ICUDATA_NAME)$(BATCH_SUFFIX) is the subset data for batch mode package390: $(OUTTMPDIR)/icudata390.lst $(OUTTMPDIR)/icudata.lst ./icupkg.inc @$(MKINSTALLDIRS) $(BUILDDIR)/tmp3901 $(INVOKE) $(PKGDATA) -s $(BUILDDIR) -T $(OUTTMPDIR)/tmp3901 -p $(ICUDATA_NAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(BUILDDIR)/icudata390.lst -m dll $(PKGDATA_VERSIONING) - cp $(OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) $(top_builddir)/stubdata/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) + cp $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) $(top_builddir)/stubdata/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) ##### Define all the data files. the build rule that depends on them is below. diff --git a/icu4c/source/icudefs.mk.in b/icu4c/source/icudefs.mk.in index 197b1437db..72140278ba 100644 --- a/icu4c/source/icudefs.mk.in +++ b/icu4c/source/icudefs.mk.in @@ -198,7 +198,7 @@ TOOLUTIL_STUBNAME = tu CTESTFW_STUBNAME = test # Link commands to link to ICU libs -LIBICUDT= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) +LIBICUDT= -L$(LIBDIR) -L$(top_builddir)/stubdata -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) LIBICUUC= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) $(LIBICUDT) LIBICUI18N= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) LIBICULE= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) @@ -208,7 +208,7 @@ LIBICUTOOLUTIL= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_S LIBICUIO= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) # Invoke, set library path for all ICU libraries. -INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/data/out:$(LIBDIR):$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) +INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) # Platform-specific setup include @platform_make_fragment@ diff --git a/icu4c/source/stubdata/Makefile.in b/icu4c/source/stubdata/Makefile.in index 0f3bb4c20a..0ef8fe9c1c 100644 --- a/icu4c/source/stubdata/Makefile.in +++ b/icu4c/source/stubdata/Makefile.in @@ -27,11 +27,11 @@ CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB) TARGET_STUBNAME=$(DATA_STUBNAME) ifneq ($(ENABLE_STATIC),) -TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A) +TARGET = $(STUBDATA_LIBDIR)$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A) endif ifneq ($(ENABLE_SHARED),) -SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(STUB_SUFFIX).$(SO) +SO_TARGET = $(STUBDATA_LIBDIR)$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(STUB_SUFFIX).$(SO) ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(BATCH_STUB_TARGET) endif diff --git a/icu4c/source/tools/pkgdata/sttcmode.c b/icu4c/source/tools/pkgdata/sttcmode.c index 83c19e0770..593dfdba86 100644 --- a/icu4c/source/tools/pkgdata/sttcmode.c +++ b/icu4c/source/tools/pkgdata/sttcmode.c @@ -121,7 +121,7 @@ void pkg_mode_static(UPKGOptions *o, FileStream *makefile, UErrorCode *status) } uprv_strcpy(tmp, LIB_STATIC_PREFIX); - uprv_strcat(tmp, o->cShortName); + uprv_strcat(tmp, o->libName); uprv_strcat(tmp, UDATA_LIB_SUFFIX); o->outFiles = pkg_appendToList(o->outFiles, &tail, uprv_strdup(tmp));