]> git.saurik.com Git - apple/icu.git/blob - icuSources/runConfigureICU
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / runConfigureICU
1 #!/bin/sh
2 # Copyright (c) 1999-2003, International Business Machines Corporation and
3 # others. All Rights Reserved.
4
5 # runConfigureICU: This script will run the "configure" script for the appropriate platform
6 # Only supported platforms are recognized
7
8 me=`basename $0`
9 OPTS=
10
11 usage()
12 {
13 ec=0$1
14 if test $ec -eq 0
15 then
16 uletter=U
17 else
18 uletter=u
19 fi
20
21 echo "${uletter}sage: $me [ -h, --help ] [ --enable-debug | --disable-release ] platform [ configurearg ... ]"
22 if test $ec -eq 0
23 then
24 cat <<EOE
25
26 Options: -h, --help Print this message and exit
27 --enable-debug Enable support for debugging
28 --disable-release Disable presetting optimization flags
29
30 The following names can be supplied as the argument for platform:
31
32 AIX4.3xlC Use IBM's xlC on AIX 4.3
33 AIX4.3xlC_nothreads Use IBM's xlC on AIX 4.3 with no multithreading
34 AIX4.3VA Use IBM's Visual Age xlC_r compiler on AIX 4.3
35 ALPHA/LINUXGCC Use GCC on Alpha/Linux systems
36 ALPHA/LINUXCCC Use Compaq C compiler on Alpha/Linux systems
37 CygWin Use the GNU C++ compiler on CygWin
38 FreeBSD Use the GNU C++ compiler on Free BSD
39 HP-UX11CC Use HP's C++ compiler on HP-UX 11
40 HP-UX11ACC Use the Advanced C++ compiler on HP-UX 11
41 LinuxRedHat Use the GNU C++ compiler on Linux
42 MacOSX Use the GNU C++ compiler on MacOS X (Darwin)
43 QNX Use QNX's QCC compiler on QNX/Neutrino
44 SOLARISCC Use Sun's CC compiler on Solaris
45 SOLARISCC/W4.2 Use Sun's Workshop 4.2 CC compiler on Solaris
46 SOLARISGCC Use the GNU C++ compiler on Solaris
47 SOLARISX86 Use Sun's CC compiler on Solaris x86
48 TRU64V5.1/CXX Use Compaq's cxx compiler on Tru64 (OSF)
49 zOS Use IBM's cxx compiler on z/OS (os/390)
50 zOSV1R2 Use IBM's cxx compiler for z/OS 1.2
51 OS390V2R10 Use IBM's cxx compiler for OS/390 2.10
52 EOE
53 fi
54
55 exit $ec
56 }
57
58 # Parse arguments
59
60 platform=
61 debug=0
62 release=1
63
64 while test $# -ne 0
65 do
66 case "$1" in
67 -h|--help)
68 usage 0
69 ;;
70 --enable-debug)
71 debug=1
72 release=0
73 ;;
74 --disable-release)
75 debug=0
76 release=0
77 ;;
78 *)
79 platform="$1"
80 shift
81 break
82 ;;
83 esac
84 shift
85 done
86
87 if test x$platform = x
88 then
89 usage 1
90 fi
91
92 # Go.
93
94 rm -f config.cache
95 rm -f config.log
96 rm -f config.status
97
98 DEBUG_CFLAGS='-g'
99 DEBUG_CXXFLAGS='-g'
100
101 if test x$configure = x
102 then
103 if test -f ./configure
104 then
105 configuredir=.
106 else
107 configuredir=`echo $0 | sed 's,[^/]*$,,'`
108 if test x$configuredir = x$0
109 then
110 configuredir=.
111 fi
112 fi
113
114 if test x$configuredir = x
115 then
116 configuredir=.
117 fi
118
119 configure=$configuredir/configure
120 fi
121
122 case $platform in
123 AIX4.3xlC)
124 THE_OS=AIX
125 THE_COMP="xlC_r"
126 CC=/usr/ibmcxx/bin/xlc_r; export CC
127 CXX=/usr/ibmcxx/bin/xlC_r; export CXX
128 RELEASE_CFLAGS="-O -qmaxmem=-1"
129 RELEASE_CXXFLAGS="-O -qmaxmem=-1"
130 ;;
131 AIX4.3xlC_nothreads)
132 THE_OS=AIX
133 THE_COMP="xlC"
134 CC=/usr/ibmcxx/bin/xlc; export CC
135 CXX=/usr/ibmcxx/bin/xlC; export CXX
136 AIX_SHLIB=/usr/ibmcxx/bin/makeC++SharedLib; export AIX_SHLIB
137 RELEASE_CFLAGS="-O -qmaxmem=-1"
138 RELEASE_CXXFLAGS="-O -qmaxmem=-1"
139 OPTS="$OPTS --enable-threads=no"
140 ;;
141 AIX4.3VA)
142 THE_OS=AIX
143 THE_COMP="xlC_r"
144 CC=`which xlc_r`; export CC
145 CXX=`which xlC_r`; export CXX
146 RELEASE_CFLAGS="-O2 -qmaxmem=-1"
147 RELEASE_CXXFLAGS="-O2 -qmaxmem=-1"
148 #LDFLAGS=-L/usr/lpp/xlC/lib; export LDFLAGS
149 ;;
150 # Just use --enable-threads=no. Visual Age makes no distinction between xlC and xlC_r or any other _r programs.
151 # AIX4.3VA_nothreads)
152 # THE_OS=AIX
153 # THE_COMP="xlC"
154 # # Only in Visual Age, there is no different between xlc and xlc_r.
155 # CC=`which xlc`; export CC
156 # CXX=`which xlC`; export CXX
157 # OPTS="$OPTS --enable-threads=no"
158 # RELEASE_CFLAGS="-O2 -qmaxmem=-1"
159 # RELEASE_CXXFLAGS="-O2 -qmaxmem=-1"
160 # #LDFLAGS=-L/usr/lpp/xlC/lib; export LDFLAGS
161 # ;;
162 SOLARISX86)
163 THE_OS="SOLARIS X86"
164 THE_COMP="Sun's CC"
165 CC=`which cc`; export CC
166 CXX=`which CC`; export CXX
167 CXX_FLAGS="-w";export CXX_FLAGS
168 C_FLAGS="-w";export C_FLAGS
169 LDFLAGS="-L -lCrun";export LDFLAGS
170 RELEASE_CFLAGS=-xO3
171 RELEASE_CXXFLAGS=-O3
172 ;;
173 SOLARISCC)
174 THE_OS=SOLARIS
175 THE_COMP="Sun's CC"
176 CC=`which cc`; export CC
177 CXX=`which CC`; export CXX
178 RELEASE_CFLAGS=-xO4
179 RELEASE_CXXFLAGS=-O4
180 ;;
181 SOLARISCC/W4.2)
182 THE_OS=SOLARIS
183 THE_COMP="Sun's CC"
184 CC=`which cc`; export CC
185 CXX=`which CC`; export CXX
186 RELEASE_CFLAGS=-x04
187 RELEASE_CXXFLAGS="-O4 +d"
188 ;;
189 SOLARISGCC)
190 THE_OS=SOLARIS
191 THE_COMP="the GNU C++"
192 CXXFLAGS=-I/usr/local/include/g++; export CXXFLAGS
193 LDFLAGS=-R/usr/local/lib; export LDFLAGS
194 ;;
195 HP-UX11CC)
196 THE_OS="HP-UX 11"
197 THE_COMP="HP's CC"
198 CC=cc; export CC
199 CXX=CC; export CXX
200 RELEASE_CFLAGS='+O2 +Ofltacc'
201 RELEASE_CXXFLAGS='+O2 +Ofltacc'
202 ;;
203 HP-UX11ACC)
204 THE_OS="HP-UX 11"
205 THE_COMP="aCC"
206 CC=cc; export CC
207 CXX=aCC; export CXX
208 RELEASE_CFLAGS='+O2 +Ofltacc'
209 RELEASE_CXXFLAGS='+O2 +Ofltacc'
210 ;;
211 TRU64V5.1/CXX)
212 THE_OS="OSF1"
213 THE_COMP="Compaq cxx"
214 CC=cc; export CC
215 CXX=cxx; export CXX
216 ;;
217 ALPHA/LINUXCCC)
218 THE_OS="Linux"
219 THE_COMP="Compaq's CC"
220 CC=ccc; export CC
221 CXX=cxx; export CXX
222 RELEASE_CFLAGS='-O4'
223 RELEASE_CXXFLAGS='-O4'
224 ;;
225 ALPHA/LINUXGCC)
226 THE_OS="Linux"
227 THE_COMP="the GNU C++"
228 CC=gcc; export CC
229 CXX=g++; export CXX
230 ;;
231 LinuxRedHat*)
232 THE_OS="Linux"
233 THE_COMP="the GNU C++"
234 CC=gcc; export CC
235 CXX=g++; export CXX
236 ;;
237 CygWin)
238 THE_OS="CygWin"
239 THE_COMP="the GNU C++"
240 ;;
241 MacOSX)
242 THE_OS="MacOS X (Darwin)"
243 THE_COMP="the GNU C++"
244 RELEASE_CFLAGS='-O2'
245 RELEASE_CXXFLAGS='-O2'
246 ;;
247 *BSD)
248 THE_OS="BSD"
249 THE_COMP="the GNU C++"
250 CC=gcc; export CC
251 CXX=g++; export CXX
252 ;;
253 QNX)
254 THE_OS="QNX"
255 THE_COMP="QNX cc"
256 CC=qcc; export CC
257 CXX=QCC; export CXX
258 ;;
259 zOS)
260 THE_OS="z/OS (OS/390)"
261 THE_COMP="z/OS 1.2 (through OS/390 v2r10) C/C++"
262 CC=cc; export CC
263 CXX=cxx; export CXX
264 export RELEASE_CFLAGS='-2'
265 export RELEASE_CXXFLAGS='-2'
266 ;;
267 zOSV1R2)
268 THE_OS="z/OS 1.2"
269 THE_COMP="z/OS 1.2 C/C++"
270 CC=cc; export CC
271 CXX=cxx; export CXX
272 export COMPILE_LINK_ENVVAR='_CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000'
273 export _CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000
274 export LDFLAGS=-Wl,"compat=pm3"
275 export CFLAGS='-Wc,"target(zOSV1R2)"'
276 export CXXFLAGS='-Wc,"target(zOSV1R2)"'
277 export RELEASE_CFLAGS='-2'
278 export RELEASE_CXXFLAGS='-2'
279 ;;
280 OS390V2R10)
281 THE_OS="OS/390 2.10"
282 THE_COMP="OS/390 2.10 C/C++"
283 CC=cc; export CC
284 CXX=cxx; export CXX
285 export COMPILE_LINK_ENVVAR='_CXX_CVERSION=0x220A0000 _C89_CVERSION=0x220A0000 _CC_CVERSION=0x220A0000 _CXX_PVERSION=0x220A0000 _C89_PVERSION=0x220A0000 _CC_PVERSION=0x220A0000'
286 export _CXX_CVERSION=0x220A0000 _C89_CVERSION=0x220A0000 _CC_CVERSION=0x220A0000 _CXX_PVERSION=0x220A0000 _C89_PVERSION=0x220A0000 _CC_PVERSION=0x220A0000
287 export LDFLAGS=-Wl,"compat=pm3"
288 export CFLAGS='-Wc,"target(OSV2R10)"'
289 export CXXFLAGS='-Wc,"target(OSV2R10)"'
290 export RELEASE_CFLAGS='-2'
291 export RELEASE_CXXFLAGS='-2'
292 ;;
293 *)
294 >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)"
295 exit 1;;
296 esac
297
298
299 # Tweak flags
300
301 if test $release -eq 1
302 then
303 if test "$RELEASE_CFLAGS" = ""
304 then
305 case $CC in
306 gcc|*/gcc|*-gcc-*|*/*-gcc-*)
307 RELEASE_CFLAGS=-O3
308 ;;
309 esac
310 fi
311 if test "$RELEASE_CFLAGS" != ""
312 then
313 CFLAGS="$CFLAGS $RELEASE_CFLAGS"
314 fi
315 export CFLAGS
316 if test "$RELEASE_CXXFLAGS" = ""
317 then
318 case $CXX in
319 g++|*/g++|*-g++-*|*/*-g++-*)
320 RELEASE_CXXFLAGS=-O
321 ;;
322 esac
323 fi
324 if test "$RELEASE_CXXFLAGS" != ""
325 then
326 CXXFLAGS="$CXXFLAGS $RELEASE_CXXFLAGS"
327 fi
328 export CXXFLAGS
329 fi
330
331 if test $debug -eq 1
332 then
333 if test "$DEBUG_CFLAGS" != ""
334 then
335 CFLAGS="$CFLAGS $DEBUG_CFLAGS"
336 fi
337 export CFLAGS
338 if test "$DEBUG_CXXFLAGS" != ""
339 then
340 CXXFLAGS="$CXXFLAGS $DEBUG_CXXFLAGS"
341 fi
342 export CXXFLAGS
343 fi
344
345 # Run configure
346
347 echo "Running ./configure $OPTS $@ for $THE_OS using $THE_COMP compiler"
348 echo
349 $configure $OPTS $@
350 echo
351 echo If the result of the above commands looks okay to you, go to the directory
352 echo source in the ICU distribution to build ICU. Please remember that ICU needs
353 echo GNU make to build properly...
354