Bug 1808234 - Clean up xpcshell variant scheduling. r=jmaher
[gecko.git] / intl / icu / source / runConfigureICU
blob3f8576da695676750e1540cb8b40038c25a2f4cf
1 #!/bin/sh
2 # Copyright (C) 2016 and later: Unicode, Inc. and others.
3 # License & terms of use: http://www.unicode.org/copyright.html
4 # Copyright (c) 1999-2015, International Business Machines Corporation and
5 # others. All Rights Reserved.
7 # runConfigureICU: This script will run the "configure" script for the appropriate platform
8 # Only supported platforms are recognized
10 me=`basename $0`
11 OPTS=
13 usage()
15 ec=0$1
16 if test $ec -eq 0
17 then
18 uletter=U
19 else
20 uletter=u
23 echo "${uletter}sage: $me [ -h, --help ] [ --enable-debug | --disable-release ] platform [ configurearg ... ]"
24 if test $ec -eq 0
25 then
26 cat <<EOE
28 Options: -h, --help Print this message and exit
29 --enable-debug Enable support for debugging
30 --disable-release Disable presetting optimization flags
32 If you want to add custom CFLAGS or CXXFLAGS or similar, provide them _before_
33 the runConfigureICU command:
35 CXXFLAGS=xyz path/to/runConfigureICU --enable-debug ...
37 The following names can be supplied as the argument for platform:
39 AIX Use the IBM XL xlclang/xlclang compilers on AIX
40 AIX/GCC Use the GNU gcc/g++ compilers on AIX
41 AIX/OpenXL Use the IBM Open XL ibm-clang_r/ibm-clang++_r compilers on AIX
42 Cygwin Use the GNU gcc/g++ compilers on Cygwin
43 Cygwin/MSVC Use the Microsoft Visual C++ compiler on Cygwin
44 Cygwin/MSVC2005 Use the Microsoft Visual C++ 2005 compiler on Cygwin
45 Cygwin/ICL Use the Intel C++ compiler on Cygwin
46 FreeBSD Use the clang/clang++ or GNU gcc/g++ compilers on FreeBSD
47 HP-UX/ACC Use the HP ANSI C/Advanced C++ compilers on HP-UX 11
48 IBMi Use the iCC compilers on IBM i, i5/OS, OS/400
49 Linux Use the clang/clang++ or GNU gcc/g++ compilers on Linux
50 Linux/gcc Use the GNU gcc/g++ compilers on Linux
51 Linux/ECC Use the Intel ECC compiler on Linux
52 Linux/ICC Use the Intel ICC compiler on Linux
53 Linux/VA Use the IBM XL compiler on Power PC Linux
54 MacOSX Use the default compilers on MacOS X (Darwin)
55 MacOSX/GCC Use the GNU gcc/g++ compilers on MacOSX (Darwin)
56 MinGW Use the GNU gcc/g++ compilers on MinGW
57 MSYS/MSVC Use the Microsoft Visual C++ computer on MSYS
58 QNX Use the QNX QCC compiler on QNX/Neutrino
59 Solaris Use the Sun cc/CC compilers on Solaris
60 Solaris/GCC Use the GNU gcc/g++ compilers on Solaris
61 SolarisX86 Use the Sun cc/CC compilers on Solaris x86
62 TRU64V5.1/CXX Use the Compaq cxx compiler on Tru64 (OSF)
63 zOS Use the IBM cxx compiler on z/OS (os/390)
64 zOSV1R2 Use the IBM cxx compiler for z/OS 1.2
65 EOE
68 exit $ec
71 # Parse arguments
73 platform=
74 debug=0
75 release=1
77 while test $# -ne 0
79 case "$1" in
80 -h|--help)
81 usage 0
83 --enable-debug)
84 debug=1
85 OPTS="$OPTS --enable-debug"
87 --disable-release)
88 release=0
89 OPTS="$OPTS --disable-release"
92 platform="$1"
93 shift
94 break
96 esac
97 shift
98 done
100 if test x$platform = x
101 then
102 usage 1
105 # Go.
107 rm -f config.cache
108 rm -f config.log
109 rm -f config.status
111 DEBUG_CFLAGS='-g'
112 DEBUG_CXXFLAGS='-g'
114 if test x$configure = x
115 then
116 if test -f ./configure
117 then
118 configuredir=.
119 else
120 configuredir=`echo $0 | sed 's,[^/]*$,,'`
121 if test x$configuredir = x$0
122 then
123 configuredir=.
127 if test x$configuredir = x
128 then
129 configuredir=.
132 configure=$configuredir/configure
135 case $platform in
136 AIX)
137 THE_OS=AIX
138 THE_COMP="xlclang"
139 CC=`which xlclang`; export CC
140 if [ ! -x $CC ]; then
141 echo "ERROR: xlclang was not found, please check the PATH to make sure it is correct."; exit 1
143 CXX=`which xlclang++`; export CXX
144 if [ ! -x $CXX ]; then
145 echo "ERROR: xlclang++ was not found, please check the PATH to make sure it is correct."; exit 1
147 RELEASE_CFLAGS="-O3 -qstrict=ieeefp"
148 RELEASE_CXXFLAGS="-O3 -qstrict=ieeefp"
150 AIX/GCC)
151 THE_OS=AIX
152 THE_COMP="the GNU C++"
153 CC=gcc; export CC
154 CXX=g++; export CXX
155 DEBUG_CFLAGS='-g -O0'
156 DEBUG_CXXFLAGS='-g -O0'
158 AIX/OpenXL)
159 THE_OS=AIX
160 THE_COMP="ibm-clang_r"
161 CC=`which ibm-clang_r`; export CC
162 if [ ! -x $CC ]; then
163 echo "ERROR: ibm-clang_r was not found, please check the PATH to make sure it is correct."; exit 1
165 CXX=`which ibm-clang++_r`; export CXX
166 if [ ! -x $CXX ]; then
167 echo "ERROR: ibm-clang++_r was not found, please check the PATH to make sure it is correct."; exit 1
169 RELEASE_CFLAGS="-O3"
170 RELEASE_CXXFLAGS="-O3"
172 Solaris)
173 THE_OS=SOLARIS
174 THE_COMP="Sun's CC"
175 CC=`which cc`; export CC
176 CXX=`which CC`; export CXX
177 RELEASE_CFLAGS="-xO1 -xlibmil"
178 RELEASE_CXXFLAGS="-O4 -xlibmil"
180 Solaris/GCC)
181 THE_OS=SOLARIS
182 THE_COMP="the GNU C++"
183 CC=gcc; export CC
184 CXX=g++; export CXX
185 RELEASE_CFLAGS=-O1
186 RELEASE_CXXFLAGS=-O2
188 SolarisX86)
189 THE_OS="SOLARIS X86"
190 THE_COMP="Sun's CC"
191 CC=`which cc`; export CC
192 CXX=`which CC`; export CXX
193 LDFLAGS="${LDFLAGS} -lCrun";export LDFLAGS
194 RELEASE_CFLAGS=-xO3
195 RELEASE_CXXFLAGS=-O3
197 HP-UX/ACC)
198 THE_OS="HP-UX 11"
199 THE_COMP="aCC"
200 CC=cc; export CC
201 CXX=aCC; export CXX
202 RELEASE_CFLAGS='+O2 +Ofltacc'
203 RELEASE_CXXFLAGS='+O2 +Ofltacc'
205 IBMi)
206 THE_OS="IBM i"
207 THE_COMP="the iCC C++"
208 CC=icc; export CC
209 CXX=icc; export CXX
210 CPP="$CC -c -qpponly"; export CPP
211 MAKE=gmake; export MAKE
212 U_MAKE=gmake; export U_MAKE
213 # gmake is a .pgm and may not be on the path. Don't use a full path, just use gmake.
214 ac_cv_path_U_MAKE=gmake; export ac_cv_path_U_MAKE
215 RELEASE_CFLAGS='-O4'
216 RELEASE_CXXFLAGS='-O4'
218 Linux/ECC)
219 THE_OS="Linux"
220 THE_COMP="Intel ECC 7.1"
221 CC=ecc; export CC
222 CXX=ecpc; export CXX
223 RELEASE_CFLAGS='-O2'
224 RELEASE_CXXFLAGS='-O2'
226 Linux/ICC)
227 THE_OS="Linux"
228 CC=`which icc`; export CC
229 CXX=`which icpc`; export CXX
230 ICC_VER=`${CC} -v 2>&1`
231 RELEASE_CFLAGS='-O'
232 RELEASE_CXXFLAGS='-O'
233 export CFLAGS="-fp-model precise"
234 export CXXFLAGS="-fp-model precise"
235 if [ "${ICC_VER}" = "Version 9.0 " ]; then
236 RELEASE_CFLAGS=''
237 RELEASE_CXXFLAGS=''
238 export CFLAGS="${CFLAGS} -O0"
239 export CXXFLAGS="${CXXFLAGS} -O0"
240 echo "ICC 9.0 does not work with optimization- disabling optimizations"
242 THE_COMP="Intel ${ICC_VER}"
244 Linux/VA)
245 THE_OS="Linux"
246 THE_COMP="IBM XL C++ Compiler"
247 CC=`which xlclang`; export CC
248 CXX=`which xlclang++`; export CXX
249 RELEASE_CFLAGS="-O3"
250 RELEASE_CXXFLAGS="-O3"
252 Linux/gcc)
253 THE_OS="Linux"
254 THE_COMP="the GNU C++"
255 CC=gcc; export CC
256 CXX=g++; export CXX
257 RELEASE_CFLAGS='-O3'
258 RELEASE_CXXFLAGS='-O3'
259 DEBUG_CFLAGS='-g'
260 DEBUG_CXXFLAGS='-g'
262 Linux*)
263 THE_OS="Linux"
264 THE_COMP="the clang or else GNU C++"
265 RELEASE_CFLAGS='-O3'
266 RELEASE_CXXFLAGS='-O3'
267 DEBUG_CFLAGS='-g'
268 DEBUG_CXXFLAGS='-g'
270 Cygwin)
271 THE_OS="Cygwin"
272 THE_COMP="the GNU C++"
273 RELEASE_CFLAGS='-O3'
274 RELEASE_CXXFLAGS='-O3'
276 Cygwin/MSVC)
277 THE_OS="Windows with Cygwin"
278 THE_COMP="Microsoft Visual C++"
279 CC=cl; export CC
280 CXX=cl; export CXX
281 RELEASE_CFLAGS='-Gy -MD'
282 RELEASE_CXXFLAGS='-Gy -MD'
283 DEBUG_CFLAGS='-FS -Zi -MDd'
284 DEBUG_CXXFLAGS='-FS -Zi -MDd'
285 DEBUG_LDFLAGS='-DEBUG'
287 Cygwin/MSVC2005)
288 THE_OS="Windows with Cygwin"
289 THE_COMP="Microsoft Visual C++ 2005"
290 CC=cl; export CC
291 CXX=cl; export CXX
292 RELEASE_CFLAGS='/Gy /MD'
293 RELEASE_CXXFLAGS='/Gy /MD'
294 DEBUG_CFLAGS='/Zi /MDd'
295 DEBUG_CXXFLAGS='/Zi /MDd'
296 DEBUG_LDFLAGS='/DEBUG'
298 Cygwin/ICL)
299 THE_OS="Windows with Cygwin"
300 THE_COMP="Intel C++"
301 CC=icl; export CC
302 CXX=icl; export CXX
303 # The Intel compiler has optimization bugs. So we disable optimization.
304 RELEASE_CFLAGS='/Od'
305 RELEASE_CXXFLAGS='/Od'
306 DEBUG_CFLAGS='/Zi'
307 DEBUG_CXXFLAGS='/Zi'
308 DEBUG_LDFLAGS='/DEBUG'
310 MacOSX)
311 THE_OS="MacOS X (Darwin)"
312 THE_COMP="the default"
313 RELEASE_CFLAGS='-O2'
314 RELEASE_CXXFLAGS='-O2'
315 DEBUG_CFLAGS='-g -O0'
316 DEBUG_CXXFLAGS='-g -O0'
318 MacOSX/GCC)
319 THE_OS="MacOS X (Darwin)"
320 THE_COMP="the GNU C++"
321 RELEASE_CFLAGS='-O2'
322 RELEASE_CXXFLAGS='-O2'
323 DEBUG_CFLAGS='-g -O0'
324 DEBUG_CXXFLAGS='-g -O0'
325 CC=gcc; export CC
326 CXX=g++; export CXX
328 MinGW)
329 THE_OS="MinGW"
330 THE_COMP="the GNU C++"
331 RELEASE_CFLAGS='-O3'
332 RELEASE_CXXFLAGS='-O3'
333 export CXXFLAGS
335 MSYS/MSVC)
336 THE_OS="MSYS"
337 THE_COMP="Microsoft Visual C++"
338 CC=cl; export CC
339 CXX=cl; export CXX
340 RELEASE_CFLAGS='-Gy -MD'
341 RELEASE_CXXFLAGS='-Gy -MD'
342 DEBUG_CFLAGS='-FS -Zi -MDd'
343 DEBUG_CXXFLAGS='-FS -Zi -MDd'
344 DEBUG_LDFLAGS='-DEBUG'
346 *BSD)
347 THE_OS="BSD"
348 THE_COMP="the GNU C++"
349 DEBUG_CFLAGS='-g -O0'
350 DEBUG_CXXFLAGS='-g -O0'
352 TRU64V5.1/CXX)
353 THE_OS="OSF1"
354 THE_COMP="Compaq cxx"
355 CC=cc; export CC
356 CXX=cxx; export CXX
358 QNX)
359 THE_OS="QNX"
360 THE_COMP="QNX cc"
361 CC=qcc; export CC
362 CXX=QCC; export CXX
364 zOS)
365 THE_OS="z/OS (OS/390)"
366 THE_COMP="z/OS C/C++"
367 CC=xlc; export CC
368 CXX=xlC; export CXX
369 RELEASE_CFLAGS="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
370 RELEASE_CXXFLAGS="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
372 zOSV1R2)
373 THE_OS="z/OS 1.2"
374 THE_COMP="z/OS 1.2 C/C++"
375 CC=cc; export CC
376 CXX=cxx; export CXX
377 export COMPILE_LINK_ENVVAR='_CXX_CICC_VER}=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000'
378 export _CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000
379 export LDFLAGS="-Wl,'compat=pm3'"
380 export CFLAGS="-Wc,'target(zOSV1R2)'"
381 export CXXFLAGS="-Wc,'target(zOSV1R2)'"
382 RELEASE_CFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'"
383 RELEASE_CXXFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'"
386 >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)"
387 exit 1;;
388 esac
391 # Tweak flags
393 if test $release -eq 1
394 then
395 if test "$RELEASE_CFLAGS" = ""
396 then
397 case $CC in
398 gcc|*/gcc|*-gcc-*|*/*-gcc-*)
399 RELEASE_CFLAGS=-O3
401 esac
403 if test "$RELEASE_CFLAGS" != ""
404 then
405 CFLAGS="$RELEASE_CFLAGS $CFLAGS"
407 if test "$RELEASE_CXXFLAGS" = ""
408 then
409 case $CXX in
410 g++|*/g++|*-g++-*|*/*-g++-*)
411 RELEASE_CXXFLAGS=-O3
413 esac
415 if test "$RELEASE_CXXFLAGS" != ""
416 then
417 CXXFLAGS="$RELEASE_CXXFLAGS $CXXFLAGS"
419 if test "$RELEASE_LDFLAGS" != ""
420 then
421 LDFLAGS="$RELEASE_LDFLAGS $LDFLAGS"
425 if test $debug -eq 1
426 then
427 if test "$DEBUG_CFLAGS" != ""
428 then
429 CFLAGS="$DEBUG_CFLAGS $CFLAGS"
431 if test "$DEBUG_CXXFLAGS" != ""
432 then
433 CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS"
435 if test "$DEBUG_LDFLAGS" != ""
436 then
437 LDFLAGS="$DEBUG_LDFLAGS $LDFLAGS"
441 export CFLAGS
442 export CXXFLAGS
443 export LDFLAGS
445 # Run configure
447 echo "export CPP=$CPP CC=$CC CXX=$CXX CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS MAKE=$MAKE"
448 echo "Running ./configure $OPTS $@ for $THE_OS using $THE_COMP compiler"
449 echo
450 if $configure $OPTS $@
451 then
452 echo
453 echo If the result of the above commands looks okay to you, go to the directory
454 echo source in the ICU distribution to build ICU. Please remember that ICU needs
455 echo GNU make to build properly...
456 else
457 echo $0: ./configure failed
458 exit 1