intl/icu/source/runConfigureICU

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/runConfigureICU	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,442 @@
     1.4 +#!/bin/sh
     1.5 +# Copyright (c) 1999-2013, International Business Machines Corporation and
     1.6 +# others. All Rights Reserved.
     1.7 +
     1.8 +# runConfigureICU: This script will run the "configure" script for the appropriate platform
     1.9 +# Only supported platforms are recognized
    1.10 +
    1.11 +me=`basename $0`
    1.12 +OPTS=
    1.13 +
    1.14 +usage()
    1.15 +{
    1.16 +    ec=0$1
    1.17 +    if test $ec -eq 0
    1.18 +    then
    1.19 +        uletter=U
    1.20 +    else
    1.21 +        uletter=u
    1.22 +    fi
    1.23 +
    1.24 +    echo "${uletter}sage: $me [ -h, --help ]  [ --enable-debug | --disable-release ] platform [ configurearg ... ]"
    1.25 +    if test $ec -eq 0
    1.26 +    then
    1.27 +        cat <<EOE
    1.28 +
    1.29 +Options: -h, --help         Print this message and exit
    1.30 +         --enable-debug     Enable support for debugging
    1.31 +         --disable-release  Disable presetting optimization flags
    1.32 +
    1.33 +If you want to add custom CFLAGS or CXXFLAGS or similar, provide them _before_
    1.34 +the runConfigureICU command:
    1.35 +
    1.36 +    CXXFLAGS=xyz path/to/runConfigureICU --enable-debug ...
    1.37 +
    1.38 +The following names can be supplied as the argument for platform:
    1.39 +
    1.40 +    AIX                 Use the IBM Visual Age xlc_r/xlC_r compilers on AIX
    1.41 +    AIX/GCC             Use the GNU gcc/g++ compilers on AIX
    1.42 +    Cygwin              Use the GNU gcc/g++ compilers on Cygwin
    1.43 +    Cygwin/MSVC         Use the Microsoft Visual C++ compiler on Cygwin
    1.44 +    Cygwin/MSVC2005     Use the Microsoft Visual C++ 2005 compiler on Cygwin
    1.45 +    Cygwin/ICL          Use the Intel C++ compiler on Cygwin
    1.46 +    FreeBSD             Use the GNU gcc/g++ compilers on Free BSD
    1.47 +    HP-UX/ACC           Use the HP ANSI C/Advanced C++ compilers on HP-UX 11
    1.48 +    IBMi                Use the iCC compilers on IBM i, i5/OS, OS/400
    1.49 +    Linux               Use the clang/clang++ or GNU gcc/g++ compilers on Linux
    1.50 +    Linux/gcc           Use the GNU gcc/g++ compilers on Linux
    1.51 +    Linux/ECC           Use the Intel ECC compiler on Linux
    1.52 +    Linux/ICC           Use the Intel ICC compiler on Linux
    1.53 +    Linux/VA            Use the IBM Visual Age compiler on Power PC Linux
    1.54 +    MacOSX              Use the default compilers on MacOS X (Darwin)
    1.55 +    MacOSX/GCC          Use the GNU gcc/g++ compilers on MacOSX (Darwin)
    1.56 +    MinGW               Use the GNU gcc/g++ compilers on MinGW
    1.57 +    QNX                 Use the QNX QCC compiler on QNX/Neutrino
    1.58 +    Solaris             Use the Sun cc/CC compilers on Solaris
    1.59 +    Solaris/GCC         Use the GNU gcc/g++ compilers on Solaris
    1.60 +    SolarisX86          Use the Sun cc/CC compilers on Solaris x86
    1.61 +    TRU64V5.1/CXX       Use the Compaq cxx compiler on Tru64 (OSF)
    1.62 +    zOS                 Use the IBM cxx compiler on z/OS (os/390)
    1.63 +    zOSV1R2             Use the IBM cxx compiler for z/OS 1.2
    1.64 +EOE
    1.65 +    fi
    1.66 +
    1.67 +    exit $ec
    1.68 +}
    1.69 +
    1.70 +# Parse arguments
    1.71 +
    1.72 +platform=
    1.73 +debug=0
    1.74 +release=1
    1.75 +
    1.76 +while test $# -ne 0
    1.77 +do
    1.78 +    case "$1" in
    1.79 +    -h|--help)
    1.80 +        usage 0
    1.81 +        ;;
    1.82 +    --enable-debug)
    1.83 +        debug=1
    1.84 +        OPTS="$OPTS --enable-debug"
    1.85 +        ;;
    1.86 +    --disable-release)
    1.87 +        release=0
    1.88 +        OPTS="$OPTS --disable-release"
    1.89 +        ;;
    1.90 +    *)
    1.91 +        platform="$1"
    1.92 +        shift
    1.93 +        break
    1.94 +        ;;
    1.95 +    esac
    1.96 +    shift
    1.97 +done
    1.98 +
    1.99 +if test x$platform = x
   1.100 +then
   1.101 +   usage 1
   1.102 +fi
   1.103 +
   1.104 +# Go.
   1.105 +
   1.106 +rm -f config.cache
   1.107 +rm -f config.log
   1.108 +rm -f config.status
   1.109 +
   1.110 +DEBUG_CFLAGS='-g'
   1.111 +DEBUG_CXXFLAGS='-g'
   1.112 +
   1.113 +if test x$configure = x
   1.114 +then
   1.115 +    if test -f ./configure
   1.116 +    then
   1.117 +        configuredir=.
   1.118 +    else
   1.119 +        configuredir=`echo $0 | sed 's,[^/]*$,,'`
   1.120 +        if test x$configuredir = x$0
   1.121 +        then
   1.122 +            configuredir=.
   1.123 +        fi
   1.124 +    fi
   1.125 +
   1.126 +    if test x$configuredir = x
   1.127 +    then
   1.128 +        configuredir=.
   1.129 +    fi
   1.130 +
   1.131 +    configure=$configuredir/configure
   1.132 +fi
   1.133 +
   1.134 +case $platform in
   1.135 +    AIX)
   1.136 +        THE_OS=AIX
   1.137 +        THE_COMP="xlC_r"
   1.138 +        CC=`which xlc_r`; export CC
   1.139 +        if [ ! -x $CC ]; then
   1.140 +           echo "ERROR: xlc_r was not found, please check the PATH to make sure it is correct."; exit 1
   1.141 +        fi
   1.142 +        CXX=`which xlC_r`; export CXX
   1.143 +        if [ ! -x $CXX ]; then
   1.144 +           echo "ERROR: xlC_r was not found, please check the PATH to make sure it is correct."; exit 1
   1.145 +        fi
   1.146 +        RELEASE_CFLAGS="-O2 -qmaxmem=-1"
   1.147 +        RELEASE_CXXFLAGS="-O2 -qmaxmem=-1"
   1.148 +        ;;
   1.149 +    AIX/GCC)
   1.150 +        THE_OS=AIX
   1.151 +        THE_COMP="the GNU C++"
   1.152 +        CC=gcc; export CC
   1.153 +        CXX=g++; export CXX
   1.154 +        DEBUG_CFLAGS='-g -O0'
   1.155 +        DEBUG_CXXFLAGS='-g -O0'
   1.156 +        ;;
   1.157 +    Solaris)
   1.158 +        THE_OS=SOLARIS
   1.159 +        THE_COMP="Sun's CC"
   1.160 +        CC=`which cc`; export CC
   1.161 +        CXX=`which CC`; export CXX
   1.162 +        RELEASE_CFLAGS="-xO1 -xlibmil"
   1.163 +        RELEASE_CXXFLAGS="-O4 -xlibmil"
   1.164 +        ;;
   1.165 +    Solaris/GCC)
   1.166 +        THE_OS=SOLARIS
   1.167 +        THE_COMP="the GNU C++"
   1.168 +        CC=gcc; export CC
   1.169 +        CXX=g++; export CXX
   1.170 +        RELEASE_CFLAGS=-O1
   1.171 +        RELEASE_CXXFLAGS=-O2
   1.172 +        ;;
   1.173 +    SolarisX86)
   1.174 +        THE_OS="SOLARIS X86"
   1.175 +        THE_COMP="Sun's CC"
   1.176 +        CC=`which cc`; export CC
   1.177 +        CXX=`which CC`; export CXX
   1.178 +        LDFLAGS="${LDFLAGS} -lCrun";export LDFLAGS
   1.179 +        RELEASE_CFLAGS=-xO3
   1.180 +        RELEASE_CXXFLAGS=-O3
   1.181 +        ;;
   1.182 +    HP-UX/ACC)
   1.183 +        THE_OS="HP-UX 11"
   1.184 +        THE_COMP="aCC"
   1.185 +        CC=cc; export CC
   1.186 +        CXX=aCC; export CXX
   1.187 +        RELEASE_CFLAGS='+O2 +Ofltacc'
   1.188 +        RELEASE_CXXFLAGS='+O2 +Ofltacc'
   1.189 +        ;;
   1.190 +    IBMi)
   1.191 +        THE_OS="IBM i"
   1.192 +        THE_COMP="the iCC C++"
   1.193 +        CC=icc; export CC
   1.194 +        CXX=icc; export CXX
   1.195 +        CPP="$CC -c -qpponly"; export CPP
   1.196 +        MAKE=gmake; export MAKE
   1.197 +        U_MAKE=gmake; export U_MAKE
   1.198 +        # gmake is a .pgm and may not be on the path.  Don't use a full path, just use gmake.
   1.199 +        ac_cv_path_U_MAKE=gmake; export ac_cv_path_U_MAKE
   1.200 +        RELEASE_CFLAGS='-O4'
   1.201 +        RELEASE_CXXFLAGS='-O4'
   1.202 +        ;;
   1.203 +    Linux/ECC)
   1.204 +        THE_OS="Linux"
   1.205 +        THE_COMP="Intel ECC 7.1"
   1.206 +        CC=ecc; export CC
   1.207 +        CXX=ecpc; export CXX
   1.208 +        RELEASE_CFLAGS='-O2'
   1.209 +        RELEASE_CXXFLAGS='-O2'
   1.210 +        ;;
   1.211 +    Linux/ICC)
   1.212 +        THE_OS="Linux"
   1.213 +        CC=`which icc`; export CC
   1.214 +        CXX=`which icpc`; export CXX
   1.215 +	ICC_VER=`${CC} -v 2>&1`
   1.216 +        RELEASE_CFLAGS='-O'
   1.217 +        RELEASE_CXXFLAGS='-O'
   1.218 +        export CFLAGS="-fp-model precise"
   1.219 +        export CXXFLAGS="-fp-model precise"
   1.220 +	if [ "${ICC_VER}" = "Version 9.0 " ]; then
   1.221 +		RELEASE_CFLAGS=''
   1.222 +		RELEASE_CXXFLAGS=''
   1.223 +		export CFLAGS="${CFLAGS} -O0"
   1.224 +		export CXXFLAGS="${CXXFLAGS} -O0"
   1.225 +		echo "ICC 9.0 does not work with optimization- disabling optimizations"
   1.226 +	fi
   1.227 +        THE_COMP="Intel ${ICC_VER}"
   1.228 +        ;;
   1.229 +    Linux/VA)
   1.230 +        THE_OS="Linux"
   1.231 +        THE_COMP="IBM Visual Age C++ Compiler"
   1.232 +        CC=`which xlc_r`; export CC
   1.233 +        CXX=`which xlC_r`; export CXX
   1.234 +        RELEASE_CFLAGS="-O2 -qmaxmem=-1"
   1.235 +        RELEASE_CXXFLAGS="-O2 -qmaxmem=-1"
   1.236 +        ;;
   1.237 +    Linux/gcc)
   1.238 +        THE_OS="Linux"
   1.239 +        THE_COMP="the GNU C++"
   1.240 +        CC=gcc; export CC
   1.241 +        CXX=g++; export CXX
   1.242 +        RELEASE_CFLAGS='-O3'
   1.243 +        RELEASE_CXXFLAGS='-O3'
   1.244 +        DEBUG_CFLAGS='-g'
   1.245 +        DEBUG_CXXFLAGS='-g'
   1.246 +        ;;
   1.247 +    Linux*)
   1.248 +        THE_OS="Linux"
   1.249 +        THE_COMP="the clang or else GNU C++"
   1.250 +        RELEASE_CFLAGS='-O3'
   1.251 +        RELEASE_CXXFLAGS='-O3'
   1.252 +        DEBUG_CFLAGS='-g'
   1.253 +        DEBUG_CXXFLAGS='-g'
   1.254 +        ;;
   1.255 +    Cygwin)
   1.256 +        THE_OS="Cygwin"
   1.257 +        THE_COMP="the GNU C++"
   1.258 +        RELEASE_CFLAGS='-O3'
   1.259 +        RELEASE_CXXFLAGS='-O3'
   1.260 +        ;;
   1.261 +    Cygwin/MSVC)
   1.262 +        THE_OS="Windows with Cygwin"
   1.263 +        THE_COMP="Microsoft Visual C++"
   1.264 +        CC=cl; export CC
   1.265 +        CXX=cl; export CXX
   1.266 +        RELEASE_CFLAGS='/Gy /MD'
   1.267 +        RELEASE_CXXFLAGS='/Gy /MD'
   1.268 +        DEBUG_CFLAGS='/Zi /MDd'
   1.269 +        DEBUG_CXXFLAGS='/Zi /MDd'
   1.270 +        DEBUG_LDFLAGS='/DEBUG'
   1.271 +        ;;
   1.272 +    Cygwin/MSVC2005)
   1.273 +        THE_OS="Windows with Cygwin"
   1.274 +        THE_COMP="Microsoft Visual C++ 2005"
   1.275 +        CC=cl; export CC
   1.276 +        CXX=cl; export CXX
   1.277 +        RELEASE_CFLAGS='/Gy /MD'
   1.278 +        RELEASE_CXXFLAGS='/Gy /MD'
   1.279 +        DEBUG_CFLAGS='/Zi /MDd'
   1.280 +        DEBUG_CXXFLAGS='/Zi /MDd'
   1.281 +        DEBUG_LDFLAGS='/DEBUG'
   1.282 +        ;;
   1.283 +    Cygwin/ICL)
   1.284 +        THE_OS="Windows with Cygwin"
   1.285 +        THE_COMP="Intel C++"
   1.286 +        CC=icl; export CC
   1.287 +        CXX=icl; export CXX
   1.288 +        # The Intel compiler has optimization bugs. So we disable optimization.
   1.289 +        RELEASE_CFLAGS='/Od'
   1.290 +        RELEASE_CXXFLAGS='/Od'
   1.291 +        DEBUG_CFLAGS='/Zi'
   1.292 +        DEBUG_CXXFLAGS='/Zi'
   1.293 +        DEBUG_LDFLAGS='/DEBUG'
   1.294 +        ;;
   1.295 +    MacOSX)
   1.296 +        THE_OS="MacOS X (Darwin)"
   1.297 +        THE_COMP="the default"
   1.298 +        RELEASE_CFLAGS='-O2'
   1.299 +        RELEASE_CXXFLAGS='-O2'
   1.300 +        DEBUG_CFLAGS='-g -O0'
   1.301 +        DEBUG_CXXFLAGS='-g -O0'
   1.302 +        ;;
   1.303 +    MacOSX/GCC)
   1.304 +        THE_OS="MacOS X (Darwin)"
   1.305 +        THE_COMP="the GNU C++"
   1.306 +        RELEASE_CFLAGS='-O2'
   1.307 +        RELEASE_CXXFLAGS='-O2'
   1.308 +        DEBUG_CFLAGS='-g -O0'
   1.309 +        DEBUG_CXXFLAGS='-g -O0'
   1.310 +	CC=gcc; export CC
   1.311 +	CXX=g++; export CXX
   1.312 +        ;;
   1.313 +    MinGW)
   1.314 +        THE_OS="MinGW"
   1.315 +        THE_COMP="the GNU C++"
   1.316 +        RELEASE_CFLAGS='-O3'
   1.317 +        RELEASE_CXXFLAGS='-O3'
   1.318 +        CXXFLAGS="--std=c++03"
   1.319 +        export CXXFLAGS
   1.320 +        ;;
   1.321 +    MSYS/MSVC)
   1.322 +        THE_OS="MSYS"
   1.323 +        THE_COMP="Microsoft Visual C++"
   1.324 +        CC=cl; export CC
   1.325 +        CXX=cl; export CXX
   1.326 +        RELEASE_CFLAGS='-Gy -MD'
   1.327 +        RELEASE_CXXFLAGS='-Gy -MD'
   1.328 +        DEBUG_CFLAGS='-Zi -MDd'
   1.329 +        DEBUG_CXXFLAGS='-Zi -MDd'
   1.330 +        DEBUG_LDFLAGS='-DEBUG'
   1.331 +        ;;
   1.332 +    *BSD)
   1.333 +        THE_OS="BSD"
   1.334 +        THE_COMP="the GNU C++"
   1.335 +        DEBUG_CFLAGS='-g -O0'
   1.336 +        DEBUG_CXXFLAGS='-g -O0'
   1.337 +        ;;
   1.338 +    TRU64V5.1/CXX)
   1.339 +        THE_OS="OSF1"
   1.340 +        THE_COMP="Compaq cxx"
   1.341 +        CC=cc; export CC
   1.342 +        CXX=cxx; export CXX
   1.343 +        ;;
   1.344 +    QNX)
   1.345 +        THE_OS="QNX"
   1.346 +        THE_COMP="QNX cc"
   1.347 +        CC=qcc; export CC
   1.348 +        CXX=QCC; export CXX
   1.349 +        ;;
   1.350 +    zOS)
   1.351 +        THE_OS="z/OS (OS/390)"
   1.352 +        THE_COMP="z/OS C/C++"
   1.353 +        CC=xlc; export CC
   1.354 +        CXX=xlC; export CXX
   1.355 +        RELEASE_CFLAGS="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
   1.356 +        RELEASE_CXXFLAGS="-O2 -Wc,'inline(AUTO,NOREPORT,1000,8000)'"
   1.357 +        ;;
   1.358 +    zOSV1R2)
   1.359 +        THE_OS="z/OS 1.2"
   1.360 +        THE_COMP="z/OS 1.2 C/C++"
   1.361 +        CC=cc; export CC
   1.362 +        CXX=cxx; export CXX
   1.363 +        export COMPILE_LINK_ENVVAR='_CXX_CICC_VER}=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000'
   1.364 +        export _CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000
   1.365 +        export LDFLAGS="-Wl,'compat=pm3'"
   1.366 +        export CFLAGS="-Wc,'target(zOSV1R2)'"
   1.367 +        export CXXFLAGS="-Wc,'target(zOSV1R2)'"
   1.368 +        RELEASE_CFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'"
   1.369 +        RELEASE_CXXFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'"
   1.370 +        ;;
   1.371 +    *)
   1.372 +        >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)"
   1.373 +        exit 1;;
   1.374 +esac
   1.375 +
   1.376 +
   1.377 +# Tweak flags
   1.378 +
   1.379 +if test $release -eq 1
   1.380 +then
   1.381 +    if test "$RELEASE_CFLAGS" = ""
   1.382 +    then
   1.383 +        case $CC in
   1.384 +            gcc|*/gcc|*-gcc-*|*/*-gcc-*)
   1.385 +                RELEASE_CFLAGS=-O3
   1.386 +                ;;
   1.387 +        esac
   1.388 +    fi
   1.389 +    if test "$RELEASE_CFLAGS" != ""
   1.390 +    then
   1.391 +        CFLAGS="$CFLAGS $RELEASE_CFLAGS"
   1.392 +    fi
   1.393 +    if test "$RELEASE_CXXFLAGS" = ""
   1.394 +    then
   1.395 +        case $CXX in
   1.396 +            g++|*/g++|*-g++-*|*/*-g++-*)
   1.397 +                RELEASE_CXXFLAGS=-O3
   1.398 +                ;;
   1.399 +        esac
   1.400 +    fi
   1.401 +    if test "$RELEASE_CXXFLAGS" != ""
   1.402 +    then
   1.403 +        CXXFLAGS="$CXXFLAGS $RELEASE_CXXFLAGS"
   1.404 +    fi
   1.405 +    if test "$RELEASE_LDFLAGS" != ""
   1.406 +    then
   1.407 +        LDFLAGS="$LDFLAGS $RELEASE_LDFLAGS"
   1.408 +    fi
   1.409 +fi
   1.410 +
   1.411 +if test $debug -eq 1
   1.412 +then
   1.413 +    if test "$DEBUG_CFLAGS" != ""
   1.414 +    then
   1.415 +        CFLAGS="$CFLAGS $DEBUG_CFLAGS"
   1.416 +    fi
   1.417 +    if test "$DEBUG_CXXFLAGS" != ""
   1.418 +    then
   1.419 +        CXXFLAGS="$CXXFLAGS $DEBUG_CXXFLAGS"
   1.420 +    fi
   1.421 +    if test "$DEBUG_LDFLAGS" != ""
   1.422 +    then
   1.423 +        LDFLAGS="$LDFLAGS $DEBUG_LDFLAGS"
   1.424 +    fi
   1.425 +fi
   1.426 +
   1.427 +export CFLAGS
   1.428 +export CXXFLAGS
   1.429 +export LDFLAGS
   1.430 +
   1.431 +# Run configure
   1.432 +
   1.433 +echo "export CPP=$CPP CC=$CC CXX=$CXX CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS MAKE=$MAKE"
   1.434 +echo "Running ./configure $OPTS $@ for $THE_OS using $THE_COMP compiler"
   1.435 +echo
   1.436 +if $configure $OPTS $@
   1.437 +then
   1.438 +	echo
   1.439 +	echo If the result of the above commands looks okay to you, go to the directory
   1.440 +	echo source in the ICU distribution to build ICU. Please remember that ICU needs
   1.441 +	echo GNU make to build properly...
   1.442 +else
   1.443 +	echo $0: ./configure failed
   1.444 +	exit 1
   1.445 +fi

mercurial