Skip to content

Commit

Permalink
ICU-22916 Remove use of makedep from MVS build, update doc
Browse files Browse the repository at this point in the history
alexgubanow [email protected]
  • Loading branch information
alexgubanow committed Sep 23, 2024
1 parent 199bc82 commit 3cca659
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/userguide/icu4c/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Some platforms use package management tools to control the installation and unin
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.
* GNU make is required for building ICU. If it is not already installed on your system, it is available at the [IBM Open Enterprise Foundation for z/OS](https://www.ibm.com/products/open-enterprise-foundation-zos) or [ZOS Open Tools](https://github.com/zopencommunity). Ensure that the PATH environment variable includes the location of this executable prior to building. Failure to add this tool to your PATH may cause ICU build failures or prevent pkgdata from running.
* 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.
Expand Down
29 changes: 5 additions & 24 deletions icu4c/source/config/mh-os390
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ CXXFLAGS +=$(ICU_IEEE) -march=$(TARGET_ICU_ARCH) -mzos-service="$(LIBICU)v$(SO_T
ARFLAGS =-cr
LIBCFLAGS +=-fvisibility=hidden
LIBCXXFLAGS +=-fvisibility=hidden
## Commands to generate dependency files
GEN_DEPS.c=makedep
GEN_DEPS.cc=makedep

## Commands to compile
# _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
Expand Down Expand Up @@ -118,31 +115,15 @@ SO = so
%.a : $(OBJECTS)
$(AR) $(ARFLAGS) $@ $(OBJECTS)

## Compilation rules
## Compilation and dependency rules
%.$(STATIC_O): $(srcdir)/%.c
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
$(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
%.o: $(srcdir)/%.c
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
$(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
%.$(STATIC_O): $(srcdir)/%.cpp
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
$(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
%.o: $(srcdir)/%.cpp
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<

## Dependency rules
%.d : %.u
@$(SHELL) -ec 'cat $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@ ; rm -f $<'

%.u : $(srcdir)/%.c
@echo "generating dependency information for $<"
@$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
@$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'

%.u : $(srcdir)/%.cpp
@echo "generating dependency information for $<"
@$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
@$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
$(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)

## Versioned libraries rules
%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
Expand Down

0 comments on commit 3cca659

Please sign in to comment.