ICU-6581 Build without versioned shared object names - fix bug in pkgdata tool for AIX

X-SVN-Rev: 26377
This commit is contained in:
John Emmons 2009-07-17 23:59:37 +00:00
parent 078e401f7b
commit 95d74a66dc
2 changed files with 16 additions and 7 deletions

View file

@ -67,12 +67,17 @@ STATIC_O = o
FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)))
SHARED_OBJECT_NO_VERSION= $(basename $(SO_TARGET)).$(SOBJ)
## Build archive from shared object
%.a : %.so
$(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $<
ln -f $< $(SHARED_OBJECT_NO_VERSION)
$(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
rm -f $(SHARED_OBJECT_NO_VERSION)
$(LIBDIR)/%.a : %.so
$(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $<
ln -f $< $(SHARED_OBJECT_NO_VERSION)
$(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
rm -f $(SHARED_OBJECT_NO_VERSION)
## Build import list from export list
%.e : %.exp

View file

@ -595,11 +595,10 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
if (o->version != 0 && o->rebuild == FALSE) {
/* Check to see if a previous built data library file exists and check if it is the latest. */
sprintf(checkLibFile, "%s%s", targetDir, libFileNames[LIB_FILE_VERSION_TMP]);
sprintf(checkLibFile, "%s%s", targetDir, libFileNames[LIB_FILE_VERSION]);
if (T_FileStream_file_exists(checkLibFile)) {
if (isFileModTimeLater(checkLibFile, o->srcDir, TRUE) && isFileModTimeLater(checkLibFile, o->options)) {
if (o->install != NULL) {
uprv_strcpy(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_TMP]);
result = pkg_installLibrary(o->install, targetDir);
}
return result;
@ -690,7 +689,7 @@ static void createFileNames(const char *version_major, const char *version, cons
sprintf(pkgDataFlags[SO_EXT], "%s.%s",
pkgDataFlags[SO_EXT],
pkgDataFlags[A_EXT]);
#elif defined(OS400)
#elif defined(OS400) || defined(_AIX)
sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s.%s",
libFileNames[LIB_FILE],
pkgDataFlags[SOBJ_EXT]);
@ -707,7 +706,12 @@ static void createFileNames(const char *version_major, const char *version, cons
reverseExt ? version_major : pkgDataFlags[SO_EXT],
reverseExt ? pkgDataFlags[SO_EXT] : version_major);
libFileNames[LIB_FILE_VERSION][0] = 0;
sprintf(libFileNames[LIB_FILE_VERSION], "%s%s%s.%s",
libFileNames[LIB_FILE],
pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "",
reverseExt ? version : pkgDataFlags[SO_EXT],
reverseExt ? pkgDataFlags[SO_EXT] : version);
#ifdef U_CYGWIN
/* Cygwin only deals with the version major number. */
@ -841,7 +845,7 @@ static int32_t pkg_archiveLibrary(const char *targetDir, const char *version, UB
int32_t result = 0;
char cmd[LARGE_BUFFER_MAX_SIZE];
/* If the shard object suffix and the final object suffix is different and the final object suffix and the
/* If the shared object suffix and the final object suffix is different and the final object suffix and the
* archive file suffix is the same, then the final library needs to be archived.
*/
if (uprv_strcmp(pkgDataFlags[SOBJ_EXT], pkgDataFlags[SO_EXT]) != 0 && uprv_strcmp(pkgDataFlags[A_EXT], pkgDataFlags[SO_EXT]) == 0) {