]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-os390
ICU-511.35.tar.gz
[apple/icu.git] / icuSources / config / mh-os390
CommitLineData
b75a7d8f 1## -*-makefile-*-
73c04bcf 2## os/390, z/OS specific setup
51004dcb 3## Copyright (c) 1999-2012, International Business Machines Corporation and
b75a7d8f 4## others. All Rights Reserved.
b75a7d8f
A
5
6###################################################################
7# IMPORTANT NOTE #
8###################################################################
9# Before you try to run the Makefile, make sure you have the #
10# environment variables set. #
11# #
12# If you are going to do the OS390BATCH build, make sure you have #
13# the OS390BATCH environment variable set. #
14# #
15# export OS390BATCH=1 #
16# #
46f4442e 17# To build a version of ICU that does not use IEEE Floating point #
b75a7d8f 18# #
46f4442e 19# export IEEE390=0 #
b75a7d8f 20# #
46f4442e
A
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. #
b75a7d8f
A
28# #
29# export OS390_STUBDATA=1 #
30# #
31# To build a version of ICU which exploits the C/C++ compiler #
32# and runtime Extra Performance Linkage (XPLINK), specify #
33# #
34# export OS390_XPLINK=1 #
35# #
36###################################################################
37
73c04bcf
A
38# TODO: Fix this configuration so that icu-config will work!
39# If statements don't work well when icu-config is generated.
b75a7d8f 40ifeq (${IEEE390},)
73c04bcf 41IEEE390=1#M#
b75a7d8f
A
42endif
43
44ifeq (${IEEE390}, 1)
51004dcb 45ICU_IEEE = -Wc,'FLOAT(IEEE)'
b75a7d8f 46else
51004dcb 47ICU_IEEE = -Wc,'FLOAT(IEEE)' -DIEEE_754=0#M#
b75a7d8f
A
48endif
49
46f4442e
A
50## Additional flags when building libraries and with threads
51THREADSCPPFLAGS = -D_OPEN_THREADS
52
73c04bcf
A
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.
55SHAREDLIBCPPFLAGS = -D_SHR_TZNAME -D_SHR_TIMEZONE
56
73c04bcf
A
57# -Wc,expo is used to export all functions
58SHAREDLIBCFLAGS = -Wc,expo
59SHAREDLIBCXXFLAGS = -Wc,expo
60
b75a7d8f
A
61# TODO: Consider using -Wc,roc,ros for making the data and strings readonly
62# -Wc,"ros" seems to work, but not the "roc"
46f4442e
A
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.
73c04bcf 68# -+ means accept any file extension as a C++ file. By default only .C is accepted.
51004dcb
A
69CFLAGS += -Wc,DLL,ROS,RENT,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'CHARS(SIGNED)','LANGLVL(EXTENDED)' $(ICU_IEEE)
70CXXFLAGS += -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'CHARS(SIGNED)','LANGLVL(EXTENDED)' $(ICU_IEEE) -+
71DEFS += -D_XOPEN_SOURCE=600
b75a7d8f
A
72ARFLAGS = -cr
73
46f4442e
A
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
78
b75a7d8f 79ifeq (${OS390_XPLINK}, 1)
73c04bcf 80#SH# if [ "x$OS390_XPLINK" = "x1" ]; then
b75a7d8f 81# These lines must be the last options specified.
46f4442e
A
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.
84ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs),goff'
51004dcb 85ICU_XPLINK_CXX = -Wc,'xplink(backchain,storeargs),goff' -Wc,'NOTEMPINC'
46f4442e 86ICU_XPLINK_L = -Wl,xplink
73c04bcf 87#SH# fi
b75a7d8f
A
88endif
89
90## OS390BATCH
91ifeq (${OS390BATCH},1)
73c04bcf 92DEFS += -DOS390BATCH#M#
b75a7d8f
A
93endif
94
b75a7d8f
A
95## Commands to generate dependency files
96GEN_DEPS.c= makedep
97GEN_DEPS.cc= makedep
98
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
46f4442e
A
102COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c
103COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CXX) -c
b75a7d8f
A
104
105# Commands to link
106LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
107LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
108
109## Commands for shared library (dll)
110SHLIB.c= $(LINK.c)
111SHLIB.cc= $(LINK.cc)
112
113## Compiler switch to embed a runtime search path
114LD_RPATH= -I
115
116## Environment variable to set a runtime search path
117LDLIBRARYPATH_ENVVAR = LIBPATH
118
119## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
120IMPORT_LIB_EXT = .x
121
122## Versioned target for a shared library.
123FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
124MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
125
126## Versioned import library names.
73c04bcf
A
127IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
128MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
129FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
b75a7d8f 130
b75a7d8f
A
131## Non-shared intermediate object suffix
132STATIC_O = o
133
134ifeq ($(OS390_STUBDATA),1)
135## Suffix of the subset data library for dual common library support
73c04bcf
A
136STUB_SUFFIX=_stub#M#
137DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M#
b75a7d8f
A
138endif
139
140ifeq ($(OS390BATCH),1)
51004dcb
A
141## IXM is used as a name prefix for XML Toolkit, default value
142ifeq ($(PDS_NAME_PREFIX),)
143PDS_NAME_PREFIX= IXMI
144endif
b75a7d8f 145ifeq ($(OS390_STUBDATA),1)
51004dcb
A
146BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'"
147BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'"
b75a7d8f 148else
51004dcb
A
149BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'"
150BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'"
73c04bcf 151PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"
b75a7d8f
A
152endif
153
51004dcb
A
154BATCH_COMMON_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'"
155BATCH_I18N_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'"
156BATCH_IO_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'"
157BATCH_LAYOUT_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'"
158BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'"
159
160BATCH_LIBICUUC= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'"
161BATCH_LIBICUI18N= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'"
162BATCH_LIBICUIO= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'"
163BATCH_LIBICULE= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'"
164BATCH_LIBICULX= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'"
b75a7d8f
A
165endif
166
51004dcb 167
b75a7d8f 168## Link commands to link to ICU libs
374ca955
A
169LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
170LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
171LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
172LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
173LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
174LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
175LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
176LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
b75a7d8f 177
73c04bcf
A
178ifneq (${ICUDATA_CHAR},e)
179#SH# if [ "$ICUDATA_CHAR" != "e" ]; then
180## We're in ASCII mode.
181CFLAGS += -Wc,'ascii'
182CXXFLAGS += -Wc,'ascii'
183SO = so
184else
185#SH# else
186## We're in EBCDIC mode.
187## Shared object suffix
188SO = dll
189endif
190#SH# fi
191
b75a7d8f
A
192## Special 390 rules
193
194## Build archive from object
195%.a : $(OBJECTS)
196 $(AR) $(ARFLAGS) $@ $(OBJECTS)
197
198## Compilation rules
199%.$(STATIC_O): $(srcdir)/%.c
200 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
201%.o: $(srcdir)/%.c
202 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
203
204%.$(STATIC_O): $(srcdir)/%.cpp
205 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
206%.o: $(srcdir)/%.cpp
207 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
208
209## Dependency rules
210%.d : %.u
211 @$(SHELL) -ec 'cat $< \
212 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
213 [ -s $@ ] || rm -f $@ ; rm -f $<'
214
215%.u : $(srcdir)/%.c
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'
219
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'
224
225## Versioned libraries rules
226%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
374ca955 227 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
b75a7d8f 228%.$(SO): %$(SO_TARGET_VERSION).$(SO)
374ca955 229 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
b75a7d8f 230
374ca955
A
231## Install libraries as executable
232INSTALL-L=$(INSTALL_PROGRAM)
233
234## End 390-specific setup