diff --git a/.gitattributes b/.gitattributes index 6cb776480f81..4525d093ca85 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,74 +9,76 @@ # The only difference between the two is that git will do EOL conversion for text files. # "!eol" is the equivalent of "svneol=native". -*.bat text !eol -*.c text !eol diff=cpp -*.cc text !eol diff=cpp -*.classpath text !eol +*.bat text !eol zos-working-tree-encoding=IBM-1047 +*.c text !eol zos-working-tree-encoding=UTF-8 diff=cpp +*.cc text !eol zos-working-tree-encoding=UTF-8 diff=cpp +*.classpath text !eol zos-working-tree-encoding=IBM-1047 *.cmd text eol=crlf -*.cpp text !eol diff=cpp -*.css text !eol diff=css -*.dsp text !eol -*.dsw text !eol -*.dtd text !eol -*.el text !eol -*.filters text !eol -*.h text !eol diff=cpp -*.htm text !eol diff=html -*.html text !eol diff=html -*.in text !eol -*.java text !eol diff=java -*.launch text !eol -*.m4 text !eol -*.mak text !eol -*.md text !eol -*.MF text !eol -*.mk text !eol -*.pl text !eol diff=perl -*.pm text !eol diff=perl -*.project text !eol -*.properties text !eol -*.props text !eol -*.py text !eol diff=python -*.rc text !eol +*.cpp text !eol zos-working-tree-encoding=UTF-8 diff=cpp +*.css text !eol zos-working-tree-encoding=IBM-1047 diff=css +*.dsp text !eol zos-working-tree-encoding=IBM-1047 +*.dsw text !eol zos-working-tree-encoding=IBM-1047 +*.dtd text !eol zos-working-tree-encoding=IBM-1047 +*.el text !eol zos-working-tree-encoding=IBM-1047 +*.filters text !eol zos-working-tree-encoding=IBM-1047 +*.h text !eol zos-working-tree-encoding=UTF-8 diff=cpp +*.htm text !eol zos-working-tree-encoding=UTF-8 diff=html +*.html text !eol zos-working-tree-encoding=UTF-8 diff=html +*.in text !eol zos-working-tree-encoding=IBM-1047 +*.java text !eol zos-working-tree-encoding=UTF-8 diff=java +*.launch text !eol zos-working-tree-encoding=IBM-1047 +*.m4 text !eol zos-working-tree-encoding=IBM-1047 +*.mak text !eol zos-working-tree-encoding=IBM-1047 +*.md text !eol zos-working-tree-encoding=UTF-8 +*.MF text !eol zos-working-tree-encoding=IBM-1047 +*.mk text !eol zos-working-tree-encoding=IBM-1047 +*.pl text !eol zos-working-tree-encoding=UTF-8 diff=perl +*.pm text !eol zos-working-tree-encoding=IBM-1047 diff=perl +*.project text !eol zos-working-tree-encoding=IBM-1047 +*.properties text !eol zos-working-tree-encoding=UTF-8 +*.props text !eol zos-working-tree-encoding=IBM-1047 +*.py text !eol zos-working-tree-encoding=UTF-8 diff=python +*.rc text !eol zos-working-tree-encoding=IBM-1047 *.sh text eol=lf *.sed text eol=lf -*.sln text !eol -*.stub text !eol -*.targets text !eol -*.txt text !eol -*.ucm text !eol -*.vcproj text !eol -*.vcxproj text !eol -*.xml text !eol -*.xsl text !eol -*.xslt text !eol -AUTHORS text !eol -BUILD text !eol -COPYING text !eol -Changelog text !eol -LICENSE text !eol -Makefile text !eol -README text !eol -SConscript text !eol -SConstruct text !eol -configure text !eol +*.sln text !eol zos-working-tree-encoding=UTF-8 +*.stub text !eol zos-working-tree-encoding=IBM-1047 +*.targets text !eol zos-working-tree-encoding=UTF-8 +*.txt text !eol zos-working-tree-encoding=UTF-8 +*.ucm text !eol zos-working-tree-encoding=IBM-1047 +*.vcproj text !eol zos-working-tree-encoding=UTF-8 +*.vcproj.filters text !eol zos-working-tree-encoding=UTF-8 +*.vcxproj text !eol zos-working-tree-encoding=UTF-8 +*.vcxproj.filters text !eol zos-working-tree-encoding=UTF-8 +*.xml text !eol zos-working-tree-encoding=UTF-8 +*.xsl text !eol zos-working-tree-encoding=IBM-1047 +*.xslt text !eol zos-working-tree-encoding=IBM-1047 +AUTHORS text !eol zos-working-tree-encoding=IBM-1047 +BUILD text !eol zos-working-tree-encoding=IBM-1047 +COPYING text !eol zos-working-tree-encoding=IBM-1047 +Changelog text !eol zos-working-tree-encoding=IBM-1047 +LICENSE text !eol zos-working-tree-encoding=IBM-1047 +Makefile text !eol zos-working-tree-encoding=IBM-1047 +README text !eol zos-working-tree-encoding=UTF-8 +SConscript text !eol zos-working-tree-encoding=IBM-1047 +SConstruct text !eol zos-working-tree-encoding=IBM-1047 +config* text !eol zos-working-tree-encoding=IBM-1047 # Explicitly set the following file types as binary files. -*.bin -text -*.brk -text -*.cnv -text -*.icu -text -*.res -text -*.nrm -text -*.spp -text -*.tri2 -text -*.otf -text -*.utf16be -text +*.bin -text zos-working-tree-encoding=UTF-8 +*.brk -text zos-working-tree-encoding=UTF-8 +*.cnv -text zos-working-tree-encoding=UTF-8 +*.icu -text zos-working-tree-encoding=UTF-8 +*.res -text zos-working-tree-encoding=UTF-8 +*.nrm -text zos-working-tree-encoding=UTF-8 +*.spp -text zos-working-tree-encoding=UTF-8 +*.tri2 -text zos-working-tree-encoding=UTF-8 +*.otf -text zos-working-tree-encoding=UTF-8 +*.utf16be -text zos-working-tree-encoding=UTF-8 # The following file types are stored in Git-LFS. # Only .jars -*.jar filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text zos-working-tree-encoding=UTF-8 # Enable syntax highlighting on GitHub.com .cpyskip.txt linguist-language=Ignore-List @@ -84,3 +86,44 @@ configure text !eol # Use JSONC for syntax highlighting on GitHub.com *.json linguist-language=jsonc +#Files below should be IBM-1047 on mainframe, while other txt shall stay UTF-8 +icu4c/source/runConfigureICU zos-working-tree-encoding=IBM-1047 +icu4c/source/install-sh zos-working-tree-encoding=IBM-1047 +icu4c/source/mkinstalldirs zos-working-tree-encoding=IBM-1047 +sources.txt zos-working-tree-encoding=IBM-1047 +*.sub zos-working-tree-encoding=IBM-1047 +icu4c/source/data/mappings/convrtrs.txt zos-working-tree-encoding=IBM-1047 +icu4c/source/data/sprep/*.txt text !eol zos-working-tree-encoding=IBM-1047 +icu4c/source/data/unidata/NormalizationCorrections.txt text !eol zos-working-tree-encoding=IBM-1047 +icu4c/source/data/zone/tzdbNames.txt text !eol zos-working-tree-encoding=IBM-1047 +icu4c/source/test/testdata/*.txt text !eol zos-working-tree-encoding=IBM-1047 +icu4c/source/test/testdata/filters/*.txt text !eol zos-working-tree-encoding=IBM-1047 +icu4c/source/test/testdata/*.ucm text !eol zos-working-tree-encoding=IBM-1047 + +#simpler to say who should stay UTF-8 from test data +icu4c/source/data/misc/*.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/cintltst/usrchdat.inc text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/Burmese_graphclust_model5_heavy.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/Burmese_graphclust_model5_heavy_Test.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/ConverterSelectorTestUTF8.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/IdnaTestV2.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/NumberFormatTestCases.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/Thai_codepoints_exclusive_model5_heavy.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/Thai_codepoints_exclusive_model5_heavy_Test.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/Thai_graphclust_model4_heavy.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/Thai_graphclust_model4_heavy_Test.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/casing.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/collationtest.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/dcfmtest.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/emoji-test.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/format.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/idna_conf.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/metaZones.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/numberformattestspecification.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/numberpermutationtest.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/rbbitst.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/regextst.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/riwords.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/te_IN.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/timezoneTypes.txt text !eol zos-working-tree-encoding=UTF-8 +icu4c/source/test/testdata/windowsZones.txt text !eol zos-working-tree-encoding=UTF-8 \ No newline at end of file diff --git a/docs/userguide/icu4c/build.md b/docs/userguide/icu4c/build.md index f2f6db71f3f8..3bea6ee4e920 100644 --- a/docs/userguide/icu4c/build.md +++ b/docs/userguide/icu4c/build.md @@ -368,55 +368,54 @@ Some platforms use package management tools to control the installation and unin ## How To Build And Install On z/OS (OS/390) -You can install ICU on z/OS or OS/390 (the previous name of z/OS), but IBM tests only the z/OS installation. You install ICU in a z/OS UNIX system services file system such as HFS or zFS. On this platform, it is important that you understand a few details: +You can install ICU on z/OS or OS/390 (the previous name of z/OS), but IBM tests only the z/OS installation. You install ICU in a z/OS UNIX System Services (z/OS UNIX) file system such as HFS or zFS. On this platform, it is important that you understand a few details: * The makedep and GNU make tools are required for building ICU. If it is not already installed on your system, it is available at the [z/OS UNIX - Tools and Toys](http://www-03.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html) site. The PATH environment variable should be updated to contain the location of this executable prior to build. Failure to add these tools to your PATH will cause ICU build failures or cause pkgdata to fail to run. -* Since USS does not support using the mmap() function over NFS, it is recommended that you build ICU on a local filesystem. Once ICU has been built, you should not have this problem while using ICU when the data library has been built as a shared library, which is this is the default setting. -* Encoding considerations: The source code assumes that it is compiled with codepage ibm-1047 (to be exact, the UNIX System Services variant of it). The pax command converts all of the source code files from ASCII to codepage ibm-1047 (USS) EBCDIC. However, some files are binary files and must not be converted, or must be converted back to their original state. You can use the [unpax-icu.sh](https://github.com/unicode-org/icu/blob/main/icu4c/as_is/os390/unpax-icu.sh) script to do this for you automatically. It will unpackage the tar file and convert all the necessary files for you automatically. -* z/OS supports both native S/390 hexadecimal floating point and (with OS/390 2.6 and later) IEEE 754 binary floating point. This is a compile time option. Applications built with IEEE should use ICU DLLs that are built with IEEE (and vice versa). The environment variable IEEE390=0 will cause the z/OS version of ICU to be built without IEEE floating point support and use the native hexadecimal floating point. By default ICU is built with IEEE 754 support. Native floating point support is sufficient for codepage conversion, resource bundle and UnicodeString operations, but the Format APIs require IEEE binary floating point. -* z/OS introduced the concept of Extra Performance Linkage (XPLINK) to bring performance improvement opportunities to call-intensive C and C++ applications such as ICU. XPLINK is enabled on a DLL-by-DLL basis, so if you are considering using XPLINK in your application that uses ICU, you should consider building the XPLINK-enabled version of ICU. You need to set ICU's environment variable `OS390_XPLINK=1` prior to invoking the make process to produce binaries that are enabled for XPLINK. The XPLINK option, which is available for z/OS 1.2 and later, requires the PTF PQ69418 to build XPLINK enabled binaries. -* ICU requires XPLINK for the icuio library. If you want to use the rest of ICU without XPLINK, then you must use the --disable-icuio configure option. -* The latest versions of z/OS use [XPLINK version (C128) of the C++ standard library](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind6.htm) by default. You may see [an error](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind5.htm) when running with XPLINK disabled. To avoid this error, set the following environment variable or similar: +* Since z/OS UNIX does not support using the mmap() function over NFS, it is recommended that you build ICU on a local filesystem. Once ICU has been built, you should not have this problem while using ICU when the data library has been built as a shared library, which is this is the default setting. +* Encoding considerations: The source code assumes that it is compiled with codepage ibm-1047 (to be exact, the z/OS UNIX variant of it). The pax command converts all of the source code files from ASCII to codepage ibm-1047 (z/OS UNIX) EBCDIC. However, some files are binary files and must not be converted, or must be converted back to their original state. You can use the [unpax-icu.sh](https://github.com/unicode-org/icu/blob/main/icu4c/as_is/os390/unpax-icu.sh) script to do this for you automatically. It will unpackage the tar file and convert all the necessary files for you automatically. +* z/OS supports both native S/390 hexadecimal floating point and (with OS/390 2.6 and later) IEEE 754 binary floating point. This is a compile time option. Applications built with IEEE should use ICU DLLs that are built with IEEE (and vice versa). The environment variable ICU_IS_NOT_IEEE754=1 will disable IEEE floating point support on z/OS and use the native hexadecimal floating point. By default, ICU is built with IEEE 754 support. Native hexadecimal floating point support is sufficient for codepage conversion, resource bundle and UnicodeString operations, but the Format APIs require IEEE binary floating point. +* Use IBM Open XL C/C++ 2.1 for z/OS (or later) for z/OS build of ICU library. IBM XL C/C++ for z/OS does not support C++17 and can only build up to ICU v58. Target architecture can be controlled with TARGET_ICU_ARCH enviromental variable, default is arch10. -``` -export _CXX_PSYSIX="CEE.SCEELIB(C128N)":"CBC.SCLBSID(IOSTREAM,COMPLEX)" -``` - -* When building ICU data, the heap size may need to be increased with the following environment variable: +When building ICU data, you might need to set the following environment variables: ``` -export _CEE_RUNOPTS="HEAPPOOLS(ON),HEAP(4M,1M,ANY,FREE,0K,4080)" +export _ENCODE_FILE_NEW=IBM-1047 +export _ENCODE_FILE_EXISTING=IBM-1047 +export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)" +export _BPXK_AUTOCVT=ON +export _TAG_REDIR_ERR=txt +export _TAG_REDIR_IN=txt +export _TAG_REDIR_OUT=txt ``` -* The rest of the instructions for building and testing ICU on z/OS with UNIX System Services are the same as the [How To Build And Install On UNIX](#how-to-build-and-install-on-unix) section. - -### z/OS (Batch/PDS) support outside the UNIX system services environment +The rest of the instructions for building and testing ICU on z/OS UNIX are the same as the [How To Build And Install On UNIX](#how-to-build-and-install-on-unix) section. -By default, ICU builds its libraries into the UNIX file system (HFS). In addition, there is a z/OS specific environment variable (OS390BATCH) to build some libraries into the z/OS native file system. This is useful, for example, when your application is externalized via Job Control Language (JCL). +### z/OS (Batch/PDS) support outside the z/OS UNIX environment -The OS390BATCH environment variable enables non-UNIX support including the batch environment. When OS390BATCH is set, the libicui18n_XX_.dll, libicuuc_XX_.dll, and libicudt_XX_e.dll binaries are built into data sets (the native file system). Turning on OS390BATCH does not turn off the normal z/OS UNIX build. This means that the z/OS UNIX (HFS) DLLs will always be created. +ICU on z/OS builds its libraries into the z/OS UNIX file system (HFS). In addition, some libraries are built with batch-ready names. The default batch-ready ICU naming convention is LICU as prefix, 2 characters for version of ICU library, and 2 characters for specific ICU library name (see examples below). Use the following environmental variables to control z/OS batch-ready build of ICU: -Two additional environment variables indicate the names of the z/OS data sets to use. The LOADMOD environment variable identifies the name of the data set that contains the dynamic link libraries (DLLs) and the LOADEXP environment variable identifies the name of the data set that contains the side decks, which are normally the files with the .x suffix in the UNIX file system. +* ICU_PDS_NAME_PREFIX sets the library name prefix. +* ICU_PDS_NAME_SUFFIX sets the library name suffix. If not set, the suffix is empty by default. +* ICU_PDS_NAME overrides ICU_PDS_NAME_PREFIX and two-character ICU library version. The two-character code for the specific ICU library will be appended. +* ICU_PLUGINS_DD indicates the ICU plug-ins location. A value of 1 forces the ICU to load plug-ins from //DD:ICUPLUG. ICU_PLUGINS_DD is not set by default, which means the ICU reads plug-ins from an HFS directory. -A data set is roughly equivalent to a UNIX or Windows file. For most kinds of data sets the operating system maintains record boundaries. UNIX and Windows files are byte streams. Two kinds of data sets are PDS and PDSE. Each data set of these two types contains a directory. It is like a UNIX directory. Each "file" is called a "member". Each member name is limited to eight bytes, normally EBCDIC. - -Here is an example of some environment variables that you can set prior to building ICU: +Detailed schema of batch-ready naming: ``` -OS390BATCH=1 -LOADMOD=_USER_.ICU.LOAD -LOADEXP=_USER_.ICU.EXP +{ICU_PDS_NAME_PREFIX}{two-character ICU library version}{two-character ICU library code}{ICU_PDS_NAME_SUFFIX} +{ ICU_PDS_NAME } ``` -The PDS member names for the DLL file names are as follows: +Default batch-ready library subset names mapped to original UNIX names: ``` -IXMI_XX_IN --> libicui18n_XX_.dll -IXMI_XX_UC --> libicuuc_XX_.dll -IXMI_XX_DA --> libicudt_XX_e.dll +LICU76DA - libicudata.so +LICU76IN - libicui18n.so +LICU76IO - libicuio.so +LICU76UC - libicuuc.so ``` -You should point the LOADMOD environment variable at a partitioned data set extended (PDSE) and point the LOADEXP environment variable at a partitioned data set (PDS). The PDSE can be allocated with the following attributes: +To use ICU from batch, copy the ICU libraries to a PDSE data set with the following attributes: ``` Data Set Name . . . : USER.ICU.LOAD @@ -434,24 +433,6 @@ Secondary cylinders : 5 Data set name type : LIBRARY ``` -The PDS can be allocated with the following attributes: - -``` -Data Set Name . . . : USER.ICU.EXP -Management class. . : **None** -Storage class . . . : BASE -Volume serial . . . : TSO007 -Device type . . . . : 3390 -Data class. . . . . : **None** -Organization . . . : PO -Record format . . . : FB -Record length . . . : 80 -Block size . . . . : 3200 -1st extent cylinders: 3 -Secondary cylinders : 3 -Data set name type : PDS -``` - ## How To Build And Install On The IBM i Family (IBM i, i5/OS OS/400) Before you start building ICU, ICU requires the following: diff --git a/icu4c/source/common/Makefile.in b/icu4c/source/common/Makefile.in index 67bcf00349fa..c487ea48ceb9 100644 --- a/icu4c/source/common/Makefile.in +++ b/icu4c/source/common/Makefile.in @@ -44,10 +44,10 @@ ifeq ($(ENABLE_SO_VERSION_DATA),1) SO_VERSION_DATA = common.res endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) BATCH_TARGET = $(BATCH_COMMON_TARGET) BATCH_LIBS = $(BATCH_LIBICUDT) -lm -endif # OS390BATCH +endif endif # ENABLE_SHARED @@ -58,10 +58,6 @@ DYNAMICCFLAGS = $(SHAREDLIBCFLAGS) DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS) CFLAGS += $(LIBCFLAGS) CXXFLAGS += $(LIBCXXFLAGS) -ifeq ($(OS390BATCH),1) -CFLAGS += -WI -CXXFLAGS += -WI -endif CPPFLAGS += -I$(srcdir) $(LIBCPPFLAGS) $(CPPFLAGSICUUC) # we want DEFS here @@ -191,10 +187,10 @@ ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),) endif endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) $(BATCH_TARGET):$(OBJECTS) - $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS) -endif # OS390BATCH + $(SHLIB.cc) $(LD_SONAME) -Wl,-x$@.x $(OUTOPT)$@ $^ $(BATCH_LIBS) +endif endif # ENABLE_SHARED ifeq (,$(MAKECMDGOALS)) diff --git a/icu4c/source/common/icuplug.cpp b/icu4c/source/common/icuplug.cpp index 7aa70a506b08..521a125e43d8 100644 --- a/icu4c/source/common/icuplug.cpp +++ b/icu4c/source/common/icuplug.cpp @@ -747,7 +747,7 @@ uplug_init(UErrorCode *status) { FILE *f; CharString pluginFile; -#ifdef OS390BATCH +#ifdef ICU_PLUGINS_DD /* There are potentially a lot of ways to implement a plugin directory on OS390/zOS */ /* Keeping in mind that unauthorized file access is logged, monitored, and enforced */ /* I've chosen to open a DDNAME if BATCH and leave it alone for (presumably) UNIX */ diff --git a/icu4c/source/common/udata.cpp b/icu4c/source/common/udata.cpp index cdd37f6a03f9..68b62272901b 100644 --- a/icu4c/source/common/udata.cpp +++ b/icu4c/source/common/udata.cpp @@ -777,17 +777,6 @@ openCommonData(const char *path, /* Path from OpenChoice? */ return nullptr; } -#if defined(OS390_STUBDATA) && defined(OS390BATCH) - if (!UDataMemory_isLoaded(&tData)) { - char ourPathBuffer[1024]; - /* One more chance, for extendCommonData() */ - uprv_strncpy(ourPathBuffer, path, 1019); - ourPathBuffer[1019]=0; - uprv_strcat(ourPathBuffer, ".dat"); - uprv_mapFile(&tData, ourPathBuffer, pErrorCode); - } -#endif - if (U_FAILURE(*pErrorCode)) { return nullptr; } diff --git a/icu4c/source/common/uinvchar.cpp b/icu4c/source/common/uinvchar.cpp index 096a8e28d117..2ffef7b58037 100644 --- a/icu4c/source/common/uinvchar.cpp +++ b/icu4c/source/common/uinvchar.cpp @@ -446,7 +446,7 @@ uprv_copyEbcdic(const UDataSwapper *ds, return length; } -U_CFUNC UBool +U_CAPI UBool uprv_isEbcdicAtSign(char c) { static const uint8_t ebcdicAtSigns[] = { 0x7C, 0x44, 0x66, 0x80, 0xAC, 0xAE, 0xAF, 0xB5, 0xEC, 0xEF, 0x00 }; diff --git a/icu4c/source/common/uinvchar.h b/icu4c/source/common/uinvchar.h index 9b7a9bd11417..3e031ccc5a65 100644 --- a/icu4c/source/common/uinvchar.h +++ b/icu4c/source/common/uinvchar.h @@ -120,7 +120,7 @@ U_NAMESPACE_END * EBCDIC machine won't be compiled the same way on other EBCDIC based machines. * @internal */ -U_CFUNC UBool +U_CAPI UBool uprv_isEbcdicAtSign(char c); /** diff --git a/icu4c/source/common/umapfile.cpp b/icu4c/source/common/umapfile.cpp index 8dddf0e78dcc..b58ac37f4d45 100644 --- a/icu4c/source/common/umapfile.cpp +++ b/icu4c/source/common/umapfile.cpp @@ -63,7 +63,7 @@ typedef HANDLE MemoryMap; # define IS_MAP(map) ((map)!=nullptr) -#elif MAP_IMPLEMENTATION==MAP_POSIX || MAP_IMPLEMENTATION==MAP_390DLL +#elif MAP_IMPLEMENTATION==MAP_POSIX typedef size_t MemoryMap; # define IS_MAP(map) ((map)!=0) @@ -76,18 +76,6 @@ typedef HANDLE MemoryMap; # ifndef MAP_FAILED # define MAP_FAILED ((void*)-1) # endif - -# if MAP_IMPLEMENTATION==MAP_390DLL - /* No memory mapping for 390 batch mode. Fake it using dll loading. */ -# include -# include "cstring.h" -# include "cmemory.h" -# include "unicode/udata.h" -# define LIB_PREFIX "lib" -# define LIB_SUFFIX ".dll" - /* This is inconvenient until we figure out what to do with U_ICUDATA_NAME in utypes.h */ -# define U_ICUDATA_ENTRY_NAME "icudt" U_ICU_VERSION_SHORT U_LIB_SUFFIX_C_NAME_STRING "_dat" -# endif #elif MAP_IMPLEMENTATION==MAP_STDIO # include # include "cmemory.h" @@ -339,192 +327,6 @@ typedef HANDLE MemoryMap; pData->pHeader = nullptr; } } - - -#elif MAP_IMPLEMENTATION==MAP_390DLL - /* 390 specific Library Loading. - * This is the only platform left that dynamically loads an ICU Data Library. - * All other platforms use .data files when dynamic loading is required, but - * this turn out to be awkward to support in 390 batch mode. - * - * The idea here is to hide the fact that 390 is using dll loading from the - * rest of ICU, and make it look like there is file loading happening. - * - */ - - static char *strcpy_returnEnd(char *dest, const char *src) - { - while((*dest=*src)!=0) { - ++dest; - ++src; - } - return dest; - } - - /*------------------------------------------------------------------------------ - * - * computeDirPath given a user-supplied path of an item to be opened, - * compute and return - * - the full directory path to be used - * when opening the file. - * - Pointer to null at end of above returned path - * - * Parameters: - * path: input path. Buffer is not altered. - * pathBuffer: Output buffer. Any contents are overwritten. - * - * Returns: - * Pointer to null termination in returned pathBuffer. - * - * TODO: This works the way ICU historically has, but the - * whole data fallback search path is so complicated that - * probably almost no one will ever really understand it, - * the potential for confusion is large. (It's not just - * this one function, but the whole scheme.) - * - *------------------------------------------------------------------------------*/ - static char *uprv_computeDirPath(const char *path, char *pathBuffer) - { - char *finalSlash; /* Ptr to last dir separator in input path, or null if none. */ - int32_t pathLen; /* Length of the returned directory path */ - - finalSlash = 0; - if (path != 0) { - finalSlash = uprv_strrchr(path, U_FILE_SEP_CHAR); - } - - *pathBuffer = 0; - if (finalSlash == 0) { - /* No user-supplied path. - * Copy the ICU_DATA path to the path buffer and return that*/ - const char *icuDataDir; - icuDataDir=u_getDataDirectory(); - if(icuDataDir!=nullptr && *icuDataDir!=0) { - return strcpy_returnEnd(pathBuffer, icuDataDir); - } else { - /* there is no icuDataDir either. Just return the empty pathBuffer. */ - return pathBuffer; - } - } - - /* User supplied path did contain a directory portion. - * Copy it to the output path buffer */ - pathLen = (int32_t)(finalSlash - path + 1); - uprv_memcpy(pathBuffer, path, pathLen); - *(pathBuffer+pathLen) = 0; - return pathBuffer+pathLen; - } - - -# define DATA_TYPE "dat" - - U_CFUNC UBool uprv_mapFile(UDataMemory *pData, const char *path, UErrorCode *status) { - const char *inBasename; - char *basename; - char pathBuffer[1024]; - const DataHeader *pHeader; - dllhandle *handle; - void *val=0; - - if (U_FAILURE(*status)) { - return false; - } - - inBasename=uprv_strrchr(path, U_FILE_SEP_CHAR); - if(inBasename==nullptr) { - inBasename = path; - } else { - inBasename++; - } - basename=uprv_computeDirPath(path, pathBuffer); - if(uprv_strcmp(inBasename, U_ICUDATA_NAME".dat") != 0) { - /* must mmap file... for build */ - int fd; - int length; - struct stat mystat; - void *data; - UDataMemory_init(pData); /* Clear the output struct. */ - - /* determine the length of the file */ - if(stat(path, &mystat)!=0 || mystat.st_size<=0) { - return false; - } - length=mystat.st_size; - - /* open the file */ - fd=open(path, O_RDONLY); - if(fd==-1) { - return false; - } - - /* get a view of the mapping */ - data=mmap(0, length, PROT_READ, MAP_PRIVATE, fd, 0); - close(fd); /* no longer needed */ - if(data==MAP_FAILED) { - // Possibly check the errorno value for ENOMEM, and report U_MEMORY_ALLOCATION_ERROR? - return false; - } - pData->map = (char *)data + length; - pData->pHeader=(const DataHeader *)data; - pData->mapAddr = data; - return true; - } - -# ifdef OS390BATCH - /* ### hack: we still need to get u_getDataDirectory() fixed - for OS/390 (batch mode - always return "//"? ) - and this here straightened out with LIB_PREFIX and LIB_SUFFIX (both empty?!) - This is probably due to the strange file system on OS/390. It's more like - a database with short entry names than a typical file system. */ - /* U_ICUDATA_NAME should always have the correct name */ - /* BUT FOR BATCH MODE IT IS AN EXCEPTION BECAUSE */ - /* THE FIRST THREE LETTERS ARE PREASSIGNED TO THE */ - /* PROJECT!!!!! */ - uprv_strcpy(pathBuffer, "IXMI" U_ICU_VERSION_SHORT "DA"); -# else - /* set up the library name */ - uprv_strcpy(basename, LIB_PREFIX U_LIBICUDATA_NAME U_ICU_VERSION_SHORT LIB_SUFFIX); -# endif - -# ifdef UDATA_DEBUG - fprintf(stderr, "dllload: %s ", pathBuffer); -# endif - - handle=dllload(pathBuffer); - -# ifdef UDATA_DEBUG - fprintf(stderr, " -> %08X\n", handle ); -# endif - - if(handle != nullptr) { - /* we have a data DLL - what kind of lookup do we need here? */ - /* try to find the Table of Contents */ - UDataMemory_init(pData); /* Clear the output struct. */ - val=dllqueryvar((dllhandle*)handle, U_ICUDATA_ENTRY_NAME); - if(val == 0) { - /* failed... so keep looking */ - return false; - } -# ifdef UDATA_DEBUG - fprintf(stderr, "dllqueryvar(%08X, %s) -> %08X\n", handle, U_ICUDATA_ENTRY_NAME, val); -# endif - - pData->pHeader=(const DataHeader *)val; - return true; - } else { - return false; /* no handle */ - } - } - - U_CFUNC void uprv_unmapFile(UDataMemory *pData) { - if(pData!=nullptr && pData->map!=nullptr) { - uprv_free(pData->map); - pData->map = nullptr; - pData->mapAddr = nullptr; - pData->pHeader = nullptr; - } - } - #else # error MAP_IMPLEMENTATION is set incorrectly #endif diff --git a/icu4c/source/common/umapfile.h b/icu4c/source/common/umapfile.h index 042e71374c1f..bacd10e70d80 100644 --- a/icu4c/source/common/umapfile.h +++ b/icu4c/source/common/umapfile.h @@ -37,19 +37,13 @@ U_CFUNC void uprv_unmapFile(UDataMemory *pData); #define MAP_WIN32 1 #define MAP_POSIX 2 #define MAP_STDIO 3 -#define MAP_390DLL 4 #if UCONFIG_NO_FILE_IO # define MAP_IMPLEMENTATION MAP_NONE #elif U_PLATFORM_USES_ONLY_WIN32_API # define MAP_IMPLEMENTATION MAP_WIN32 #elif U_HAVE_MMAP || U_PLATFORM == U_PF_OS390 -# if U_PLATFORM == U_PF_OS390 && defined (OS390_STUBDATA) - /* No memory mapping for 390 batch mode. Fake it using dll loading. */ -# define MAP_IMPLEMENTATION MAP_390DLL -# else -# define MAP_IMPLEMENTATION MAP_POSIX -# endif +# define MAP_IMPLEMENTATION MAP_POSIX #else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */ # define MAP_IMPLEMENTATION MAP_STDIO #endif diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 2b20d74a89ae..b8eb52d6ce68 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -768,7 +768,7 @@ #elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \ UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__)) # define U_EXPORT __declspec(dllexport) -#elif defined(__GNUC__) +#elif defined(__GNUC__) || defined(__open_xl__) # define U_EXPORT __attribute__((visibility("default"))) #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) @@ -807,7 +807,7 @@ */ #ifdef U_HIDDEN /* Use the predefined value. */ -#elif defined(__GNUC__) +#elif defined(__GNUC__) || defined(__open_xl__) # define U_HIDDEN __attribute__((visibility("hidden"))) #else # define U_HIDDEN diff --git a/icu4c/source/config/dist.mk b/icu4c/source/config/dist.mk index a2750f99e8c3..57c3749aab77 100644 --- a/icu4c/source/config/dist.mk +++ b/icu4c/source/config/dist.mk @@ -8,7 +8,7 @@ # This is to be called from ../Makefile.in # # This will only work if subversion is installed. -# You must checkout ICU4C at the `/icu` or `/icu/icu4c` level - not just `…/source` +# You must checkout ICU4C at the `/icu` or `/icu/icu4c` level - not just `.../source` # also note that `make dist` does NOT reflect any local modifications, but pulls from HEAD. top_builddir = . diff --git a/icu4c/source/config/mh-os390 b/icu4c/source/config/mh-os390 index 56edbeb70805..b982253b4062 100644 --- a/icu4c/source/config/mh-os390 +++ b/icu4c/source/config/mh-os390 @@ -11,190 +11,106 @@ # Before you try to run the Makefile, make sure you have the # # environment variables set. # # # -# If you are going to do the OS390BATCH build, make sure you have # -# the OS390BATCH environment variable set. # -# # -# export OS390BATCH=1 # -# # # To build a version of ICU that does not use IEEE Floating point # # # -# export IEEE390=0 # -# # -# To build a version of ICU which uses a two data libraries # -# where the smaller one is loaded first, use OS390_STUBDATA. # -# USAGE OF THIS OPTION IS DEPRECATED. You should look into using # -# Link Pack Area (LPA), library lookaside facility (LLA) or other # -# z/OS options that enable page fault based loading of read-only # -# code/data instead of this option. # -# This option will be removed in a future version of ICU. # -# # -# export OS390_STUBDATA=1 # -# # -# To build a version of ICU which exploits the C/C++ compiler # -# and runtime Extra Performance Linkage (XPLINK), specify # -# # -# export OS390_XPLINK=1 # -# # +# export ICU_IS_NOT_IEEE754=1 # ################################################################### - -# TODO: Fix this configuration so that icu-config will work! -# If statements don't work well when icu-config is generated. -ifeq (${IEEE390},) -IEEE390=1#M# -endif - -ifeq (${IEEE390}, 1) -ICU_IEEE = -Wc,'FLOAT(IEEE)' -DIEEE_754=0#M# +BUILD_HOST_ICU=OS390 +ifeq (${ICU_IS_NOT_IEEE754}, 1) +ICU_IEEE=-mzos-float-kind=hex -DIEEE_754=0 else -ICU_IEEE =#M# +ICU_IEEE=-mzos-float-kind=ieee -DIEEE_754=1 endif - -## Additional flags when building libraries and with threads -THREADSCPPFLAGS = -D_OPEN_THREADS=3 - -# For a dynamically called DLL module to share access to the POSIX external -# variables, with its caller, the DLL module must define these _SHR_* macros. -SHAREDLIBCPPFLAGS = -D_SHR_TZNAME -D_SHR_TIMEZONE - -# -Wc,expo is used to export all functions -SHAREDLIBCFLAGS = -Wc,expo -SHAREDLIBCXXFLAGS = -Wc,expo - -# TODO: Consider using -Wc,roc,ros for making the data and strings readonly -# -Wc,"ros" seems to work, but not the "roc" -# The RENT option makes the program reentrant. This may not really have the same -# meaning as normal reentrancy on other platforms. See the z/OS documentation -# for details. This is the default for C++, but not C. -# The DLL option must be used by the callee and caller code when using shared libraries. -# NOCSECT might be used as an optimization option. -# -+ means accept any file extension as a C++ file. By default only .C is accepted. -CFLAGS += -Wc,DLL,ROS,RENT,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED)' $(ICU_IEEE) -CXXFLAGS += -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED0X)' $(ICU_IEEE) -+ -ARFLAGS = -cr - -# _MSE_PROTOS usually interacts with _XOPEN_SOURCE. It affects some standard -# C functions that use wchar_t, and it selects behavior for -# multibyte extension support (MSE) functions. -#DEFS += -D_MSE_PROTOS - -ifeq (${OS390_XPLINK}, 1) -#SH# if [ "x$OS390_XPLINK" = "x1" ]; then -# These lines must be the last options specified. -# GOFF is the strategic object module format for S/390. It is required for XPLINK. -# NOTEMPINC could be used if ICU starts using templates. -ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs),goff' -ICU_XPLINK_CXX = -Wc,'xplink(backchain,storeargs),goff' -Wc,'NOTEMPINC' -ICU_XPLINK_L = -Wl,xplink -#SH# fi +ifeq (${TARGET_ICU_ARCH},) +TARGET_ICU_ARCH=arch10 endif - -## OS390BATCH -ifeq (${OS390BATCH},1) -DEFS += -DOS390BATCH#M# +ifeq (${ICU_PLUGINS_DD},1) +DEFS+=-DICU_PLUGINS_DD endif +## Flags for position independent code +SHAREDLIBCFLAGS += -fPIC +SHAREDLIBCXXFLAGS += -fPIC +# For a dynamically called DLL module to share access to the POSIX external +# variables, with its caller, the DLL module must define these _SHR_* macros. +SHAREDLIBCPPFLAGS +=-D_SHR_TZNAME -D_SHR_TIMEZONE +CFLAGS +=$(ICU_IEEE) -march=$(TARGET_ICU_ARCH) -mzos-service="$(LIBICU)v$(SO_TARGET_VERSION)" +CXXFLAGS +=$(ICU_IEEE) -march=$(TARGET_ICU_ARCH) -mzos-service="$(LIBICU)v$(SO_TARGET_VERSION)" +ARFLAGS =-cr +LIBCFLAGS +=-fvisibility=hidden +LIBCXXFLAGS +=-fvisibility=hidden ## Commands to generate dependency files -GEN_DEPS.c= makedep -GEN_DEPS.cc= makedep +GEN_DEPS.c=makedep +GEN_DEPS.cc=makedep ## Commands to compile # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and # it's only needed for long function names -COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c -COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CXX) -c - -# Commands to link -LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) -LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) +COMPILE.c=$(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c +COMPILE.cc=$(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c ## Commands for shared library (dll) -SHLIB.c= $(LINK.c) -SHLIB.cc= $(LINK.cc) +SHLIB.c=$(COMPILE_LINK_ENVVAR) $(CC) --shared $(LDFLAGS) +SHLIB.cc=$(COMPILE_LINK_ENVVAR) $(CXX) --shared $(LDFLAGS) ## Compiler switch to embed a runtime search path -LD_RPATH= -I +LD_RPATH=-I ## Environment variable to set a runtime search path LDLIBRARYPATH_ENVVAR = LIBPATH -## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC -IMPORT_LIB_EXT = .x - ## Versioned target for a shared library. -FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) -MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) +FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) +MIDDLE_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) ## Versioned import library names. -IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M# -MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M# -FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M# +IMPORT_LIB=$(basename $(notdir $(SO_TARGET))).x +MIDDLE_IMPORT_LIB=$(basename $(notdir $(MIDDLE_SO_TARGET))).x +FINAL_IMPORT_LIB=$(basename $(notdir $(FINAL_SO_TARGET))).x ## Non-shared intermediate object suffix STATIC_O = o -ifeq ($(OS390_STUBDATA),1) -## Suffix of the subset data library for dual common library support -STUB_SUFFIX=_stub#M# -DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M# -endif - -ifeq ($(OS390BATCH),1) -## PDS_NAME_PREFIX sets the prefix of the PDS dataset name while keeping the ICU version number. +## ICU_PDS_NAME_PREFIX sets the prefix of the PDS dataset name while keeping the ICU version number. ## To use custom names set ICU_PDS_NAME and ICU_PDS_NAME_SUFFIX -## IXM is used as a name prefix for XML Toolkit, default value -ifeq ($(PDS_NAME_PREFIX),) -PDS_NAME_PREFIX= IXMI +ifeq ($(ICU_PDS_NAME_PREFIX),) +ICU_PDS_NAME_PREFIX=LICU endif ifeq ($(ICU_PDS_NAME),) -PDS_FULL_NAME=${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR} +PDS_FULL_NAME=${ICU_PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR} else PDS_FULL_NAME=${ICU_PDS_NAME} endif -ifeq ($(OS390_STUBDATA),1) -BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_FULL_NAME}D1${ICU_PDS_NAME_SUFFIX})'" -BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_FULL_NAME}D1${ICU_PDS_NAME_SUFFIX})'" -else -BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_FULL_NAME}DA${ICU_PDS_NAME_SUFFIX})'" -BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_FULL_NAME}DA${ICU_PDS_NAME_SUFFIX})'" -PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\" -endif - -BATCH_COMMON_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}UC${ICU_PDS_NAME_SUFFIX})'" -BATCH_I18N_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}IN${ICU_PDS_NAME_SUFFIX})'" -BATCH_IO_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}IO${ICU_PDS_NAME_SUFFIX})'" -BATCH_LAYOUT_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}LE${ICU_PDS_NAME_SUFFIX})'" -BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}LX${ICU_PDS_NAME_SUFFIX})'" - -BATCH_LIBICUUC= "//'${LOADEXP}(${PDS_FULL_NAME}UC${ICU_PDS_NAME_SUFFIX})'" -BATCH_LIBICUI18N= "//'${LOADEXP}(${PDS_FULL_NAME}IN${ICU_PDS_NAME_SUFFIX})'" -BATCH_LIBICUIO= "//'${LOADEXP}(${PDS_FULL_NAME}IO${ICU_PDS_NAME_SUFFIX})'" -BATCH_LIBICULE= "//'${LOADEXP}(${PDS_FULL_NAME}LE${ICU_PDS_NAME_SUFFIX})'" -BATCH_LIBICULX= "//'${LOADEXP}(${PDS_FULL_NAME}LX${ICU_PDS_NAME_SUFFIX})'" -endif - +BATCH_STUB_TARGET=${PDS_FULL_NAME}DA${ICU_PDS_NAME_SUFFIX} +PKGDATA_DEFS+=-DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\" -DBATCH_STUB_TARGET=\"$(BATCH_STUB_TARGET)\" +BATCH_COMMON_TARGET=$(LIBDIR)/${PDS_FULL_NAME}UC${ICU_PDS_NAME_SUFFIX} +BATCH_I18N_TARGET=$(LIBDIR)/${PDS_FULL_NAME}IN${ICU_PDS_NAME_SUFFIX} +BATCH_IO_TARGET=$(LIBDIR)/${PDS_FULL_NAME}IO${ICU_PDS_NAME_SUFFIX} +BATCH_LAYOUT_TARGET=$(LIBDIR)/${PDS_FULL_NAME}LE${ICU_PDS_NAME_SUFFIX} +BATCH_LAYOUTEX_TARGET=$(LIBDIR)/${PDS_FULL_NAME}LX${ICU_PDS_NAME_SUFFIX} + +BATCH_LIBICUDT=$(top_builddir)/stubdata/${BATCH_STUB_TARGET}.x +BATCH_LIBICUUC=${BATCH_COMMON_TARGET}.x +BATCH_LIBICUI18N=${BATCH_I18N_TARGET}.x +BATCH_LIBICULE=${BATCH_LAYOUT_TARGET}.x +BATCH_LIBICULX=${BATCH_LAYOUTEX_TARGET}.x ## Link commands to link to ICU libs -LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x -LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x -LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x -LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x -LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x -LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x -LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x +LIBICUDT=$(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x +LIBICUUC=$(LIBDIR)/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x +LIBICUI18N=$(LIBDIR)/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x +LIBICULX=$(LIBDIR)/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x +LIBICUIO=$(LIBDIR)/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x +LIBCTESTFW=$(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x +LIBICUTOOLUTIL=$(LIBDIR)/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x ifneq (${ICUDATA_CHAR},e) #SH# if [ "$ICUDATA_CHAR" != "e" ]; then ## We're in ASCII mode. CFLAGS += -Wc,'ascii' CXXFLAGS += -Wc,'ascii' -SO = so -else -#SH# else -## We're in EBCDIC mode. -## Shared object suffix -SO = dll endif -#SH# fi +SO = so ## Special 390 rules @@ -207,28 +123,10 @@ endif $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< %.o: $(srcdir)/%.c $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< - -# This causes escapesrc to be built before other ICU targets. -NEED_ESCAPING=YES - -ifneq ($(SKIP_ESCAPING),) %.$(STATIC_O): $(srcdir)/%.cpp $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< %.o: $(srcdir)/%.cpp $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< -else -# convert *.cpp files to _*.cpp with \u / \U escaping -CLEANFILES += _*.cpp - -# the actual escaping -_%.cpp: $(srcdir)/%.cpp - @$(BINDIR)/escapesrc$(EXEEXT) $< $@ - -%.$(STATIC_O): _%.cpp - $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< -%.o: _%.cpp - $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< -endif ## Dependency rules %.d : %.u diff --git a/icu4c/source/data/Makefile.in b/icu4c/source/data/Makefile.in index 641bc6c9f0c9..266ad7aec033 100644 --- a/icu4c/source/data/Makefile.in +++ b/icu4c/source/data/Makefile.in @@ -46,25 +46,11 @@ CURDIR:=$(CURR_FULL_DIR) ifeq ($(CURDIR),) CURDIR=. endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -z -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) else PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) endif -OS390_PDS_NAME = -z -L $(BATCH_STUB_TARGET) - -ifeq ($(OS390_STUBDATA),1) -OS390PKG=package390 -OS390INSTALL=install390 - -# Additional data for 390 -OS390LIST=$(OUTTMPDIR)/icudata390.lst -OUTTMPDIR_390STUB=$(top_builddir)/data/out/tmp_390stub -endif - -ifeq ($(OS390BATCH),1) -CPPFLAGS += -Wc,'ros,roc' -endif # OBJDATADIR must be a short path (with ..'s) to the data. @@ -118,7 +104,7 @@ check-exhaustive: check distclean-local: clean $(RMV) Makefile -all-local: icupkg.inc build-local packagedata $(POST_DATA_BUILD) $(OS390PKG) +all-local: icupkg.inc build-local packagedata $(POST_DATA_BUILD) dist-local: @@ -180,7 +166,7 @@ endif echo timestamp > $@ ## Install ICU data. -install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata $(OS390INSTALL) +install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR) ifeq ($(PKGDATA_MODE),files) $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME) @@ -216,23 +202,6 @@ else endif -#### -#### -#### 390 support -install390: package390 - $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(libdir) - $(INVOKE) $(PKGDATA) -s $(BUILDDIR)$(STUB_SUFFIX) -T $(OUTTMPDIR_390STUB) -p $(ICUDATA_NAME)$(STUB_SUFFIX) $(PKGDATA_LIBNAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(OS390LIST) -m dll $(PKGDATA_VERSIONING) -I $(DESTDIR)$(ICUPKGDATA_DIR) -ifeq ($(PKGDATA_MODE),dll) - $(INSTALL-L) $(ICUPKGDATA_OUTDIR)/$(FINAL_IMPORT_LIB) $(DESTDIR)$(ICUPKGDATA_DIR)/$(FINAL_IMPORT_LIB) -endif - -#### $(LIB_ICUDATA_NAME)$(STUB_SUFFIX) is the subset data for batch mode -package390: $(OUTTMPDIR)/icudata390.lst $(PKGDATA_LIST) ./icupkg.inc packagedata - ln -s $(ICUDATA_NAME) $(OUTDIR)/build/$(ICUDATA_NAME)$(STUB_SUFFIX) - $(INVOKE) $(PKGDATA) -s $(BUILDDIR)$(STUB_SUFFIX) -T $(OUTTMPDIR_390STUB) -p $(ICUDATA_NAME)$(STUB_SUFFIX) $(PKGDATA_LIBNAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(OS390LIST) -m dll $(PKGDATA_VERSIONING) - cp $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) $(top_builddir)/stubdata/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) - - ## Include the main build rules for data files include $(top_builddir)/$(subdir)/rules.mk @@ -259,10 +228,10 @@ PKGDATA_LIST = $(TMP_DIR)/icudata.lst CLEANFILES = *~ icupkg.inc *.x ifeq ($(ICUDATA_SOURCE_ARCHIVE),) -build-local: $(SO_VERSION_DATA) $(ICUDATA_ALL_OUTPUT_FILES) $(PKGDATA_LIST) $(OS390LIST) +build-local: $(SO_VERSION_DATA) $(ICUDATA_ALL_OUTPUT_FILES) $(PKGDATA_LIST) echo timestamp > $@ else -build-local: $(SO_VERSION_DATA) $(PKGDATA_LIST) $(OS390LIST) +build-local: $(SO_VERSION_DATA) $(PKGDATA_LIST) echo timestamp > $@ $(PKGDATA_LIST): $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE) ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) diff --git a/icu4c/source/data/mappings/gb18030-2022.ucm b/icu4c/source/data/mappings/gb18030-2022.ucm index 7f02d06856bf..8aa30af125f4 100644 --- a/icu4c/source/data/mappings/gb18030-2022.ucm +++ b/icu4c/source/data/mappings/gb18030-2022.ucm @@ -68,8 +68,8 @@ CHARMAP # U+3000 = IDEOGRAPHIC SPACE (normally \xA1\xA1) # # PUA U+E5E5 used to round-trip to \xA3\xA0, as specified in GB18030. -# Now that \xA3\xA0 maps to U+3000 (“reverse fallback” mapping), -# we use a “good one-way” mapping from U+E5E5 to \xA3\xA0 +# Now that \xA3\xA0 maps to U+3000 ("reverse fallback" mapping), +# we use a "good one-way" mapping from U+E5E5 to \xA3\xA0 # for maximum compatibility with previous behavior. \x80 |3 \xA3\xA0 |3 diff --git a/icu4c/source/data/misc/currencyNumericCodes.txt b/icu4c/source/data/misc/currencyNumericCodes.txt index a84e114413f5..fd8c7d043344 100644 --- a/icu4c/source/data/misc/currencyNumericCodes.txt +++ b/icu4c/source/data/misc/currencyNumericCodes.txt @@ -1,4 +1,4 @@ -//--------------------------------------------------------- +//--------------------------------------------------------- // Copyright (C) 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html //--------------------------------------------------------- diff --git a/icu4c/source/data/misc/icustd.txt b/icu4c/source/data/misc/icustd.txt index dcbf71137a1c..f2cdb068bc67 100644 --- a/icu4c/source/data/misc/icustd.txt +++ b/icu4c/source/data/misc/icustd.txt @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// Copyright (C) 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // *************************************************************************** // * diff --git a/icu4c/source/data/misc/zoneinfo64.txt b/icu4c/source/data/misc/zoneinfo64.txt index c9a13dd6e0a0..98cb8efe32cb 100644 --- a/icu4c/source/data/misc/zoneinfo64.txt +++ b/icu4c/source/data/misc/zoneinfo64.txt @@ -1,4 +1,4 @@ -//--------------------------------------------------------- +//--------------------------------------------------------- // Copyright (C) 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html //--------------------------------------------------------- diff --git a/icu4c/source/i18n/Makefile.in b/icu4c/source/i18n/Makefile.in index ce7fe006e6cc..b48c229260f7 100644 --- a/icu4c/source/i18n/Makefile.in +++ b/icu4c/source/i18n/Makefile.in @@ -40,10 +40,10 @@ ifeq ($(ENABLE_SO_VERSION_DATA),1) SO_VERSION_DATA = i18n.res endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) BATCH_TARGET = $(BATCH_I18N_TARGET) BATCH_LIBS = $(BATCH_LIBICUUC) -lm -endif # OS390BATCH +endif endif # ENABLE_SHARED @@ -54,10 +54,6 @@ DYNAMICCFLAGS = $(SHAREDLIBCFLAGS) DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS) CFLAGS += $(LIBCFLAGS) CXXFLAGS += $(LIBCXXFLAGS) -ifeq ($(OS390BATCH),1) -CFLAGS += -WI -CXXFLAGS += -WI -endif CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/common $(LIBCPPFLAGS) $(CPPFLAGSICUI18N) DEFS += -DU_I18N_IMPLEMENTATION @@ -165,10 +161,10 @@ ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),) endif endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) $(BATCH_TARGET):$(OBJECTS) - $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS) -endif # OS390BATCH + $(SHLIB.cc) $(LD_SONAME) -Wl,-x$@.x $(OUTOPT)$@ $^ $(BATCH_LIBS) +endif endif # ENABLE_SHARED ifeq (,$(MAKECMDGOALS)) diff --git a/icu4c/source/io/Makefile.in b/icu4c/source/io/Makefile.in index 9bf9359eaddd..1e4ec5f95016 100644 --- a/icu4c/source/io/Makefile.in +++ b/icu4c/source/io/Makefile.in @@ -40,10 +40,10 @@ ifeq ($(ENABLE_SO_VERSION_DATA),1) SO_VERSION_DATA = io.res endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) BATCH_TARGET = $(BATCH_IO_TARGET) BATCH_LIBS = $(BATCH_LIBICUUC) $(BATCH_LIBICUI18N) -lm -endif # OS390BATCH +endif endif # ENABLE_SHARED @@ -161,10 +161,10 @@ ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),) endif endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) $(BATCH_TARGET):$(OBJECTS) - $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS) -endif # OS390BATCH + $(SHLIB.cc) $(LD_SONAME) -Wl,-x$@.x $(OUTOPT)$@ $^ $(BATCH_LIBS) +endif endif # ENABLE_SHARED ifeq (,$(MAKECMDGOALS)) diff --git a/icu4c/source/layoutex/Makefile.in b/icu4c/source/layoutex/Makefile.in index d735099582a2..1826b568ae87 100644 --- a/icu4c/source/layoutex/Makefile.in +++ b/icu4c/source/layoutex/Makefile.in @@ -39,10 +39,10 @@ ifeq ($(ENABLE_SO_VERSION_DATA),1) SO_VERSION_DATA = layoutex.res endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) BATCH_TARGET = $(BATCH_LAYOUTEX_TARGET) BATCH_LIBS = $(BATCH_LIBICUUC) $(BATCH_LIBICULE) -lm -endif # OS390BATCH +endif endif # ENABLE_SHARED @@ -172,10 +172,10 @@ ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),) endif endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) $(BATCH_TARGET):$(OBJECTS) - $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS) -endif # OS390BATCH + $(SHLIB.cc) $(LD_SONAME) -Wl,-x$@.x $(OUTOPT)$@ $^ $(BATCH_LIBS) +endif endif # ENABLE_SHARED ifeq (,$(MAKECMDGOALS)) diff --git a/icu4c/source/python/icutools/databuilder/renderers/makefile.py b/icu4c/source/python/icutools/databuilder/renderers/makefile.py index 9b2005b07d91..0a59712f7c32 100644 --- a/icu4c/source/python/icutools/databuilder/renderers/makefile.py +++ b/icu4c/source/python/icutools/databuilder/renderers/makefile.py @@ -10,6 +10,8 @@ from .. import utils from ..request_types import * +import platform + def get_gnumake_rules(build_dirs, requests, makefile_vars, **kwargs): makefile_string = "" @@ -87,6 +89,26 @@ def get_gnumake_rules_helper(request, common_vars, **kwargs): if isinstance(request, PrintFileRequest): var_name = "%s_CONTENT" % request.name.upper() + platform_os = platform.system() + cmds = [] + if platform_os in ["OS390", "OS/390", "zos"] and request.shall_be_utf8: + cmds.append( + '''echo "$${VAR_NAME}" | iconv -f IBM-1047 -T -t UTF-8 > {MAKEFILENAME}'''.format( + VAR_NAME = var_name, + MAKEFILENAME = files_to_makefile([request.output_file], common_vars), + **common_vars + )) + cmds.append( + '''sed -i '1s/^/\\xef\\xbb\\xbf/' {MAKEFILENAME}'''.format( + MAKEFILENAME = files_to_makefile([request.output_file], common_vars), + **common_vars + )) + else: + cmds.append("echo \"$${VAR_NAME}\" > {MAKEFILENAME}".format( + VAR_NAME = var_name, + MAKEFILENAME = files_to_makefile([request.output_file], common_vars), + **common_vars + )) return [ MakeStringVar( name = var_name, @@ -97,13 +119,7 @@ def get_gnumake_rules_helper(request, common_vars, **kwargs): dep_literals = [], dep_files = [], output_file = request.output_file, - cmds = [ - "echo \"$${VAR_NAME}\" > {MAKEFILENAME}".format( - VAR_NAME = var_name, - MAKEFILENAME = files_to_makefile([request.output_file], common_vars), - **common_vars - ) - ] + cmds = cmds ) ] diff --git a/icu4c/source/python/icutools/databuilder/request_types.py b/icu4c/source/python/icutools/databuilder/request_types.py index aa70f8d9185b..59af5d483d6f 100644 --- a/icu4c/source/python/icutools/databuilder/request_types.py +++ b/icu4c/source/python/icutools/databuilder/request_types.py @@ -228,9 +228,10 @@ def _del_at(self, i): class PrintFileRequest(AbstractRequest): - def __init__(self, **kwargs): + def __init__(self, shall_be_utf8 = False, **kwargs): self.output_file = None self.content = None + self.shall_be_utf8 = shall_be_utf8 super(PrintFileRequest, self).__init__(**kwargs) def all_output_files(self): @@ -317,6 +318,7 @@ def flatten(self, config, all_requests, common_vars): PrintFileRequest( name = self.name, output_file = self.txt_file, + shall_be_utf8 = True, content = self._generate_index_file(common_vars) ).flatten(config, all_requests, common_vars) + SingleExecutionRequest( diff --git a/icu4c/source/runConfigureICU b/icu4c/source/runConfigureICU index 17a4cd83da21..a97aea5302e2 100755 --- a/icu4c/source/runConfigureICU +++ b/icu4c/source/runConfigureICU @@ -61,8 +61,7 @@ The following names can be supplied as the argument for platform: Solaris/GCC Use the GNU gcc/g++ compilers on Solaris SolarisX86 Use the Sun cc/CC compilers on Solaris x86 TRU64V5.1/CXX Use the Compaq cxx compiler on Tru64 (OSF) - zOS Use the IBM cxx compiler on z/OS (os/390) - zOSV1R2 Use the IBM cxx compiler for z/OS 1.2 + zOS Use the IBM Open XL C/C++ 2.1 for z/OS compiler on z/OS (OS/390) EOE fi @@ -374,24 +373,21 @@ case $platform in ;; zOS) THE_OS="z/OS (OS/390)" - THE_COMP="z/OS C/C++" - CC=xlc; export CC - CXX=xlC; export CXX - RELEASE_CFLAGS="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'" - RELEASE_CXXFLAGS="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'" - ;; - zOSV1R2) - THE_OS="z/OS 1.2" - THE_COMP="z/OS 1.2 C/C++" - CC=cc; export CC - CXX=cxx; export CXX - export COMPILE_LINK_ENVVAR='_CXX_CICC_VER}=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000' - export _CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000 - export LDFLAGS="-Wl,'compat=pm3'" - export CFLAGS="-Wc,'target(zOSV1R2)'" - export CXXFLAGS="-Wc,'target(zOSV1R2)'" - RELEASE_CFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'" - RELEASE_CXXFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'" + THE_COMP="IBM OpenXL C/C++" + CC=`which ibm-clang`; export CC + if [ ! -x $CC ]; then + echo "ERROR: ibm-clang was not found, please check the PATH to make sure it is correct."; exit 1 + fi + CXX=`which ibm-clang++`; export CXX + if [ ! -x $CXX ]; then + echo "ERROR: ibm-clang++ was not found, please check the PATH to make sure it is correct."; exit 1 + fi + RELEASE_CFLAGS='-O2 -m32 -D_UNIX03_SOURCE -D_UNIX03_THREADS -D_POSIX_SOURCE -D_POSIX_THREADS -D_OPEN_SYS_SOCK_IPV6=1 -D_XOPEN_SOURCE_EXTENDED=1 -DOE_SOCKETS -D_OPEN_SYS_IF_EXT=1' + RELEASE_CXXFLAGS='-O2 -m32 -D_UNIX03_SOURCE -D_UNIX03_THREADS -D_POSIX_SOURCE -D_POSIX_THREADS -D_OPEN_SYS_SOCK_IPV6=1 -D_XOPEN_SOURCE_EXTENDED=1 -DOE_SOCKETS -D_OPEN_SYS_IF_EXT=1' + RELEASE_LDFLAGS='-m32' + DEBUG_CFLAGS='-g -O0 -m32 -D_UNIX03_SOURCE -D_UNIX03_THREADS -D_POSIX_SOURCE -D_POSIX_THREADS -D_OPEN_SYS_SOCK_IPV6=1 -D_XOPEN_SOURCE_EXTENDED=1 -DOE_SOCKETS -D_OPEN_SYS_IF_EXT=1' + DEBUG_CXXFLAGS='-g -O0 -m32 -D_UNIX03_SOURCE -D_UNIX03_THREADS -D_POSIX_SOURCE -D_POSIX_THREADS -D_OPEN_SYS_SOCK_IPV6=1 -D_XOPEN_SOURCE_EXTENDED=1 -DOE_SOCKETS -D_OPEN_SYS_IF_EXT=1' + DEBUG_LDFLAGS='-m32' ;; *) >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)" diff --git a/icu4c/source/stubdata/Makefile.in b/icu4c/source/stubdata/Makefile.in index cf2051030409..f791e5216898 100644 --- a/icu4c/source/stubdata/Makefile.in +++ b/icu4c/source/stubdata/Makefile.in @@ -147,10 +147,10 @@ ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),) endif endif -ifeq ($(OS390BATCH),1) +ifeq ($(BUILD_HOST_ICU),OS390) $(BATCH_STUB_TARGET): $(OBJECTS) $(SHLIB.c) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS) -endif # OS390BATCH +endif endif # ENABLE_SHARED ifeq (,$(MAKECMDGOALS)) diff --git a/icu4c/source/test/intltest/intltest.h b/icu4c/source/test/intltest/intltest.h index 04cdb5c41c2b..8fb825f6de6d 100644 --- a/icu4c/source/test/intltest/intltest.h +++ b/icu4c/source/test/intltest/intltest.h @@ -23,11 +23,6 @@ U_NAMESPACE_USE -#if U_PLATFORM == U_PF_OS390 -// avoid collision with math.h/log() -// this must be after including utypes.h so that U_PLATFORM is actually defined -#pragma map(IntlTest::log( const UnicodeString &message ),"logos390") -#endif //----------------------------------------------------------------------------- //convenience classes to ease porting code that uses the Java diff --git a/icu4c/source/tools/pkgdata/pkgdata.cpp b/icu4c/source/tools/pkgdata/pkgdata.cpp index b34618c716be..3e4cfd7b3267 100644 --- a/icu4c/source/tools/pkgdata/pkgdata.cpp +++ b/icu4c/source/tools/pkgdata/pkgdata.cpp @@ -1483,63 +1483,12 @@ static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, c result = runCommand(cmd); #if U_PLATFORM == U_PF_OS390 - char *env_tmp; - char PDS_LibName[512]; - char PDS_Name[512]; - - PDS_Name[0] = 0; - PDS_LibName[0] = 0; - if (specialHandling && uprv_strcmp(libFileNames[LIB_FILE],"libicudata") == 0) { - if (env_tmp = getenv("ICU_PDS_NAME")) { - sprintf(PDS_Name, "%s%s", - env_tmp, - "DA"); - strcat(PDS_Name, getenv("ICU_PDS_NAME_SUFFIX")); - } else if (env_tmp = getenv("PDS_NAME_PREFIX")) { - sprintf(PDS_Name, "%s%s", - env_tmp, - U_ICU_VERSION_SHORT "DA"); - } else { - sprintf(PDS_Name, "%s%s", - "IXMI", - U_ICU_VERSION_SHORT "DA"); - } - } else if (!specialHandling && uprv_strcmp(libFileNames[LIB_FILE],"libicudata_stub") == 0) { - if (env_tmp = getenv("ICU_PDS_NAME")) { - sprintf(PDS_Name, "%s%s", - env_tmp, - "D1"); - strcat(PDS_Name, getenv("ICU_PDS_NAME_SUFFIX")); - } else if (env_tmp = getenv("PDS_NAME_PREFIX")) { - sprintf(PDS_Name, "%s%s", - env_tmp, - U_ICU_VERSION_SHORT "D1"); - } else { - sprintf(PDS_Name, "%s%s", - "IXMI", - U_ICU_VERSION_SHORT "D1"); - } - } - - if (PDS_Name[0]) { - sprintf(PDS_LibName,"%s%s%s%s%s", - "\"//'", - getenv("LOADMOD"), - "(", - PDS_Name, - ")'\""); - sprintf(cmd, "%s %s -o %s %s %s%s %s %s", - pkgDataFlags[GENLIB], - pkgDataFlags[LDICUDTFLAGS], - PDS_LibName, - objectFile, - pkgDataFlags[LD_SONAME], - pkgDataFlags[LD_SONAME][0] == 0 ? "" : libFileNames[LIB_FILE_VERSION_MAJOR], - pkgDataFlags[RPATH_FLAGS], - pkgDataFlags[BIR_FLAGS]); + sprintf(cmd, "%s %s -o %s%s %s %s%s %s %s", pkgDataFlags[GENLIB], pkgDataFlags[LDICUDTFLAGS], + targetDir, BATCH_STUB_TARGET, objectFile, pkgDataFlags[LD_SONAME], + pkgDataFlags[LD_SONAME][0] == 0 ? "" : libFileNames[LIB_FILE_VERSION_MAJOR], + pkgDataFlags[RPATH_FLAGS], pkgDataFlags[BIR_FLAGS]); - result = runCommand(cmd); - } + result = runCommand(cmd); #endif }