2 # Copyright (c) 1999-2014, International Business Machines Corporation and
3 # others. All Rights Reserved.
5 # runConfigureICU: This script will run the "configure" script for the appropriate platform
6 # Only supported platforms are recognized
21 echo "${uletter}sage: $me [ -h, --help ] [ --enable-debug | --disable-release ] platform [ configurearg ... ]"
26 Options: -h, --help Print this message and exit
27 --enable-debug Enable support for debugging
28 --disable-release Disable presetting optimization flags
30 If you want to add custom CFLAGS or CXXFLAGS or similar, provide them _before_
31 the runConfigureICU command:
33 CXXFLAGS=xyz path/to/runConfigureICU --enable-debug ...
35 The following names can be supplied as the argument for platform:
37 AIX Use the IBM Visual Age xlc_r/xlC_r compilers on AIX
38 AIX/GCC Use the GNU gcc/g++ compilers on AIX
39 Cygwin Use the GNU gcc/g++ compilers on Cygwin
40 Cygwin/MSVC Use the Microsoft Visual C++ compiler on Cygwin
41 Cygwin/MSVC2005 Use the Microsoft Visual C++ 2005 compiler on Cygwin
42 Cygwin/ICL Use the Intel C++ compiler on Cygwin
43 FreeBSD Use the clang/clang++ or GNU gcc/g++ compilers on FreeBSD
44 HP-UX/ACC Use the HP ANSI C/Advanced C++ compilers on HP-UX 11
45 IBMi Use the iCC compilers on IBM i, i5/OS, OS/400
46 Linux Use the clang/clang++ or GNU gcc/g++ compilers on Linux
47 Linux/gcc Use the GNU gcc/g++ compilers on Linux
48 Linux/ECC Use the Intel ECC compiler on Linux
49 Linux/ICC Use the Intel ICC compiler on Linux
50 Linux/VA Use the IBM Visual Age compiler on Power PC Linux
51 MacOSX Use the default compilers on MacOS X (Darwin)
52 MacOSX/GCC Use the GNU gcc/g++ compilers on MacOSX (Darwin)
53 MinGW Use the GNU gcc/g++ compilers on MinGW
54 MSYS/MSVC Use the Microsoft Visual C++ computer on MSYS
55 QNX Use the QNX QCC compiler on QNX/Neutrino
56 Solaris Use the Sun cc/CC compilers on Solaris
57 Solaris/GCC Use the GNU gcc/g++ compilers on Solaris
58 SolarisX86 Use the Sun cc/CC compilers on Solaris x86
59 TRU64V5.1/CXX Use the Compaq cxx compiler on Tru64 (OSF)
60 zOS Use the IBM cxx compiler on z/OS (os/390)
61 zOSV1R2 Use the IBM cxx compiler for z/OS 1.2
82 OPTS
="$OPTS --enable-debug"
86 OPTS
="$OPTS --disable-release"
97 if test x
$platform = x
111 if test x
$configure = x
113 if test -f .
/configure
117 configuredir
=`echo $0 | sed 's,[^/]*$,,'`
118 if test x
$configuredir = x
$0
124 if test x
$configuredir = x
129 configure
=$configuredir/configure
136 CC
=`which xlc_r`; export CC
137 if [ ! -x $CC ]; then
138 echo "ERROR: xlc_r was not found, please check the PATH to make sure it is correct."; exit 1
140 CXX
=`which xlC_r`; export CXX
141 if [ ! -x $CXX ]; then
142 echo "ERROR: xlC_r was not found, please check the PATH to make sure it is correct."; exit 1
144 RELEASE_CFLAGS
="-O2 -qmaxmem=-1"
145 RELEASE_CXXFLAGS
="-O2 -qmaxmem=-1"
149 THE_COMP
="the GNU C++"
152 DEBUG_CFLAGS
='-g -O0'
153 DEBUG_CXXFLAGS
='-g -O0'
158 CC
=`which cc`; export CC
159 CXX
=`which CC`; export CXX
160 RELEASE_CFLAGS
="-xO1 -xlibmil"
161 RELEASE_CXXFLAGS
="-O4 -xlibmil"
165 THE_COMP
="the GNU C++"
174 CC
=`which cc`; export CC
175 CXX
=`which CC`; export CXX
176 LDFLAGS
="${LDFLAGS} -lCrun";export LDFLAGS
185 RELEASE_CFLAGS
='+O2 +Ofltacc'
186 RELEASE_CXXFLAGS
='+O2 +Ofltacc'
190 THE_COMP
="the iCC C++"
193 CPP
="$CC -c -qpponly"; export CPP
194 MAKE
=gmake
; export MAKE
195 U_MAKE
=gmake
; export U_MAKE
196 # gmake is a .pgm and may not be on the path. Don't use a full path, just use gmake.
197 ac_cv_path_U_MAKE
=gmake
; export ac_cv_path_U_MAKE
199 RELEASE_CXXFLAGS
='-O4'
203 THE_COMP
="Intel ECC 7.1"
207 RELEASE_CXXFLAGS
='-O2'
211 CC
=`which icc`; export CC
212 CXX
=`which icpc`; export CXX
213 ICC_VER
=`${CC} -v 2>&1`
215 RELEASE_CXXFLAGS
='-O'
216 export CFLAGS
="-fp-model precise"
217 export CXXFLAGS
="-fp-model precise"
218 if [ "${ICC_VER}" = "Version 9.0 " ]; then
221 export CFLAGS
="${CFLAGS} -O0"
222 export CXXFLAGS
="${CXXFLAGS} -O0"
223 echo "ICC 9.0 does not work with optimization- disabling optimizations"
225 THE_COMP
="Intel ${ICC_VER}"
229 THE_COMP
="IBM Visual Age C++ Compiler"
230 CC
=`which xlc_r`; export CC
231 CXX
=`which xlC_r`; export CXX
232 RELEASE_CFLAGS
="-O2 -qmaxmem=-1"
233 RELEASE_CXXFLAGS
="-O2 -qmaxmem=-1"
237 THE_COMP
="the GNU C++"
241 RELEASE_CXXFLAGS
='-O3'
247 THE_COMP
="the clang or else GNU C++"
249 RELEASE_CXXFLAGS
='-O3'
255 THE_COMP
="the GNU C++"
257 RELEASE_CXXFLAGS
='-O3'
260 THE_OS
="Windows with Cygwin"
261 THE_COMP
="Microsoft Visual C++"
264 RELEASE_CFLAGS
='-Gy -MD'
265 RELEASE_CXXFLAGS
='-Gy -MD'
266 DEBUG_CFLAGS
='-Zi -MDd'
267 DEBUG_CXXFLAGS
='-Zi -MDd'
268 DEBUG_LDFLAGS
='-DEBUG'
271 THE_OS
="Windows with Cygwin"
272 THE_COMP
="Microsoft Visual C++ 2005"
275 RELEASE_CFLAGS
='/Gy /MD'
276 RELEASE_CXXFLAGS
='/Gy /MD'
277 DEBUG_CFLAGS
='/Zi /MDd'
278 DEBUG_CXXFLAGS
='/Zi /MDd'
279 DEBUG_LDFLAGS
='/DEBUG'
282 THE_OS
="Windows with Cygwin"
286 # The Intel compiler has optimization bugs. So we disable optimization.
288 RELEASE_CXXFLAGS
='/Od'
291 DEBUG_LDFLAGS
='/DEBUG'
294 THE_OS
="MacOS X (Darwin)"
295 THE_COMP
="the default"
297 RELEASE_CXXFLAGS
='-O2'
298 DEBUG_CFLAGS
='-g -O0'
299 DEBUG_CXXFLAGS
='-g -O0'
302 THE_OS
="MacOS X (Darwin)"
303 THE_COMP
="the GNU C++"
305 RELEASE_CXXFLAGS
='-O2'
306 DEBUG_CFLAGS
='-g -O0'
307 DEBUG_CXXFLAGS
='-g -O0'
313 THE_COMP
="the GNU C++"
315 RELEASE_CXXFLAGS
='-O3'
316 CXXFLAGS
="--std=c++03"
321 THE_COMP
="Microsoft Visual C++"
324 RELEASE_CFLAGS
='-Gy -MD'
325 RELEASE_CXXFLAGS
='-Gy -MD'
326 DEBUG_CFLAGS
='-Zi -MDd'
327 DEBUG_CXXFLAGS
='-Zi -MDd'
328 DEBUG_LDFLAGS
='-DEBUG'
332 THE_COMP
="the GNU C++"
333 DEBUG_CFLAGS
='-g -O0'
334 DEBUG_CXXFLAGS
='-g -O0'
338 THE_COMP
="Compaq cxx"
349 THE_OS
="z/OS (OS/390)"
350 THE_COMP
="z/OS C/C++"
353 RELEASE_CFLAGS
="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
354 RELEASE_CXXFLAGS
="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
358 THE_COMP
="z/OS 1.2 C/C++"
361 export COMPILE_LINK_ENVVAR
='_CXX_CICC_VER}=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000'
362 export _CXX_CVERSION
=0x41020000 _C89_CVERSION
=0x41020000 _CC_CVERSION
=0x41020000 _CXX_PVERSION
=0x41020000 _C89_PVERSION
=0x41020000 _CC_PVERSION
=0x41020000
363 export LDFLAGS
="-Wl,'compat=pm3'"
364 export CFLAGS
="-Wc,'target(zOSV1R2)'"
365 export CXXFLAGS
="-Wc,'target(zOSV1R2)'"
366 RELEASE_CFLAGS
="-2 -Wc,'inline(auto,noreport,500,4000)'"
367 RELEASE_CXXFLAGS
="-2 -Wc,'inline(auto,noreport,500,4000)'"
370 >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)"
377 if test $release -eq 1
379 if test "$RELEASE_CFLAGS" = ""
382 gcc
|*/gcc
|*-gcc-*|*/*-gcc-*)
387 if test "$RELEASE_CFLAGS" != ""
389 CFLAGS
="$RELEASE_CFLAGS $CFLAGS"
391 if test "$RELEASE_CXXFLAGS" = ""
394 g
++|*/g
++|*-g++-*|*/*-g++-*)
399 if test "$RELEASE_CXXFLAGS" != ""
401 CXXFLAGS
="$RELEASE_CXXFLAGS $CXXFLAGS"
403 if test "$RELEASE_LDFLAGS" != ""
405 LDFLAGS
="$RELEASE_LDFLAGS $LDFLAGS"
411 if test "$DEBUG_CFLAGS" != ""
413 CFLAGS
="$DEBUG_CFLAGS $CFLAGS"
415 if test "$DEBUG_CXXFLAGS" != ""
417 CXXFLAGS
="$DEBUG_CXXFLAGS $CXXFLAGS"
419 if test "$DEBUG_LDFLAGS" != ""
421 LDFLAGS
="$DEBUG_LDFLAGS $LDFLAGS"
431 echo "export CPP=$CPP CC=$CC CXX=$CXX CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS MAKE=$MAKE"
432 echo "Running ./configure $OPTS $@ for $THE_OS using $THE_COMP compiler"
434 if $configure $OPTS $@
437 echo If the result of the above commands looks okay to you
, go to the directory
438 echo source in the ICU distribution to build ICU. Please remember that ICU needs
439 echo GNU
make to build properly...
441 echo $0: .
/configure failed