ICU-9022 fix build for data on zOS

X-SVN-Rev: 31615
This commit is contained in:
Dragan Besevic 2012-03-13 20:18:59 +00:00
parent 98931e7986
commit 6bde113710
3 changed files with 45 additions and 5 deletions

View File

@ -1,5 +1,5 @@
## Makefile.in for ICU data
## Copyright (c) 1999-2011, International Business Machines Corporation and
## Copyright (c) 1999-2012, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
@ -45,6 +45,7 @@ ifeq ($(CURDIR),)
CURDIR=.
endif
PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR)
OS390_PDS_NAME = -z -L $(BATCH_STUB_TARGET)
ifeq ($(OS390_STUBDATA),1)
OS390PKG=package390
@ -175,6 +176,9 @@ endif
endif
ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
$(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(PKGDATA_LIST)
ifeq ($(OS390BATCH),1)
$(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(OS390_PDS_NAME) $(PKGDATA_LIST)
endif
else
$(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR)
endif

View File

@ -105,7 +105,8 @@ enum {
FORCE_PREFIX,
LIBNAME,
QUIET,
WITHOUT_ASSEMBLY
WITHOUT_ASSEMBLY,
PDS_BUILD
};
/* This sets the modes that are available */
@ -146,7 +147,8 @@ static UOption options[]={
/*17*/ UOPTION_DEF( "force-prefix", 'f', UOPT_NO_ARG),
/*18*/ UOPTION_DEF( "libname", 'L', UOPT_REQUIRES_ARG),
/*19*/ UOPTION_DEF( "quiet", 'q', UOPT_NO_ARG),
/*20*/ UOPTION_DEF( "without-assembly", 'w', UOPT_NO_ARG)
/*20*/ UOPTION_DEF( "without-assembly", 'w', UOPT_NO_ARG),
/*21*/ UOPTION_DEF( "zos-pds-build", 'z', UOPT_NO_ARG)
};
/* This enum and the following char array should be kept in sync. */
@ -369,6 +371,12 @@ main(int argc, char* argv[]) {
o.quiet = FALSE;
}
if(options[PDS_BUILD].doesOccur) {
o.pdsbuild = TRUE;
} else {
o.pdsbuild = FALSE;
}
o.verbose = options[VERBOSE].doesOccur;
@ -742,7 +750,13 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
#if U_PLATFORM != U_PF_OS400
if (!noVersion) {
/* Create symbolic links for the final library file. */
#if U_PLATFORM == U_PF_OS390
if (!o->pdsbuild) {
result = pkg_createSymLinks(targetDir, noVersion);
}
#else
result = pkg_createSymLinks(targetDir, noVersion);
#endif
if (result != 0) {
fprintf(stderr, "Error creating symbolic links of the data library file.\n");
return result;
@ -864,6 +878,19 @@ static void createFileNames(UPKGOptions *o, const char mode, const char *version
sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s.%s",
libFileNames[LIB_FILE],
pkgDataFlags[SOBJ_EXT]);
#elif U_PLATFROM == U_PF_OS390
if (o->pdsbuild) {
sprintf(libFileNames[LIB_FILE], "%s",
libName);
sprintf(libFileNames[LIB_FILE_VERSION_TMP], "\"%s\"",
libFileNames[LIB_FILE]);
} else {
sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s%s%s.%s",
libFileNames[LIB_FILE],
pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "",
reverseExt ? version : pkgDataFlags[SOBJ_EXT],
reverseExt ? pkgDataFlags[SOBJ_EXT] : version);
}
#else
if (noVersion && !reverseExt) {
sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s%s%s",
@ -1518,7 +1545,15 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD
if (result == 0) {
/* Generate the library file. */
result = pkg_generateLibraryFile(targetDir, mode, buffer, cmd);
#if U_PLATFORM == U_PF_OS390
if (o->pdsbuild && mode == MODE_DLL) {
result = pkg_generateLibraryFile("",mode, buffer, cmd);
} else {
result = pkg_generateLibraryFile(targetDir,mode, buffer, cmd);
}
#else
result = pkg_generateLibraryFile(targetDir,mode, buffer, cmd);
#endif
}
uprv_free(buffer);

View File

@ -1,6 +1,6 @@
/**************************************************************************
*
* Copyright (C) 2000-2011, International Business Machines
* Copyright (C) 2000-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
***************************************************************************
@ -126,6 +126,7 @@ typedef struct UPKGOptions_
UBool verbose;
UBool quiet;
UBool withoutAssembly;
UBool pdsbuild; /* for building PDS in z/OS */
} UPKGOptions;
char * convertToNativePathSeparators(char *path);