2 ## os/390, z/OS specific setup
3 ## Copyright (c) 1999-2012, 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 = -Wc,'FLOAT(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,DLL,ROS,RENT,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'CHARS(SIGNED)','LANGLVL(EXTENDED)' $(ICU_IEEE)
70 CXXFLAGS += -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'CHARS(SIGNED)','LANGLVL(EXTENDED)' $(ICU_IEEE) -+
71 DEFS += -D_XOPEN_SOURCE=600
74 # _MSE_PROTOS usually interacts with _XOPEN_SOURCE. It affects some standard
75 # C functions that use wchar_t, and it selects behavior for
76 # multibyte extension support (MSE) functions.
77 #DEFS += -D_MSE_PROTOS
79 ifeq (${OS390_XPLINK}, 1)
80 #SH# if [ "x$OS390_XPLINK" = "x1" ]; then
81 # These lines must be the last options specified.
82 # GOFF is is the strategic object module format for S/390. It is required for XPLINK.
83 # NOTEMPINC could be used if ICU starts using templates.
84 ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs),goff'
85 ICU_XPLINK_CXX = -Wc,'xplink(backchain,storeargs),goff' -Wc,'NOTEMPINC'
86 ICU_XPLINK_L = -Wl,xplink
91 ifeq (${OS390BATCH},1)
92 DEFS += -DOS390BATCH#M#
95 ## Commands to generate dependency files
99 ## Commands to compile
100 # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
101 # it's only needed for long function names
102 COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c
103 COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CXX) -c
106 LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
107 LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
109 ## Commands for shared library (dll)
113 ## Compiler switch to embed a runtime search path
116 ## Environment variable to set a runtime search path
117 LDLIBRARYPATH_ENVVAR = LIBPATH
119 ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
122 ## Versioned target for a shared library.
123 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
124 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
126 ## Versioned import library names.
127 IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
128 MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
129 FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
131 ## Non-shared intermediate object suffix
134 ifeq ($(OS390_STUBDATA),1)
135 ## Suffix of the subset data library for dual common library support
137 DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M#
140 ifeq ($(OS390BATCH),1)
141 ## IXM is used as a name prefix for XML Toolkit, default value
142 ifeq ($(PDS_NAME_PREFIX),)
143 PDS_NAME_PREFIX= IXMI
145 ifeq ($(OS390_STUBDATA),1)
146 BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'"
147 BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'"
149 BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'"
150 BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'"
151 PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"
154 BATCH_COMMON_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'"
155 BATCH_I18N_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'"
156 BATCH_IO_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'"
157 BATCH_LAYOUT_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'"
158 BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'"
160 BATCH_LIBICUUC= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'"
161 BATCH_LIBICUI18N= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'"
162 BATCH_LIBICUIO= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'"
163 BATCH_LIBICULE= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'"
164 BATCH_LIBICULX= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'"
168 ## Link commands to link to ICU libs
169 LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
170 LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
171 LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
172 LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
173 LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
174 LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
175 LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
176 LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
178 ifneq (${ICUDATA_CHAR},e)
179 #SH# if [ "$ICUDATA_CHAR" != "e" ]; then
180 ## We're in ASCII mode.
181 CFLAGS += -Wc,'ascii'
182 CXXFLAGS += -Wc,'ascii'
186 ## We're in EBCDIC mode.
187 ## Shared object suffix
194 ## Build archive from object
196 $(AR) $(ARFLAGS) $@ $(OBJECTS)
199 %.$(STATIC_O): $(srcdir)/%.c
200 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
202 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
204 %.$(STATIC_O): $(srcdir)/%.cpp
205 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
207 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
211 @$(SHELL) -ec 'cat $< \
212 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
213 [ -s $@ ] || rm -f $@ ; rm -f $<'
216 @echo "generating dependency information for $<"
217 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
218 @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
220 %.u : $(srcdir)/%.cpp
221 @echo "generating dependency information for $<"
222 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
223 @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
225 ## Versioned libraries rules
226 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
227 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
228 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
229 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
231 ## Install libraries as executable
232 INSTALL-L=$(INSTALL_PROGRAM)
234 ## End 390-specific setup