#!/bin/sh # Copyright (c) 1999-2009, International Business Machines Corporation and # others. All Rights Reserved. # runConfigureICU: This script will run the "configure" script for the appropriate platform # Only supported platforms are recognized me=`basename $0` OPTS= usage() { ec=0$1 if test $ec -eq 0 then uletter=U else uletter=u fi echo "${uletter}sage: $me [ -h, --help ] [ --enable-debug | --disable-release ] platform [ configurearg ... ]" if test $ec -eq 0 then cat <&1` RELEASE_CFLAGS='-O' RELEASE_CXXFLAGS='-O' export CFLAGS="-fp-model precise" export CXXFLAGS="-fp-model precise" if [ "${ICC_VER}" = "Version 9.0 " ]; then RELEASE_CFLAGS='' RELEASE_CXXFLAGS='' export CFLAGS="${CFLAGS} -O0" export CXXFLAGS="${CXXFLAGS} -O0" echo "ICC 9.0 does not work with optimization- disabling optimizations" fi THE_COMP="Intel ${ICC_VER}" ;; Linux/VA) THE_OS="Linux" THE_COMP="IBM Visual Age C++ Compiler" CC=`which xlc_r`; export CC CXX=`which xlC_r`; export CXX RELEASE_CFLAGS="-O2 -qmaxmem=-1" RELEASE_CXXFLAGS="-O2 -qmaxmem=-1" ;; Linux*) THE_OS="Linux" THE_COMP="the GNU C++" CC=gcc; export CC CXX=g++; export CXX ;; Cygwin) THE_OS="Cygwin" THE_COMP="the GNU C++" RELEASE_CFLAGS='-O3' RELEASE_CXXFLAGS='-O3' ;; Cygwin/MSVC) THE_OS="Windows with Cygwin" THE_COMP="Microsoft Visual C++" CC=cl; export CC CXX=cl; export CXX RELEASE_CFLAGS='/Gy /MD' RELEASE_CXXFLAGS='/Gy /MD' DEBUG_CFLAGS='/Zi /MDd' DEBUG_CXXFLAGS='/Zi /MDd' DEBUG_LDFLAGS='/DEBUG' ;; Cygwin/MSVC2005) THE_OS="Windows with Cygwin" THE_COMP="Microsoft Visual C++ 2005" CC=cl; export CC CXX=cl; export CXX RELEASE_CFLAGS='/Gy /MD' RELEASE_CXXFLAGS='/Gy /MD' DEBUG_CFLAGS='/Zi /MDd' DEBUG_CXXFLAGS='/Zi /MDd' DEBUG_LDFLAGS='/DEBUG' ;; Cygwin/ICL) THE_OS="Windows with Cygwin" THE_COMP="Intel C++" CC=icl; export CC CXX=icl; export CXX # The Intel compiler has optimization bugs. So we disable optimization. RELEASE_CFLAGS='/Od' RELEASE_CXXFLAGS='/Od' DEBUG_CFLAGS='/Zi' DEBUG_CXXFLAGS='/Zi' DEBUG_LDFLAGS='/DEBUG' ;; MacOSX) THE_OS="MacOS X (Darwin)" THE_COMP="the GNU C++" RELEASE_CFLAGS='-O2' RELEASE_CXXFLAGS='-O2' ;; *BSD) THE_OS="BSD" THE_COMP="the GNU C++" CC=gcc; export CC CXX=g++; export CXX ;; TRU64V5.1/CXX) THE_OS="OSF1" THE_COMP="Compaq cxx" CC=cc; export CC CXX=cxx; export CXX ;; QNX) THE_OS="QNX" THE_COMP="QNX cc" CC=qcc; export CC CXX=QCC; export CXX ;; zOS) THE_OS="z/OS (OS/390)" THE_COMP="z/OS C/C++" CC=cc; export CC CXX=cxx; export CXX RELEASE_CFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'" RELEASE_CXXFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'" ;; zOSV1R2) THE_OS="z/OS 1.2" THE_COMP="z/OS 1.2 C/C++" CC=cc; export CC CXX=cxx; export CXX export COMPILE_LINK_ENVVAR='_CXX_CICC_VER}=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000' export _CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000 export LDFLAGS="-Wl,'compat=pm3'" export CFLAGS="-Wc,'target(zOSV1R2)'" export CXXFLAGS="-Wc,'target(zOSV1R2)'" export RELEASE_CFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'" export RELEASE_CXXFLAGS="-2 -Wc,'inline(auto,noreport,500,4000)'" ;; *) >&2 echo "$me: unrecognized platform \"$platform\" (use --help for help)" exit 1;; esac # Tweak flags if test $release -eq 1 then if test "$RELEASE_CFLAGS" = "" then case $CC in gcc|*/gcc|*-gcc-*|*/*-gcc-*) RELEASE_CFLAGS=-O3 ;; esac fi if test "$RELEASE_CFLAGS" != "" then CFLAGS="$CFLAGS $RELEASE_CFLAGS" fi if test "$RELEASE_CXXFLAGS" = "" then case $CXX in g++|*/g++|*-g++-*|*/*-g++-*) RELEASE_CXXFLAGS=-O3 ;; esac fi if test "$RELEASE_CXXFLAGS" != "" then CXXFLAGS="$CXXFLAGS $RELEASE_CXXFLAGS" fi if test "$RELEASE_LDFLAGS" != "" then LDFLAGS="$LDFLAGS $RELEASE_LDFLAGS" fi fi if test $debug -eq 1 then if test "$DEBUG_CFLAGS" != "" then CFLAGS="$CFLAGS $DEBUG_CFLAGS" fi if test "$DEBUG_CXXFLAGS" != "" then CXXFLAGS="$CXXFLAGS $DEBUG_CXXFLAGS" fi if test "$DEBUG_LDFLAGS" != "" then LDFLAGS="$LDFLAGS $DEBUG_LDFLAGS" fi fi export CFLAGS export CXXFLAGS export LDFLAGS # Run configure echo "Running ./configure $OPTS $@ for $THE_OS using $THE_COMP compiler" echo if $configure $OPTS $@ then echo echo If the result of the above commands looks okay to you, go to the directory echo source in the ICU distribution to build ICU. Please remember that ICU needs echo GNU make to build properly... else echo $0: ./configure failed exit 1 fi