nsprpub/configure.in

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nsprpub/configure.in	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,3230 @@
     1.4 +dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
     1.5 +dnl 
     1.6 +dnl This Source Code Form is subject to the terms of the Mozilla Public
     1.7 +dnl License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.9 +
    1.10 +AC_PREREQ(2.61)
    1.11 +AC_INIT
    1.12 +AC_CONFIG_SRCDIR([pr/include/nspr.h])
    1.13 +
    1.14 +AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
    1.15 +AC_CANONICAL_TARGET
    1.16 +
    1.17 +dnl ========================================================
    1.18 +dnl = Defaults
    1.19 +dnl ========================================================
    1.20 +MOD_MAJOR_VERSION=4
    1.21 +MOD_MINOR_VERSION=10
    1.22 +MOD_PATCH_VERSION=6
    1.23 +NSPR_MODNAME=nspr20
    1.24 +_HAVE_PTHREADS=
    1.25 +USE_PTHREADS=
    1.26 +USE_USER_PTHREADS=
    1.27 +USE_NSPR_THREADS=
    1.28 +USE_N32=
    1.29 +USE_X32=
    1.30 +USE_64=
    1.31 +USE_CPLUS=
    1.32 +USE_IPV6=
    1.33 +USE_MDUPDATE=
    1.34 +_MACOSX_DEPLOYMENT_TARGET=
    1.35 +_OPTIMIZE_FLAGS=-O
    1.36 +_DEBUG_FLAGS=-g
    1.37 +MOZ_DEBUG=1
    1.38 +MOZ_OPTIMIZE=
    1.39 +OBJDIR='$(OBJDIR_NAME)'
    1.40 +OBJDIR_NAME=.
    1.41 +OBJDIR_SUFFIX=OBJ
    1.42 +NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
    1.43 +NOSUCHFILE=/no-such-file
    1.44 +LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
    1.45 +LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
    1.46 +CYGWIN_WRAPPER=
    1.47 +MACOS_SDK_DIR=
    1.48 +NEXT_ROOT=
    1.49 +MT=
    1.50 +MOZ_OS2_HIGH_MEMORY=1
    1.51 +PROFILE_GEN_CFLAGS=
    1.52 +PROFILE_GEN_LDFLAGS=
    1.53 +PROFILE_USE_CFLAGS=
    1.54 +PROFILE_USE_LDFLAGS=
    1.55 +
    1.56 +dnl Link in libraries necessary to resolve all symbols for shared libs
    1.57 +RESOLVE_LINK_SYMBOLS=
    1.58 +
    1.59 +dnl ========================================================
    1.60 +dnl =
    1.61 +dnl = Dont change the following lines.  Doing so breaks:
    1.62 +dnl =
    1.63 +dnl = CFLAGS="-foo" ./configure
    1.64 +dnl =
    1.65 +dnl ========================================================
    1.66 +CFLAGS="${CFLAGS=}"
    1.67 +CXXFLAGS="${CXXFLAGS=}"
    1.68 +LDFLAGS="${LDFLAGS=}"
    1.69 +DLLFLAGS="${DLLFLAGS=}"
    1.70 +HOST_CFLAGS="${HOST_CFLAGS=}"
    1.71 +HOST_LDFLAGS="${HOST_LDFLAGS=}"
    1.72 +
    1.73 +case "$target" in
    1.74 +*-cygwin*|*-mingw*|*-msys*)
    1.75 +    # Check to see if we are really running in a msvc environemnt
    1.76 +    _WIN32_MSVC=
    1.77 +    AC_CHECK_PROGS(CC, cl)
    1.78 +    if test "$CC" = "cl"; then
    1.79 +        echo 'main() { return 0; }' > dummy.c
    1.80 +        ${CC} -o dummy dummy.c >/dev/null 2>&1
    1.81 +        if test $? = 0; then
    1.82 +            _WIN32_MSVC=1
    1.83 +            CXX=$CC
    1.84 +        else
    1.85 +            AC_MSG_WARN([$(CC) test failed.  Using normal feature tests])
    1.86 +        fi
    1.87 +        rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
    1.88 +    fi
    1.89 +    ;;
    1.90 +*-mks*)
    1.91 +    _WIN32_MSVC=1
    1.92 +    ;;
    1.93 +esac
    1.94 +
    1.95 +if test -n "$_WIN32_MSVC"; then
    1.96 +    SKIP_PATH_CHECKS=1
    1.97 +    SKIP_COMPILER_CHECKS=1
    1.98 +    SKIP_LIBRARY_CHECKS=1
    1.99 +fi
   1.100 +
   1.101 +dnl ========================================================
   1.102 +dnl = Android uses a very custom (hacky) toolchain; we need to do this
   1.103 +dnl = here, so that the compiler checks can succeed
   1.104 +dnl ========================================================
   1.105 +
   1.106 +AC_ARG_WITH(android-ndk,
   1.107 +[  --with-android-ndk=DIR
   1.108 +                          location where the Android NDK can be found],
   1.109 +    android_ndk=$withval)
   1.110 +
   1.111 +AC_ARG_WITH(android-toolchain,
   1.112 +[  --with-android-toolchain=DIR
   1.113 +                          location of the Android toolchain],
   1.114 +    android_toolchain=$withval)
   1.115 +
   1.116 +dnl The default android_version is different for each target cpu.
   1.117 +case "$target_cpu" in
   1.118 +arm)
   1.119 +    android_version=5
   1.120 +    ;;
   1.121 +i?86|mipsel)
   1.122 +    android_version=9
   1.123 +    ;;
   1.124 +esac
   1.125 +
   1.126 +AC_ARG_WITH(android-version,
   1.127 +[  --with-android-version=VER
   1.128 +                          Android platform version, default 5 for arm, 9 for x86/mips],
   1.129 +    android_version=$withval)
   1.130 +
   1.131 +AC_ARG_WITH(android-platform,
   1.132 +[  --with-android-platform=DIR
   1.133 +                          location of platform dir],
   1.134 +    android_platform=$withval)
   1.135 +
   1.136 +case "$target" in
   1.137 +arm-linux*-android*|*-linuxandroid*)
   1.138 +    android_tool_prefix="arm-linux-androideabi"
   1.139 +    ;;
   1.140 +i?86-*android*)
   1.141 +    android_tool_prefix="i686-linux-android"
   1.142 +    ;;
   1.143 +mipsel-*android*)
   1.144 +    android_tool_prefix="mipsel-linux-android"
   1.145 +    ;;
   1.146 +*)
   1.147 +    android_tool_prefix="$target_os"
   1.148 +    ;;
   1.149 +esac
   1.150 +
   1.151 +dnl ========================================================
   1.152 +dnl = Gonk is a fork of Android used for Mozilla's B2G project.
   1.153 +dnl = Configuration is done largely by the top level config
   1.154 +dnl = and the specified gonk directory doesn't matter here.
   1.155 +dnl ========================================================
   1.156 +
   1.157 +AC_ARG_WITH(gonk,
   1.158 +[  --with-gonk=DIR         location of gonk dir],
   1.159 +    gonkdir=$withval)
   1.160 +
   1.161 +if test -n "$gonkdir" ; then
   1.162 +    dnl Most things are directly configured by env vars when building for gonk
   1.163 +
   1.164 +    dnl prevent cross compile section from using these flags as host flags
   1.165 +    if test -z "$HOST_CPPFLAGS" ; then
   1.166 +        HOST_CPPFLAGS=" "
   1.167 +    fi
   1.168 +    if test -z "$HOST_CFLAGS" ; then
   1.169 +        HOST_CFLAGS=" "
   1.170 +    fi
   1.171 +    if test -z "$HOST_CXXFLAGS" ; then
   1.172 +        HOST_CXXFLAGS=" "
   1.173 +    fi
   1.174 +    if test -z "$HOST_LDFLAGS" ; then
   1.175 +        HOST_LDFLAGS=" "
   1.176 +    fi
   1.177 +
   1.178 +    AC_DEFINE(ANDROID)
   1.179 +else
   1.180 +case "$target" in
   1.181 +*-android*|*-linuxandroid*)
   1.182 +    if test -z "$android_ndk" ; then
   1.183 +       AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
   1.184 +    fi
   1.185 +
   1.186 +    if test -z "$android_toolchain" ; then
   1.187 +        AC_MSG_CHECKING([for android toolchain directory])
   1.188 +
   1.189 +        kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
   1.190 +
   1.191 +        case "$target_cpu" in
   1.192 +        arm)
   1.193 +            target_name=arm-linux-androideabi-4.4.3
   1.194 +            ;;
   1.195 +        i?86)
   1.196 +            target_name=x86-4.4.3
   1.197 +            ;;
   1.198 +        mipsel)
   1.199 +            target_name=mipsel-linux-android-4.4.3
   1.200 +            ;;
   1.201 +        esac
   1.202 +        android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
   1.203 +
   1.204 +        if test -d "$android_toolchain" ; then
   1.205 +            AC_MSG_RESULT([$android_toolchain])
   1.206 +        else
   1.207 +            AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
   1.208 +        fi
   1.209 +    fi
   1.210 +
   1.211 +    if test -z "$android_platform" ; then
   1.212 +        AC_MSG_CHECKING([for android platform directory])
   1.213 +
   1.214 +        case "$target_cpu" in
   1.215 +        arm)
   1.216 +            target_name=arm
   1.217 +            ;;
   1.218 +        i?86)
   1.219 +            target_name=x86
   1.220 +            ;;
   1.221 +        mipsel)
   1.222 +            target_name=mips
   1.223 +            ;;
   1.224 +        esac
   1.225 +
   1.226 +        android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"
   1.227 +
   1.228 +        if test -d "$android_platform" ; then
   1.229 +            AC_MSG_RESULT([$android_platform])
   1.230 +        else
   1.231 +            AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.])
   1.232 +        fi
   1.233 +    fi
   1.234 +
   1.235 +    dnl Old NDK support. If minimum requirement is changed to NDK r8b,
   1.236 +    dnl please remove this.
   1.237 +    case "$target_cpu" in
   1.238 +    i?86)
   1.239 +        if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
   1.240 +            dnl Old NDK toolchain name
   1.241 +            android_tool_prefix="i686-android-linux"
   1.242 +        fi
   1.243 +        ;;
   1.244 +    esac
   1.245 +
   1.246 +    dnl set up compilers
   1.247 +    AS="$android_toolchain"/bin/"$android_tool_prefix"-as
   1.248 +    CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
   1.249 +    CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
   1.250 +    CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
   1.251 +    LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
   1.252 +    AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
   1.253 +    RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
   1.254 +    STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
   1.255 +
   1.256 +    CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
   1.257 +    CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
   1.258 +    CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
   1.259 +    LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
   1.260 +
   1.261 +    dnl prevent cross compile section from using these flags as host flags
   1.262 +    if test -z "$HOST_CPPFLAGS" ; then
   1.263 +        HOST_CPPFLAGS=" "
   1.264 +    fi
   1.265 +    if test -z "$HOST_CFLAGS" ; then
   1.266 +        HOST_CFLAGS=" "
   1.267 +    fi
   1.268 +    if test -z "$HOST_CXXFLAGS" ; then
   1.269 +        HOST_CXXFLAGS=" "
   1.270 +    fi
   1.271 +    if test -z "$HOST_LDFLAGS" ; then
   1.272 +        HOST_LDFLAGS=" "
   1.273 +    fi
   1.274 +
   1.275 +    AC_DEFINE(ANDROID)
   1.276 +    ;;
   1.277 +esac
   1.278 +fi
   1.279 +
   1.280 +dnl ========================================================
   1.281 +dnl =
   1.282 +dnl = Check options that may affect the compiler
   1.283 +dnl =
   1.284 +dnl ========================================================
   1.285 +dist_prefix='${MOD_DEPTH}/dist'
   1.286 +dist_bindir='${dist_prefix}/bin'
   1.287 +dist_includedir='${dist_prefix}/include/nspr'
   1.288 +dist_libdir='${dist_prefix}/lib'
   1.289 +dnl If the --includedir option was not specified, add '/nspr' to autoconf's
   1.290 +dnl default value of includedir.
   1.291 +if test "${includedir}" = '${prefix}/include'; then
   1.292 +    includedir='${prefix}/include/nspr'
   1.293 +fi
   1.294 +
   1.295 +AC_ARG_WITH(dist-prefix,
   1.296 +    [  --with-dist-prefix=DIST_PREFIX
   1.297 +                          place build files in DIST_PREFIX [dist]],
   1.298 +    dist_prefix=$withval)
   1.299 +
   1.300 +AC_ARG_WITH(dist-bindir,
   1.301 +    [  --with-dist-bindir=DIR  build execuatables in DIR [DIST_PREFIX/bin]],
   1.302 +    dist_bindir=$withval)
   1.303 +
   1.304 +AC_ARG_WITH(dist-includedir,
   1.305 +    [  --with-dist-includedir=DIR
   1.306 +                          build include files in DIR [DIST_PREFIX/include/nspr]],
   1.307 +    dist_includedir=$withval)
   1.308 +
   1.309 +AC_ARG_WITH(dist-libdir,
   1.310 +    [  --with-dist-libdir=DIR  build library files in DIR [DIST_PREFIX/lib]],
   1.311 +    dist_libdir=$withval)
   1.312 +
   1.313 +AC_SUBST(dist_prefix)
   1.314 +AC_SUBST(dist_bindir)
   1.315 +AC_SUBST(dist_includedir)
   1.316 +AC_SUBST(dist_libdir)
   1.317 +
   1.318 +dnl Check if NSPR is being compiled for Mozilla
   1.319 +dnl Let --with-arg override environment setting
   1.320 +dnl
   1.321 +AC_ARG_WITH(mozilla,
   1.322 +    [  --with-mozilla          Compile NSPR with Mozilla support],
   1.323 +    [   if test "$withval" = "yes"; then
   1.324 +            AC_DEFINE(MOZILLA_CLIENT)
   1.325 +            MOZILLA_CLIENT=1
   1.326 +	    else
   1.327 +	        MOZILLA_CLIENT=
   1.328 +	    fi],
   1.329 +    [	if test -n "$MOZILLA_CLIENT"; then
   1.330 +	        AC_DEFINE(MOZILLA_CLIENT)
   1.331 +	    fi])
   1.332 +
   1.333 +AC_ARG_ENABLE(optimize,
   1.334 +    [  --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
   1.335 +    [ if test "$enableval" != "no"; then
   1.336 +          MOZ_OPTIMIZE=1
   1.337 +          if test -n "$enableval" -a "$enableval" != "yes"; then
   1.338 +            _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
   1.339 +            _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
   1.340 +          fi
   1.341 +      else
   1.342 +          MOZ_OPTIMIZE=
   1.343 +      fi ])
   1.344 +
   1.345 +AC_ARG_ENABLE(debug,
   1.346 +    [  --enable-debug[=DBG]    Enable debugging (using compiler flags DBG)],
   1.347 +    [ if test "$enableval" != "no"; then
   1.348 +          MOZ_DEBUG=1
   1.349 +          MOZ_DEBUG_SYMBOLS=1
   1.350 +          if test -n "$enableval" -a "$enableval" != "yes"; then
   1.351 +              _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
   1.352 +              _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
   1.353 +          fi
   1.354 +      else
   1.355 +          MOZ_DEBUG=
   1.356 +      fi ],
   1.357 +      MOZ_DEBUG_SYMBOLS=1)
   1.358 +
   1.359 +AC_ARG_ENABLE(debug-symbols,
   1.360 +    [  --enable-debug-symbols[=DBG]    Enable debugging symbols
   1.361 +                                       (using compiler flags DBG)],
   1.362 +    [ if test "$enableval" != "no"; then
   1.363 +          MOZ_DEBUG_SYMBOLS=1
   1.364 +          if test -n "$enableval" -a "$enableval" != "yes"; then
   1.365 +              if test -z "$_SAVE_DEBUG_FLAGS"; then
   1.366 +                  _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
   1.367 +                  _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
   1.368 +              else
   1.369 +                  AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
   1.370 +              fi
   1.371 +          fi
   1.372 +      else
   1.373 +          MOZ_DEBUG_SYMBOLS=
   1.374 +      fi ])
   1.375 +
   1.376 +AC_ARG_ENABLE(win32-target,
   1.377 +    [  --enable-win32-target=\$t
   1.378 +                          Specify win32 flavor. (WIN95 or WINNT)],
   1.379 +    OS_TARGET=`echo $enableval | tr a-z A-Z`)
   1.380 +
   1.381 +AC_ARG_ENABLE(symbian-target,
   1.382 +    [  --enable-symbian-target=\$t
   1.383 +                          Specify symbian flavor. (WINSCW or GCCE)],
   1.384 +    OS_TARGET=`echo $enableval | tr a-z A-Z`)
   1.385 +
   1.386 +AC_ARG_ENABLE(debug-rtl,
   1.387 +    [  --enable-debug-rtl      Use the MSVC debug runtime library],
   1.388 +    [ if test "$enableval" = "yes"; then
   1.389 +	    USE_DEBUG_RTL=1
   1.390 +      else
   1.391 +	    USE_DEBUG_RTL=0
   1.392 +      fi ])
   1.393 +
   1.394 +AC_ARG_ENABLE(n32,
   1.395 +    [  --enable-n32            Enable n32 ABI support (IRIX only)],
   1.396 +    [ if test "$enableval" = "yes"; then
   1.397 +	USE_N32=1
   1.398 +      else if test "$enableval" = "no"; then
   1.399 +	USE_N32=
   1.400 +      fi
   1.401 +    fi ])
   1.402 +
   1.403 +AC_ARG_ENABLE(x32,
   1.404 +    [  --enable-x32            Enable x32 ABI support (x86_64 only)],
   1.405 +    [ if test "$enableval" = "yes"; then
   1.406 +        USE_X32=1
   1.407 +      else if test "$enableval" = "no"; then
   1.408 +        USE_X32=
   1.409 +      fi
   1.410 +    fi ])
   1.411 +
   1.412 +AC_ARG_ENABLE(64bit,
   1.413 +    [  --enable-64bit          Enable 64-bit support (on certain platforms)],
   1.414 +    [ if test "$enableval" = "yes"; then
   1.415 +	    USE_64=1
   1.416 +      fi ])
   1.417 +
   1.418 +AC_ARG_ENABLE(mdupdate,
   1.419 +    [  --enable-mdupdate       Enable use of certain compilers' mdupdate feature],
   1.420 +    [ if test "$enableval" = "yes"; then
   1.421 +	    USE_MDUPDATE=1
   1.422 +      fi ])
   1.423 +
   1.424 +AC_ARG_ENABLE(cplus,
   1.425 +    [  --enable-cplus          Enable some c++ api routines],
   1.426 +    [ if test "$enableval" = "yes"; then
   1.427 +	    USE_CPLUS=1
   1.428 +      fi]) 
   1.429 +
   1.430 +AC_ARG_WITH(arm-kuser,
   1.431 +    [  --with-arm-kuser        Use kuser helpers (Linux/ARM only)
   1.432 +                          (Requires kernel 2.6.13 or later)],
   1.433 +    [ if test "$withval" = "yes"; then
   1.434 +	    AC_DEFINE(_PR_ARM_KUSER)
   1.435 +      fi ])
   1.436 +
   1.437 +dnl ========================================================
   1.438 +dnl = Mac OS X SDK support
   1.439 +dnl ========================================================
   1.440 +AC_ARG_WITH(macos-sdk,
   1.441 +    [  --with-macos-sdk=dir    Location of platform SDK to use (Mac OS X only)],
   1.442 +    MACOS_SDK_DIR=$withval)
   1.443 +
   1.444 +AC_ARG_ENABLE(macos-target,
   1.445 +             [  --enable-macos-target=VER
   1.446 +                          Set the minimum MacOS version needed at runtime
   1.447 +                          [10.2 for ppc, 10.4 for x86]],
   1.448 +             [_MACOSX_DEPLOYMENT_TARGET=$enableval])
   1.449 +
   1.450 +dnl ========================================================
   1.451 +dnl =
   1.452 +dnl = Set the threading model
   1.453 +dnl =
   1.454 +dnl ========================================================
   1.455 +case "$target" in
   1.456 +
   1.457 +*-aix*)
   1.458 +    case "${target_os}" in
   1.459 +    aix3.2*)
   1.460 +        USE_NSPR_THREADS=1
   1.461 +        ;;
   1.462 +    *)
   1.463 +        USE_PTHREADS=1
   1.464 +        ;;
   1.465 +    esac
   1.466 +    ;;
   1.467 +
   1.468 +esac
   1.469 +
   1.470 +dnl ========================================================
   1.471 +dnl =
   1.472 +dnl = Set the default C compiler
   1.473 +dnl =
   1.474 +dnl ========================================================
   1.475 +if test -z "$CC"; then
   1.476 +    case "$target" in
   1.477 +
   1.478 +    *-aix*)
   1.479 +        if test -z "$USE_NSPR_THREADS"; then
   1.480 +            CC=xlc_r
   1.481 +        else
   1.482 +            CC=xlc
   1.483 +        fi
   1.484 +    ;;
   1.485 +
   1.486 +    *-hpux*)
   1.487 +        CC=cc
   1.488 +    ;;
   1.489 +
   1.490 +    *-irix*)
   1.491 +        CC=cc
   1.492 +    ;;
   1.493 +
   1.494 +    *-osf*)
   1.495 +        CC=cc
   1.496 +    ;;
   1.497 +
   1.498 +    *-solaris*)
   1.499 +        CC=cc
   1.500 +    ;;
   1.501 +
   1.502 +    esac
   1.503 +fi
   1.504 +
   1.505 +dnl ========================================================
   1.506 +dnl =
   1.507 +dnl = Set the default C++ compiler
   1.508 +dnl =
   1.509 +dnl ========================================================
   1.510 +if test -z "$CXX"; then
   1.511 +    case "$target" in
   1.512 +
   1.513 +    *-aix*)
   1.514 +        if test -z "$USE_NSPR_THREADS"; then
   1.515 +            CXX=xlC_r
   1.516 +        else
   1.517 +            CXX=xlC
   1.518 +        fi
   1.519 +    ;;
   1.520 +
   1.521 +    *-hpux*)
   1.522 +        case "${target_os}" in
   1.523 +        hpux10.30)
   1.524 +            CXX=aCC
   1.525 +            ;;
   1.526 +        hpux11.*)
   1.527 +            CXX=aCC
   1.528 +            ;;
   1.529 +        *)
   1.530 +            CXX=CC
   1.531 +            ;;
   1.532 +        esac
   1.533 +    ;;
   1.534 +
   1.535 +    *-irix*)
   1.536 +        CXX=CC
   1.537 +    ;;
   1.538 +
   1.539 +    *-osf*)
   1.540 +        CXX=cxx
   1.541 +    ;;
   1.542 +
   1.543 +    *-solaris*)
   1.544 +        CXX=CC
   1.545 +    ;;
   1.546 +
   1.547 +    esac
   1.548 +fi
   1.549 +
   1.550 +if test -z "$SKIP_PATH_CHECKS"; then
   1.551 +    AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
   1.552 +fi
   1.553 +
   1.554 +if test -n "$MOZ_DEBUG"; then
   1.555 +    AC_DEFINE(DEBUG)
   1.556 +    DEFINES="$DEFINES -UNDEBUG"
   1.557 +
   1.558 +    case "${target_os}" in
   1.559 +    beos*)
   1.560 +        DEFINES="$DEFINES -DDEBUG_${USER}"
   1.561 +        ;;
   1.562 +    mks*|cygwin*|mingw*|msys*|os2*)
   1.563 +        DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
   1.564 +        ;;
   1.565 +    *)
   1.566 +        DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
   1.567 +        ;;
   1.568 +    esac
   1.569 +else
   1.570 +    AC_DEFINE(NDEBUG)
   1.571 +    DEFINES="$DEFINES -UDEBUG"
   1.572 +fi
   1.573 +
   1.574 +if test -z "$SKIP_COMPILER_CHECKS"; then
   1.575 +dnl ========================================================
   1.576 +dnl Checks for compilers.
   1.577 +dnl ========================================================
   1.578 +if test "$target" != "$host"; then
   1.579 +    echo "cross compiling from $host to $target"
   1.580 +    cross_compiling=yes
   1.581 +
   1.582 +    case "$build:$target" in
   1.583 +      powerpc-apple-darwin8*:i?86-apple-darwin*)
   1.584 +        dnl The Darwin cross compiler doesn't necessarily point itself at a
   1.585 +        dnl root that has libraries for the proper architecture, it defaults
   1.586 +        dnl to the system root.  The libraries in the system root on current
   1.587 +        dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
   1.588 +        dnl checks will fail.  Fake a working SDK in that case.
   1.589 +        _SAVE_CFLAGS=$CFLAGS
   1.590 +        _SAVE_CXXFLAGS=$CXXFLAGS
   1.591 +        CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
   1.592 +        CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
   1.593 +        ;;
   1.594 +      *:arm*-apple-darwin*)
   1.595 +        dnl The arm compiler doesn't appear to know about its root by default,
   1.596 +        dnl so explicitly pass it one here. Later on we'll put this in CFLAGS
   1.597 +        dnl anyway.
   1.598 +        _SAVE_CFLAGS=$CFLAGS
   1.599 +        _SAVE_CXXFLAGS=$CXXFLAGS
   1.600 +        CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS"
   1.601 +        CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS"
   1.602 +        ;;
   1.603 +    esac
   1.604 +
   1.605 +    AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
   1.606 +    unset ac_cv_prog_CC
   1.607 +    dnl Now exit the conditional block to invoke AC_PROG_CC.
   1.608 +fi
   1.609 +
   1.610 +dnl In the latest versions of autoconf, AC_PROG_CC is a one-shot macro,
   1.611 +dnl declared with AC_DEFUN_ONCE. So it must not be expanded inside a
   1.612 +dnl conditional block. Invoke AC_PROG_CC outside any conditional block
   1.613 +dnl and before invoking AC_TRY_COMPILE (which requires AC_PROG_CC).
   1.614 +AC_PROG_CC
   1.615 +
   1.616 +dnl Reenter the conditional blocks after invoking AC_PROG_CC.
   1.617 +if test "$target" != "$host"; then
   1.618 +    if test -n "$USE_CPLUS"; then
   1.619 +        AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
   1.620 +        unset ac_cv_prog_CXX
   1.621 +        AC_PROG_CXX
   1.622 +    fi
   1.623 +
   1.624 +    case "$build:$target" in
   1.625 +      powerpc-apple-darwin8*:i?86-apple-darwin*|*:arm*-apple-darwin*)
   1.626 +        dnl Revert the changes made above.  From this point on, the target
   1.627 +        dnl compiler will never be used without applying the SDK to CFLAGS
   1.628 +        dnl (see --with-macos-sdk below).
   1.629 +        CFLAGS=$_SAVE_CFLAGS
   1.630 +        CXXFLAGS=$_SAVE_CXXFLAGS
   1.631 +        ;;
   1.632 +    esac
   1.633 +
   1.634 +    AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
   1.635 +    AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
   1.636 +    AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
   1.637 +    AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
   1.638 +    AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
   1.639 +    AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
   1.640 +
   1.641 +    _SAVE_CC="$CC"
   1.642 +    _SAVE_CFLAGS="$CFLAGS"
   1.643 +    _SAVE_LDFLAGS="$LDFLAGS"
   1.644 +
   1.645 +    AC_MSG_CHECKING([for $host compiler])
   1.646 +    AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
   1.647 +    if test -z "$HOST_CC"; then
   1.648 +        AC_MSG_ERROR([no acceptable cc found in \$PATH])
   1.649 +    fi
   1.650 +    AC_MSG_RESULT([$HOST_CC])
   1.651 +    if test -z "$HOST_CFLAGS"; then
   1.652 +        HOST_CFLAGS="$CFLAGS"
   1.653 +    fi
   1.654 +    if test -z "$HOST_LDFLAGS"; then
   1.655 +        HOST_LDFLAGS="$LDFLAGS"
   1.656 +    fi
   1.657 +
   1.658 +    CC="$HOST_CC"
   1.659 +    CFLAGS="$HOST_CFLAGS"
   1.660 +    LDFLAGS="$HOST_LDFLAGS"
   1.661 +
   1.662 +    AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
   1.663 +    AC_TRY_COMPILE([], [return 0;],
   1.664 +        [AC_MSG_RESULT([yes])],
   1.665 +        [AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.])] )
   1.666 +
   1.667 +    CC=$_SAVE_CC
   1.668 +    CFLAGS=$_SAVE_CFLAGS
   1.669 +    LDFLAGS=$_SAVE_LDFLAGS
   1.670 +else
   1.671 +    if test -n "$USE_CPLUS"; then
   1.672 +        if test "$CC" = "cl" -a -z "$CXX"; then
   1.673 +            CXX=$CC
   1.674 +        else
   1.675 +            AC_PROG_CXX
   1.676 +        fi
   1.677 +    fi
   1.678 +    AC_PROG_RANLIB
   1.679 +    AC_PATH_PROGS(AS, as, $CC)
   1.680 +    AC_PATH_PROGS(AR, ar, echo not_ar)
   1.681 +    AC_PATH_PROGS(LD, ld link, echo not_ld)
   1.682 +    AC_PATH_PROGS(STRIP, strip, echo not_strip)
   1.683 +    AC_PATH_PROGS(WINDRES, windres, echo not_windres)
   1.684 +    if test -z "$HOST_CC"; then
   1.685 +        HOST_CC="$CC"
   1.686 +    fi
   1.687 +    if test -z "$HOST_CFLAGS"; then
   1.688 +        HOST_CFLAGS="$CFLAGS"
   1.689 +    fi
   1.690 +fi
   1.691 +
   1.692 +AC_PROG_CPP
   1.693 +
   1.694 +if test "$GCC" = "yes"; then
   1.695 +    GNU_CC=1
   1.696 +fi
   1.697 +if test "$GXX" = "yes"; then
   1.698 +    GNU_CXX=1
   1.699 +fi
   1.700 +if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
   1.701 +    GNU_AS=1
   1.702 +fi
   1.703 +rm -f a.out
   1.704 +
   1.705 +case "$build:$target" in
   1.706 +    i?86-apple-darwin*:powerpc-apple-darwin*)
   1.707 +        dnl cross_compiling will have erroneously been set to "no" in this
   1.708 +        dnl case, because the x86 build host is able to run ppc code in a
   1.709 +        dnl translated environment, making a cross compiler appear native.
   1.710 +        cross_compiling=yes
   1.711 +        ;;
   1.712 +esac
   1.713 +
   1.714 +if test "$cross_compiling"  = "yes"; then
   1.715 +    CROSS_COMPILE=1
   1.716 +else
   1.717 +    CROSS_COMPILE=
   1.718 +fi
   1.719 +
   1.720 +dnl ========================================================
   1.721 +dnl Check for gcc -pipe support
   1.722 +dnl ========================================================
   1.723 +AC_MSG_CHECKING([for gcc -pipe support])
   1.724 +if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
   1.725 +    echo '#include <stdio.h>' > dummy-hello.c
   1.726 +    echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
   1.727 +    ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
   1.728 +    cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
   1.729 +    if test $? = 0; then
   1.730 +        _res_as_stdin="yes"
   1.731 +    else
   1.732 +        _res_as_stdin="no"
   1.733 +    fi
   1.734 +    if test "$_res_as_stdin" = "yes"; then
   1.735 +        _SAVE_CFLAGS=$CFLAGS
   1.736 +        CFLAGS="$CFLAGS -pipe"
   1.737 +        AC_TRY_COMPILE( [ #include <stdio.h> ],
   1.738 +            [printf("Hello World\n");],
   1.739 +            [_res_gcc_pipe="yes"],
   1.740 +            [_res_gcc_pipe="no"] )
   1.741 +        CFLAGS=$_SAVE_CFLAGS
   1.742 +    fi
   1.743 +    if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
   1.744 +        _res="yes";
   1.745 +        CFLAGS="$CFLAGS -pipe"
   1.746 +        CXXFLAGS="$CXXFLAGS -pipe"
   1.747 +    else
   1.748 +        _res="no"
   1.749 +    fi
   1.750 +    rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
   1.751 +    AC_MSG_RESULT([$_res])
   1.752 +else
   1.753 +    AC_MSG_RESULT([no])
   1.754 +fi
   1.755 +
   1.756 +dnl ========================================================
   1.757 +dnl Profile guided optimization
   1.758 +dnl ========================================================
   1.759 +dnl Test for profiling options
   1.760 +dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
   1.761 +
   1.762 +_SAVE_CFLAGS="$CFLAGS"
   1.763 +CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
   1.764 +
   1.765 +AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
   1.766 +AC_TRY_COMPILE([], [return 0;],
   1.767 +               [ PROFILE_GEN_CFLAGS="-fprofile-generate"
   1.768 +                 result="yes" ], result="no")
   1.769 +AC_MSG_RESULT([$result])
   1.770 +
   1.771 +if test $result = "yes"; then
   1.772 +   PROFILE_GEN_LDFLAGS="-fprofile-generate"
   1.773 +   PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
   1.774 +   PROFILE_USE_LDFLAGS="-fprofile-use"
   1.775 +fi
   1.776 +
   1.777 +CFLAGS="$_SAVE_CFLAGS"
   1.778 +
   1.779 +dnl ===============================================================
   1.780 +dnl Check for .hidden assembler directive and visibility attribute.
   1.781 +dnl Borrowed from glibc configure.in
   1.782 +dnl ===============================================================
   1.783 +if test "$GNU_CC"; then
   1.784 +    AC_CACHE_CHECK(for visibility(hidden) attribute,
   1.785 +        ac_cv_visibility_hidden,
   1.786 +        [cat > conftest.c <<EOF
   1.787 +        int foo __attribute__ ((visibility ("hidden"))) = 1;
   1.788 +EOF
   1.789 +        ac_cv_visibility_hidden=no
   1.790 +        if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
   1.791 +            if grep '\.hidden.*foo' conftest.s >/dev/null; then
   1.792 +                ac_cv_visibility_hidden=yes
   1.793 +            fi
   1.794 +        fi
   1.795 +        rm -f conftest.[cs]
   1.796 +        ])
   1.797 +    if test "$ac_cv_visibility_hidden" = "yes"; then
   1.798 +        AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
   1.799 +        AC_CACHE_CHECK(for visibility pragma support,
   1.800 +            ac_cv_visibility_pragma,
   1.801 +            [cat > conftest.c <<EOF
   1.802 +#pragma GCC visibility push(hidden)
   1.803 +            int foo_hidden = 1;
   1.804 +#pragma GCC visibility push(default)
   1.805 +            int foo_default = 1;
   1.806 +EOF
   1.807 +            ac_cv_visibility_pragma=no
   1.808 +            if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
   1.809 +                if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
   1.810 +                    if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
   1.811 +                        ac_cv_visibility_pragma=yes
   1.812 +                    fi
   1.813 +                fi
   1.814 +            fi
   1.815 +            rm -f conftest.[cs]
   1.816 +            ])
   1.817 +        if test "$ac_cv_visibility_pragma" = "yes"; then
   1.818 +            AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
   1.819 +            # To work around a build problem on Linux x86-64 (Bugzilla bug
   1.820 +            # 293438), we use the -fvisibility=hidden flag.  This flag is less
   1.821 +            # optimal than #pragma GCC visibility push(hidden) because the flag
   1.822 +            # assumes that symbols defined outside the current source file have
   1.823 +            # the default visibility.  This has the advantage that we don't need
   1.824 +            # to wrap system header files, but has the disadvantage that calls
   1.825 +            # to hidden symbols defined in other source files cannot be
   1.826 +            # optimized by the compiler.  The -fvisibility=hidden flag does
   1.827 +            # hide and export symbols correctly.
   1.828 +            #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
   1.829 +            #WRAP_SYSTEM_INCLUDES=1
   1.830 +            VISIBILITY_FLAGS="-fvisibility=hidden"
   1.831 +            WRAP_SYSTEM_INCLUDES=
   1.832 +        fi
   1.833 +    fi
   1.834 +fi # GNU_CC
   1.835 +
   1.836 +fi # SKIP_COMPILER_CHECKS
   1.837 +
   1.838 +dnl ========================================================
   1.839 +dnl Checks for programs.
   1.840 +dnl ========================================================
   1.841 +if test -z "$SKIP_PATH_CHECKS"; then
   1.842 +    AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
   1.843 +elif test -z "$PERL"; then
   1.844 +    PERL=perl
   1.845 +fi
   1.846 +
   1.847 +dnl ========================================================
   1.848 +dnl Default platform specific options
   1.849 +dnl ========================================================
   1.850 +OBJ_SUFFIX=o
   1.851 +LIB_SUFFIX=a
   1.852 +DLL_SUFFIX=so
   1.853 +ASM_SUFFIX=s
   1.854 +MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
   1.855 +PR_MD_ASFILES=
   1.856 +PR_MD_CSRCS=
   1.857 +PR_MD_ARCH_DIR=unix
   1.858 +AR_FLAGS='cr $@'
   1.859 +AS='$(CC)'
   1.860 +ASFLAGS='$(CFLAGS)'
   1.861 +
   1.862 +if test -n "$CROSS_COMPILE"; then
   1.863 +    OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
   1.864 +    OS_RELEASE=
   1.865 +    OS_TEST="${target_cpu}"
   1.866 +    case "${target_os}" in
   1.867 +        linux*)       OS_ARCH=Linux ;;
   1.868 +        solaris*)     OS_ARCH=SunOS OS_RELEASE=5 ;;
   1.869 +        mingw*)       OS_ARCH=WINNT CPU_ARCH=x86 ;;
   1.870 +        darwin*)      OS_ARCH=Darwin ;;
   1.871 +        riscos*)      OS_ARCH=RISCOS ;;
   1.872 +    esac
   1.873 +else
   1.874 +    OS_ARCH=`uname -s | sed -e 's|/|_|g'`
   1.875 +    OS_RELEASE=`uname -r`
   1.876 +    OS_TEST=`uname -m`
   1.877 +fi
   1.878 +
   1.879 +if test "$OS_ARCH" = "IRIX64"; then
   1.880 +    OS_ARCH=IRIX
   1.881 +fi
   1.882 +
   1.883 +if test "$OS_ARCH" = "AIX"; then
   1.884 +    OS_RELEASE=`uname -v`.`uname -r`
   1.885 +fi
   1.886 +
   1.887 +if test "$OS_ARCH" = "FreeBSD"; then
   1.888 +    OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
   1.889 +fi
   1.890 +
   1.891 +if test "$OS_ARCH" = "Linux"; then
   1.892 +    OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
   1.893 +    OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
   1.894 +fi
   1.895 +
   1.896 +#######################################################################
   1.897 +# Master "Core Components" macros for getting the OS target           #
   1.898 +#######################################################################
   1.899 +
   1.900 +#
   1.901 +# Note: OS_TARGET should be specified on the command line for gmake.
   1.902 +# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
   1.903 +# The difference between the Win95 target and the WinNT target is that
   1.904 +# the WinNT target uses Windows NT specific features not available
   1.905 +# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
   1.906 +# at lesser performance (the Win95 target uses threads; the WinNT target
   1.907 +# uses fibers).
   1.908 +#
   1.909 +# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
   1.910 +# cross-compilation.
   1.911 +#
   1.912 +
   1.913 +#
   1.914 +# The following hack allows one to build on a WIN95 machine (as if
   1.915 +# s/he were cross-compiling on a WINNT host for a WIN95 target).
   1.916 +# It also accomodates for MKS's uname.exe.  If you never intend
   1.917 +# to do development on a WIN95 machine, you don't need this hack.
   1.918 +#
   1.919 +case "$OS_ARCH" in
   1.920 +Windows_95)
   1.921 +    OS_ARCH=Windows_NT
   1.922 +    OS_TARGET=WIN95
   1.923 +    ;;
   1.924 +Windows_98)
   1.925 +    OS_ARCH=Windows_NT
   1.926 +    OS_TARGET=WIN95
   1.927 +    ;;
   1.928 +CYGWIN_9*|CYGWIN_ME*)
   1.929 +    OS_ARCH='CYGWIN_NT-4.0'
   1.930 +    OS_TARGET=WIN95
   1.931 +    ;;
   1.932 +OS_2)
   1.933 +    OS_ARCH=OS2
   1.934 +    OS_TARGET=OS2
   1.935 +    ;;
   1.936 +esac
   1.937 +
   1.938 +#
   1.939 +# On WIN32, we also define the variable CPU_ARCH.
   1.940 +#
   1.941 +
   1.942 +case "$OS_ARCH" in
   1.943 +Windows_NT)
   1.944 +#
   1.945 +# If uname -s returns "Windows_NT", we assume that we are using
   1.946 +# the uname.exe in MKS toolkit.
   1.947 +#
   1.948 +# The -r option of MKS uname only returns the major version number.
   1.949 +# So we need to use its -v option to get the minor version number.
   1.950 +# Moreover, it doesn't have the -p option, so we need to use uname -m.
   1.951 +#
   1.952 +    OS_ARCH=WINNT
   1.953 +    OS_MINOR_RELEASE=`uname -v`
   1.954 +    if test "$OS_MINOR_RELEASE" = "00"; then
   1.955 +        OS_MINOR_RELEASE=0
   1.956 +    fi
   1.957 +    OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
   1.958 +    CPU_ARCH=`uname -m`
   1.959 +    #
   1.960 +    # MKS's uname -m returns "586" on a Pentium machine.
   1.961 +    #
   1.962 +    if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
   1.963 +        CPU_ARCH=x86
   1.964 +    fi
   1.965 +    ;;
   1.966 +CYGWIN_NT*|MINGW*_NT*|MSYS_NT*)
   1.967 +#
   1.968 +# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
   1.969 +# the uname.exe in the Cygwin tools.
   1.970 +# If uname -s returns "MINGW32_NT-5.1", we assume that we are using
   1.971 +# the uname.exe in the MSYS tools.
   1.972 +# If uname -s returns "MSYS_NT-6.3", we assume that we are using
   1.973 +# the uname.exe in the MSYS2 tools.
   1.974 +#
   1.975 +    OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
   1.976 +    OS_ARCH=WINNT
   1.977 +    CPU_ARCH=`uname -m`
   1.978 +    #
   1.979 +    # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
   1.980 +    #
   1.981 +    if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
   1.982 +        CPU_ARCH=x86
   1.983 +    fi
   1.984 +    ;;
   1.985 +esac
   1.986 +
   1.987 +if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
   1.988 +    OS_TARGET=WIN95
   1.989 +    if test -n "$MOZ_DEBUG" -a -z "$USE_DEBUG_RTL"; then
   1.990 +        USE_DEBUG_RTL=1
   1.991 +    fi
   1.992 +fi
   1.993 +if test -z "$OS_TARGET"; then
   1.994 +    OS_TARGET=$OS_ARCH
   1.995 +fi
   1.996 +if test "$OS_TARGET" = "WIN95"; then
   1.997 +    OS_RELEASE="4.0"
   1.998 +fi
   1.999 +OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
  1.1000 +
  1.1001 +dnl ========================================================
  1.1002 +dnl Enable high-memory support on OS/2 by default.
  1.1003 +dnl ========================================================
  1.1004 +AC_ARG_ENABLE(os2-high-mem,
  1.1005 +    [  --disable-os2-high-mem  Disable high-memory support on OS/2],
  1.1006 +    [ if test "$enableval" = "no"; then
  1.1007 +        MOZ_OS2_HIGH_MEMORY=
  1.1008 +      else
  1.1009 +        MOZ_OS2_HIGH_MEMORY=1
  1.1010 +      fi ])
  1.1011 +
  1.1012 +dnl ========================================================
  1.1013 +dnl = ARM toolchain tweaks
  1.1014 +dnl ========================================================
  1.1015 +
  1.1016 +dnl Defaults
  1.1017 +MOZ_ALIGN=toolchain-default
  1.1018 +
  1.1019 +case "$target" in
  1.1020 +arm*-android*|arm*-linuxandroid*)
  1.1021 +    MOZ_THUMB=yes
  1.1022 +    MOZ_ARCH=armv7-a
  1.1023 +    MOZ_FPU=vfp
  1.1024 +    MOZ_FLOAT_ABI=softfp
  1.1025 +    MOZ_SOFT_FLOAT=yes
  1.1026 +    MOZ_ALIGN=no
  1.1027 +    ;;
  1.1028 +arm*-*)
  1.1029 +    if test -n "$MOZ_PLATFORM_MAEMO"; then
  1.1030 +        MOZ_THUMB=no
  1.1031 +        MOZ_ARCH=armv7-a
  1.1032 +        MOZ_FLOAT_ABI=softfp
  1.1033 +    fi
  1.1034 +    if test "$MOZ_PLATFORM_MAEMO" = 6; then
  1.1035 +        MOZ_THUMB=yes
  1.1036 +    fi
  1.1037 +    ;;
  1.1038 +esac
  1.1039 +
  1.1040 +dnl Kept for compatibility with some buildbot mozconfig
  1.1041 +AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
  1.1042 +
  1.1043 +AC_ARG_WITH(thumb,
  1.1044 +[  --with-thumb[[=yes|no|toolchain-default]]]
  1.1045 +[                          Use Thumb instruction set (-mthumb)],
  1.1046 +    if test -z "$GNU_CC"; then
  1.1047 +        AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
  1.1048 +    fi
  1.1049 +    MOZ_THUMB=$withval)
  1.1050 +
  1.1051 +AC_ARG_WITH(thumb-interwork,
  1.1052 +[  --with-thumb-interwork[[=yes|no|toolchain-default]]
  1.1053 +                           Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
  1.1054 +    if test -z "$GNU_CC"; then
  1.1055 +        AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
  1.1056 +    fi
  1.1057 +    MOZ_THUMB_INTERWORK=$withval)
  1.1058 +
  1.1059 +AC_ARG_WITH(arch,
  1.1060 +[  --with-arch=[[type|toolchain-default]]
  1.1061 +                           Use specific CPU features (-march=type)],
  1.1062 +    if test -z "$GNU_CC"; then
  1.1063 +        AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
  1.1064 +    fi
  1.1065 +    MOZ_ARCH=$withval)
  1.1066 +
  1.1067 +AC_ARG_WITH(fpu,
  1.1068 +[  --with-fpu=[[type|toolchain-default]]
  1.1069 +                           Use specific FPU type (-mfpu=type)],
  1.1070 +    if test -z "$GNU_CC"; then
  1.1071 +        AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
  1.1072 +    fi
  1.1073 +    MOZ_FPU=$withval)
  1.1074 +
  1.1075 +AC_ARG_WITH(float-abi,
  1.1076 +[  --with-float-abi=[[type|toolchain-default]]
  1.1077 +                           Use specific arm float ABI (-mfloat-abi=type)],
  1.1078 +    if test -z "$GNU_CC"; then
  1.1079 +        AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
  1.1080 +    fi
  1.1081 +    MOZ_FLOAT_ABI=$withval)
  1.1082 +
  1.1083 +AC_ARG_WITH(soft-float,
  1.1084 +[  --with-soft-float[[=yes|no|toolchain-default]]
  1.1085 +                           Use soft float library (-msoft-float)],
  1.1086 +    if test -z "$GNU_CC"; then
  1.1087 +        AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
  1.1088 +    fi
  1.1089 +    MOZ_SOFT_FLOAT=$withval)
  1.1090 +
  1.1091 +case "$MOZ_ARCH" in
  1.1092 +toolchain-default|"")
  1.1093 +    arch_flag=""
  1.1094 +    ;;
  1.1095 +*)
  1.1096 +    arch_flag="-march=$MOZ_ARCH"
  1.1097 +    ;;
  1.1098 +esac
  1.1099 +
  1.1100 +case "$MOZ_THUMB" in
  1.1101 +yes)
  1.1102 +    MOZ_THUMB2=1
  1.1103 +    thumb_flag="-mthumb"
  1.1104 +    ;;
  1.1105 +no)
  1.1106 +    MOZ_THUMB2=
  1.1107 +    thumb_flag="-marm"
  1.1108 +    ;;
  1.1109 +*)
  1.1110 +    _SAVE_CFLAGS="$CFLAGS"
  1.1111 +    CFLAGS="$arch_flag"
  1.1112 +    AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
  1.1113 +        MOZ_THUMB2=1,
  1.1114 +        MOZ_THUMB2=)
  1.1115 +    CFLAGS="$_SAVE_CFLAGS"
  1.1116 +    thumb_flag=""
  1.1117 +    ;;
  1.1118 +esac
  1.1119 +
  1.1120 +case "$MOZ_THUMB_INTERWORK" in
  1.1121 +yes)
  1.1122 +    thumb_interwork_flag="-mthumb-interwork"
  1.1123 +    ;;
  1.1124 +no)
  1.1125 +    thumb_interwork_flag="-mno-thumb-interwork"
  1.1126 +    ;;
  1.1127 +*) # toolchain-default
  1.1128 +    thumb_interwork_flag=""
  1.1129 +    ;;
  1.1130 +esac
  1.1131 +
  1.1132 +case "$MOZ_FPU" in
  1.1133 +toolchain-default|"")
  1.1134 +    fpu_flag=""
  1.1135 +    ;;
  1.1136 +*)
  1.1137 +    fpu_flag="-mfpu=$MOZ_FPU"
  1.1138 +    ;;
  1.1139 +esac
  1.1140 +
  1.1141 +case "$MOZ_FLOAT_ABI" in
  1.1142 +toolchain-default|"")
  1.1143 +    float_abi_flag=""
  1.1144 +    ;;
  1.1145 +*)
  1.1146 +    float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
  1.1147 +    ;;
  1.1148 +esac
  1.1149 +
  1.1150 +case "$MOZ_SOFT_FLOAT" in
  1.1151 +yes)
  1.1152 +    soft_float_flag="-msoft-float"
  1.1153 +    ;;
  1.1154 +no)
  1.1155 +    soft_float_flag="-mno-soft-float"
  1.1156 +    ;;
  1.1157 +*) # toolchain-default
  1.1158 +    soft_float_flag=""
  1.1159 +    ;;
  1.1160 +esac
  1.1161 +
  1.1162 +case "$MOZ_ALIGN" in
  1.1163 +toolchain-default|"")
  1.1164 +    align_flag=""
  1.1165 +    ;;
  1.1166 +no)
  1.1167 +    align_flag="-mno-unaligned-access"
  1.1168 +    ;;
  1.1169 +yes)
  1.1170 +    align_flag="-munaligned-access"
  1.1171 +    ;;
  1.1172 +*)
  1.1173 +    align_flag=""
  1.1174 +    ;;
  1.1175 +esac
  1.1176 +
  1.1177 +if test -n "$align_flag"; then
  1.1178 +  _SAVE_CFLAGS="$CFLAGS"
  1.1179 +  CFLAGS="$CFLAGS $align_flag"
  1.1180 +  AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
  1.1181 +  AC_TRY_COMPILE([],[],,align_flag="")
  1.1182 +  CFLAGS="$_SAVE_CFLAGS"
  1.1183 +fi
  1.1184 +
  1.1185 +dnl Use echo to avoid accumulating space characters
  1.1186 +all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
  1.1187 +if test -n "$all_flags"; then
  1.1188 +    _SAVE_CFLAGS="$CFLAGS"
  1.1189 +    CFLAGS="$all_flags"
  1.1190 +    AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
  1.1191 +    AC_TRY_COMPILE([],[return 0;],
  1.1192 +        AC_MSG_RESULT([yes]),
  1.1193 +        AC_MSG_ERROR([no]))
  1.1194 +
  1.1195 +    CFLAGS="$_SAVE_CFLAGS $all_flags"
  1.1196 +    CXXFLAGS="$CXXFLAGS $all_flags"
  1.1197 +    ASFLAGS="$ASFLAGS $all_flags"
  1.1198 +    if test -n "$thumb_flag"; then
  1.1199 +        LDFLAGS="$LDFLAGS $thumb_flag"
  1.1200 +    fi
  1.1201 +fi
  1.1202 +
  1.1203 +dnl ========================================================
  1.1204 +dnl Override of system specific host options
  1.1205 +dnl ========================================================
  1.1206 +case "$host" in
  1.1207 +*-mingw*|*-msys*)
  1.1208 +    NSINSTALL=nsinstall
  1.1209 +    ;;
  1.1210 +*-cygwin*|*-mks*)
  1.1211 +    NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
  1.1212 +    if test `echo "${PATH}" | grep -c \;` = 0; then
  1.1213 +        CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
  1.1214 +    fi
  1.1215 +    ;;
  1.1216 +*-beos*)
  1.1217 +    HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
  1.1218 +    ;;
  1.1219 +*os2*)
  1.1220 +    ;;
  1.1221 +*)
  1.1222 +    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
  1.1223 +    ;;
  1.1224 +esac
  1.1225 +
  1.1226 +dnl ========================================================
  1.1227 +dnl Override of system specific target options
  1.1228 +dnl ========================================================
  1.1229 +case "$target" in
  1.1230 +
  1.1231 +*-aix*)
  1.1232 +    AC_DEFINE(XP_UNIX)
  1.1233 +    AC_DEFINE(AIX)
  1.1234 +    AC_DEFINE(SYSV)
  1.1235 +    DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
  1.1236 +    AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
  1.1237 +    case "${target_os}" in
  1.1238 +    aix3.2*)
  1.1239 +        AC_DEFINE(AIX_RENAME_SELECT)
  1.1240 +        AC_DEFINE(_PR_NO_LARGE_FILES)
  1.1241 +        AIX_LINK_OPTS='-bnso -berok'
  1.1242 +        PR_MD_ASFILES=os_AIX.s
  1.1243 +        ;;
  1.1244 +    aix4.1*)
  1.1245 +        AC_DEFINE(AIX_TIMERS)
  1.1246 +        AC_DEFINE(_PR_NO_LARGE_FILES)
  1.1247 +        AC_DEFINE(AIX4_1)
  1.1248 +        MKSHLIB=
  1.1249 +        DSO_LDOPTS=
  1.1250 +        AIX_LINK_OPTS='-bnso -berok'
  1.1251 +        LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
  1.1252 +        LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
  1.1253 +        ;;
  1.1254 +    aix4.2*)
  1.1255 +        AC_DEFINE(AIX_TIMERS)
  1.1256 +        AC_DEFINE(_PR_HAVE_OFF64_T)
  1.1257 +        AIX_LINK_OPTS='-brtl -bnso -berok'
  1.1258 +        ;;
  1.1259 +    aix4.3*)
  1.1260 +        AC_DEFINE(AIX_TIMERS)
  1.1261 +        AC_DEFINE(_PR_HAVE_OFF64_T)
  1.1262 +        AC_DEFINE(AIX4_3_PLUS)
  1.1263 +        AC_DEFINE(HAVE_SOCKLEN_T)
  1.1264 +        AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.1265 +        USE_IPV6=1
  1.1266 +        AIX_LINK_OPTS='-brtl -bnso -berok'
  1.1267 +        ;;
  1.1268 +    *)
  1.1269 +        AC_DEFINE(AIX_TIMERS)
  1.1270 +        AC_DEFINE(_PR_HAVE_OFF64_T)
  1.1271 +        AC_DEFINE(AIX4_3_PLUS)
  1.1272 +        AC_DEFINE(HAVE_SOCKLEN_T)
  1.1273 +        AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.1274 +        USE_IPV6=1
  1.1275 +        AIX_LINK_OPTS='-brtl -bnso -berok'
  1.1276 +        ;;
  1.1277 +    esac
  1.1278 +    CFLAGS="$CFLAGS -qro -qroconst"
  1.1279 +    AIX_WRAP='$(DIST)/lib/aixwrap.o'
  1.1280 +    AIX_TMP='./_aix_tmp.o'
  1.1281 +    if test -n "$USE_64"; then
  1.1282 +        MDCPUCFG_H=_aix64.cfg
  1.1283 +        OBJECT_MODE=64
  1.1284 +    else
  1.1285 +        MDCPUCFG_H=_aix32.cfg
  1.1286 +    fi
  1.1287 +    PR_MD_CSRCS=aix.c
  1.1288 +    RESOLVE_LINK_SYMBOLS=1
  1.1289 +    ;;
  1.1290 +        
  1.1291 +*-beos*)
  1.1292 +    AC_DEFINE(XP_BEOS)
  1.1293 +    AC_DEFINE(BeOS)
  1.1294 +    AC_DEFINE(BEOS)
  1.1295 +    AC_DEFINE(_POSIX_SOURCE)
  1.1296 +    DSO_LDOPTS=-nostart
  1.1297 +    MDCPUCFG_H=_beos.cfg
  1.1298 +    USE_BTHREADS=1
  1.1299 +    PR_MD_ARCH_DIR=beos
  1.1300 +    RESOLVE_LINK_SYMBOLS=1
  1.1301 +    case "${target_cpu}" in
  1.1302 +    i*86)
  1.1303 +        _OPTIMIZE_FLAGS=-O2
  1.1304 +        _DEBUG_FLAGS='-gdwarf-2 -O0'
  1.1305 +        MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
  1.1306 +        AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
  1.1307 +        ;;
  1.1308 +    powerpc)
  1.1309 +        CC=mwcc
  1.1310 +        CCC=mwcc
  1.1311 +        LD=mwld
  1.1312 +        DSO_LDOPTS='-xms -export pragma -init _init_routine_ -term _term_routine_ -lroot -lnet /boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o /boot/develop/lib/ppc/start_dyn.o'
  1.1313 +        _OPTIMIZE_FLAGS=-O2    
  1.1314 +        _DEBUG_FLAGS='-g -O0'
  1.1315 +        ;;
  1.1316 +    esac
  1.1317 +    ;;
  1.1318 +
  1.1319 +*-bsdi*)
  1.1320 +    AC_DEFINE(XP_UNIX)
  1.1321 +    AC_DEFINE(BSDI)
  1.1322 +    AC_DEFINE(NEED_BSDREGEX)
  1.1323 +
  1.1324 +    CFLAGS="$CFLAGS -Wall -Wno-format"
  1.1325 +    CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
  1.1326 +
  1.1327 +    if echo "$OS_TEST" | grep -c 86 >/dev/null; then
  1.1328 +        CPU_ARCH=x86
  1.1329 +    elif echo "$OS_TEST" | grep -c sparc >/dev/null; then 
  1.1330 +        CPU_ARCH=sparc
  1.1331 +    fi
  1.1332 +
  1.1333 +    MDCPUCFG_H=_bsdi.cfg
  1.1334 +    PR_MD_CSRCS=bsdi.c
  1.1335 +
  1.1336 +    DSO_LDOPTS=-r
  1.1337 +
  1.1338 +    case "$target_os" in
  1.1339 +    bsdi1.1*)
  1.1340 +        AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
  1.1341 +        AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
  1.1342 +        AC_DEFINE(_PR_NEED_H_ERRNO)
  1.1343 +        MKSHLIB=
  1.1344 +        DSO_CFLAGS=
  1.1345 +        DSO_LDOPTS=
  1.1346 +        ;;
  1.1347 +
  1.1348 +    bsdi2.1*)
  1.1349 +        AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
  1.1350 +        AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
  1.1351 +        AC_DEFINE(HAVE_DLL)
  1.1352 +        AC_DEFINE(USE_DLFCN)
  1.1353 +        AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
  1.1354 +        PR_MD_ASFILES=os_BSD_OS_386_2.s
  1.1355 +        ;;
  1.1356 +
  1.1357 +    bsdi4.* | bsdi5.*)
  1.1358 +        AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
  1.1359 +        AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
  1.1360 +        AC_DEFINE(HAVE_DLL)
  1.1361 +        AC_DEFINE(USE_DLFCN)
  1.1362 +        AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
  1.1363 +        MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
  1.1364 +        DSO_CFLAGS=-fPIC
  1.1365 +        DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
  1.1366 +        STRIP="$STRIP -d"
  1.1367 +        case "$target_os" in
  1.1368 +        bsdi4.2* | bsdi4.3* | bsdi5.*)
  1.1369 +            AC_DEFINE(_PR_HAVE_GETPROTO_R)
  1.1370 +            AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
  1.1371 +            ;;
  1.1372 +        esac
  1.1373 +        ;;
  1.1374 +    *)
  1.1375 +        AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
  1.1376 +        AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
  1.1377 +        AC_DEFINE(HAVE_DLL)
  1.1378 +        AC_DEFINE(USE_DLFCN)
  1.1379 +        AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
  1.1380 +        ;;
  1.1381 +    esac
  1.1382 +
  1.1383 +    ;;
  1.1384 +
  1.1385 +*-darwin*)
  1.1386 +    AC_DEFINE(XP_UNIX)
  1.1387 +    AC_DEFINE(DARWIN)
  1.1388 +    AC_DEFINE(HAVE_BSD_FLOCK)
  1.1389 +    AC_DEFINE(HAVE_SOCKLEN_T)
  1.1390 +    AS='$(CC) -x assembler-with-cpp'
  1.1391 +    CFLAGS="$CFLAGS -Wall -fno-common"
  1.1392 +    case "${target_cpu}" in
  1.1393 +        arm*)
  1.1394 +            CPU_ARCH=arm
  1.1395 +            ;;
  1.1396 +        i*86*|x86_64)
  1.1397 +            if test -n "$USE_64"; then
  1.1398 +                CPU_ARCH=x86_64
  1.1399 +            else        
  1.1400 +                CPU_ARCH=i386
  1.1401 +            fi
  1.1402 +            ;;
  1.1403 +        *)
  1.1404 +            CPU_ARCH=ppc
  1.1405 +            ;;
  1.1406 +    esac
  1.1407 +    if test "`echo $CC | grep -c '\-arch '`" = "0"; then
  1.1408 +        CC="$CC -arch $CPU_ARCH"
  1.1409 +    fi
  1.1410 +    AC_CHECK_HEADER(crt_externs.h)
  1.1411 +    DSO_CFLAGS=-fPIC
  1.1412 +    DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
  1.1413 +    _OPTIMIZE_FLAGS=-O2
  1.1414 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1.1415 +    STRIP="$STRIP -x -S"
  1.1416 +    DLL_SUFFIX=dylib
  1.1417 +    USE_PTHREADS=1
  1.1418 +    MDCPUCFG_H=_darwin.cfg
  1.1419 +    PR_MD_CSRCS=darwin.c
  1.1420 +    PR_MD_ASFILES=os_Darwin.s
  1.1421 +
  1.1422 +    # Add Mac OS X support for loading CFM & CFBundle plugins
  1.1423 +    if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
  1.1424 +        AC_DEFINE(XP_MACOSX)
  1.1425 +        OS_TARGET=MacOSX
  1.1426 +
  1.1427 +        if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
  1.1428 +            dnl Use the specified value
  1.1429 +            export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
  1.1430 +        elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
  1.1431 +            dnl No value specified on the command line or in the environment,
  1.1432 +            dnl use the lesser of the library's minimum or the architecture's
  1.1433 +            dnl minimum.
  1.1434 +            case "${target_cpu}" in
  1.1435 +                powerpc*)
  1.1436 +                    dnl Architecture minimum 10.2
  1.1437 +                    export MACOSX_DEPLOYMENT_TARGET=10.2
  1.1438 +                    ;;
  1.1439 +                i*86*)
  1.1440 +                    dnl Architecture minimum 10.4
  1.1441 +                    export MACOSX_DEPLOYMENT_TARGET=10.4
  1.1442 +                    ;;
  1.1443 +            esac
  1.1444 +        fi
  1.1445 +
  1.1446 +        dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
  1.1447 +        dnl in use.  NEXT_ROOT will be set and exported if it's needed for
  1.1448 +        dnl ld.
  1.1449 +
  1.1450 +        if test "$MACOS_SDK_DIR"; then
  1.1451 +            dnl Sync this section with the one in Mozilla's top level.
  1.1452 +
  1.1453 +            if test ! -d "$MACOS_SDK_DIR"; then
  1.1454 +                AC_MSG_ERROR([SDK not found.  When using --with-macos-sdk, you must
  1.1455 +specify a valid SDK.  SDKs are installed when the optional cross-development
  1.1456 +tools are selected during the Xcode/Developer Tools installation.])
  1.1457 +            fi
  1.1458 +
  1.1459 +            changequote(,)
  1.1460 +            CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
  1.1461 +            GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
  1.1462 +            GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
  1.1463 +            changequote([,])
  1.1464 +            GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
  1.1465 +            if test "$GCC_VERSION_MAJOR" -lt "4" ; then
  1.1466 +                SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
  1.1467 +                if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
  1.1468 +                    SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
  1.1469 +                fi
  1.1470 +
  1.1471 +                SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
  1.1472 +
  1.1473 +                CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
  1.1474 +
  1.1475 +                dnl CPP needs to be set for AC_CHECK_HEADER.
  1.1476 +                CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
  1.1477 +
  1.1478 +                changequote(,)
  1.1479 +                HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
  1.1480 +                changequote([,])
  1.1481 +                if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
  1.1482 +                    dnl The build host is running Tiger (10.4) or earlier.
  1.1483 +                    dnl ld support for -syslibroot is compiler-agnostic, but
  1.1484 +                    dnl only available on Tiger and later.  On Tiger and
  1.1485 +                    dnl earlier build hosts, just rely on NEXT_ROOT, because
  1.1486 +                    dnl it's not been shown to cause any problems.
  1.1487 +                    MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}"
  1.1488 +                else
  1.1489 +                    dnl The build host is running Leopard (10.5) or later.
  1.1490 +                    dnl With NEXT_ROOT set, the linker will still not apply
  1.1491 +                    dnl it when resolving dependencies.  This causes problems
  1.1492 +                    dnl on Leopard, where an SDK depends on frameworks which
  1.1493 +                    dnl were present in earlier OS releases (and the associated
  1.1494 +                    dnl SDK) but not in Leopard.  -syslibroot does not have
  1.1495 +                    dnl this problem, but it results in harmless warnings when
  1.1496 +                    dnl NEXT_ROOT is set.  NEXT_ROOT needs to remain set even
  1.1497 +                    dnl on Leopard because the compiler uses it too.
  1.1498 +                    MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
  1.1499 +                fi
  1.1500 +
  1.1501 +                LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
  1.1502 +                export NEXT_ROOT=$MACOS_SDK_DIR
  1.1503 +
  1.1504 +                if test -n "$CROSS_COMPILE" ; then
  1.1505 +                    dnl NEXT_ROOT will be in the environment, but it
  1.1506 +                    dnl shouldn't be set for the build host.  HOST_CXX is
  1.1507 +                    dnl presently unused.
  1.1508 +                    HOST_CC="NEXT_ROOT= $HOST_CC"
  1.1509 +                    HOST_CXX="NEXT_ROOT= $HOST_CXX"
  1.1510 +                fi
  1.1511 +            else
  1.1512 +                dnl gcc >= 4.0 uses different paths than above, but knows
  1.1513 +                dnl how to find them itself.
  1.1514 +                CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
  1.1515 +
  1.1516 +                dnl CPP needs to be set for AC_CHECK_HEADER.
  1.1517 +                CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
  1.1518 +
  1.1519 +                dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
  1.1520 +                dnl has an ld that supports -syslibroot.  Don't set
  1.1521 +                dnl NEXT_ROOT because it will be ignored and cause
  1.1522 +                dnl warnings when -syslibroot is specified.
  1.1523 +                if test "$GCC_VERSION_FULL" != "4.0.0" ; then
  1.1524 +                    dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
  1.1525 +                    dnl based on the -isysroot it receives.
  1.1526 +                    LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
  1.1527 +                else
  1.1528 +                    dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
  1.1529 +                    dnl to be explicit.
  1.1530 +                    LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
  1.1531 +                fi
  1.1532 +            fi
  1.1533 +        fi
  1.1534 +    fi
  1.1535 +    ;;
  1.1536 +
  1.1537 +*-dgux*)
  1.1538 +    AC_DEFINE(XP_UNIX)
  1.1539 +    AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.1540 +    AC_DEFINE(SVR4)
  1.1541 +    AC_DEFINE(SYSV)
  1.1542 +    AC_DEFINE(DGUX)
  1.1543 +    AC_DEFINE(_DGUX_SOURCE)
  1.1544 +    AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
  1.1545 +    DSO_LDOPTS=-G
  1.1546 +    _OPTIMIZE_FLAGS=-O2
  1.1547 +    _DEBUG_FLAGS=
  1.1548 +    MDCPUCFG_H=_dgux.cfg
  1.1549 +    PR_MD_CSRCS=dgux.c
  1.1550 +    ;;
  1.1551 +
  1.1552 +*-freebsd*)
  1.1553 +    if test -z "$USE_NSPR_THREADS"; then
  1.1554 +        USE_PTHREADS=1
  1.1555 +    fi
  1.1556 +    AC_DEFINE(XP_UNIX)
  1.1557 +    AC_DEFINE(FREEBSD)
  1.1558 +    AC_DEFINE(HAVE_BSD_FLOCK)
  1.1559 +    AC_DEFINE(HAVE_SOCKLEN_T)
  1.1560 +    CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
  1.1561 +    MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
  1.1562 +    if test "$MOZ_OBJFORMAT" = "elf"; then
  1.1563 +        DLL_SUFFIX=so
  1.1564 +    else
  1.1565 +        DLL_SUFFIX=so.1.0
  1.1566 +    fi
  1.1567 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1.1568 +    DSO_CFLAGS=-fPIC
  1.1569 +    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
  1.1570 +    MDCPUCFG_H=_freebsd.cfg
  1.1571 +    PR_MD_CSRCS=freebsd.c
  1.1572 +    ;;
  1.1573 +
  1.1574 +*-hpux*)
  1.1575 +    AC_DEFINE(XP_UNIX)
  1.1576 +    AC_DEFINE(HPUX)
  1.1577 +    AC_DEFINE(_HPUX_SOURCE)
  1.1578 +    # OSF1 and HPUX report the POLLHUP event for a socket when the
  1.1579 +    # shutdown(SHUT_WR) operation is called for the remote end, even though
  1.1580 +    # the socket is still writeable. Use select(), instead of poll(), to
  1.1581 +    # workaround this problem.
  1.1582 +    AC_DEFINE(_PR_POLL_WITH_SELECT)
  1.1583 +    AC_DEFINE(_USE_BIG_FDS)
  1.1584 +    DSO_LDOPTS='-b +h $(notdir $@)'
  1.1585 +    PR_MD_CSRCS=hpux.c
  1.1586 +    if test "$OS_TEST" = "ia64"; then
  1.1587 +        DLL_SUFFIX=so
  1.1588 +        DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
  1.1589 +        CPU_ARCH_TAG=_$OS_TEST 
  1.1590 +        if test -z "$USE_64"; then
  1.1591 +            COMPILER_TAG=_32
  1.1592 +        fi
  1.1593 +        PR_MD_ASFILES=os_HPUX_ia64.s
  1.1594 +    else
  1.1595 +        AC_DEFINE(hppa)
  1.1596 +        DLL_SUFFIX=sl
  1.1597 +        PR_MD_ASFILES=os_HPUX.s
  1.1598 +    fi
  1.1599 +    if test -n "$USE_64"; then
  1.1600 +        MDCPUCFG_H=_hpux64.cfg
  1.1601 +    else
  1.1602 +        MDCPUCFG_H=_hpux32.cfg
  1.1603 +    fi
  1.1604 +    if test -z "$GNU_CC"; then
  1.1605 +        CC="$CC -Ae"
  1.1606 +        CXX="$CXX -ext"
  1.1607 +        DSO_CFLAGS=+Z
  1.1608 +    else
  1.1609 +        DSO_CFLAGS=-fPIC
  1.1610 +        ASFLAGS="$ASFLAGS -x assembler-with-cpp"
  1.1611 +    fi
  1.1612 +
  1.1613 +    if test -n "$MOZILLA_CLIENT"; then
  1.1614 +        DEFAULT_IMPL_STRATEGY=_EMU
  1.1615 +    fi
  1.1616 +
  1.1617 +    if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
  1.1618 +        AC_DEFINE(_PR_NEED_H_ERRNO)
  1.1619 +        AC_DEFINE(HPUX9)
  1.1620 +        DEFAULT_IMPL_STRATEGY=_EMU
  1.1621 +    	USE_NSPR_THREADS=1
  1.1622 +    fi
  1.1623 +
  1.1624 +    if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
  1.1625 +        AC_DEFINE(_PR_NO_LARGE_FILES)
  1.1626 +    fi
  1.1627 +
  1.1628 +    if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
  1.1629 +        AC_DEFINE(_PR_NEED_H_ERRNO)
  1.1630 +    fi
  1.1631 +
  1.1632 +    if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
  1.1633 +        AC_DEFINE(HAVE_INT_LOCALTIME_R)
  1.1634 +    fi
  1.1635 +
  1.1636 +    if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
  1.1637 +        AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
  1.1638 +    fi
  1.1639 +
  1.1640 +    # HP-UX 11i v2 (B.11.23) or higher
  1.1641 +    changequote(<<,>>)
  1.1642 +    case "$OS_RELEASE" in
  1.1643 +    [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
  1.1644 +        USE_IPV6=1
  1.1645 +        ;;
  1.1646 +    esac
  1.1647 +    changequote([,])
  1.1648 +
  1.1649 +    if test "$OS_RELEASE" = "B.10.01"; then
  1.1650 +        AC_DEFINE(HPUX10)
  1.1651 +        DEFAULT_IMPL_STRATEGY=_EMU
  1.1652 +    fi
  1.1653 +
  1.1654 +    if test "$OS_RELEASE" = "B.10.10"; then
  1.1655 +        AC_DEFINE(HPUX10)
  1.1656 +        AC_DEFINE(HPUX10_10)
  1.1657 +        DEFAULT_IMPL_STRATEGY=_PTH
  1.1658 +    fi
  1.1659 +
  1.1660 +    if test "$OS_RELEASE" = "B.10.20"; then
  1.1661 +        AC_DEFINE(HPUX10)
  1.1662 +        AC_DEFINE(HPUX10_20)
  1.1663 +        if test -z "$GNU_CC"; then
  1.1664 +            CFLAGS="$CFLAGS +DAportable +DS1.1"
  1.1665 +            CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
  1.1666 +        fi
  1.1667 +        DEFAULT_IMPL_STRATEGY=_PTH
  1.1668 +    fi
  1.1669 +
  1.1670 +    if test "$OS_RELEASE" = "B.10.30"; then
  1.1671 +        AC_DEFINE(HPUX10)
  1.1672 +        AC_DEFINE(HPUX10_30)
  1.1673 +        if test -z "$GNU_CC"; then
  1.1674 +            CFLAGS="$CFLAGS +DAportable +DS1.1"
  1.1675 +            CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
  1.1676 +        fi
  1.1677 +        DEFAULT_IMPL_STRATEGY=_PTH
  1.1678 +    fi
  1.1679 +
  1.1680 +    if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
  1.1681 +        AC_DEFINE(HPUX10)
  1.1682 +        AC_DEFINE(HPUX11)
  1.1683 +        AC_DEFINE(_LARGEFILE64_SOURCE)
  1.1684 +        AC_DEFINE(_PR_HAVE_OFF64_T)
  1.1685 +        AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.1686 +        if test -z "$GNU_CC"; then
  1.1687 +            if test -z "$USE_64"; then
  1.1688 +                if test "$OS_TEST" = "ia64"; then
  1.1689 +                    CFLAGS="$CFLAGS +DD32"
  1.1690 +                    CXXFLAGS="$CXXFLAGS +DD32"
  1.1691 +                else
  1.1692 +                    CFLAGS="$CFLAGS +DAportable +DS2.0"
  1.1693 +                    CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
  1.1694 +                fi
  1.1695 +            else
  1.1696 +                if test "$OS_TEST" = "ia64"; then
  1.1697 +                    CFLAGS="$CFLAGS +DD64"
  1.1698 +                    CXXFLAGS="$CXXFLAGS +DD64"
  1.1699 +                else
  1.1700 +                    CFLAGS="$CFLAGS +DA2.0W +DS2.0"
  1.1701 +                    CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
  1.1702 +                fi
  1.1703 +            fi
  1.1704 +        fi
  1.1705 +        DEFAULT_IMPL_STRATEGY=_PTH
  1.1706 +    fi
  1.1707 +
  1.1708 +    if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
  1.1709 +        USE_NSPR_THREADS=1
  1.1710 +        USE_PTHREADS=
  1.1711 +        USE_USER_PTHREADS=
  1.1712 +    elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
  1.1713 +        USE_PTHREADS=1
  1.1714 +        if test "$USE_NSPR_THREADS"; then
  1.1715 +            USE_PTHREADS=
  1.1716 +        fi
  1.1717 +        if test "$USE_USER_PTHREADS"; then
  1.1718 +            USE_PTHREADS=
  1.1719 +        fi
  1.1720 +    fi
  1.1721 +    ;;
  1.1722 +
  1.1723 +*-irix*)
  1.1724 +    AC_DEFINE(XP_UNIX)
  1.1725 +    AC_DEFINE(IRIX)
  1.1726 +    AC_DEFINE(SVR4)
  1.1727 +    AC_DEFINE(_SGI_MP_SOURCE)
  1.1728 +    AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.1729 +    PR_MD_CSRCS=irix.c
  1.1730 +    PR_MD_ASFILES=os_Irix.s
  1.1731 +    MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
  1.1732 +    STRIP="$STRIP -f"
  1.1733 +    RESOLVE_LINK_SYMBOLS=1
  1.1734 +    if test -n "$USE_64"; then
  1.1735 +        MDCPUCFG_H=_irix64.cfg
  1.1736 +    else
  1.1737 +        MDCPUCFG_H=_irix32.cfg
  1.1738 +    fi
  1.1739 +    case "${target_os}" in
  1.1740 +    irix6*)
  1.1741 +        AC_DEFINE(IRIX6)
  1.1742 +        USE_PTHREADS=1
  1.1743 +        USE_N32=1
  1.1744 +        COMPILER_TAG=_n32
  1.1745 +        IMPL_STRATEGY=_PTH
  1.1746 +        ;;
  1.1747 +    irix5*)
  1.1748 +        AC_DEFINE(IRIX5)
  1.1749 +        USE_NSPR_THREADS=1
  1.1750 +        ;;
  1.1751 +    *)
  1.1752 +        USE_PTHREADS=1
  1.1753 +        USE_N32=1
  1.1754 +        ;;
  1.1755 +    esac
  1.1756 +    if test "$GNU_CC"; then
  1.1757 +        dnl
  1.1758 +        dnl If we are using gcc with native binutils, we need to
  1.1759 +        dnl suppress the
  1.1760 +        dnl #lineno "filename" num num
  1.1761 +        dnl lines, which confuse IRIX native as.  Add -Wp,-P to the
  1.1762 +        dnl gcc command line, which passes -P to the preprocessor.
  1.1763 +        dnl
  1.1764 +	    AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
  1.1765 +	    CFLAGS="$CFLAGS -Wall -Wno-format"
  1.1766 +	    _OPTIMIZE_FLAGS="-O6"
  1.1767 +    else
  1.1768 +	    if test -n "$USE_N32"; then
  1.1769 +		AS='as -D_ASM $(INCLUDES) -n32'
  1.1770 +	    else
  1.1771 +		AS='as -D_ASM $(INCLUDES)'
  1.1772 +	    fi
  1.1773 +	    CFLAGS="$CFLAGS -fullwarn -xansi"
  1.1774 +	    if test "$USE_N32"; then
  1.1775 +	        _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
  1.1776 +	    else
  1.1777 +	        _OPTIMIZE_FLAGS="-O -Olimit 4000"
  1.1778 +	    fi
  1.1779 +	    if test "$USE_MDUPDATE"; then
  1.1780 +                CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
  1.1781 +	    fi
  1.1782 +	    case "${target}" in
  1.1783 +	    *-irix6.*)
  1.1784 +	        CFLAGS="$CFLAGS -multigot"
  1.1785 +	        DSO_LDOPTS="-no_unresolved"
  1.1786 +	        if test "$USE_N32"; then
  1.1787 +		        CFLAGS="$CFLAGS -n32 -woff 1209"
  1.1788 +		        DSO_LDOPTS="$DSO_LDOPTS -n32"
  1.1789 +	        else
  1.1790 +		        if test "$USE_64"; then
  1.1791 +		            CFLAGS="$CFLAGS -64"
  1.1792 +		        else
  1.1793 +		            CFLAGS="$CFLAGS -32"
  1.1794 +		        fi
  1.1795 +	        fi
  1.1796 +	        ;;
  1.1797 +	    *)
  1.1798 +	        CFLAGS="$CFLAGS -xgot"
  1.1799 +	        ;;
  1.1800 +	    esac
  1.1801 +    fi
  1.1802 +    if test "${target_os}" = "irix5.3"; then
  1.1803 +	    AC_DEFINE(IRIX5_3)
  1.1804 +    fi
  1.1805 +    case "${target_os}" in
  1.1806 +	irix6.5)
  1.1807 +	    if test -z "$GNU_CC"; then
  1.1808 +		    CFLAGS="$CFLAGS -mips3"
  1.1809 +	    fi
  1.1810 +	    AC_DEFINE(_PR_HAVE_GETPROTO_R)
  1.1811 +	    AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
  1.1812 +	    AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
  1.1813 +	    ;;
  1.1814 +	irix5*)
  1.1815 +	    ;;
  1.1816 +	*)
  1.1817 +	    AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
  1.1818 +	    ;;
  1.1819 +	esac
  1.1820 +    ;;
  1.1821 +
  1.1822 +*-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
  1.1823 +    if test -z "$USE_NSPR_THREADS"; then
  1.1824 +        USE_PTHREADS=1
  1.1825 +        IMPL_STRATEGY=_PTH
  1.1826 +    fi
  1.1827 +    AC_DEFINE(XP_UNIX)
  1.1828 +    AC_DEFINE(_GNU_SOURCE)
  1.1829 +    AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.1830 +    case "${target}" in
  1.1831 +    *-android*|*-linuxandroid*)
  1.1832 +        OS_TARGET=Android
  1.1833 +        AC_DEFINE(LINUX)
  1.1834 +        ;;
  1.1835 +    *-linux*)
  1.1836 +        AC_DEFINE(LINUX)
  1.1837 +        ;;
  1.1838 +    esac
  1.1839 +    CFLAGS="$CFLAGS -Wall"
  1.1840 +    CXXFLAGS="$CXXFLAGS -Wall"
  1.1841 +    MDCPUCFG_H=_linux.cfg
  1.1842 +    PR_MD_CSRCS=linux.c
  1.1843 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1.1844 +    DSO_CFLAGS=-fPIC
  1.1845 +    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
  1.1846 +    _OPTIMIZE_FLAGS=-O2
  1.1847 +    _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
  1.1848 +                                   # combo is not yet good at debugging inlined
  1.1849 +                                   # functions (even when using DWARF2 as the
  1.1850 +                                   # debugging format)
  1.1851 +    COMPILER_TAG=_glibc
  1.1852 +    if echo "$OS_TEST" | grep -c 86 >/dev/null; then
  1.1853 +        CPU_ARCH=x86
  1.1854 +    else
  1.1855 +        CPU_ARCH=$OS_TEST
  1.1856 +    fi
  1.1857 +    CPU_ARCH_TAG=_${CPU_ARCH}
  1.1858 +    case "${target_cpu}" in
  1.1859 +    alpha)
  1.1860 +        AC_DEFINE(_ALPHA_)
  1.1861 +        AC_DEFINE(__alpha)
  1.1862 +        CFLAGS="$CFLAGS -mieee"
  1.1863 +        CXXFLAGS="$CXXFLAGS -mieee"
  1.1864 +        ;;
  1.1865 +    i*86)
  1.1866 +        AC_DEFINE(i386)
  1.1867 +        PR_MD_ASFILES=os_Linux_x86.s
  1.1868 +        ;;
  1.1869 +    ia64)
  1.1870 +        PR_MD_ASFILES=os_Linux_ia64.s
  1.1871 +        ;;
  1.1872 +    x86_64)
  1.1873 +        if test -n "$USE_64"; then
  1.1874 +            PR_MD_ASFILES=os_Linux_x86_64.s
  1.1875 +        elif test -n "$USE_X32"; then
  1.1876 +            PR_MD_ASFILES=os_Linux_x86_64.s
  1.1877 +            CC="$CC -mx32"
  1.1878 +            CXX="$CXX -mx32"
  1.1879 +        else
  1.1880 +            AC_DEFINE(i386)
  1.1881 +            PR_MD_ASFILES=os_Linux_x86.s
  1.1882 +            CC="$CC -m32"
  1.1883 +            CXX="$CXX -m32"
  1.1884 +        fi
  1.1885 +        ;;
  1.1886 +    ppc|powerpc)
  1.1887 +        PR_MD_ASFILES=os_Linux_ppc.s
  1.1888 +        ;;
  1.1889 +    powerpc64)
  1.1890 +        if test -n "$USE_64"; then
  1.1891 +            CC="$CC -m64"
  1.1892 +            CXX="$CXX -m64"
  1.1893 +        else
  1.1894 +            PR_MD_ASFILES=os_Linux_ppc.s
  1.1895 +        fi
  1.1896 +        ;;
  1.1897 +    m68k)
  1.1898 +        CFLAGS="$CFLAGS -m68020-60"
  1.1899 +        CXXFLAGS="$CXXFLAGS -m68020-60"
  1.1900 +        ;;
  1.1901 +    esac    
  1.1902 +    ;;
  1.1903 +
  1.1904 +*-mingw*|*-msys*|*-cygwin*|*-mks*)
  1.1905 +    AC_DEFINE(XP_PC)
  1.1906 +    AC_DEFINE(WIN32)
  1.1907 +    PR_MD_ARCH_DIR=windows
  1.1908 +    RESOLVE_LINK_SYMBOLS=1
  1.1909 +
  1.1910 +    if test -n "$GNU_CC"; then
  1.1911 +        CC="$CC -mwindows"
  1.1912 +        CXX="$CXX -mwindows"
  1.1913 +        DLL_SUFFIX=dll
  1.1914 +        MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
  1.1915 +        RC=$WINDRES
  1.1916 +        # Use temp file for windres (bug 213281)
  1.1917 +        RCFLAGS='-O coff --use-temp-file'
  1.1918 +    else
  1.1919 +        CC=cl
  1.1920 +        CXX=cl
  1.1921 +        LD=link
  1.1922 +        AR='lib -NOLOGO -OUT:"$@"'
  1.1923 +        AR_FLAGS=
  1.1924 +        RANLIB='echo not_ranlib'
  1.1925 +        STRIP='echo not_strip'
  1.1926 +        RC=rc.exe
  1.1927 +        GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
  1.1928 +        OBJ_SUFFIX=obj
  1.1929 +        LIB_SUFFIX=lib
  1.1930 +        DLL_SUFFIX=dll
  1.1931 +
  1.1932 +        # Determine compiler version
  1.1933 +        changequote(,)
  1.1934 +        _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
  1.1935 +        changequote([,])
  1.1936 +        CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
  1.1937 +        _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
  1.1938 +        _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
  1.1939 +        _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
  1.1940 +        _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
  1.1941 +        MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
  1.1942 +
  1.1943 +        if test "$_CC_MAJOR_VERSION" -eq "14"; then
  1.1944 +           dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
  1.1945 +           dnl so be very specific here!
  1.1946 +           dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
  1.1947 +           if test $_CC_RELEASE -gt 50727; then
  1.1948 +              _USE_DYNAMICBASE=1
  1.1949 +           elif test $_CC_BUILD -ge 762; then
  1.1950 +              _USE_DYNAMICBASE=1
  1.1951 +           fi
  1.1952 +           AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
  1.1953 +           AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
  1.1954 +        elif test $_CC_MAJOR_VERSION -ge 15; then
  1.1955 +           _USE_DYNAMICBASE=1    
  1.1956 +           AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
  1.1957 +           AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
  1.1958 +        fi
  1.1959 +
  1.1960 +        if test -n "$_USE_DYNAMICBASE"; then
  1.1961 +           DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
  1.1962 +        fi
  1.1963 +
  1.1964 +        # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
  1.1965 +        # tape manipulation utility (or something else)
  1.1966 +        if test "$MSC_VER" -ge "1400"; then
  1.1967 +            changequote(,)
  1.1968 +            _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
  1.1969 +            changequote([,])
  1.1970 +
  1.1971 +            MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
  1.1972 +            if test -n "$MSMT_TOOL"; then
  1.1973 +                MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
  1.1974 +                if test -z "$MSMANIFEST_TOOL_VERSION"; then
  1.1975 +                    AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
  1.1976 +                fi
  1.1977 +                MT=mt
  1.1978 +                unset MSMT_TOOL
  1.1979 +            else
  1.1980 +                AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
  1.1981 +            fi
  1.1982 +        fi
  1.1983 +        
  1.1984 +        CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
  1.1985 +        DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
  1.1986 +        _DEBUG_FLAGS=-Zi
  1.1987 +        _OPTIMIZE_FLAGS=-O2
  1.1988 +
  1.1989 +        PROFILE_GEN_CFLAGS="-GL"
  1.1990 +        PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
  1.1991 +        PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
  1.1992 +        PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
  1.1993 +
  1.1994 +        if test "$MSC_VER" -ge "1800"; then
  1.1995 +            dnl Visual C++ 2013 requires -FS when parallel building with
  1.1996 +            dnl make -jN. If not specified, compiler sometimes emits C1041
  1.1997 +            dnl error.
  1.1998 +            CFLAGS="$CFLAGS -FS"
  1.1999 +            dnl -Gw can benefit when using linker optimization on PGO.
  1.2000 +            dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
  1.2001 +            PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -Gw"
  1.2002 +            PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw"
  1.2003 +        fi
  1.2004 +
  1.2005 +        if test -z "$MOZ_OPTIMIZE"; then
  1.2006 +            CFLAGS="$CFLAGS -Od"
  1.2007 +        fi
  1.2008 +
  1.2009 +        if test "$USE_DEBUG_RTL" = 1; then
  1.2010 +            CFLAGS="$CFLAGS -MDd"
  1.2011 +        else
  1.2012 +            CFLAGS="$CFLAGS -MD"
  1.2013 +        fi
  1.2014 +
  1.2015 +        if test -n "$MOZ_DEBUG"; then
  1.2016 +            AC_DEFINE(_DEBUG)
  1.2017 +        else
  1.2018 +            DEFINES="$DEFINES -U_DEBUG"
  1.2019 +        fi
  1.2020 +
  1.2021 +        if test -n "$MOZ_DEBUG_SYMBOLS"; then
  1.2022 +            if test -n "$MOZ_OPTIMIZE"; then
  1.2023 +                DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
  1.2024 +                LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
  1.2025 +            else
  1.2026 +                DLLFLAGS="$DLLFLAGS -DEBUG"
  1.2027 +                LDFLAGS="$LDFLAGS -DEBUG"
  1.2028 +            fi
  1.2029 +        fi
  1.2030 +
  1.2031 +        OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
  1.2032 +        if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
  1.2033 +            OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
  1.2034 +        fi
  1.2035 +        
  1.2036 +        if test "$OS_TARGET" = "WINNT"; then
  1.2037 +            CFLAGS="$CFLAGS -GT"
  1.2038 +            LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
  1.2039 +            LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
  1.2040 +        else
  1.2041 +            LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
  1.2042 +            LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
  1.2043 +        fi
  1.2044 +    fi # GNU_CC
  1.2045 +
  1.2046 +    if test -n "$USE_STATIC_TLS"; then
  1.2047 +        AC_DEFINE(_PR_USE_STATIC_TLS)
  1.2048 +    fi
  1.2049 +
  1.2050 +    if test "$OS_TARGET" = "WINNT"; then
  1.2051 +        AC_DEFINE(WINNT)
  1.2052 +    else
  1.2053 +        AC_DEFINE(WIN95)
  1.2054 +        # undefine WINNT as some versions of mingw gcc define it by default
  1.2055 +        DEFINES="$DEFINES -UWINNT"
  1.2056 +        AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
  1.2057 +    fi
  1.2058 +
  1.2059 +    if test "$CPU_ARCH" = "x86"; then
  1.2060 +        CPU_ARCH_TAG=
  1.2061 +    else
  1.2062 +        CPU_ARCH_TAG=$CPU_ARCH
  1.2063 +    fi
  1.2064 +
  1.2065 +    if test "$USE_DEBUG_RTL" = 1; then
  1.2066 +        OBJDIR_SUFFIX=OBJD
  1.2067 +    fi
  1.2068 +
  1.2069 +    case "$OS_TARGET" in
  1.2070 +    WINNT)
  1.2071 +	    MDCPUCFG_H=_winnt.cfg
  1.2072 +	    ;;
  1.2073 +    WIN95)
  1.2074 +	    MDCPUCFG_H=_win95.cfg
  1.2075 +	    ;;
  1.2076 +    *)
  1.2077 +	    AC_MSG_ERROR([Missing OS_TARGET for ${target}.  Use --enable-win32-target to set.])
  1.2078 +   	;;
  1.2079 +    esac
  1.2080 +
  1.2081 +    case "$target_cpu" in
  1.2082 +    i*86)
  1.2083 +	if test -n "$USE_64"; then
  1.2084 +	    AC_DEFINE(_AMD64_)
  1.2085 +	else		
  1.2086 +	    AC_DEFINE(_X86_)
  1.2087 +	fi
  1.2088 +        ;;
  1.2089 +    x86_64)
  1.2090 +	    AC_DEFINE(_AMD64_)
  1.2091 +	    USE_64=1
  1.2092 +	    ;;
  1.2093 +    ia64)
  1.2094 +	    AC_DEFINE(_IA64_)
  1.2095 +	    USE_64=1
  1.2096 +	    ;;
  1.2097 +    *)
  1.2098 +	    AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
  1.2099 +	    ;;
  1.2100 +    esac
  1.2101 +    ;;
  1.2102 +
  1.2103 +*-netbsd*)
  1.2104 +    AC_DEFINE(XP_UNIX)
  1.2105 +    AC_DEFINE(NETBSD)
  1.2106 +    AC_DEFINE(HAVE_BSD_FLOCK)
  1.2107 +    if test -z "$USE_NSPR_THREADS"; then
  1.2108 +        USE_PTHREADS=1
  1.2109 +    fi
  1.2110 +    MDCPUCFG_H=_netbsd.cfg
  1.2111 +    PR_MD_CSRCS=netbsd.c
  1.2112 +
  1.2113 +    DSO_CFLAGS='-fPIC -DPIC'
  1.2114 +    CFLAGS="$CFLAGS -ansi -Wall"
  1.2115 +    CXXFLAGS="$CXXFLAGS -ansi -Wall"
  1.2116 +    MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
  1.2117 +
  1.2118 +    if test -z "$OBJECT_FMT"; then
  1.2119 +        if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
  1.2120 +            OBJECT_FMT=a.out
  1.2121 +            DLL_SUFFIX=so.1.0
  1.2122 +            DSO_LDOPTS='-shared'
  1.2123 +        else
  1.2124 +            OBJECT_FMT=ELF
  1.2125 +            DLL_SUFFIX=so
  1.2126 +            DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
  1.2127 +        fi
  1.2128 +    fi
  1.2129 +
  1.2130 +    if test "$LIBRUNPATH"; then
  1.2131 +        DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
  1.2132 +    fi
  1.2133 +    ;;
  1.2134 +
  1.2135 +*-nto*)
  1.2136 +    AC_DEFINE(XP_UNIX)
  1.2137 +    AC_DEFINE(NTO)
  1.2138 +    AC_DEFINE(_QNX_SOURCE)
  1.2139 +    AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
  1.2140 +    MDCPUCFG_H=_nto.cfg
  1.2141 +    PR_MD_CSRCS=nto.c
  1.2142 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
  1.2143 +    DSO_CFLAGS=-fPIC
  1.2144 +    DSO_LDOPTS=-shared
  1.2145 +    OS_LIBS="$OS_LIBS -lsocket"
  1.2146 +    _OPTIMIZE_FLAGS="-O1"
  1.2147 +    _DEBUG_FLAGS="-gstabs"
  1.2148 +	;;
  1.2149 +
  1.2150 +*-openbsd*)
  1.2151 +    AC_DEFINE(XP_UNIX)
  1.2152 +    AC_DEFINE(OPENBSD)
  1.2153 +    AC_DEFINE(HAVE_BSD_FLOCK)
  1.2154 +    AC_DEFINE(HAVE_SOCKLEN_T)
  1.2155 +    CFLAGS="$CFLAGS -ansi -Wall"
  1.2156 +    CXXFLAGS="$CXXFLAGS -ansi -Wall"
  1.2157 +    DLL_SUFFIX=so.1.0
  1.2158 +    DSO_CFLAGS=-fPIC
  1.2159 +    MDCPUCFG_H=_openbsd.cfg
  1.2160 +    PR_MD_CSRCS=openbsd.c
  1.2161 +    OS_LIBS="-lc"
  1.2162 +    if test -z "$USE_NSPR_THREADS"; then
  1.2163 +        USE_PTHREADS=1
  1.2164 +    fi
  1.2165 +    DSO_LDOPTS='-shared -fPIC'
  1.2166 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1.2167 +    ;;
  1.2168 +
  1.2169 +*-osf*)
  1.2170 +    SHELL_OVERRIDE="SHELL		= /usr/bin/ksh"
  1.2171 +    AC_DEFINE(XP_UNIX)
  1.2172 +    AC_DEFINE(OSF1)
  1.2173 +    AC_DEFINE(_REENTRANT)
  1.2174 +    # OSF1 and HPUX report the POLLHUP event for a socket when the
  1.2175 +    # shutdown(SHUT_WR) operation is called for the remote end, even though
  1.2176 +    # the socket is still writeable. Use select(), instead of poll(), to
  1.2177 +    # workaround this problem.
  1.2178 +    AC_DEFINE(_PR_POLL_WITH_SELECT)
  1.2179 +
  1.2180 +    if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
  1.2181 +        USE_NSPR_THREADS=1
  1.2182 +    fi
  1.2183 +
  1.2184 +    if test -z "$GNU_CC"; then
  1.2185 +        CC="$CC -std1 -ieee_with_inexact"
  1.2186 +        if test "$OS_RELEASE" != "V2.0"; then
  1.2187 +            CC="$CC -readonly_strings"
  1.2188 +        fi
  1.2189 +        _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
  1.2190 +        AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
  1.2191 +    else
  1.2192 +        CFLAGS="$CFLAGS -mieee"
  1.2193 +        CXXFLAGS="$CXXFLAGS -mieee"
  1.2194 +    fi
  1.2195 +
  1.2196 +    if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
  1.2197 +        AC_DEFINE(HAVE_INT_LOCALTIME_R)
  1.2198 +    else
  1.2199 +        AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.2200 +        AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
  1.2201 +    fi
  1.2202 +    if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
  1.2203 +        AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
  1.2204 +    fi
  1.2205 +    DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
  1.2206 +    MDCPUCFG_H=_osf1.cfg
  1.2207 +    PR_MD_CSRCS=osf1.c
  1.2208 +    ;;
  1.2209 +
  1.2210 +*-qnx*)
  1.2211 +    AC_DEFINE(XP_UNIX)
  1.2212 +    AC_DEFINE(QNX)
  1.2213 +    AC_DEFINE(_PR_NEED_H_ERRNO)
  1.2214 +    USE_NSPR_THREADS=1
  1.2215 +    MDCPUCFG_H=_qnx.cfg
  1.2216 +    PR_MD_CSRCS=qnx.c
  1.2217 +    ;;
  1.2218 +
  1.2219 +*-riscos*)
  1.2220 +    AC_DEFINE(XP_UNIX)
  1.2221 +    AC_DEFINE(RISCOS)
  1.2222 +    AC_DEFINE(_PR_NEED_H_ERRNO)
  1.2223 +    USE_PTHREADS=1
  1.2224 +    MDCPUCFG_H=_riscos.cfg
  1.2225 +    PR_MD_CSRCS=riscos.c
  1.2226 +    DSO_CFLAGS=-fPIC
  1.2227 +    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
  1.2228 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1.2229 +    ;;
  1.2230 +
  1.2231 +*-*-sco*)
  1.2232 +    AC_DEFINE(XP_UNIX)
  1.2233 +    AC_DEFINE(SCO)
  1.2234 +    AC_DEFINE(sco)
  1.2235 +    AC_DEFINE(SYSV)
  1.2236 +    AC_DEFINE(_SVID3)
  1.2237 +    AC_DEFINE(_PR_NEED_H_ERRNO)
  1.2238 +    CC='cc -b elf -KPIC'
  1.2239 +    CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
  1.2240 +    USE_NSPR_THREADS=1
  1.2241 +    CPU_ARCH=x86
  1.2242 +    DSO_LDOPTS='-b elf -G'
  1.2243 +    MDCPUCFG_H=_scoos.cfg
  1.2244 +    PR_MD_SRCS=scoos.c
  1.2245 +    ;;
  1.2246 +
  1.2247 +*-solaris*)
  1.2248 +    if test -z "$USE_NSPR_THREADS"; then
  1.2249 +        USE_PTHREADS=1
  1.2250 +    fi
  1.2251 +    AC_DEFINE(XP_UNIX)
  1.2252 +    AC_DEFINE(SVR4)
  1.2253 +    AC_DEFINE(SYSV)
  1.2254 +    AC_DEFINE(__svr4)
  1.2255 +    AC_DEFINE(__svr4__)
  1.2256 +    AC_DEFINE(SOLARIS)
  1.2257 +    AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.2258 +    CPU_ARCH=`uname -p`
  1.2259 +    MDCPUCFG_H=_solaris.cfg
  1.2260 +    PR_MD_CSRCS=solaris.c
  1.2261 +    LD=/usr/ccs/bin/ld
  1.2262 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1.2263 +    RESOLVE_LINK_SYMBOLS=1
  1.2264 +    case "${OS_RELEASE}" in
  1.2265 +    5.8|5.9)
  1.2266 +        ;;
  1.2267 +    *)
  1.2268 +        # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
  1.2269 +        USE_B_DIRECT=1
  1.2270 +        ;;
  1.2271 +    esac
  1.2272 +    if test -n "$GNU_CC"; then
  1.2273 +        DSO_CFLAGS=-fPIC
  1.2274 +        if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
  1.2275 +            GCC_USE_GNU_LD=1
  1.2276 +        fi
  1.2277 +        DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore' 
  1.2278 +        if test -n "$USE_B_DIRECT"; then
  1.2279 +            DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
  1.2280 +        fi
  1.2281 +    else
  1.2282 +        DSO_CFLAGS=-KPIC
  1.2283 +        DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
  1.2284 +        if test -n "$USE_B_DIRECT"; then
  1.2285 +            DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
  1.2286 +        fi
  1.2287 +    fi
  1.2288 +    if test -n "$GNU_CC"; then
  1.2289 +        CFLAGS="$CFLAGS -Wall"
  1.2290 +        CXXFLAGS="$CXXFLAGS -Wall"
  1.2291 +        if test -n "$USE_MDUPDATE"; then
  1.2292 +            CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
  1.2293 +            CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
  1.2294 +        fi
  1.2295 +        GCC_AS=`$CC -print-prog-name=as`
  1.2296 +        if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
  1.2297 +            GNU_AS=1
  1.2298 +        fi
  1.2299 +    else
  1.2300 +        CFLAGS="$CFLAGS -xstrconst"
  1.2301 +        CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
  1.2302 +        if test -z "$MOZ_OPTIMIZE"; then
  1.2303 +            CFLAGS="$CFLAGS -xs"
  1.2304 +            CXXFLAGS="$CXXFLAGS -xs"
  1.2305 +        fi
  1.2306 +        _OPTIMIZE_FLAGS=-xO4
  1.2307 +    fi
  1.2308 +    if test -z "$GNU_AS"; then
  1.2309 +        ASFLAGS="$ASFLAGS -Wa,-P"
  1.2310 +    fi
  1.2311 +    if test -n "$USE_64"; then
  1.2312 +        if test -n "$GNU_CC"; then
  1.2313 +            CC="$CC -m64"
  1.2314 +            CXX="$CXX -m64"
  1.2315 +        else
  1.2316 +            if test "$OS_TEST" = "i86pc"; then
  1.2317 +                CC="$CC -xarch=amd64"
  1.2318 +                CXX="$CXX -xarch=amd64"
  1.2319 +            else
  1.2320 +                CC="$CC -xarch=v9"
  1.2321 +                CXX="$CXX -xarch=v9"
  1.2322 +            fi
  1.2323 +        fi
  1.2324 +    fi
  1.2325 +    if test "$OS_TEST" = "i86pc"; then
  1.2326 +        if test -z "$USE_64"; then
  1.2327 +            AC_DEFINE(i386)
  1.2328 +        fi
  1.2329 +        CPU_ARCH_TAG=_$OS_TEST
  1.2330 +        # The default debug format, DWARF (-g), is not supported by gcc
  1.2331 +        # on i386-ANY-sysv4/solaris, but the stabs format is.  It is
  1.2332 +        # assumed that the Solaris assembler /usr/ccs/bin/as is used.
  1.2333 +        # If your gcc uses GNU as, you do not need the -Wa,-s option.
  1.2334 +        if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
  1.2335 +            _DEBUG_FLAGS=-gstabs
  1.2336 +            if test -z "$GNU_AS"; then
  1.2337 +                _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
  1.2338 +            fi
  1.2339 +        fi
  1.2340 +    fi
  1.2341 +    case "${target_os}" in
  1.2342 +    solaris2.3*)
  1.2343 +        AC_DEFINE(_PR_NO_LARGE_FILES)
  1.2344 +        ;;
  1.2345 +    solaris2.4*)
  1.2346 +        AC_DEFINE(_PR_NO_LARGE_FILES)
  1.2347 +        ;;
  1.2348 +    solaris2.5*)
  1.2349 +        AC_DEFINE(SOLARIS2_5)    
  1.2350 +        ;;
  1.2351 +    *)
  1.2352 +        AC_DEFINE(_PR_HAVE_OFF64_T)
  1.2353 +        # The lfcompile64(5) man page on Solaris 2.6 says:
  1.2354 +        #     For applications that do not wish to conform to the POSIX or
  1.2355 +        #     X/Open  specifications,  the  64-bit transitional interfaces
  1.2356 +        #     are available by default.  No compile-time flags need to  be
  1.2357 +        #     set.
  1.2358 +        # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
  1.2359 +        # The native compiler, gcc 2.8.x, and egcs don't have this problem.
  1.2360 +        if test -n "$GNU_CC"; then
  1.2361 +            AC_DEFINE(_LARGEFILE64_SOURCE)
  1.2362 +        fi
  1.2363 +        ;;
  1.2364 +    esac
  1.2365 +    case "${target_os}" in
  1.2366 +    solaris2.3*)
  1.2367 +        ;;
  1.2368 +    solaris2.4*)
  1.2369 +        ;;
  1.2370 +    solaris2.5*)
  1.2371 +        ;;
  1.2372 +    solaris2.6*)
  1.2373 +        ;;
  1.2374 +    solaris2.7*)
  1.2375 +        ;;
  1.2376 +    *)
  1.2377 +        # Solaris 8 or higher has IPv6.
  1.2378 +        AC_DEFINE(_PR_INET6)
  1.2379 +        ;;
  1.2380 +    esac
  1.2381 +    if test "$CPU_ARCH" = "sparc"; then
  1.2382 +        # 64-bit Solaris SPARC requires V9 architecture, so the following
  1.2383 +        # is not needed.
  1.2384 +        if test -z "$USE_64"; then
  1.2385 +            ULTRASPARC_LIBRARY=nspr_flt
  1.2386 +        fi
  1.2387 +    fi
  1.2388 +    # Purify requires that binaries linked against nspr also
  1.2389 +    # be linked against -lrt (or -lposix4) so add it to OS_LIBS
  1.2390 +    _rev=`uname -r`
  1.2391 +    _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
  1.2392 +    OS_LIBS="$OS_LIBS $_librt"
  1.2393 +    ;;
  1.2394 +
  1.2395 +*-sco-sysv5*)
  1.2396 +    AC_DEFINE(XP_UNIX)
  1.2397 +    AC_DEFINE(UNIXWARE)
  1.2398 +    AC_DEFINE(SVR4)
  1.2399 +    AC_DEFINE(SYSV)
  1.2400 +    USE_NSPR_THREADS=1
  1.2401 +    if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
  1.2402 +        AC_DEFINE(_PR_NO_LARGE_FILES)
  1.2403 +        CC='$(NSDEPTH)/build/hcc cc'
  1.2404 +        CXX='$(NSDEPTH)/build/hcpp CC'
  1.2405 +        MDCPUCFG_H=_unixware.cfg
  1.2406 +    else
  1.2407 +        AC_DEFINE(_LARGEFILE64_SOURCE)
  1.2408 +        AC_DEFINE(_PR_HAVE_OFF64_T)
  1.2409 +        AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
  1.2410 +        MDCPUCFG_H=_unixware7.cfg
  1.2411 +    fi
  1.2412 +    PR_MD_CSRCS=unixware.c
  1.2413 +    DSO_LDOPTS=-G
  1.2414 +    CPU_ARCH=x86
  1.2415 +    ;;
  1.2416 +
  1.2417 +*-symbian*)
  1.2418 +    AC_ARG_WITH(symbian-sdk,
  1.2419 +    [  --with-symbian-sdk=SYMBIAN_SDK_DIR
  1.2420 +                          The path to the Symbian SDK],
  1.2421 +    SYMBIAN_SDK_DIR=$withval)
  1.2422 +
  1.2423 +    echo -----------------------------------------------------------------------------
  1.2424 +    echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
  1.2425 +    echo -----------------------------------------------------------------------------
  1.2426 +
  1.2427 +    AC_DEFINE(XP_UNIX)
  1.2428 +    AC_DEFINE(SYMBIAN)
  1.2429 +    AC_DEFINE(__arm__)
  1.2430 +    AC_DEFINE(__SYMBIAN32__)
  1.2431 +    AC_DEFINE(_UNICODE)
  1.2432 +    AC_DEFINE(NDEBUG)
  1.2433 +    AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
  1.2434 +    AC_DEFINE(MOZ_STDERR_TO_STDOUT)
  1.2435 +    AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
  1.2436 +    AC_DEFINE(HAVE_SOCKLEN_T)
  1.2437 +    USE_PTHREADS=1
  1.2438 +    LIB_SUFFIX=lib
  1.2439 +    DLL_SUFFIX=dll
  1.2440 +    MKSHLIB=
  1.2441 +    DSO_LDOPTS=
  1.2442 +    DSO_CFLAGS=
  1.2443 +    VISIBILITY_FLAGS=
  1.2444 +    MDCPUCFG_H=_symbian.cfg
  1.2445 +    PR_MD_CSRCS=symbian.c
  1.2446 +    NSINSTALL=nsinstall
  1.2447 +    RANLIB='echo no ranlib '
  1.2448 +    CPU_ARCH=ARM
  1.2449 +    OS_ARCH=SYMBIAN
  1.2450 +    OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
  1.2451 +    CFLAGS="$CFLAGS -MD -nostdinc"
  1.2452 +    SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
  1.2453 +    echo -------------------------------------------------------
  1.2454 +    echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
  1.2455 +    echo -------------------------------------------------------
  1.2456 +    case "$OS_TARGET" in
  1.2457 +    WINSCW)
  1.2458 +        CC=mwccsym2.exe
  1.2459 +        CXX=mwccsym2.exe
  1.2460 +        LD=mwldsym2.exe
  1.2461 +        AR=mwldsym2.exe
  1.2462 +        WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
  1.2463 +        CFLAGS="$CFLAGS -O0 -inline off -wchar_t off -align 4 -warnings on -w nohidevirtual,nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -nostderr -gccdep -cwd source -i- -I\$(VPATH)"
  1.2464 +        SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
  1.2465 +        AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
  1.2466 +        AC_DEFINE(_DEBUG)
  1.2467 +        AC_DEFINE(__CW32__)
  1.2468 +        AC_DEFINE(__WINS__)
  1.2469 +        AC_DEFINE(__WINSCW__)
  1.2470 +        DEFINES="$DEFINES -U_WIN32"
  1.2471 +	    ;;
  1.2472 +    GCCE)
  1.2473 +        CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
  1.2474 +        CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
  1.2475 +        SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
  1.2476 +        AC_DEFINE(__GCCE__)
  1.2477 +        AC_DEFINE(__EABI__)
  1.2478 +        DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
  1.2479 +	    ;;
  1.2480 +    *)
  1.2481 +	    AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
  1.2482 +   	;;
  1.2483 +    esac
  1.2484 +    CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
  1.2485 +    ;;
  1.2486 +
  1.2487 +*-os2*)
  1.2488 +    AC_DEFINE(XP_OS2)
  1.2489 +    AC_DEFINE(XP_PC)
  1.2490 +    AC_DEFINE(BSD_SELECT)
  1.2491 +    AC_DEFINE(TCPV40HDRS)
  1.2492 +    LIB_SUFFIX=lib
  1.2493 +    DLL_SUFFIX=dll
  1.2494 +    RC=rc.exe
  1.2495 +    PR_MD_ARCH_DIR=os2
  1.2496 +    PROG_SUFFIX=.exe
  1.2497 +    NSINSTALL=nsinstall
  1.2498 +    MDCPUCFG_H=_os2.cfg
  1.2499 +    RESOLVE_LINK_SYMBOLS=1
  1.2500 +
  1.2501 +    AC_DEFINE(OS2)
  1.2502 +    AR=emxomfar
  1.2503 +    AR_FLAGS='r $@'
  1.2504 +    CFLAGS="$CFLAGS -Wall -Zomf"
  1.2505 +    CXXFLAGS="$CFLAGS -Wall -Zomf"
  1.2506 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1.2507 +    DSO_CFLAGS=
  1.2508 +    DSO_LDOPTS='-Zomf -Zdll'
  1.2509 +    LDFLAGS='-Zmap'
  1.2510 +    _OPTIMIZE_FLAGS="-O2 -s"
  1.2511 +    _DEBUG_FLAGS="-g -fno-inline"
  1.2512 +    if test -n "$MOZ_OPTIMIZE"; then
  1.2513 +      DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
  1.2514 +    fi
  1.2515 +    IMPLIB='emximp -o'
  1.2516 +    FILTER='emxexp -o'
  1.2517 +    if test -n "$MOZ_OS2_HIGH_MEMORY"; then
  1.2518 +      LDFLAGS="$LDFLAGS -Zhigh-mem"
  1.2519 +      AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
  1.2520 +    fi
  1.2521 +
  1.2522 +    # GCC for OS/2 currently predefines these, but we don't want them
  1.2523 +    DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
  1.2524 +    ;;
  1.2525 +
  1.2526 +*)
  1.2527 +    AC_DEFINE(XP_UNIX)
  1.2528 +    ;;
  1.2529 +   
  1.2530 +esac
  1.2531 +
  1.2532 +if test -z "$SKIP_LIBRARY_CHECKS"; then
  1.2533 +dnl ========================================================
  1.2534 +dnl Check for system libraries
  1.2535 +dnl ========================================================
  1.2536 +
  1.2537 +
  1.2538 +dnl We don't want anything to link with libdl even if it's present on OS X, 
  1.2539 +dnl since it's not used and not part of the default installation.
  1.2540 +dnl The same goes for BeOS.
  1.2541 +dnl OS/2 has dlfcn in libc.
  1.2542 +
  1.2543 +case $target in
  1.2544 +*-darwin*|*-beos*|*-os2*)
  1.2545 +    ;;
  1.2546 +*)
  1.2547 +    AC_CHECK_LIB(dl, dlopen,
  1.2548 +        [AC_CHECK_HEADER(dlfcn.h,
  1.2549 +            OS_LIBS="-ldl $OS_LIBS")])
  1.2550 +    ;;
  1.2551 +esac
  1.2552 +
  1.2553 +
  1.2554 +dnl ========================================================
  1.2555 +dnl Check for system header files.
  1.2556 +dnl ========================================================
  1.2557 +
  1.2558 +dnl ========================================================
  1.2559 +dnl Check for typedefs and structs
  1.2560 +dnl ========================================================
  1.2561 +
  1.2562 +dnl ========================================================
  1.2563 +dnl Checks for library functions.
  1.2564 +dnl ========================================================
  1.2565 +AC_PROG_GCC_TRADITIONAL
  1.2566 +_SAVE_LIBS="$LIBS"
  1.2567 +LIBS="$LIBS $OS_LIBS"
  1.2568 +AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
  1.2569 +LIBS="$_SAVE_LIBS"
  1.2570 +
  1.2571 +dnl ========================================================
  1.2572 +dnl Check options
  1.2573 +dnl ========================================================
  1.2574 +
  1.2575 +dnl ======================================================
  1.2576 +dnl = Enable compiling with ccache
  1.2577 +dnl ======================================================
  1.2578 +AC_ARG_WITH(ccache,
  1.2579 +[  --with-ccache[=path/to/ccache]
  1.2580 +                          Enable compiling with ccache],
  1.2581 +    CCACHE=$withval, CCACHE="no")
  1.2582 +
  1.2583 +if test "$CCACHE" != "no"; then
  1.2584 +    if test -n "$CCACHE"; then
  1.2585 +        if test "$CCACHE" = "yes"; then
  1.2586 +            CCACHE=
  1.2587 +        else
  1.2588 +            if test ! -e "$CCACHE"; then
  1.2589 +                AC_MSG_ERROR([$CCACHE not found])
  1.2590 +            fi
  1.2591 +        fi
  1.2592 +    fi
  1.2593 +    AC_PATH_PROGS(CCACHE, $CCACHE ccache)
  1.2594 +    if test -z "$CCACHE" -o "$CCACHE" = ":"; then
  1.2595 +        AC_MSG_ERROR([ccache not found])
  1.2596 +    elif test -x "$CCACHE"; then
  1.2597 +        CC="$CCACHE $CC"
  1.2598 +        CXX="$CCACHE $CXX"
  1.2599 +    else
  1.2600 +        AC_MSG_ERROR([$CCACHE is not executable])
  1.2601 +    fi
  1.2602 +fi
  1.2603 +
  1.2604 +dnl ========================================================
  1.2605 +dnl =
  1.2606 +dnl = --enable-strip
  1.2607 +dnl = 
  1.2608 +dnl = Enable stripping of libs and executables
  1.2609 +dnl = 
  1.2610 +dnl ========================================================
  1.2611 +AC_ARG_ENABLE(strip,
  1.2612 +    [  --enable-strip          Enable stripping of shared libs and programs],
  1.2613 +    [ if test "$enableval" = "yes"; then
  1.2614 +	    ENABLE_STRIP=1
  1.2615 +      fi ])
  1.2616 +
  1.2617 +dnl Check for hpux options
  1.2618 +case "${target_os}" in
  1.2619 +hpux*)
  1.2620 +if test -z "$GNU_CC"; then
  1.2621 +
  1.2622 +    AC_CACHE_CHECK(for +Olit support,
  1.2623 +        ac_cv_hpux_usable_olit_option,
  1.2624 +        dnl since aCC doesn't throw an error on invalid options,
  1.2625 +        dnl we have to test this the hard way
  1.2626 +        [ac_cv_hpux_usable_olit_option=no
  1.2627 +        rm -f conftest*
  1.2628 +        echo 'int main() { return 0; }' | cat > conftest.c
  1.2629 +        ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
  1.2630 +        if test $? -eq 0; then
  1.2631 +            if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
  1.2632 +                ac_cv_hpux_usable_olit_option=yes
  1.2633 +            fi
  1.2634 +        fi
  1.2635 +        rm -f conftest*
  1.2636 +        ])
  1.2637 +
  1.2638 +    if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
  1.2639 +        CFLAGS="$CFLAGS +Olit=all"
  1.2640 +        CXXFLAGS="$CXXFLAGS +Olit=all"
  1.2641 +    else
  1.2642 +        CFLAGS="$CFLAGS +ESlit"
  1.2643 +        CXXFLAGS="$CXXFLAGS +ESlit"
  1.2644 +    fi
  1.2645 +fi
  1.2646 +;;
  1.2647 +esac
  1.2648 +
  1.2649 +dnl
  1.2650 +dnl Apparently, some systems cannot properly check for the pthread
  1.2651 +dnl library unless <pthread.h> is included so we need to test
  1.2652 +dnl using it
  1.2653 +dnl
  1.2654 +dnl MOZ_CHECK_PTHREADS(lib, success, failure)
  1.2655 +AC_DEFUN(MOZ_CHECK_PTHREADS,
  1.2656 +[
  1.2657 +AC_MSG_CHECKING([for pthread_create in -l$1])
  1.2658 +echo "
  1.2659 +    #include <pthread.h> 
  1.2660 +    void *foo(void *v) { return v; } 
  1.2661 +    int main() { 
  1.2662 +        pthread_t t;
  1.2663 +        if (!pthread_create(&t, 0, &foo, 0)) {
  1.2664 +            pthread_join(t, 0);
  1.2665 +        }
  1.2666 +        return 0;
  1.2667 +    }" > dummy.c ;
  1.2668 +    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
  1.2669 +    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
  1.2670 +    _res=$? ;
  1.2671 +    rm -f dummy.c dummy${ac_exeext} ;
  1.2672 +    if test "$_res" = "0"; then
  1.2673 +        AC_MSG_RESULT([yes])
  1.2674 +        [$2]
  1.2675 +    else
  1.2676 +        AC_MSG_RESULT([no])
  1.2677 +        [$3]
  1.2678 +    fi
  1.2679 +])
  1.2680 +
  1.2681 +case "$target_os" in
  1.2682 +darwin*)
  1.2683 +    _HAVE_PTHREADS=1
  1.2684 +    ;;
  1.2685 +*)
  1.2686 +    MOZ_CHECK_PTHREADS(pthreads,
  1.2687 +        _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
  1.2688 +        MOZ_CHECK_PTHREADS(pthread,
  1.2689 +            _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
  1.2690 +            MOZ_CHECK_PTHREADS(c_r,
  1.2691 +                _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
  1.2692 +                MOZ_CHECK_PTHREADS(c,
  1.2693 +                    _HAVE_PTHREADS=1
  1.2694 +                )
  1.2695 +            )
  1.2696 +        )
  1.2697 +    )
  1.2698 +    ;;
  1.2699 +esac
  1.2700 +
  1.2701 +AC_ARG_WITH(pthreads,
  1.2702 +    [  --with-pthreads         Use system pthreads library as thread subsystem],
  1.2703 +    [ if test "$withval" = "yes"; then
  1.2704 +	    if test -n "$_HAVE_PTHREADS"; then
  1.2705 +		    USE_PTHREADS=1 
  1.2706 +		    USE_USER_PTHREADS=
  1.2707 +		    USE_NSPR_THREADS=
  1.2708 +	    else
  1.2709 +		    AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
  1.2710 +	    fi
  1.2711 +	  else
  1.2712 +	    USE_PTHREADS=
  1.2713 +	    _PTHREAD_LDFLAGS=
  1.2714 +	  fi],
  1.2715 +	[ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
  1.2716 +	    USE_PTHREADS=1
  1.2717 +	    USE_USER_PTHREADS=
  1.2718 +	    USE_NSPR_THREADS=
  1.2719 +	  fi])
  1.2720 +
  1.2721 +AC_ARG_ENABLE(user-pthreads,
  1.2722 +    [  --enable-user-pthreads  Build using userland pthreads],
  1.2723 +    [ if test "$enableval" = "yes"; then
  1.2724 +        if test -n "$_HAVE_PTHREADS"; then
  1.2725 +		    USE_PTHREADS=
  1.2726 +		    USE_USER_PTHREADS=1
  1.2727 +		    USE_NSPR_THREADS=
  1.2728 +	    else
  1.2729 +		    AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
  1.2730 +	    fi
  1.2731 +	  fi])
  1.2732 +
  1.2733 +AC_ARG_ENABLE(nspr-threads,
  1.2734 +    [  --enable-nspr-threads   Build using classic nspr threads],
  1.2735 +    [ if test "$enableval" = "yes"; then
  1.2736 +	    USE_PTHREADS=
  1.2737 +	    USE_USER_PTHREADS=
  1.2738 +	    USE_NSPR_THREADS=1
  1.2739 +	  fi])
  1.2740 +
  1.2741 +case "$target" in
  1.2742 +*-beos*)
  1.2743 +    AC_ARG_WITH(bthreads,
  1.2744 +    [  --with-bthreads         Use system bthreads library as thread subsystem
  1.2745 +                          (BeOS only)],
  1.2746 +    [	if test "$withval" = "yes"; then
  1.2747 +    	    USE_BTHREADS=1
  1.2748 +	        USE_USER_PTHREADS=
  1.2749 +	        USE_PTHREADS=
  1.2750 +	    fi])
  1.2751 +    ;;
  1.2752 +esac
  1.2753 +
  1.2754 +fi # SKIP_LIBRARY_CHECKS
  1.2755 +
  1.2756 +AC_ARG_ENABLE(ipv6,
  1.2757 +    [  --enable-ipv6           Compile ipv6 support],
  1.2758 +    [ if test "$enableval" = "yes"; then
  1.2759 +	    USE_IPV6=1
  1.2760 +      else
  1.2761 +	    USE_IPV6=
  1.2762 +      fi])
  1.2763 +
  1.2764 +if test -n "$USE_PTHREADS"; then
  1.2765 +   dnl See if -pthread is supported.
  1.2766 +   rm -f conftest*
  1.2767 +   ac_cv_have_dash_pthread=no
  1.2768 +   AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
  1.2769 +   echo 'int main() { return 0; }' | cat > conftest.c
  1.2770 +   ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
  1.2771 +   if test $? -eq 0; then
  1.2772 +	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
  1.2773 +	    ac_cv_have_dash_pthread=yes
  1.2774 +		case "$target_os" in
  1.2775 +	    freebsd*)
  1.2776 +# Freebsd doesn't use -pthread for compiles, it uses them for linking
  1.2777 +            ;;
  1.2778 +	    *)
  1.2779 +            CFLAGS="$CFLAGS -pthread"
  1.2780 +            CXXFLAGS="$CXXFLAGS -pthread"
  1.2781 +            ;;
  1.2782 +        esac
  1.2783 +	fi
  1.2784 +    fi
  1.2785 +    rm -f conftest*
  1.2786 +    AC_MSG_RESULT($ac_cv_have_dash_pthread)
  1.2787 +
  1.2788 +	dnl
  1.2789 +	dnl See if -pthreads is supported.
  1.2790 +	dnl
  1.2791 +    ac_cv_have_dash_pthreads=no
  1.2792 +    if test "$ac_cv_have_dash_pthread" = "no"; then
  1.2793 +	    AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
  1.2794 +    	echo 'int main() { return 0; }' | cat > conftest.c
  1.2795 +	    ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
  1.2796 +    	if test $? -eq 0; then
  1.2797 +	    	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
  1.2798 +			    ac_cv_have_dash_pthreads=yes
  1.2799 +			    CFLAGS="$CFLAGS -pthreads"
  1.2800 +			    CXXFLAGS="$CXXFLAGS -pthreads"
  1.2801 +		    fi
  1.2802 +	    fi
  1.2803 +	    rm -f conftest*
  1.2804 +    	AC_MSG_RESULT($ac_cv_have_dash_pthreads)
  1.2805 +    fi
  1.2806 +
  1.2807 +    case "$target" in
  1.2808 +    *-solaris*)
  1.2809 +        if test "$ac_cv_have_dash_pthreads" = "yes"; then
  1.2810 +            _PTHREAD_LDFLAGS=
  1.2811 +        fi
  1.2812 +	    ;;
  1.2813 +    *-freebsd*)
  1.2814 +	    AC_DEFINE(_REENTRANT)
  1.2815 +	    AC_DEFINE(_THREAD_SAFE)
  1.2816 +	    dnl -pthread links in -lc_r, so don't specify it explicitly.
  1.2817 +	    if test "$ac_cv_have_dash_pthread" = "yes"; then
  1.2818 +	        _PTHREAD_LDFLAGS="-pthread"
  1.2819 +	    else
  1.2820 +	        _PTHREAD_LDFLAGS="-lc_r"
  1.2821 +	    fi
  1.2822 +	    ;;
  1.2823 +    *-netbsd*)
  1.2824 +	    if test "$ac_cv_have_dash_pthread" = "yes"; then
  1.2825 +	        _PTHREAD_LDFLAGS="-pthread"
  1.2826 +	    fi
  1.2827 +	    ;;
  1.2828 +    *-bsdi*)
  1.2829 +	    AC_DEFINE(_THREAD_SAFE)
  1.2830 +	    dnl -pthread links in -lc_r, so don't specify it explicitly.
  1.2831 +	    if test "$ac_cv_have_dash_pthread" = "yes"; then
  1.2832 +	        _PTHREAD_LDFLAGS=
  1.2833 +	    fi
  1.2834 +	    ;;
  1.2835 +    *-openbsd*)
  1.2836 +        if test "$ac_cv_have_dash_pthread" = "yes"; then
  1.2837 +            _PTHREAD_LDFLAGS=-pthread
  1.2838 +        fi
  1.2839 +        ;;
  1.2840 +    *-linux*|*-gnu*|*-k*bsd*-gnu)
  1.2841 +        AC_DEFINE(_REENTRANT)
  1.2842 +        ;;
  1.2843 +    esac
  1.2844 +
  1.2845 +else 
  1.2846 +    if test -n "$USE_USER_PTHREADS"; then
  1.2847 +	    USE_PTHREADS=
  1.2848 +	    USE_NSPR_THREADS=
  1.2849 +    else
  1.2850 +        _PTHREAD_LDFLAGS=
  1.2851 +    fi
  1.2852 +fi
  1.2853 +dnl Special thread exceptions
  1.2854 +
  1.2855 +case "$target" in
  1.2856 +*-aix*)
  1.2857 +    if test -n "$USE_NSPR_THREADS"; then
  1.2858 +        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.2859 +    fi
  1.2860 +    case "$target_os" in
  1.2861 +    aix4.1*)
  1.2862 +        if test -z "$USE_PTHREADS"; then
  1.2863 +            AC_DEFINE(AIX_RENAME_SELECT)
  1.2864 +        fi
  1.2865 +        ;;
  1.2866 +    aix4.2*)
  1.2867 +        if test -z "$USE_NSPR_THREADS"; then
  1.2868 +            AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
  1.2869 +        fi
  1.2870 +        ;;
  1.2871 +    aix4.3*)
  1.2872 +        if test -z "$USE_NSPR_THREADS"; then
  1.2873 +            AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
  1.2874 +        fi
  1.2875 +        if test -n "$USE_PTHREADS"; then
  1.2876 +            AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
  1.2877 +        fi
  1.2878 +        ;;
  1.2879 +    *)
  1.2880 +        if test -z "$USE_NSPR_THREADS"; then
  1.2881 +            AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
  1.2882 +        fi
  1.2883 +        if test -n "$USE_PTHREADS"; then
  1.2884 +            AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
  1.2885 +        fi
  1.2886 +        ;;
  1.2887 +    esac
  1.2888 +    ;;
  1.2889 +*-bsdi*)
  1.2890 +    if test -n "$USE_PTHREADS"; then
  1.2891 +        AC_DEFINE(_PR_NEED_PTHREAD_INIT)
  1.2892 +    fi
  1.2893 +    ;;
  1.2894 +*-freebsd*)
  1.2895 +    if test -n "$USE_NSPR_THREADS"; then
  1.2896 +        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.2897 +    fi
  1.2898 +    ;;
  1.2899 +*-hpux*)
  1.2900 +    if test -n "$USE_NSPR_THREADS"; then
  1.2901 +        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.2902 +    fi 
  1.2903 +    if test "$USE_PTHREADS"; then
  1.2904 +        if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
  1.2905 +            AC_DEFINE(_REENTRANT)
  1.2906 +            AC_DEFINE(_PR_DCETHREADS)
  1.2907 +        else
  1.2908 +            AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
  1.2909 +            AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
  1.2910 +        fi
  1.2911 +    fi
  1.2912 +    if test "$USE_USER_PTHREADS"; then
  1.2913 +        AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
  1.2914 +    fi
  1.2915 +    ;;
  1.2916 +*-irix*)
  1.2917 +    if test "${target_os}" = "irix6.5"; then
  1.2918 +        if test -n "$USE_PTHREADS"; then
  1.2919 +            AC_DEFINE(_PR_HAVE_GETHOST_R)
  1.2920 +            AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
  1.2921 +        fi
  1.2922 +    fi
  1.2923 +    ;;
  1.2924 +*-linux*|*-gnu*|*-k*bsd*-gnu)
  1.2925 +    if test -n "$USE_NSPR_THREADS"; then
  1.2926 +        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.2927 +    fi
  1.2928 +    ;;
  1.2929 +*-mingw*|*-msys*|*-cygwin*|*-mks*|*-os2*|*-beos*)
  1.2930 +    dnl win32, os2 & beos cannot use pthreads
  1.2931 +    USE_PTHREADS=
  1.2932 +    _PTHREAD_LDFLAGS=
  1.2933 +    USE_USER_PTHREADS=
  1.2934 +    ;;
  1.2935 +*-netbsd*|*-openbsd*)
  1.2936 +    if test -n "$USE_NSPR_THREADS"; then
  1.2937 +        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.2938 +    fi
  1.2939 +    ;;
  1.2940 +*-osf*)
  1.2941 +    if test -n "$USE_NSPR_THREADS"; then
  1.2942 +        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.2943 +    fi
  1.2944 +    if test -n "$USE_PTHREADS"; then
  1.2945 +        if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
  1.2946 +            :
  1.2947 +        else
  1.2948 +            AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
  1.2949 +        fi
  1.2950 +    fi
  1.2951 +    ;;
  1.2952 +*-solaris*)
  1.2953 +    if test -n "$USE_NSPR_THREADS"; then
  1.2954 +        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
  1.2955 +    fi
  1.2956 +    if test -n "$USE_PTHREADS"; then
  1.2957 +        AC_DEFINE(_REENTRANT)
  1.2958 +        AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
  1.2959 +        if test "$OS_TEST" = "i86pc"; then
  1.2960 +            if test -n "$USE_64"; then
  1.2961 +               PR_MD_ASFILES=os_SunOS_x86_64.s
  1.2962 +            else
  1.2963 +               PR_MD_ASFILES=os_SunOS_x86.s
  1.2964 +            fi
  1.2965 +        else
  1.2966 +            if test -n "$USE_64"; then
  1.2967 +                PR_MD_ASFILES=os_SunOS_sparcv9.s
  1.2968 +            fi
  1.2969 +        fi
  1.2970 +    fi
  1.2971 +    ;;
  1.2972 +*-nto*)
  1.2973 +    if test -n "$USE_PTHREADS"; then
  1.2974 +        AC_DEFINE(_PR_HAVE_GETHOST_R)
  1.2975 +        AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
  1.2976 +    fi
  1.2977 +    ;;
  1.2978 +esac
  1.2979 +
  1.2980 +OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
  1.2981 +
  1.2982 +dnl If the user passed in arg to --enable-optimize or --enable-debug,
  1.2983 +dnl make sure that we use it.
  1.2984 +if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
  1.2985 +    _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
  1.2986 +fi
  1.2987 +
  1.2988 +if test -n "$_SAVE_DEBUG_FLAGS"; then
  1.2989 +    _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
  1.2990 +fi
  1.2991 +
  1.2992 +if test -n "$MOZ_OPTIMIZE"; then
  1.2993 +    CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
  1.2994 +    CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
  1.2995 +fi
  1.2996 +
  1.2997 +if test -n "$MOZ_DEBUG_SYMBOLS"; then
  1.2998 +    CFLAGS="$CFLAGS $_DEBUG_FLAGS"
  1.2999 +    CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
  1.3000 +fi
  1.3001 +
  1.3002 +if test -n "$MOZ_OPTIMIZE"; then
  1.3003 +    OBJDIR_TAG=_OPT
  1.3004 +else
  1.3005 +    OBJDIR_TAG=_DBG
  1.3006 +fi
  1.3007 +
  1.3008 +if test -n "$USE_64"; then
  1.3009 +    COMPILER_TAG=_64
  1.3010 +fi
  1.3011 +
  1.3012 +RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
  1.3013 +
  1.3014 +dnl ========================================================
  1.3015 +dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
  1.3016 +dnl ========================================================
  1.3017 +case "$target_os" in
  1.3018 +cygwin*|mks*)
  1.3019 +    CC="\$(CYGWIN_WRAPPER) $CC"
  1.3020 +    CXX="\$(CYGWIN_WRAPPER) $CXX"
  1.3021 +    RC="\$(CYGWIN_WRAPPER) $RC"
  1.3022 +    ;;
  1.3023 +esac
  1.3024 +
  1.3025 +dnl ========================================================
  1.3026 +dnl = Use malloc wrapper lib
  1.3027 +dnl ========================================================
  1.3028 +AC_ARG_ENABLE(wrap-malloc,
  1.3029 +[  --enable-wrap-malloc    Wrap malloc calls (gnu linker only)],
  1.3030 +[     if test "$enableval" = "yes"; then
  1.3031 +	    _WRAP_MALLOC=1
  1.3032 +      fi ])
  1.3033 +
  1.3034 +if test -n "$_WRAP_MALLOC"; then
  1.3035 +    if test -n "$GNU_CC"; then
  1.3036 +        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
  1.3037 +        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
  1.3038 +        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
  1.3039 +        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
  1.3040 +    else
  1.3041 +        AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
  1.3042 +    fi
  1.3043 +fi
  1.3044 +
  1.3045 +dnl ========================================================
  1.3046 +dnl = Location of malloc wrapper lib
  1.3047 +dnl ========================================================
  1.3048 +AC_ARG_WITH(wrap-malloc,
  1.3049 +[  --with-wrap-malloc=SHAREDLIB  Location of malloc wrapper library],
  1.3050 +    WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
  1.3051 +
  1.3052 +dnl ========================================================
  1.3053 +dnl Substitution of found variables.
  1.3054 +dnl ========================================================
  1.3055 +AC_SUBST(SHELL_OVERRIDE)
  1.3056 +
  1.3057 +AC_SUBST(MOZILLA_CLIENT)
  1.3058 +AC_SUBST(CC)
  1.3059 +AC_SUBST(CXX)
  1.3060 +AC_SUBST(CFLAGS)
  1.3061 +AC_SUBST(CXXFLAGS)
  1.3062 +AC_SUBST(CPPFLAGS)
  1.3063 +AC_SUBST(HOST_CC)
  1.3064 +AC_SUBST(HOST_CFLAGS)
  1.3065 +AC_SUBST(LDFLAGS)
  1.3066 +AC_SUBST(HOST_LDFLAGS)
  1.3067 +AC_SUBST(GNU_CC)
  1.3068 +AC_SUBST(GCC_USE_GNU_LD)
  1.3069 +AC_SUBST(MSC_VER)
  1.3070 +AC_SUBST(CROSS_COMPILE)
  1.3071 +
  1.3072 +AC_SUBST(MOZ_OPTIMIZE)
  1.3073 +AC_SUBST(MOZ_DEBUG)
  1.3074 +AC_SUBST(MOZ_DEBUG_SYMBOLS)
  1.3075 +
  1.3076 +AC_SUBST(USE_CPLUS)
  1.3077 +AC_SUBST(USE_IPV6)
  1.3078 +AC_SUBST(USE_N32)
  1.3079 +AC_SUBST(USE_X32)
  1.3080 +AC_SUBST(USE_64)
  1.3081 +AC_SUBST(OBJECT_MODE)
  1.3082 +AC_SUBST(ENABLE_STRIP)
  1.3083 +
  1.3084 +AC_SUBST(USE_PTHREADS)
  1.3085 +AC_SUBST(USE_BTHREADS)
  1.3086 +AC_SUBST(USE_USER_PTHREADS)
  1.3087 +AC_SUBST(USE_NSPR_THREADS)
  1.3088 +
  1.3089 +AC_SUBST(LIBNSPR)
  1.3090 +AC_SUBST(LIBPLC)
  1.3091 +
  1.3092 +AC_SUBST(MOD_MAJOR_VERSION)
  1.3093 +AC_SUBST(MOD_MINOR_VERSION)
  1.3094 +AC_SUBST(MOD_PATCH_VERSION)
  1.3095 +AC_SUBST(NSPR_MODNAME)
  1.3096 +AC_SUBST(MDCPUCFG_H)
  1.3097 +AC_SUBST(PR_MD_CSRCS)
  1.3098 +AC_SUBST(PR_MD_ASFILES)
  1.3099 +AC_SUBST(PR_MD_ARCH_DIR)
  1.3100 +AC_SUBST(CPU_ARCH)
  1.3101 +
  1.3102 +AC_SUBST(OBJ_SUFFIX)
  1.3103 +AC_SUBST(LIB_SUFFIX)
  1.3104 +AC_SUBST(DLL_SUFFIX)
  1.3105 +AC_SUBST(ASM_SUFFIX)
  1.3106 +AC_SUBST(WRAP_LDFLAGS)
  1.3107 +AC_SUBST(MKSHLIB)
  1.3108 +AC_SUBST(DSO_CFLAGS)
  1.3109 +AC_SUBST(DSO_LDOPTS)
  1.3110 +
  1.3111 +AC_SUBST(OS_TARGET)
  1.3112 +AC_SUBST(OS_ARCH)
  1.3113 +AC_SUBST(OS_RELEASE)
  1.3114 +AC_SUBST(OS_TEST)
  1.3115 +AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
  1.3116 +
  1.3117 +AC_SUBST(DEFINES)
  1.3118 +AC_SUBST(DEFS)
  1.3119 +AC_SUBST(AR)
  1.3120 +AC_SUBST(AR_FLAGS)
  1.3121 +AC_SUBST(AS)
  1.3122 +AC_SUBST(ASFLAGS)
  1.3123 +AC_SUBST(LD)
  1.3124 +AC_SUBST(RANLIB)
  1.3125 +AC_SUBST(PERL)
  1.3126 +AC_SUBST(STRIP)
  1.3127 +AC_SUBST(FILTER)
  1.3128 +AC_SUBST(IMPLIB)
  1.3129 +
  1.3130 +AC_SUBST(PROFILE_GEN_CFLAGS)
  1.3131 +AC_SUBST(PROFILE_GEN_LDFLAGS)
  1.3132 +AC_SUBST(PROFILE_USE_CFLAGS)
  1.3133 +AC_SUBST(PROFILE_USE_LDFLAGS)
  1.3134 +
  1.3135 +AC_SUBST(OS_LIBS)
  1.3136 +AC_SUBST(RESOLVE_LINK_SYMBOLS)
  1.3137 +AC_SUBST(AIX_LINK_OPTS)
  1.3138 +AC_SUBST(NOSUCHFILE)
  1.3139 +AC_SUBST(MOZ_OBJFORMAT)
  1.3140 +AC_SUBST(ULTRASPARC_LIBRARY)
  1.3141 +
  1.3142 +AC_SUBST(OBJDIR)
  1.3143 +AC_SUBST(OBJDIR_NAME)
  1.3144 +AC_SUBST(RELEASE_OBJDIR_NAME)
  1.3145 +AC_SUBST(NSINSTALL)
  1.3146 +AC_SUBST(OPTIMIZER)
  1.3147 +AC_SUBST(RC)
  1.3148 +AC_SUBST(RCFLAGS)
  1.3149 +AC_SUBST(DLLFLAGS)
  1.3150 +AC_SUBST(EXEFLAGS)
  1.3151 +AC_SUBST(OS_DLLFLAGS)
  1.3152 +AC_SUBST(CYGWIN_WRAPPER)
  1.3153 +AC_SUBST(VISIBILITY_FLAGS)
  1.3154 +AC_SUBST(WRAP_SYSTEM_INCLUDES)
  1.3155 +AC_SUBST(MACOS_SDK_DIR)
  1.3156 +AC_SUBST(SYMBIAN_SDK_DIR)
  1.3157 +AC_SUBST(NEXT_ROOT)
  1.3158 +AC_SUBST(MT)
  1.3159 +
  1.3160 +dnl ========================================================
  1.3161 +dnl Generate output files.
  1.3162 +dnl ========================================================
  1.3163 +MAKEFILES="
  1.3164 +    Makefile
  1.3165 +    config/Makefile
  1.3166 +    config/autoconf.mk
  1.3167 +    config/nsprincl.mk
  1.3168 +    config/nsprincl.sh
  1.3169 +    config/nspr-config
  1.3170 +    config/nspr.pc
  1.3171 +    lib/Makefile
  1.3172 +    lib/ds/Makefile
  1.3173 +    lib/libc/Makefile
  1.3174 +    lib/libc/include/Makefile
  1.3175 +    lib/libc/src/Makefile
  1.3176 +    lib/tests/Makefile
  1.3177 +    pkg/Makefile
  1.3178 +    pr/Makefile
  1.3179 +    pr/include/Makefile
  1.3180 +    pr/include/md/Makefile
  1.3181 +    pr/include/obsolete/Makefile
  1.3182 +    pr/include/private/Makefile
  1.3183 +    pr/src/Makefile
  1.3184 +    pr/src/io/Makefile
  1.3185 +    pr/src/linking/Makefile
  1.3186 +    pr/src/malloc/Makefile
  1.3187 +    pr/src/md/Makefile
  1.3188 +    pr/src/md/${PR_MD_ARCH_DIR}/Makefile
  1.3189 +    pr/src/memory/Makefile
  1.3190 +    pr/src/misc/Makefile
  1.3191 +    pr/src/threads/Makefile
  1.3192 +    pr/tests/Makefile
  1.3193 +    pr/tests/dll/Makefile
  1.3194 +"
  1.3195 +
  1.3196 +if test "$OS_TARGET" = "Linux"; then
  1.3197 +    MAKEFILES="$MAKEFILES
  1.3198 +        pkg/linux/Makefile
  1.3199 +    "
  1.3200 +elif test "$OS_TARGET" = "SunOS"; then
  1.3201 +    MAKEFILES="$MAKEFILES
  1.3202 +        pkg/solaris/Makefile
  1.3203 +        pkg/solaris/SUNWpr/Makefile
  1.3204 +        pkg/solaris/SUNWprd/Makefile
  1.3205 +    "
  1.3206 +fi
  1.3207 +
  1.3208 +if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
  1.3209 +    MAKEFILES="$MAKEFILES
  1.3210 +        pr/src/threads/combined/Makefile
  1.3211 +    "
  1.3212 +elif test -n "$USE_PTHREADS"; then
  1.3213 +    MAKEFILES="$MAKEFILES
  1.3214 +        pr/src/pthreads/Makefile
  1.3215 +    "
  1.3216 +elif test -n "$USE_BTHREADS"; then
  1.3217 +    MAKEFILES="$MAKEFILES
  1.3218 +        pr/src/bthreads/Makefile
  1.3219 +    "
  1.3220 +fi
  1.3221 +
  1.3222 +if test -n "$USE_CPLUS"; then
  1.3223 +    MAKEFILES="$MAKEFILES
  1.3224 +        pr/src/cplus/Makefile
  1.3225 +        pr/src/cplus/tests/Makefile
  1.3226 +    "
  1.3227 +fi
  1.3228 +
  1.3229 +echo $MAKEFILES > unallmakefiles
  1.3230 +
  1.3231 +AC_CONFIG_FILES([$MAKEFILES])
  1.3232 +AC_CONFIG_COMMANDS([default], [chmod +x config/nspr-config])
  1.3233 +AC_OUTPUT

mercurial