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