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
23 echo "${uletter}sage: $me [ -h, --help ] [ --enable-debug | --disable-release ] platform [ configurearg ... ]"
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 Visual Age xlc_r/xlC_r compilers on AIX
40 AIX/GCC Use the GNU gcc/g++ compilers on AIX
41 Cygwin Use the GNU gcc/g++ compilers on Cygwin
42 Cygwin/MSVC Use the Microsoft Visual C++ compiler on Cygwin
43 Cygwin/MSVC2005 Use the Microsoft Visual C++ 2005 compiler on Cygwin
44 Cygwin/ICL Use the Intel C++ compiler on Cygwin
45 FreeBSD Use the clang/clang++ or GNU gcc/g++ compilers on FreeBSD
46 HP-UX/ACC Use the HP ANSI C/Advanced C++ compilers on HP-UX 11
47 IBMi Use the iCC compilers on IBM i, i5/OS, OS/400
48 Linux Use the clang/clang++ or GNU gcc/g++ compilers on Linux
49 Linux/gcc Use the GNU gcc/g++ compilers on Linux
50 Linux/ECC Use the Intel ECC compiler on Linux
51 Linux/ICC Use the Intel ICC compiler on Linux
52 Linux/VA Use the IBM Visual Age compiler on Power PC Linux
53 MacOSX Use the default compilers on MacOS X (Darwin)
54 MacOSX/GCC Use the GNU gcc/g++ compilers on MacOSX (Darwin)
55 MinGW Use the GNU gcc/g++ compilers on MinGW
56 MSYS/MSVC Use the Microsoft Visual C++ computer on MSYS
57 QNX Use the QNX QCC compiler on QNX/Neutrino
58 Solaris Use the Sun cc/CC compilers on Solaris
59 Solaris/GCC Use the GNU gcc/g++ compilers on Solaris
60 SolarisX86 Use the Sun cc/CC compilers on Solaris x86
61 TRU64V5.1/CXX Use the Compaq cxx compiler on Tru64 (OSF)
62 zOS Use the IBM cxx compiler on z/OS (os/390)
63 zOSV1R2 Use the IBM cxx compiler for z/OS 1.2
84 OPTS
="$OPTS --enable-debug"
88 OPTS
="$OPTS --disable-release"
99 if test x
$platform = x
113 if test x
$configure = x
115 if test -f .
/configure
119 configuredir
=`echo $0 | sed 's,[^/]*$,,'`
120 if test x
$configuredir = x
$0
126 if test x
$configuredir = x
131 configure
=$configuredir/configure
138 CC
=`which xlc_r`; export CC
139 if [ ! -x $CC ]; then
140 echo "ERROR: xlc_r was not found, please check the PATH to make sure it is correct."; exit 1
142 CXX
=`which xlC_r`; export CXX
143 if [ ! -x $CXX ]; then
144 echo "ERROR: xlC_r was not found, please check the PATH to make sure it is correct."; exit 1
146 RELEASE_CFLAGS
="-O2 -qmaxmem=-1"
147 RELEASE_CXXFLAGS
="-O2 -qmaxmem=-1"
151 THE_COMP
="the GNU C++"
154 DEBUG_CFLAGS
='-g -O0'
155 DEBUG_CXXFLAGS
='-g -O0'
160 CC
=`which cc`; export CC
161 CXX
=`which CC`; export CXX
162 RELEASE_CFLAGS
="-xO1 -xlibmil"
163 RELEASE_CXXFLAGS
="-O4 -xlibmil"
167 THE_COMP
="the GNU C++"
176 CC
=`which cc`; export CC
177 CXX
=`which CC`; export CXX
178 LDFLAGS
="${LDFLAGS} -lCrun";export LDFLAGS
187 RELEASE_CFLAGS
='+O2 +Ofltacc'
188 RELEASE_CXXFLAGS
='+O2 +Ofltacc'
192 THE_COMP
="the iCC C++"
195 CPP
="$CC -c -qpponly"; export CPP
196 MAKE
=gmake
; export MAKE
197 U_MAKE
=gmake
; export U_MAKE
198 # gmake is a .pgm and may not be on the path. Don't use a full path, just use gmake.
199 ac_cv_path_U_MAKE
=gmake
; export ac_cv_path_U_MAKE
201 RELEASE_CXXFLAGS
='-O4'
205 THE_COMP
="Intel ECC 7.1"
209 RELEASE_CXXFLAGS
='-O2'
213 CC
=`which icc`; export CC
214 CXX
=`which icpc`; export CXX
215 ICC_VER
=`${CC} -v 2>&1`
217 RELEASE_CXXFLAGS
='-O'
218 export CFLAGS
="-fp-model precise"
219 export CXXFLAGS
="-fp-model precise"
220 if [ "${ICC_VER}" = "Version 9.0 " ]; then
223 export CFLAGS
="${CFLAGS} -O0"
224 export CXXFLAGS
="${CXXFLAGS} -O0"
225 echo "ICC 9.0 does not work with optimization- disabling optimizations"
227 THE_COMP
="Intel ${ICC_VER}"
231 THE_COMP
="IBM Visual Age C++ Compiler"
232 CC
=`which xlc_r`; export CC
233 CXX
=`which xlC_r`; export CXX
234 RELEASE_CFLAGS
="-O2 -qmaxmem=-1"
235 RELEASE_CXXFLAGS
="-O2 -qmaxmem=-1"
239 THE_COMP
="the GNU C++"
243 RELEASE_CXXFLAGS
='-O3'
249 THE_COMP
="the clang or else GNU C++"
251 RELEASE_CXXFLAGS
='-O3'
257 THE_COMP
="the GNU C++"
259 RELEASE_CXXFLAGS
='-O3'
262 THE_OS
="Windows with Cygwin"
263 THE_COMP
="Microsoft Visual C++"
266 RELEASE_CFLAGS
='-Gy -MD'
267 RELEASE_CXXFLAGS
='-Gy -MD'
268 DEBUG_CFLAGS
='-FS -Zi -MDd'
269 DEBUG_CXXFLAGS
='-FS -Zi -MDd'
270 DEBUG_LDFLAGS
='-DEBUG'
273 THE_OS
="Windows with Cygwin"
274 THE_COMP
="Microsoft Visual C++ 2005"
277 RELEASE_CFLAGS
='/Gy /MD'
278 RELEASE_CXXFLAGS
='/Gy /MD'
279 DEBUG_CFLAGS
='/Zi /MDd'
280 DEBUG_CXXFLAGS
='/Zi /MDd'
281 DEBUG_LDFLAGS
='/DEBUG'
284 THE_OS
="Windows with Cygwin"
288 # The Intel compiler has optimization bugs. So we disable optimization.
290 RELEASE_CXXFLAGS
='/Od'
293 DEBUG_LDFLAGS
='/DEBUG'
296 THE_OS
="MacOS X (Darwin)"
297 THE_COMP
="the default"
299 RELEASE_CXXFLAGS
='-O2'
300 DEBUG_CFLAGS
='-g -O0'
301 DEBUG_CXXFLAGS
='-g -O0'
304 THE_OS
="MacOS X (Darwin)"
305 THE_COMP
="the GNU C++"
307 RELEASE_CXXFLAGS
='-O2'
308 DEBUG_CFLAGS
='-g -O0'
309 DEBUG_CXXFLAGS
='-g -O0'
315 THE_COMP
="the GNU C++"
317 RELEASE_CXXFLAGS
='-O3'
322 THE_COMP
="Microsoft Visual C++"
325 RELEASE_CFLAGS
='-Gy -MD'
326 RELEASE_CXXFLAGS
='-Gy -MD'
327 DEBUG_CFLAGS
='-FS -Zi -MDd'
328 DEBUG_CXXFLAGS
='-FS -Zi -MDd'
329 DEBUG_LDFLAGS
='-DEBUG'
333 THE_COMP
="the GNU C++"
334 DEBUG_CFLAGS
='-g -O0'
335 DEBUG_CXXFLAGS
='-g -O0'
339 THE_COMP
="Compaq cxx"
350 THE_OS
="z/OS (OS/390)"
351 THE_COMP
="z/OS C/C++"
354 RELEASE_CFLAGS
="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
355 RELEASE_CXXFLAGS
="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
359 THE_COMP
="z/OS 1.2 C/C++"
362 export COMPILE_LINK_ENVVAR
='_CXX_CICC_VER}=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000'
363 export _CXX_CVERSION
=0x41020000 _C89_CVERSION
=0x41020000 _CC_CVERSION
=0x41020000 _CXX_PVERSION
=0x41020000 _C89_PVERSION
=0x41020000 _CC_PVERSION
=0x41020000
364 export LDFLAGS
="-Wl,'compat=pm3'"
365 export CFLAGS
="-Wc,'target(zOSV1R2)'"
366 export CXXFLAGS
="-Wc,'target(zOSV1R2)'"
367 RELEASE_CFLAGS
="-2 -Wc,'inline(auto,noreport,500,4000)'"
368 RELEASE_CXXFLAGS
="-2 -Wc,'inline(auto,noreport,500,4000)'"
371 >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)"
378 if test $release -eq 1
380 if test "$RELEASE_CFLAGS" = ""
383 gcc
|*/gcc
|*-gcc-*|*/*-gcc-*)
388 if test "$RELEASE_CFLAGS" != ""
390 CFLAGS
="$RELEASE_CFLAGS $CFLAGS"
392 if test "$RELEASE_CXXFLAGS" = ""
395 g
++|*/g
++|*-g++-*|*/*-g++-*)
400 if test "$RELEASE_CXXFLAGS" != ""
402 CXXFLAGS
="$RELEASE_CXXFLAGS $CXXFLAGS"
404 if test "$RELEASE_LDFLAGS" != ""
406 LDFLAGS
="$RELEASE_LDFLAGS $LDFLAGS"
412 if test "$DEBUG_CFLAGS" != ""
414 CFLAGS
="$DEBUG_CFLAGS $CFLAGS"
416 if test "$DEBUG_CXXFLAGS" != ""
418 CXXFLAGS
="$DEBUG_CXXFLAGS $CXXFLAGS"
420 if test "$DEBUG_LDFLAGS" != ""
422 LDFLAGS
="$DEBUG_LDFLAGS $LDFLAGS"
432 echo "export CPP=$CPP CC=$CC CXX=$CXX CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS MAKE=$MAKE"
433 echo "Running ./configure $OPTS $@ for $THE_OS using $THE_COMP compiler"
435 if $configure $OPTS $@
438 echo If the result of the above commands looks okay to you
, go to the directory
439 echo source in the ICU distribution to build ICU. Please remember that ICU needs
440 echo GNU
make to build properly...
442 echo $0: .
/configure failed