]> git.saurik.com Git - apple/icu.git/blame_incremental - icuSources/config/mh-os390
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / config / mh-os390
... / ...
CommitLineData
1## -*-makefile-*-
2## os/390, z/OS specific setup
3## Copyright (c) 1999-2006, International Business Machines Corporation and
4## others. All Rights Reserved.
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# #
17# To build a version of ICU which uses IEEE Floating point #
18# #
19# export IEEE390=1 #
20# #
21# To build a version of ICU which uses a two common libraries #
22# where the smaller one is loaded first. #
23# #
24# export OS390_STUBDATA=1 #
25# #
26# To build a version of ICU which exploits the C/C++ compiler #
27# and runtime Extra Performance Linkage (XPLINK), specify #
28# #
29# export OS390_XPLINK=1 #
30# #
31###################################################################
32
33# TODO: Fix this configuration so that icu-config will work!
34# If statements don't work well when icu-config is generated.
35ifeq (${IEEE390},)
36IEEE390=1#M#
37endif
38
39ifeq (${IEEE390}, 1)
40ICU_IEEE = -Wc,'float(ieee)'
41else
42ICU_IEEE = -DIEEE_754=0#M#
43endif
44
45# For a dynamically called DLL module to share access to the POSIX external
46# variables, with its caller, the DLL module must define these _SHR_* macros.
47SHAREDLIBCPPFLAGS = -D_SHR_TZNAME -D_SHR_TIMEZONE
48
49## Additional flags when building libraries and with threads
50THREADSCPPFLAGS = -D_OPEN_THREADS
51
52# -Wc,expo is used to export all functions
53SHAREDLIBCFLAGS = -Wc,expo
54SHAREDLIBCXXFLAGS = -Wc,expo
55
56# TODO: Consider using -Wc,roc,ros for making the data and strings readonly
57# -Wc,"ros" seems to work, but not the "roc"
58# -+ means accept any file extension as a C++ file. By default only .C is accepted.
59CFLAGS += -Wc,'langlvl(extended),spill(2000),ros,dll' $(ICU_IEEE)
60CXXFLAGS += -Wc,'langlvl(extended),spill(2000),ros,dll' $(ICU_IEEE) -+
61DEFS += -D_XOPEN_SOURCE_EXTENDED -D_MSE_PROTOS
62ARFLAGS = -cr
63
64ifeq (${OS390_XPLINK}, 1)
65#SH# if [ "x$OS390_XPLINK" = "x1" ]; then
66# Note: The following options require the PTF for PQ69418 on z/OS 1.2
67# and later.
68# These lines must be the last options specified.
69ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs)' -Wc,'GOFF,NOCSECT,RENT'
70ICU_XPLINK_CPP = -Wc,'xplink(backchain,storeargs)' -Wc,'GOFF,NOCSECT,NOTEMPINC'
71ICU_XPLINK_L = -Wl,dll,xplink -Wl,EDIT=NO
72#SH# fi
73endif
74
75## OS390BATCH
76ifeq (${OS390BATCH},1)
77DEFS += -DOS390BATCH#M#
78endif
79
80## Commands to generate dependency files
81GEN_DEPS.c= makedep
82GEN_DEPS.cc= makedep
83
84## Commands to compile
85# _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
86# it's only needed for long function names
87COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c
88COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CPP) -c
89
90# Commands to link
91LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
92LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
93
94## Commands for shared library (dll)
95SHLIB.c= $(LINK.c)
96SHLIB.cc= $(LINK.cc)
97
98## Compiler switch to embed a runtime search path
99LD_RPATH= -I
100
101## Environment variable to set a runtime search path
102LDLIBRARYPATH_ENVVAR = LIBPATH
103
104## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
105IMPORT_LIB_EXT = .x
106
107## Versioned target for a shared library.
108FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
109MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
110
111## Versioned import library names.
112IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
113MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
114FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
115
116## Non-shared intermediate object suffix
117STATIC_O = o
118
119ifeq ($(OS390_STUBDATA),1)
120## Suffix of the subset data library for dual common library support
121STUB_SUFFIX=_stub#M#
122DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M#
123endif
124
125ifeq ($(OS390BATCH),1)
126ifeq ($(OS390_STUBDATA),1)
127BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
128BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
129else
130BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
131BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
132PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"
133endif
134
135BATCH_COMMON_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
136BATCH_I18N_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
137BATCH_IO_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
138BATCH_LAYOUT_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'"
139BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'"
140
141BATCH_LIBICUUC= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
142BATCH_LIBICUI18N= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
143BATCH_LIBICUIO= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
144BATCH_LIBICULE= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'"
145BATCH_LIBICULX= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'"
146endif
147
148## Link commands to link to ICU libs
149LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
150LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
151LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
152LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
153LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
154LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
155LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
156LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
157
158ifneq (${ICUDATA_CHAR},e)
159#SH# if [ "$ICUDATA_CHAR" != "e" ]; then
160## We're in ASCII mode.
161CFLAGS += -Wc,'ascii'
162CXXFLAGS += -Wc,'ascii'
163SO = so
164else
165#SH# else
166## We're in EBCDIC mode.
167## Shared object suffix
168SO = dll
169endif
170#SH# fi
171
172## Special 390 rules
173
174## Build archive from object
175%.a : $(OBJECTS)
176 $(AR) $(ARFLAGS) $@ $(OBJECTS)
177
178## Compilation rules
179%.$(STATIC_O): $(srcdir)/%.c
180 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
181%.o: $(srcdir)/%.c
182 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
183
184%.$(STATIC_O): $(srcdir)/%.cpp
185 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
186%.o: $(srcdir)/%.cpp
187 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
188
189## Dependency rules
190%.d : %.u
191 @$(SHELL) -ec 'cat $< \
192 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
193 [ -s $@ ] || rm -f $@ ; rm -f $<'
194
195%.u : $(srcdir)/%.c
196 @echo "generating dependency information for $<"
197 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
198 @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
199
200%.u : $(srcdir)/%.cpp
201 @echo "generating dependency information for $<"
202 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
203 @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
204
205## Versioned libraries rules
206%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
207 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
208%.$(SO): %$(SO_TARGET_VERSION).$(SO)
209 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
210
211## Install libraries as executable
212INSTALL-L=$(INSTALL_PROGRAM)
213
214## End 390-specific setup