intl/icu/source/runConfigureICU

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial