2 ## os/390, z/OS specific setup
3 ## Copyright (c) 1999-2007, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ###################################################################
8 ###################################################################
9 # Before you try to run the Makefile, make sure you have the #
10 # environment variables set. #
12 # If you are going to do the OS390BATCH build, make sure you have #
13 # the OS390BATCH environment variable set. #
15 # export OS390BATCH=1 #
17 # To build a version of ICU that does not use IEEE Floating point #
21 # To build a version of ICU which uses a two data libraries #
22 # where the smaller one is loaded first, use OS390_STUBDATA. #
23 # USAGE OF THIS OPTION IS DEPRECATED. You should look into using #
24 # Link Pack Area (LPA), library lookaside facility (LLA) or other #
25 # z/OS options that enable page fault based loading of read-only #
26 # code/data instead of this option. #
27 # This option will be removed in a future version of ICU. #
29 # export OS390_STUBDATA=1 #
31 # To build a version of ICU which exploits the C/C++ compiler #
32 # and runtime Extra Performance Linkage (XPLINK), specify #
34 # export OS390_XPLINK=1 #
36 ###################################################################
38 # TODO: Fix this configuration so that icu-config will work!
39 # If statements don't work well when icu-config is generated.
45 ICU_IEEE = -Wc,'float(ieee)'
47 ICU_IEEE = -DIEEE_754=0#M#
50 ## Additional flags when building libraries and with threads
51 THREADSCPPFLAGS = -D_OPEN_THREADS
53 # For a dynamically called DLL module to share access to the POSIX external
54 # variables, with its caller, the DLL module must define these _SHR_* macros.
55 SHAREDLIBCPPFLAGS = -D_SHR_TZNAME -D_SHR_TIMEZONE
57 # -Wc,expo is used to export all functions
58 SHAREDLIBCFLAGS = -Wc,expo
59 SHAREDLIBCXXFLAGS = -Wc,expo
61 # TODO: Consider using -Wc,roc,ros for making the data and strings readonly
62 # -Wc,"ros" seems to work, but not the "roc"
63 # The RENT option makes the program reentrant. This may not really have the same
64 # meaning as normal reentrancy on other platforms. See the z/OS documentation
65 # for details. This is the default for C++, but not C.
66 # The DLL option must be used by the callee and caller code when using shared libraries.
67 # NOCSECT might be used as an optimization option.
68 # -+ means accept any file extension as a C++ file. By default only .C is accepted.
69 CFLAGS += -Wc,'langlvl(extended),ros,rent,dll' $(ICU_IEEE)
70 CXXFLAGS += -Wc,'langlvl(extended),ros,dll' $(ICU_IEEE) -+
73 # _MSE_PROTOS usually interacts with _XOPEN_SOURCE. It affects some standard
74 # C functions that use wchar_t, and it selects behavior for
75 # multibyte extension support (MSE) functions.
76 #DEFS += -D_MSE_PROTOS
78 ifeq (${OS390_XPLINK}, 1)
79 #SH# if [ "x$OS390_XPLINK" = "x1" ]; then
80 # These lines must be the last options specified.
81 # GOFF is is the strategic object module format for S/390. It is required for XPLINK.
82 # NOTEMPINC could be used if ICU starts using templates.
83 ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs),goff'
84 ICU_XPLINK_CXX = -Wc,'xplink(backchain,storeargs),goff'
85 ICU_XPLINK_L = -Wl,xplink
90 ifeq (${OS390BATCH},1)
91 DEFS += -DOS390BATCH#M#
94 ## Commands to generate dependency files
98 ## Commands to compile
99 # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
100 # it's only needed for long function names
101 COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c
102 COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CXX) -c
105 LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
106 LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
108 ## Commands for shared library (dll)
112 ## Compiler switch to embed a runtime search path
115 ## Environment variable to set a runtime search path
116 LDLIBRARYPATH_ENVVAR = LIBPATH
118 ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
121 ## Versioned target for a shared library.
122 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
123 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
125 ## Versioned import library names.
126 IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
127 MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
128 FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
130 ## Non-shared intermediate object suffix
133 ifeq ($(OS390_STUBDATA),1)
134 ## Suffix of the subset data library for dual common library support
136 DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M#
139 ifeq ($(OS390BATCH),1)
140 ifeq ($(OS390_STUBDATA),1)
141 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
142 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
144 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
145 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
146 PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"
149 BATCH_COMMON_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
150 BATCH_I18N_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
151 BATCH_IO_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
152 BATCH_LAYOUT_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'"
153 BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'"
155 BATCH_LIBICUUC= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
156 BATCH_LIBICUI18N= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
157 BATCH_LIBICUIO= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
158 BATCH_LIBICULE= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'"
159 BATCH_LIBICULX= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'"
162 ## Link commands to link to ICU libs
163 LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
164 LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
165 LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
166 LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
167 LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
168 LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
169 LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
170 LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
172 ifneq (${ICUDATA_CHAR},e)
173 #SH# if [ "$ICUDATA_CHAR" != "e" ]; then
174 ## We're in ASCII mode.
175 CFLAGS += -Wc,'ascii'
176 CXXFLAGS += -Wc,'ascii'
180 ## We're in EBCDIC mode.
181 ## Shared object suffix
188 ## Build archive from object
190 $(AR) $(ARFLAGS) $@ $(OBJECTS)
193 %.$(STATIC_O): $(srcdir)/%.c
194 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
196 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
198 %.$(STATIC_O): $(srcdir)/%.cpp
199 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
201 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
205 @$(SHELL) -ec 'cat $< \
206 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
207 [ -s $@ ] || rm -f $@ ; rm -f $<'
210 @echo "generating dependency information for $<"
211 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
212 @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
214 %.u : $(srcdir)/%.cpp
215 @echo "generating dependency information for $<"
216 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
217 @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
219 ## Versioned libraries rules
220 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
221 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
222 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
223 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
225 ## Install libraries as executable
226 INSTALL-L=$(INSTALL_PROGRAM)
228 ## End 390-specific setup