]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | #!/bin/sh |
374ca955 | 2 | # Copyright (c) 1999-2004, International Business Machines Corporation and |
b75a7d8f A |
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 | |
374ca955 | 35 | AIXGCC Use GCC on AIX |
b75a7d8f A |
36 | ALPHA/LINUXGCC Use GCC on Alpha/Linux systems |
37 | ALPHA/LINUXCCC Use Compaq C compiler on Alpha/Linux systems | |
374ca955 A |
38 | BeOS Use the GNU C++ compiler on BeOS |
39 | Cygwin Use the GNU C++ compiler on Cygwin | |
40 | Cygwin/MSVC Use the Microsoft Visual C++ compiler on Cygwin | |
b75a7d8f | 41 | FreeBSD Use the GNU C++ compiler on Free BSD |
b75a7d8f | 42 | HP-UX11ACC Use the Advanced C++ compiler on HP-UX 11 |
374ca955 | 43 | HP-UX11CC Use HP's C++ compiler on HP-UX 11 |
b75a7d8f | 44 | LinuxRedHat Use the GNU C++ compiler on Linux |
374ca955 A |
45 | LINUX/ECC Use the Intel ECC compiler on Linux |
46 | LINUX/ICC Use the Intel ICC compiler on Linux | |
47 | LINUX/VA Use IBM's Visual Age compiler on Power PC Linux | |
b75a7d8f A |
48 | MacOSX Use the GNU C++ compiler on MacOS X (Darwin) |
49 | QNX Use QNX's QCC compiler on QNX/Neutrino | |
50 | SOLARISCC Use Sun's CC compiler on Solaris | |
51 | SOLARISCC/W4.2 Use Sun's Workshop 4.2 CC compiler on Solaris | |
52 | SOLARISGCC Use the GNU C++ compiler on Solaris | |
53 | SOLARISX86 Use Sun's CC compiler on Solaris x86 | |
54 | TRU64V5.1/CXX Use Compaq's cxx compiler on Tru64 (OSF) | |
55 | zOS Use IBM's cxx compiler on z/OS (os/390) | |
56 | zOSV1R2 Use IBM's cxx compiler for z/OS 1.2 | |
57 | OS390V2R10 Use IBM's cxx compiler for OS/390 2.10 | |
58 | EOE | |
59 | fi | |
60 | ||
61 | exit $ec | |
62 | } | |
63 | ||
64 | # Parse arguments | |
65 | ||
66 | platform= | |
67 | debug=0 | |
68 | release=1 | |
69 | ||
70 | while test $# -ne 0 | |
71 | do | |
72 | case "$1" in | |
73 | -h|--help) | |
74 | usage 0 | |
75 | ;; | |
76 | --enable-debug) | |
77 | debug=1 | |
374ca955 | 78 | OPTS="$OPTS --enable-debug" |
b75a7d8f A |
79 | ;; |
80 | --disable-release) | |
b75a7d8f | 81 | release=0 |
374ca955 | 82 | OPTS="$OPTS --disable-release" |
b75a7d8f A |
83 | ;; |
84 | *) | |
85 | platform="$1" | |
86 | shift | |
87 | break | |
88 | ;; | |
89 | esac | |
90 | shift | |
91 | done | |
92 | ||
93 | if test x$platform = x | |
94 | then | |
95 | usage 1 | |
96 | fi | |
97 | ||
98 | # Go. | |
99 | ||
100 | rm -f config.cache | |
101 | rm -f config.log | |
102 | rm -f config.status | |
103 | ||
104 | DEBUG_CFLAGS='-g' | |
105 | DEBUG_CXXFLAGS='-g' | |
106 | ||
107 | if test x$configure = x | |
108 | then | |
109 | if test -f ./configure | |
110 | then | |
111 | configuredir=. | |
112 | else | |
113 | configuredir=`echo $0 | sed 's,[^/]*$,,'` | |
114 | if test x$configuredir = x$0 | |
115 | then | |
116 | configuredir=. | |
117 | fi | |
118 | fi | |
119 | ||
120 | if test x$configuredir = x | |
121 | then | |
122 | configuredir=. | |
123 | fi | |
124 | ||
125 | configure=$configuredir/configure | |
126 | fi | |
127 | ||
128 | case $platform in | |
129 | AIX4.3xlC) | |
130 | THE_OS=AIX | |
131 | THE_COMP="xlC_r" | |
132 | CC=/usr/ibmcxx/bin/xlc_r; export CC | |
133 | CXX=/usr/ibmcxx/bin/xlC_r; export CXX | |
134 | RELEASE_CFLAGS="-O -qmaxmem=-1" | |
135 | RELEASE_CXXFLAGS="-O -qmaxmem=-1" | |
136 | ;; | |
137 | AIX4.3xlC_nothreads) | |
138 | THE_OS=AIX | |
139 | THE_COMP="xlC" | |
140 | CC=/usr/ibmcxx/bin/xlc; export CC | |
141 | CXX=/usr/ibmcxx/bin/xlC; export CXX | |
142 | AIX_SHLIB=/usr/ibmcxx/bin/makeC++SharedLib; export AIX_SHLIB | |
143 | RELEASE_CFLAGS="-O -qmaxmem=-1" | |
144 | RELEASE_CXXFLAGS="-O -qmaxmem=-1" | |
145 | OPTS="$OPTS --enable-threads=no" | |
146 | ;; | |
147 | AIX4.3VA) | |
148 | THE_OS=AIX | |
149 | THE_COMP="xlC_r" | |
150 | CC=`which xlc_r`; export CC | |
151 | CXX=`which xlC_r`; export CXX | |
152 | RELEASE_CFLAGS="-O2 -qmaxmem=-1" | |
153 | RELEASE_CXXFLAGS="-O2 -qmaxmem=-1" | |
154 | #LDFLAGS=-L/usr/lpp/xlC/lib; export LDFLAGS | |
155 | ;; | |
374ca955 A |
156 | # For no threads use --enable-threads=no. Visual Age makes no distinction between xlC and xlC_r or any other _r programs. |
157 | AIXGCC) | |
158 | THE_OS=AIX | |
159 | THE_COMP="gcc" | |
160 | CC=`which gcc`; export CC | |
161 | CXX=`which g++`; export CXX | |
162 | ;; | |
b75a7d8f A |
163 | SOLARISX86) |
164 | THE_OS="SOLARIS X86" | |
165 | THE_COMP="Sun's CC" | |
166 | CC=`which cc`; export CC | |
167 | CXX=`which CC`; export CXX | |
168 | CXX_FLAGS="-w";export CXX_FLAGS | |
169 | C_FLAGS="-w";export C_FLAGS | |
170 | LDFLAGS="-L -lCrun";export LDFLAGS | |
171 | RELEASE_CFLAGS=-xO3 | |
172 | RELEASE_CXXFLAGS=-O3 | |
173 | ;; | |
174 | SOLARISCC) | |
175 | THE_OS=SOLARIS | |
176 | THE_COMP="Sun's CC" | |
177 | CC=`which cc`; export CC | |
178 | CXX=`which CC`; export CXX | |
179 | RELEASE_CFLAGS=-xO4 | |
180 | RELEASE_CXXFLAGS=-O4 | |
181 | ;; | |
182 | SOLARISCC/W4.2) | |
183 | THE_OS=SOLARIS | |
184 | THE_COMP="Sun's CC" | |
185 | CC=`which cc`; export CC | |
186 | CXX=`which CC`; export CXX | |
187 | RELEASE_CFLAGS=-x04 | |
188 | RELEASE_CXXFLAGS="-O4 +d" | |
189 | ;; | |
190 | SOLARISGCC) | |
191 | THE_OS=SOLARIS | |
192 | THE_COMP="the GNU C++" | |
374ca955 A |
193 | CXXFLAGS="$CXXFLAGS -I/usr/local/include/g++"; export CXXFLAGS |
194 | LDFLAGS="$LDFLAGS -R/usr/local/lib"; export LDFLAGS | |
195 | RELEASE_CXXFLAGS=-O | |
196 | RELEASE_CFLAGS=-O3 | |
b75a7d8f A |
197 | ;; |
198 | HP-UX11CC) | |
199 | THE_OS="HP-UX 11" | |
200 | THE_COMP="HP's CC" | |
201 | CC=cc; export CC | |
202 | CXX=CC; export CXX | |
203 | RELEASE_CFLAGS='+O2 +Ofltacc' | |
204 | RELEASE_CXXFLAGS='+O2 +Ofltacc' | |
205 | ;; | |
206 | HP-UX11ACC) | |
207 | THE_OS="HP-UX 11" | |
208 | THE_COMP="aCC" | |
209 | CC=cc; export CC | |
210 | CXX=aCC; export CXX | |
211 | RELEASE_CFLAGS='+O2 +Ofltacc' | |
212 | RELEASE_CXXFLAGS='+O2 +Ofltacc' | |
213 | ;; | |
214 | TRU64V5.1/CXX) | |
215 | THE_OS="OSF1" | |
216 | THE_COMP="Compaq cxx" | |
217 | CC=cc; export CC | |
218 | CXX=cxx; export CXX | |
219 | ;; | |
220 | ALPHA/LINUXCCC) | |
221 | THE_OS="Linux" | |
222 | THE_COMP="Compaq's CC" | |
223 | CC=ccc; export CC | |
224 | CXX=cxx; export CXX | |
225 | RELEASE_CFLAGS='-O4' | |
226 | RELEASE_CXXFLAGS='-O4' | |
227 | ;; | |
228 | ALPHA/LINUXGCC) | |
229 | THE_OS="Linux" | |
230 | THE_COMP="the GNU C++" | |
231 | CC=gcc; export CC | |
232 | CXX=g++; export CXX | |
233 | ;; | |
234 | LinuxRedHat*) | |
235 | THE_OS="Linux" | |
236 | THE_COMP="the GNU C++" | |
237 | CC=gcc; export CC | |
238 | CXX=g++; export CXX | |
239 | ;; | |
374ca955 A |
240 | LINUX/ECC) |
241 | THE_OS="Linux" | |
242 | THE_COMP="Intel ECC 7.1" | |
243 | CC=ecc; export CC | |
244 | CXX=ecpc; export CXX | |
245 | RELEASE_CFLAGS='-O2' | |
246 | RELEASE_CXXFLAGS='-O2' | |
247 | ;; | |
248 | LINUX/ICC) | |
249 | THE_OS="Linux" | |
250 | THE_COMP="Intel ICC 6.0" | |
251 | CC=icc; export CC | |
252 | CXX=icpc; export CXX | |
253 | RELEASE_CFLAGS='-O0' | |
254 | RELEASE_CXXFLAGS='-O0' | |
255 | ;; | |
256 | LINUX/VA) | |
257 | THE_OS="Linux" | |
258 | THE_COMP="IBM Visual Age C++ Compiler" | |
259 | CC=`which xlc_r`; export CC | |
260 | CXX=`which xlC_r`; export CXX | |
261 | RELEASE_CFLAGS="-O2 -qmaxmem=-1" | |
262 | RELEASE_CXXFLAGS="-O2 -qmaxmem=-1" | |
263 | ;; | |
264 | Cygwin) | |
265 | THE_OS="Cygwin" | |
b75a7d8f | 266 | THE_COMP="the GNU C++" |
374ca955 A |
267 | RELEASE_CFLAGS='-O3' |
268 | RELEASE_CXXFLAGS='-O3' | |
269 | ;; | |
270 | Cygwin/MSVC) | |
271 | THE_OS="Windows with Cygwin" | |
272 | THE_COMP="Microsoft Visual C++" | |
273 | CC=cl; export CC | |
274 | CXX=cl; export CXX | |
275 | RELEASE_CFLAGS='/O2 /Ob2' | |
276 | RELEASE_CXXFLAGS='/O2 /Ob2' | |
277 | # The real debug flags are defined by the mh file because configure can't handle them. | |
278 | DEBUG_CFLAGS= | |
279 | DEBUG_CXXFLAGS= | |
b75a7d8f A |
280 | ;; |
281 | MacOSX) | |
282 | THE_OS="MacOS X (Darwin)" | |
283 | THE_COMP="the GNU C++" | |
284 | RELEASE_CFLAGS='-O2' | |
285 | RELEASE_CXXFLAGS='-O2' | |
286 | ;; | |
287 | *BSD) | |
288 | THE_OS="BSD" | |
289 | THE_COMP="the GNU C++" | |
290 | CC=gcc; export CC | |
291 | CXX=g++; export CXX | |
292 | ;; | |
293 | QNX) | |
294 | THE_OS="QNX" | |
295 | THE_COMP="QNX cc" | |
296 | CC=qcc; export CC | |
297 | CXX=QCC; export CXX | |
298 | ;; | |
374ca955 A |
299 | BeOS) |
300 | THE_OS="BeOS" | |
301 | THE_COMP="the GNU C++" | |
302 | OPTIMIZATIONS="-fdefault-inline -fdefer-pop -fforce-mem -fforce-addr \ | |
303 | -finline -finline-functions \ | |
304 | -fkeep-inline-functions -fkeep-static-consts -fbranch-count-reg \ | |
305 | -ffunction-cse -fstrength-reduce -fthread-jumps -fcse-follow-jumps \ | |
306 | -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt \ | |
307 | -fexpensive-optimizations -foptimize-register-move -fregmove \ | |
308 | -fschedule-insns -fschedule-insns2 -ffloat-store -funroll-loops \ | |
309 | -fmove-all-movables -freduce-all-givs -fpeephole \ | |
310 | -funroll-all-loops -ffunction-sections -fdata-sections" | |
311 | RELEASE_CFLAGS="$OPTIMIZATIONS" | |
312 | RELEASE_CXXFLAGS="$OPTIMIZATIONS" | |
313 | ;; | |
b75a7d8f A |
314 | zOS) |
315 | THE_OS="z/OS (OS/390)" | |
316 | THE_COMP="z/OS 1.2 (through OS/390 v2r10) C/C++" | |
317 | CC=cc; export CC | |
318 | CXX=cxx; export CXX | |
319 | export RELEASE_CFLAGS='-2' | |
320 | export RELEASE_CXXFLAGS='-2' | |
321 | ;; | |
322 | zOSV1R2) | |
323 | THE_OS="z/OS 1.2" | |
324 | THE_COMP="z/OS 1.2 C/C++" | |
325 | CC=cc; export CC | |
326 | CXX=cxx; export CXX | |
327 | export COMPILE_LINK_ENVVAR='_CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000' | |
328 | export _CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000 | |
329 | export LDFLAGS=-Wl,"compat=pm3" | |
330 | export CFLAGS='-Wc,"target(zOSV1R2)"' | |
331 | export CXXFLAGS='-Wc,"target(zOSV1R2)"' | |
332 | export RELEASE_CFLAGS='-2' | |
333 | export RELEASE_CXXFLAGS='-2' | |
334 | ;; | |
335 | OS390V2R10) | |
336 | THE_OS="OS/390 2.10" | |
337 | THE_COMP="OS/390 2.10 C/C++" | |
338 | CC=cc; export CC | |
339 | CXX=cxx; export CXX | |
340 | export COMPILE_LINK_ENVVAR='_CXX_CVERSION=0x220A0000 _C89_CVERSION=0x220A0000 _CC_CVERSION=0x220A0000 _CXX_PVERSION=0x220A0000 _C89_PVERSION=0x220A0000 _CC_PVERSION=0x220A0000' | |
341 | export _CXX_CVERSION=0x220A0000 _C89_CVERSION=0x220A0000 _CC_CVERSION=0x220A0000 _CXX_PVERSION=0x220A0000 _C89_PVERSION=0x220A0000 _CC_PVERSION=0x220A0000 | |
342 | export LDFLAGS=-Wl,"compat=pm3" | |
343 | export CFLAGS='-Wc,"target(OSV2R10)"' | |
344 | export CXXFLAGS='-Wc,"target(OSV2R10)"' | |
345 | export RELEASE_CFLAGS='-2' | |
346 | export RELEASE_CXXFLAGS='-2' | |
347 | ;; | |
348 | *) | |
349 | >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)" | |
350 | exit 1;; | |
351 | esac | |
352 | ||
353 | ||
354 | # Tweak flags | |
355 | ||
356 | if test $release -eq 1 | |
357 | then | |
358 | if test "$RELEASE_CFLAGS" = "" | |
359 | then | |
360 | case $CC in | |
361 | gcc|*/gcc|*-gcc-*|*/*-gcc-*) | |
362 | RELEASE_CFLAGS=-O3 | |
363 | ;; | |
364 | esac | |
365 | fi | |
366 | if test "$RELEASE_CFLAGS" != "" | |
367 | then | |
368 | CFLAGS="$CFLAGS $RELEASE_CFLAGS" | |
369 | fi | |
370 | export CFLAGS | |
371 | if test "$RELEASE_CXXFLAGS" = "" | |
372 | then | |
373 | case $CXX in | |
374 | g++|*/g++|*-g++-*|*/*-g++-*) | |
375 | RELEASE_CXXFLAGS=-O | |
376 | ;; | |
377 | esac | |
378 | fi | |
379 | if test "$RELEASE_CXXFLAGS" != "" | |
380 | then | |
381 | CXXFLAGS="$CXXFLAGS $RELEASE_CXXFLAGS" | |
382 | fi | |
383 | export CXXFLAGS | |
384 | fi | |
385 | ||
386 | if test $debug -eq 1 | |
387 | then | |
388 | if test "$DEBUG_CFLAGS" != "" | |
389 | then | |
390 | CFLAGS="$CFLAGS $DEBUG_CFLAGS" | |
391 | fi | |
392 | export CFLAGS | |
393 | if test "$DEBUG_CXXFLAGS" != "" | |
394 | then | |
395 | CXXFLAGS="$CXXFLAGS $DEBUG_CXXFLAGS" | |
396 | fi | |
397 | export CXXFLAGS | |
374ca955 A |
398 | if test "$DEBUG_LDFLAGS" != "" |
399 | then | |
400 | LDFLAGS="$LDFLAGS $DEBUG_LDFLAGS" | |
401 | fi | |
402 | export LDFLAGS | |
b75a7d8f A |
403 | fi |
404 | ||
405 | # Run configure | |
406 | ||
407 | echo "Running ./configure $OPTS $@ for $THE_OS using $THE_COMP compiler" | |
408 | echo | |
409 | $configure $OPTS $@ | |
410 | echo | |
411 | echo If the result of the above commands looks okay to you, go to the directory | |
412 | echo source in the ICU distribution to build ICU. Please remember that ICU needs | |
413 | echo GNU make to build properly... |