#! /bin/sh













































if test `uname -s | grep -c MINGW 2>/dev/null` != "0"; then
  msyshost=1
fi


# Read the user's .mozconfig script.  We can't do this in
# configure.in: autoconf puts the argument parsing code above anything
# expanded from configure.in, and we need to get the configure options
# from .mozconfig in place before that argument parsing code.
# Read in '.mozconfig' script to set the initial options.
# See the mozconfig2configure script for more details.
_AUTOCONF_TOOLS_DIR=`dirname $0`/./build/autoconf
. $_AUTOCONF_TOOLS_DIR/mozconfig2configure
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13 
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
  --disable-compile-environment
                          Disable compiler/library checks."
ac_help="$ac_help
  --with-l10n-base=DIR    path to l10n repositories"
ac_help="$ac_help
  --with-android-ndk=DIR
                          location where the Android NDK can be found"
ac_help="$ac_help
  --with-android-toolchain=DIR
                          location of the android toolchain"
ac_help="$ac_help
  --with-android-version=VER
                          android platform version, default 5"
ac_help="$ac_help
  --with-android-sdk=DIR
                          location where the Android SDK can be found (base directory, e.g. .../android/platforms/android-6)"
ac_help="$ac_help
  --with-android-platform=DIR
                           location of platform dir"
ac_help="$ac_help
  --with-gonk=DIR
               location of gonk dir"
ac_help="$ac_help
  --with-gonk-toolchain-prefix=DIR
                          prefix to gonk toolchain commands"
ac_help="$ac_help
  --enable-metro           Enable Windows Metro build targets"
ac_help="$ac_help
  --with-windows-version=WINSDK_TARGETVER
                          Windows SDK version to target. Lowest version
                          currently allowed is 601 (Win7), highest is 602 (Win8)"
ac_help="$ac_help
  --with-system-ply       Use system installed python ply library"
ac_help="$ac_help
  --enable-macos-target=VER (default=10.5)
                          Set the minimum MacOS version needed at runtime"
ac_help="$ac_help
  --with-macos-sdk=dir    Location of platform SDK to use (Mac OS X only)"
ac_help="$ac_help
  --with-x                use the X Window System"
ac_help="$ac_help
  --with-arch=[[type|toolchain-default]]
                           Use specific CPU features (-march=type). Resets
                           thumb, fpu, float-abi, etc. defaults when set"
ac_help="$ac_help
  --with-thumb[[=yes|no|toolchain-default]]
                          Use Thumb instruction set (-mthumb)"
ac_help="$ac_help
  --with-thumb-interwork[[=yes|no|toolchain-default]]
                           Use Thumb/ARM instuctions interwork (-mthumb-interwork)"
ac_help="$ac_help
  --with-fpu=[[type|toolchain-default]]
                           Use specific FPU type (-mfpu=type)"
ac_help="$ac_help
  --with-float-abi=[[type|toolchain-default]]
                           Use specific arm float ABI (-mfloat-abi=type)"
ac_help="$ac_help
  --with-soft-float[[=yes|no|toolchain-default]]
                           Use soft float library (-msoft-float)"
ac_help="$ac_help
  --enable-address-sanitizer       Enable Address Sanitizer (default=no)"
ac_help="$ac_help
  --enable-llvm-hacks       Enable workarounds required for several LLVM instrumentations (default=no)"
ac_help="$ac_help
  --disable-os2-high-mem  Disable high-memory support on OS/2"
ac_help="$ac_help
  --enable-profiling      Set compile flags necessary for using sampling profilers (e.g. shark, perf)"
ac_help="$ac_help
  --enable-valgrind       Enable Valgrind integration hooks (default=no)"
ac_help="$ac_help
  --enable-dmd            Enable DMD; also disables jemalloc (default=no)"
ac_help="$ac_help
  --enable-jprof          Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling."
ac_help="$ac_help
  --enable-shark          Enable shark remote profiling. Implies --enable-profiling."
ac_help="$ac_help
  --enable-callgrind      Enable callgrind profiling. Implies --enable-profiling."
ac_help="$ac_help
  --enable-vtune          Enable vtune profiling. Implies --enable-profiling."
ac_help="$ac_help
  --enable-cpp-rtti       Enable C++ RTTI "
ac_help="$ac_help
  --disable-icf          Disable Identical Code Folding"
ac_help="$ac_help
  --enable-dtrace         build with dtrace support if available (default=no)"
ac_help="$ac_help
  --with-pthreads         Force use of system pthread library with NSPR "
ac_help="$ac_help
  --with-libxul-sdk=PFX   Use the libXUL SDK at <PFX>"
ac_help="$ac_help
  --with-system-libxul    Use system installed libxul SDK"
ac_help="$ac_help
  --with-system-nspr      Use system installed NSPR"
ac_help="$ac_help
  --with-nspr-prefix=PFX  Prefix where NSPR is installed"
ac_help="$ac_help
  --with-nspr-exec-prefix=PFX
                          Exec prefix where NSPR is installed"
ac_help="$ac_help
  --with-system-libevent=[PFX]
                          Use system libevent [installed at prefix PFX]"
ac_help="$ac_help
  --with-system-nss       Use system installed NSS"
ac_help="$ac_help
  --with-nss-prefix=PFX   Prefix where NSS is installed"
ac_help="$ac_help
  --with-nss-exec-prefix=PFX
                          Exec prefix where NSS is installed"
ac_help="$ac_help
  --with-system-jpeg[=PFX]
                          Use system libjpeg [installed at prefix PFX]"
ac_help="$ac_help
  --with-system-zlib[=PFX]
                          Use system libz [installed at prefix PFX]"
ac_help="$ac_help
  --with-system-bz2[=PFX]
                          Use system libbz2 [installed at prefix PFX]"
ac_help="$ac_help
  --with-system-png[=PFX]
                          Use system libpng [installed at prefix PFX]"
ac_help="$ac_help
  --enable-system-hunspell
                          Use system hunspell (located with pkgconfig)"
ac_help="$ac_help
  --enable-system-ffi       Use system libffi (located with pkgconfig)"
ac_help="$ac_help
  --with-java-bin-path=dir
                          Location of Java binaries (java, javac, jar)"
ac_help="$ac_help
  --enable-application=APP
                          Options include:
                            browser (Firefox)
                            xulrunner
                            tools/update-packaging (AUS-related packaging tools)"
ac_help="$ac_help
  --with-xulrunner-stub-name=appname   Create the xulrunner stub with the given name"
ac_help="$ac_help
--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME"
ac_help="$ac_help
--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME"
ac_help="$ac_help
  --enable-default-toolkit=TK
                          Select default toolkit
                          Platform specific defaults:
                            Mac OS X - cairo-cocoa
                            OS/2 - cairo-os2
                            Win32 - cairo-windows
                            * - cairo-gtk2
                            * - cairo-qt"
ac_help="$ac_help
  --without-x              Build without X11"
ac_help="$ac_help
  --with-arm-kuser         Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)"
ac_help="$ac_help
  --enable-startup-notification
                          Enable startup-notification support (default: disabled) "
ac_help="$ac_help
  --with-qtdir=\$dir       Specify Qt directory "
ac_help="$ac_help
  --enable-ui-locale=ab-CD
                          Select the user interface locale (default: en-US)"
ac_help="$ac_help
  --enable-official-branding
                          Enable Official mozilla.org Branding
                          Do not distribute builds with
                          --enable-official-branding unless you have
                          permission to use trademarks per
                          http://www.mozilla.org/foundation/trademarks/ ."
ac_help="$ac_help
  --with-branding=dir     Use branding from the specified directory."
ac_help="$ac_help
  --with-distribution-id=ID
                          Set distribution-specific id (default=org.mozilla)"
ac_help="$ac_help
  --disable-pango         Disable usage of Pango "
ac_help="$ac_help
  --disable-gnomevfs      Disable GnomeVFS support "
ac_help="$ac_help
  --enable-gio            Enable GIO support (default: disabled)"
ac_help="$ac_help
  --disable-gconf      Disable Gconf support "
ac_help="$ac_help
  --enable-libproxy         Enable libproxy support "
ac_help="$ac_help
  --disable-libnotify     Disable libnotify support "
ac_help="$ac_help
  --disable-gnomeui       Disable libgnomeui support (default: auto, optional at runtime) "
ac_help="$ac_help
  --disable-dbus          Disable dbus support "
ac_help="$ac_help
  --disable-websms-backend
                           Disable WebSMS backend"
ac_help="$ac_help
  --disable-crypto        Disable crypto support (Personal Security Manager)"
ac_help="$ac_help
  --disable-jsd           Disable JavaScript debug library"
ac_help="$ac_help
  --enable-ipdl-tests     Enable expensive IPDL tests"
ac_help="$ac_help
  --enable-e10s-compat     Turns off code for e10s compat"
ac_help="$ac_help
  --disable-dbm           Disable building dbm"
ac_help="$ac_help
  --disable-accessibility Disable accessibility support (off by default on OS X)"
ac_help="$ac_help
  --disable-printing      Disable printing support"
ac_help="$ac_help
  --enable-raw           Enable support for RAW media"
ac_help="$ac_help
  --disable-ogg           Disable support for OGG media (Theora video and Vorbis audio)"
ac_help="$ac_help
  --disable-opus          Disable support for Opus audio"
ac_help="$ac_help
  --disable-webm          Disable support for WebM media (VP8 video and Vorbis audio)"
ac_help="$ac_help
  --enable-media-plugins  Enable support for media plugins"
ac_help="$ac_help
  --enable-media-navigator  Enable support for getUserMedia"
ac_help="$ac_help
  --enable-omx-plugin      Enable building OMX plugin (B2G)"
ac_help="$ac_help
  --with-system-libvpx    Use system libvpx (located with pkgconfig)"
ac_help="$ac_help
  --disable-wave          Disable Wave decoder support"
ac_help="$ac_help
  --enable-gstreamer           Enable GStreamer support"
ac_help="$ac_help
  --disable-permissions   Disable permissions (popup and cookie blocking)"
ac_help="$ac_help
  --disable-negotiateauth Disable GSS-API negotiation "
ac_help="$ac_help
  --disable-xtf           Disable XTF (pluggable xml tags) support"
ac_help="$ac_help
  --disable-pref-extensions
                          Disable pref extensions such as autoconfig"
ac_help="$ac_help
  --disable-system-extension-dirs
                          Disable searching system- and account-global
                          directories for extensions of any kind; use
                          only profile-specific extension directories"
ac_help="$ac_help
  --disable-universalchardet
                          Disable universal encoding detection"
ac_help="$ac_help
  --disable-angle     Disable building of ANGLE for WebGL->D3D translation"
ac_help="$ac_help
  --disable-crashreporter Disable breakpad crash reporting"
ac_help="$ac_help
  --with-crashreporter-enable-percent=NN
                          Enable sending crash reports by default on NN% of users. (default=100)"
ac_help="$ac_help
 --disable-libjpeg-turbo  Disable optimized jpeg decoding routines"
ac_help="$ac_help
  --enable-extensions     Enable extensions"
ac_help="$ac_help
  --enable-tree-freetype  Enable Tree FreeType"
ac_help="$ac_help
  --disable-webapp-runtime  Disable Web App Runtime"
ac_help="$ac_help
  --enable-maintenance-service       Enable building of maintenanceservice"
ac_help="$ac_help
  --enable-verify-mar     Enable verifying MAR signatures"
ac_help="$ac_help
  --enable-signmar     Enable building the signmar program"
ac_help="$ac_help
  --disable-updater       Disable building of updater"
ac_help="$ac_help
  --enable-update-channel=CHANNEL
                          Select application update channel (default=default)"
ac_help="$ac_help
  --enable-update-packaging
                          Enable tools/update-packaging"
ac_help="$ac_help
  --disable-tests         Do not build test libraries & programs"
ac_help="$ac_help
  --disable-parental-controls
                          Do not build parental controls"
ac_help="$ac_help
  --disable-feeds         Disable feed handling and processing components"
ac_help="$ac_help
  --enable-system-sqlite  Use system sqlite (located with pkgconfig)"
ac_help="$ac_help
  --enable-safe-browsing  Enable safe browsing (anti-phishing) implementation"
ac_help="$ac_help
  --enable-url-classifier Enable url classifier module"
ac_help="$ac_help
  --disable-zipwriter     Disable zipwriter component"
ac_help="$ac_help
  --disable-libconic      Disable libconic"
ac_help="$ac_help
  --with-maemo-version=MAEMO_SDK_TARGET_VER
                          Maemo SDK Version"
ac_help="$ac_help
  --enable-meegocontentaction           Enable meegocontentaction support"
ac_help="$ac_help
  --enable-meegotouch  Enable meegotouch support"
ac_help="$ac_help
  --enable-egl-xrender-composite
                          Enable EGL xrender composite optimizations"
ac_help="$ac_help
  --with-gl-provider=ID
                          Set GL provider backend type"
ac_help="$ac_help
  --enable-faststripe     Use faststripe theme"
ac_help="$ac_help
  --enable-debug[=DBG]    Enable building with developer debug info
                           (using compiler flags DBG)"
ac_help="$ac_help
  --with-debug-label=LABELS
                          Define DEBUG_<value> for each comma-separated
                          value given."
ac_help="$ac_help
  --enable-mobile-optimize
                          Enable mobile optimizations"
ac_help="$ac_help
  --disable-optimize      Disable compiler optimization
  --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]"
ac_help="$ac_help
  --enable-debug-symbols[=DBG]
                          Enable debugging symbols (using compiler flags DBG)"
ac_help="$ac_help
  --enable-warnings-as-errors
                          Enable treating of warnings as errors"
ac_help="$ac_help
  --disable-logging       Disable logging facilities"
ac_help="$ac_help
  --enable-logrefcnt      Enable logging of refcounts (default=debug) "
ac_help="$ac_help
  --enable-dump-painting          Enable paint debugging."
ac_help="$ac_help
  --enable-trace-malloc   Enable malloc tracing; also disables jemalloc"
ac_help="$ac_help
  --enable-jemalloc       Replace memory allocator with jemalloc"
ac_help="$ac_help
  --enable-wrap-malloc    Wrap malloc calls (gnu linker only)"
ac_help="$ac_help
  --with-wrap-malloc=DIR  Location of malloc wrapper library"
ac_help="$ac_help
  --enable-trace-jscalls  Enable JS call enter/exit callback (default=no)"
ac_help="$ac_help
  --disable-gcincremental Disable incremental GC"
ac_help="$ac_help
  --enable-ETW            Enable ETW (Event Tracing for Windows) event reporting"
ac_help="$ac_help
  --enable-gczeal         Enable zealous JavaScript GCing"
ac_help="$ac_help
  --enable-js-diagnostics
                          Enable JS diagnostic assertions and breakpad data"
ac_help="$ac_help
  --with-ccache[=path/to/ccache]
                          Enable compiling with ccache"
ac_help="$ac_help
  --with-static-checking=path/to/gcc_dehydra.so
                          Enable static checking of code using GCC-dehydra"
ac_help="$ac_help
  --enable-strip          Enable stripping of libs & executables "
ac_help="$ac_help
  --enable-install-strip  Enable stripping of libs & executables when packaging "
ac_help="$ac_help
  --enable-elf-dynstr-gc  Enable elf dynstr garbage collector (opt builds only)"
ac_help="$ac_help
  --disable-elf-hack      Disable elf hacks"
ac_help="$ac_help
  --enable-stdcxx-compat  Enable compatibility with older libstdc++"
ac_help="$ac_help
  --enable-functiontimer  Enable NS_FUNCTION_TIMER "
ac_help="$ac_help
  --enable-reflow-perf    Enable reflow performance tracing"
ac_help="$ac_help
  --enable-codesighs      Enable code size analysis tools"
ac_help="$ac_help
  --enable-b2g-ril      Set compile flags necessary for testing B2G Radio Interface Layer via network sockets "
ac_help="$ac_help
  --enable-b2g-bt      Set compile flags necessary for compiling Bluetooth API for B2G "
ac_help="$ac_help
  --jitreport-granularity=N
                           Default granularity at which to report JIT code
                           to external tools
                             0 - no info
                             1 - code ranges for whole functions only
                             2 - per-line information
                             3 - per-op information"
ac_help="$ac_help
  --enable-xterm-updates  Update XTERM titles with current command."
ac_help="$ac_help
  --enable-chrome-format=jar|flat|both|symlink|omni
                          Select FORMAT of chrome files (default=jar)"
ac_help="$ac_help
  --with-default-mozilla-five-home
                          Set the default value for MOZILLA_FIVE_HOME"
ac_help="$ac_help
  --with-user-appdir=DIR  Set user-specific appdir (default=.mozilla)"
ac_help="$ac_help
  --with-doc-input-dirs=DIRS
                          Header/idl dirs to create docs from"
ac_help="$ac_help
  --with-doc-include-dirs=DIRS
                          Include dirs to preprocess doc headers"
ac_help="$ac_help
  --with-doc-output-dir=DIR
                          Dir to generate docs into"
ac_help="$ac_help
  --disable-pedantic      Issue all warnings demanded by strict ANSI C "
ac_help="$ac_help
  --disable-auto-deps     Do not automatically generate dependency info"
ac_help="$ac_help
  --disable-md            Do not use compiler-based dependencies "
ac_help="$ac_help
  --enable-shared-js
                          Create a shared JavaScript library."
ac_help="$ac_help
  --enable-skia   Enable use of Skia"
ac_help="$ac_help
  --enable-system-cairo   Use system cairo (located with pkgconfig)"
ac_help="$ac_help
 --enable-system-pixman Use system pixman (located with pkgconfig)"
ac_help="$ac_help
  --disable-xul           Disable XUL"
ac_help="$ac_help
  --disable-profilelocking
                          Disable profile locking"
ac_help="$ac_help
  --enable-necko-protocols[={http,ftp,default,all,none}]
                          Enable/disable specific protocol handlers"
ac_help="$ac_help
  --disable-necko-wifi    Disable necko wifi scanner"
ac_help="$ac_help
  --disable-cookies       Disable cookie support"
ac_help="$ac_help
  --disable-ctypes        Disable js-ctypes"
ac_help="$ac_help
  --with-macbundlename-prefix=prefix
                          Prefix for MOZ_MACBUNDLE_NAME"

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case "$ac_option" in

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir="$ac_optarg" ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$ac_optarg" ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file="$ac_optarg" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    eval "enable_${ac_feature}=no" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he)
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir="$ac_optarg" ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir="$ac_optarg" ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir="$ac_optarg" ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir="$ac_optarg" ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    localstatedir="$ac_optarg" ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir="$ac_optarg" ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir="$ac_optarg" ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$ac_optarg" ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix="$ac_optarg" ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir="$ac_optarg" ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir="$ac_optarg" ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir="$ac_optarg" ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    eval "with_${ac_package}=no" ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes="$ac_optarg" ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries="$ac_optarg" ;;

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" 1>&2
    fi
    if test "x$nonopt" != xNONE; then
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
    fi
    nonopt="$ac_option"
    ;;

  esac
done

if test -n "$ac_prev"; then
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>./config.log

echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5

# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# Only set these to C if already set.  These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=config/config.mk

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then its parent.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    echo "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done

if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi


ac_aux_dir=
for ac_dir in ${srcdir}/build/autoconf $srcdir/${srcdir}/build/autoconf; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in ${srcdir}/build/autoconf $srcdir/${srcdir}/build/autoconf" 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


# Do some error checking and defaulting for the host and target type.
# The inputs are:
#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
#
# The rules are:
# 1. You are not allowed to specify --host, --target, and nonopt at the
#    same time.
# 2. Host defaults to nonopt.
# 3. If nonopt is not specified, then host defaults to the current host,
#    as determined by config.guess.
# 4. Target and build default to nonopt.
# 5. If nonopt is not specified, then target and build default to host.

# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
case $host---$target---$nonopt in
NONE---*---* | *---NONE---* | *---*---NONE) ;;
*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
esac


# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:1063: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
    fi ;;
  *) host_alias=$nonopt ;;
  esac ;;
esac

host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

echo $ac_n "checking target system type""... $ac_c" 1>&6
echo "configure:1084: checking target system type" >&5

target_alias=$target
case "$target_alias" in
NONE)
  case $nonopt in
  NONE) target_alias=$host_alias ;;
  *) target_alias=$nonopt ;;
  esac ;;
esac

target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6

echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:1102: checking build system type" >&5

build_alias=$build
case "$build_alias" in
NONE)
  case $nonopt in
  NONE) build_alias=$host_alias ;;
  *) build_alias=$nonopt ;;
  esac ;;
esac

build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6

test "$host_alias" != "$target_alias" &&
  test "$program_prefix$program_suffix$program_transform_name" = \
    NONENONEs,x,x, &&
  program_prefix=${target_alias}-

TARGET_CPU="${target_cpu}"
TARGET_VENDOR="${target_vendor}"
TARGET_OS="${target_os}"

MOZ_DEB_TIMESTAMP=`date +"%a, %d  %b %Y %T %z"   2>&1`


CFLAGS="${CFLAGS=}"
CPPFLAGS="${CPPFLAGS=}"
CXXFLAGS="${CXXFLAGS=}"
LDFLAGS="${LDFLAGS=}"
HOST_CFLAGS="${HOST_CFLAGS=}"
HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
HOST_LDFLAGS="${HOST_LDFLAGS=}"

_SUBDIR_CC="$CC"
_SUBDIR_CXX="$CXX"
_SUBDIR_CFLAGS="$CFLAGS"
_SUBDIR_CPPFLAGS="$CPPFLAGS"
_SUBDIR_CXXFLAGS="$CXXFLAGS"
_SUBDIR_LDFLAGS="$LDFLAGS"
_SUBDIR_HOST_CC="$HOST_CC"
_SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
_SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
_SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
_SUBDIR_CONFIG_ARGS="$ac_configure_args"

MOZJPEG=62
MOZPNG=10509
MOZZLIB=0x1230
NSPR_VERSION=4
NSS_VERSION=3

GLIB_VERSION=1.2.0
PERL_VERSION=5.006
PYTHON_VERSION=2.5
CAIRO_VERSION=1.10
PANGO_VERSION=1.14.0
GTK2_VERSION=2.10.0
WINDRES_VERSION=2.14.90
W32API_VERSION=3.14
GNOMEVFS_VERSION=2.0
GNOMEUI_VERSION=2.2.0
GCONF_VERSION=1.2.1
GIO_VERSION=2.18
STARTUP_NOTIFICATION_VERSION=0.8
DBUS_VERSION=0.60
SQLITE_VERSION=3.7.12.1
LIBNOTIFY_VERSION=0.4

MSMANIFEST_TOOL=

MISSING_X=
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1182: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AWK"; then
  ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AWK="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AWK="$ac_cv_prog_AWK"
if test -n "$AWK"; then
  echo "$ac_t""$AWK" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AWK" && break
done


USE_PTHREADS=
_PTHREAD_LDFLAGS=""

_topsrcdir=`cd \`dirname $0\`; pwd`
_objdir=`pwd`

if test "$_topsrcdir" != "$_objdir"
then
  # Check for a couple representative files in the source tree
  _conflict_files=
  for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
    if test -f $file; then
      _conflict_files="$_conflict_files $file"
    fi
  done
  if test "$_conflict_files"; then
    echo "***"
    echo "*   Your source tree contains these files:"
    for file in $_conflict_files; do
      echo "*         $file"
    done
    cat 1>&2 <<-EOF
	*   This indicates that you previously built in the source tree.
	*   A source tree build can confuse the separate objdir build.
	*
	*   To clean up the source tree:
	*     1. cd $_topsrcdir
	*     2. gmake distclean
	***
	EOF
    exit 1
    break
  fi
fi
MOZ_BUILD_ROOT=`pwd`


if test -z "$CROSS_COMPILE"; then
case "$target" in
*-mingw*)
    if test -z "$CC"; then CC=cl; fi
    if test -z "$CXX"; then CXX=cl; fi
    if test -z "$CPP"; then CPP="cl -E -nologo"; fi
    if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
    if test -z "$LD"; then LD=link; fi
    if test -z "$AS"; then
        case "${target_cpu}" in
        i*86)
            AS=ml;
            ;;
        x86_64)
            AS=ml64;
            ;;
        esac
    fi
    if test -z "$MIDL"; then MIDL=midl; fi

    # need override this flag since we don't use $(LDFLAGS) for this.
    if test -z "$HOST_LDFLAGS" ; then
        HOST_LDFLAGS=" "
    fi
    ;;
*-darwin*)
    # we prefer gcc-4.2 over gcc on older darwin, so
    # use that specific version if it's available.
    # On newer versions of darwin, gcc is llvm-gcc while gcc-4.2 is the plain
    # one, so we also try that first. If that fails, we fall back to clang
    # as llvm-gcc is an unsupported dead end.
      for ac_prog in $CC gcc-4.2 clang gcc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1285: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$CC" in
  /*)
  ac_cv_path_CC="$CC" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_CC="$CC" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_CC="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
CC="$ac_cv_path_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CC" && break
done

  if test "$msyshost"; then
    case "$CC" in
    /*)
      tmp_DIRNAME=`dirname "$CC"`
      tmp_BASENAME=`basename "$CC"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      CC="$tmp_PWD/$tmp_BASENAME"
      if test -e "$CC.exe"; then
        CC="$CC.exe"
      fi
    esac
  fi

      for ac_prog in $CXX g++-4.2 clang++ g++
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1338: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$CXX" in
  /*)
  ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_CXX="$CXX" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_CXX="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
CXX="$ac_cv_path_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done

  if test "$msyshost"; then
    case "$CXX" in
    /*)
      tmp_DIRNAME=`dirname "$CXX"`
      tmp_BASENAME=`basename "$CXX"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      CXX="$tmp_PWD/$tmp_BASENAME"
      if test -e "$CXX.exe"; then
        CXX="$CXX.exe"
      fi
    esac
  fi

    IS_LLVM_GCC=$($CC -v 2>&1 | grep llvm-gcc)
    if test -n "$IS_LLVM_GCC"
    then
      echo llvm-gcc is known to be broken, please use gcc-4.2 or clang.
      exit 1
    fi
    ;;
esac
fi


COMPILE_ENVIRONMENT=1
# Check whether --enable-compile-environment or --disable-compile-environment was given.
if test "${enable_compile_environment+set}" = set; then
  enableval="$enable_compile_environment"
  if test "$enableval" = "no"; then
    COMPILE_ENVIRONMENT= 
  elif test "$enableval" = "yes"; then
    :
  else
    { echo "configure: error: Option, compile-environment, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



# Check whether --with-l10n-base or --without-l10n-base was given.
if test "${with_l10n_base+set}" = set; then
  withval="$with_l10n_base"
  L10NBASEDIR=$withval
fi

if test -n "$L10NBASEDIR"; then
    if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
        { echo "configure: error: --with-l10n-base must specify a path" 1>&2; exit 1; }
    elif test -d "$L10NBASEDIR"; then
        L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
    else
        { echo "configure: error: Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist" 1>&2; exit 1; }
    fi
fi


  for ac_prog in $PERL perl5 perl 
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1434: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PERL" in
  /*)
  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PERL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PERL="$ac_cv_path_PERL"
if test -n "$PERL"; then
  echo "$ac_t""$PERL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$PERL" && break
done

  if test "$msyshost"; then
    case "$PERL" in
    /*)
      tmp_DIRNAME=`dirname "$PERL"`
      tmp_BASENAME=`basename "$PERL"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      PERL="$tmp_PWD/$tmp_BASENAME"
      if test -e "$PERL.exe"; then
        PERL="$PERL.exe"
      fi
    esac
  fi

if test -z "$PERL" -o "$PERL" = ":"; then
    { echo "configure: error: perl not found in \$PATH" 1>&2; exit 1; }
fi


# Check whether --with-android-ndk or --without-android-ndk was given.
if test "${with_android_ndk+set}" = set; then
  withval="$with_android_ndk"
  android_ndk=$withval
fi


# Check whether --with-android-toolchain or --without-android-toolchain was given.
if test "${with_android_toolchain+set}" = set; then
  withval="$with_android_toolchain"
  android_toolchain=$withval
fi



# Check whether --with-android-version or --without-android-version was given.
if test "${with_android_version+set}" = set; then
  withval="$with_android_version"
  android_version=$withval
else
  android_version=5
fi


# Check whether --with-android-sdk or --without-android-sdk was given.
if test "${with_android_sdk+set}" = set; then
  withval="$with_android_sdk"
  android_sdk=$withval
fi


# Check whether --with-android-platform or --without-android-platform was given.
if test "${with_android_platform+set}" = set; then
  withval="$with_android_platform"
  android_platform=$withval
fi


case "$target" in
arm-linux*-android*|*-linuxandroid*)
    android_tool_prefix="arm-linux-androideabi"
    ;;
i?86-*android*)
    android_tool_prefix="i686-android-linux"
    ;;
mipsel-*android*)
    android_tool_prefix="mipsel-linux-android"
    ;;
*)
    android_tool_prefix="$target_os"
    ;;
esac

# Check whether --with-gonk or --without-gonk was given.
if test "${with_gonk+set}" = set; then
  withval="$with_gonk"
  gonkdir=$withval
fi


# Check whether --with-gonk-toolchain-prefix or --without-gonk-toolchain-prefix was given.
if test "${with_gonk_toolchain_prefix+set}" = set; then
  withval="$with_gonk_toolchain_prefix"
  gonk_toolchain_prefix=$withval
fi


if test -n "$gonkdir" ; then
    kernel_name=`uname -s | tr "[:upper:]" "[:lower:]"`
    android_source="$gonkdir"
    ANDROID_SOURCE="$android_source"
    ANDROID_NDK="${ANDROID_SOURCE}/ndk"

        AS="$gonk_toolchain_prefix"as
    CC="$gonk_toolchain_prefix"gcc
    CXX="$gonk_toolchain_prefix"g++
    CPP="$gonk_toolchain_prefix"cpp
    LD="$gonk_toolchain_prefix"ld
    AR="$gonk_toolchain_prefix"ar
    RANLIB="$gonk_toolchain_prefix"ranlib
    STRIP="$gonk_toolchain_prefix"strip

    STLPORT_CPPFLAGS="-I$gonkdir/ndk/sources/cxx-stl/stlport/stlport/"
    STLPORT_LIBS="-lstlport"

    case "$target_cpu" in
    arm)
        ARCH_DIR=arch-arm
        ;;
    i?86)
        ARCH_DIR=arch-x86
        ;;
    esac

    CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/hardware/libhardware_legacy/include -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/frameworks/base/include -I$gonkdir/external/dbus $CPPFLAGS -I$gonkdir/frameworks/base/services/sensorservice"
    CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
    CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS $STLPORT_CPPFLAGS"
    LIBS="$LIBS $STLPORT_LIBS"

        LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"

        if test -z "$HOST_CPPFLAGS" ; then
        HOST_CPPFLAGS=" "
    fi
    if test -z "$HOST_CFLAGS" ; then
        HOST_CFLAGS=" "
    fi
    if test -z "$HOST_CXXFLAGS" ; then
        HOST_CXXFLAGS=" "
    fi
    if test -z "$HOST_LDFLAGS" ; then
        HOST_LDFLAGS=" "
    fi

    cat >> confdefs.h <<\EOF
#define ANDROID 1
EOF

    cat >> confdefs.h <<\EOF
#define HAVE_SYS_UIO_H 1
EOF

    cat >> confdefs.h <<\EOF
#define HAVE_PTHREADS 1
EOF

    CROSS_COMPILE=1
    MOZ_CHROME_FILE_FORMAT=omni
    ZLIB_DIR=yes
    direct_nspr_config=1
else
case "$target" in
*-android*|*-linuxandroid*)
    if test -z "$android_ndk" ; then
        { echo "configure: error: You must specify --with-android-ndk=/path/to/ndk when targeting Android." 1>&2; exit 1; }
    fi

    if test -z "$android_sdk" ; then
        { echo "configure: error: You must specify --with-android-sdk=/path/to/sdk when targeting Android." 1>&2; exit 1; }
    else
        if ! test -e "$android_sdk"/source.properties ; then
            { echo "configure: error: The path in --with-android-sdk isn't valid (source.properties hasn't been found)." 1>&2; exit 1; }
        fi

        # Minimum Android SDK API Level we require.
        android_min_api_level=13

        # Get the api level from "$android_sdk"/source.properties.
        android_api_level=`$AWK -F = '$1 == "AndroidVersion.ApiLevel" {print $2}' "$android_sdk"/source.properties`

        if test -z "$android_api_level" ; then
            { echo "configure: error: Unexpected error: no AndroidVersion.ApiLevel field has been found in source.properties." 1>&2; exit 1; }
        fi

        if ! test "$android_api_level" -eq "$android_api_level" ; then
            { echo "configure: error: Unexpected error: the found android api value isn't a number! (found $android_api_level)" 1>&2; exit 1; }
        fi

        if test $android_api_level -lt $android_min_api_level ; then
            { echo "configure: error: The given Android SDK provides API level $android_api_level ($android_min_api_level or higher required)." 1>&2; exit 1; }
        fi
    fi

    android_platform_tools="$android_sdk"/../../platform-tools
    if test ! -d "$android_platform_tools" ; then
        android_platform_tools="$android_sdk"/tools # SDK Tools < r8
    fi

    if test -z "$android_toolchain" ; then
        echo $ac_n "checking for android toolchain directory""... $ac_c" 1>&6
echo "configure:1657: checking for android toolchain directory" >&5

        kernel_name=`uname -s | tr "[:upper:]" "[:lower:]"`

        case "$target_cpu" in
        arm)
            target_name=arm-linux-androideabi-4.4.3
            ;;
        i?86)
            target_name=x86-4.4.3
            ;;
        mipsel)
            target_name=mipsel-linux-android-4.4.3
            ;;
        esac
        android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86

        if test -d "$android_toolchain" ; then
            echo "$ac_t""$android_toolchain" 1>&6
        else
            { echo "configure: error: not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain." 1>&2; exit 1; }
        fi
    fi

    if test -z "$android_platform" ; then
        echo $ac_n "checking for android platform directory""... $ac_c" 1>&6
echo "configure:1683: checking for android platform directory" >&5

        case "$target_cpu" in
        arm)
            target_name=arm
            ;;
        i?86)
            target_name=x86
            ;;
        mipsel)
            target_name=mips
            ;;
        esac

        android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"

        if test -d "$android_platform" ; then
            echo "$ac_t""$android_platform" 1>&6
        else
            { echo "configure: error: not found. You have to specify --with-android-platform=/path/to/ndk/platform." 1>&2; exit 1; }
        fi
    fi

        AS="$android_toolchain"/bin/"$android_tool_prefix"-as
    CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
    CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
    CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
    LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
    AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
    RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
    STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
    OBJCOPY="$android_toolchain"/bin/"$android_tool_prefix"-objcopy

    CPPFLAGS="-isystem $android_platform/usr/include $CPPFLAGS"
    CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
    CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS"
    ASFLAGS="-isystem $android_platform/usr/include -DANDROID $ASFLAGS"

                    LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"

        if test -z "$HOST_CPPFLAGS" ; then
        HOST_CPPFLAGS=" "
    fi
    if test -z "$HOST_CFLAGS" ; then
        HOST_CFLAGS=" "
    fi
    if test -z "$HOST_CXXFLAGS" ; then
        HOST_CXXFLAGS=" "
    fi
    if test -z "$HOST_LDFLAGS" ; then
        HOST_LDFLAGS=" "
    fi

    ANDROID_NDK="${android_ndk}"
    ANDROID_TOOLCHAIN="${android_toolchain}"
    ANDROID_PLATFORM="${android_platform}"
    ANDROID_SDK="${android_sdk}"
    ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
    ANDROID_VERSION="${android_version}"
    if test -z "$ANDROID_PACKAGE_NAME" ; then
        ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)'
    fi

    cat >> confdefs.h <<\EOF
#define ANDROID 1
EOF

    cat >> confdefs.h <<EOF
#define ANDROID_VERSION $android_version
EOF

    
    CROSS_COMPILE=1
    MOZ_CHROME_FILE_FORMAT=omni
    ZLIB_DIR=yes
    ;;
*-linux*)
    # Extract the first word of "objcopy", so it can be a program name with args.
set dummy objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1763: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$OBJCOPY" in
  /*)
  ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_OBJCOPY="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
OBJCOPY="$ac_cv_path_OBJCOPY"
if test -n "$OBJCOPY"; then
  echo "$ac_t""$OBJCOPY" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    ;;
esac

fi











AR_FLAGS='cr $@'

if test "$COMPILE_ENVIRONMENT"; then

if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then
    echo "cross compiling from $host to $target"
    cross_compiling=yes

    _SAVE_CC="$CC"
    _SAVE_CFLAGS="$CFLAGS"
    _SAVE_LDFLAGS="$LDFLAGS"

    echo $ac_n "checking for host c compiler""... $ac_c" 1>&6
echo "configure:1823: checking for host c compiler" >&5
    for ac_prog in $HOST_CC gcc cc /usr/ucb/cc cl icc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1829: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$HOST_CC"; then
  ac_cv_prog_HOST_CC="$HOST_CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_HOST_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
HOST_CC="$ac_cv_prog_HOST_CC"
if test -n "$HOST_CC"; then
  echo "$ac_t""$HOST_CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$HOST_CC" && break
done
test -n "$HOST_CC" || HOST_CC=""""

    if test -z "$HOST_CC"; then
        { echo "configure: error: no acceptable c compiler found in \$PATH" 1>&2; exit 1; }
    fi
    echo "$ac_t""$HOST_CC" 1>&6
    echo $ac_n "checking for host c++ compiler""... $ac_c" 1>&6
echo "configure:1864: checking for host c++ compiler" >&5
    for ac_prog in $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1870: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_HOST_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$HOST_CXX"; then
  ac_cv_prog_HOST_CXX="$HOST_CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_HOST_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
HOST_CXX="$ac_cv_prog_HOST_CXX"
if test -n "$HOST_CXX"; then
  echo "$ac_t""$HOST_CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$HOST_CXX" && break
done
test -n "$HOST_CXX" || HOST_CXX=""""

    if test -z "$HOST_CXX"; then
        { echo "configure: error: no acceptable c++ compiler found in \$PATH" 1>&2; exit 1; }
    fi
    echo "$ac_t""$HOST_CXX" 1>&6

    if test -z "$HOST_CFLAGS"; then
        HOST_CFLAGS="$CFLAGS"
    fi
    if test -z "$HOST_CXXFLAGS"; then
        HOST_CXXFLAGS="$CXXFLAGS"
    fi
    if test -z "$HOST_LDFLAGS"; then
        HOST_LDFLAGS="$LDFLAGS"
    fi
    if test -z "$HOST_AR_FLAGS"; then
        HOST_AR_FLAGS="$AR_FLAGS"
    fi
    for ac_prog in $HOST_RANLIB ranlib
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1922: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_HOST_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$HOST_RANLIB"; then
  ac_cv_prog_HOST_RANLIB="$HOST_RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy=":"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_HOST_RANLIB="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
HOST_RANLIB="$ac_cv_prog_HOST_RANLIB"
if test -n "$HOST_RANLIB"; then
  echo "$ac_t""$HOST_RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$HOST_RANLIB" && break
done
test -n "$HOST_RANLIB" || HOST_RANLIB="ranlib"

    for ac_prog in $HOST_AR ar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1957: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_HOST_AR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$HOST_AR"; then
  ac_cv_prog_HOST_AR="$HOST_AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy=":"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_HOST_AR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
HOST_AR="$ac_cv_prog_HOST_AR"
if test -n "$HOST_AR"; then
  echo "$ac_t""$HOST_AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$HOST_AR" && break
done
test -n "$HOST_AR" || HOST_AR="ar"

    CC="$HOST_CC"
    CFLAGS="$HOST_CFLAGS"
    LDFLAGS="$HOST_LDFLAGS"

    echo $ac_n "checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1992: checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
    cat > conftest.$ac_ext <<EOF
#line 1994 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:2001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_prog_hostcc_works=1 echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: installation or configuration problem: host compiler $HOST_CC cannot create executables." 1>&2; exit 1; } 
fi
rm -f conftest*

    CC="$HOST_CXX"
    CFLAGS="$HOST_CXXFLAGS"

    echo $ac_n "checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2016: checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works" >&5
    cat > conftest.$ac_ext <<EOF
#line 2018 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:2025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_prog_hostcxx_works=1 echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: installation or configuration problem: host compiler $HOST_CXX cannot create executables." 1>&2; exit 1; } 
fi
rm -f conftest*

    CC=$_SAVE_CC
    CFLAGS=$_SAVE_CFLAGS
    LDFLAGS=$_SAVE_LDFLAGS

    for ac_prog in $CC "${target_alias}-gcc" "${target}-gcc"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2045: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CC" && break
done
test -n "$CC" || CC=":"

    unset ac_cv_prog_CC
    # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2079: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2109: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2160: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2192: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 2203 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:2208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2234: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:2239: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:2267: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  ac_cv_prog_cc_g=yes
else
  ac_cv_prog_cc_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi

    for ac_prog in $CXX "${target_alias}-g++" "${target}-g++"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2303: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX=":"

    unset ac_cv_prog_CXX
    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2339: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2371: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

#line 2382 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:2387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
if test $ac_cv_prog_cxx_works = no; then
  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2413: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:2418: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

echo "$ac_t""$ac_cv_prog_gxx" 1>&6

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:2446: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

for ac_declaration in \
   ''\
   '#include <stdlib.h>' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  cat > conftest.$ac_ext <<EOF
#line 2487 "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
int main() {
exit (42);
; return 0; }
EOF
if { (eval echo configure:2495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  continue
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 2505 "configure"
#include "confdefs.h"
$ac_declaration
int main() {
exit (42);
; return 0; }
EOF
if { (eval echo configure:2512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi



    for ac_prog in $RANLIB "${target_alias}-ranlib" "${target}-ranlib"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2534: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$RANLIB" && break
done
test -n "$RANLIB" || RANLIB=":"

    for ac_prog in $AR "${target_alias}-ar" "${target}-ar"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2569: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AR" && break
done
test -n "$AR" || AR=":"

      for ac_prog in $AS "${target_alias}-as" "${target}-as"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2604: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$AS" in
  /*)
  ac_cv_path_AS="$AS" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_AS="$AS" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_AS="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
AS="$ac_cv_path_AS"
if test -n "$AS"; then
  echo "$ac_t""$AS" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AS" && break
done
test -n "$AS" || AS=":"

  if test "$msyshost"; then
    case "$AS" in
    /*)
      tmp_DIRNAME=`dirname "$AS"`
      tmp_BASENAME=`basename "$AS"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      AS="$tmp_PWD/$tmp_BASENAME"
      if test -e "$AS.exe"; then
        AS="$AS.exe"
      fi
    esac
  fi

    for ac_prog in $LD "${target_alias}-ld" "${target}-ld"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2658: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LD"; then
  ac_cv_prog_LD="$LD" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LD="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
LD="$ac_cv_prog_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$LD" && break
done
test -n "$LD" || LD=":"

    for ac_prog in $STRIP "${target_alias}-strip" "${target}-strip"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2693: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_STRIP="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
STRIP="$ac_cv_prog_STRIP"
if test -n "$STRIP"; then
  echo "$ac_t""$STRIP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$STRIP" && break
done
test -n "$STRIP" || STRIP=":"

    for ac_prog in $WINDRES "${target_alias}-windres" "${target}-windres"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2728: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$WINDRES"; then
  ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_WINDRES="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
WINDRES="$ac_cv_prog_WINDRES"
if test -n "$WINDRES"; then
  echo "$ac_t""$WINDRES" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$WINDRES" && break
done
test -n "$WINDRES" || WINDRES=":"

    cat >> confdefs.h <<\EOF
#define CROSS_COMPILE 1
EOF

else
    # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2766: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2796: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2847: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:2879: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 2890 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:2926: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:2954: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  ac_cv_prog_cc_g=yes
else
  ac_cv_prog_cc_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi

    case "$target" in
    *-mingw*)
      # Work around the conftest.exe access problem on Windows
      sleep 2
    esac
    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2995: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:3027: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

#line 3038 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:3043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
if test $ac_cv_prog_cxx_works = no; then
  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:3069: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:3074: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:3083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

echo "$ac_t""$ac_cv_prog_gxx" 1>&6

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:3102: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

for ac_declaration in \
   ''\
   '#include <stdlib.h>' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  cat > conftest.$ac_ext <<EOF
#line 3143 "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
int main() {
exit (42);
; return 0; }
EOF
if { (eval echo configure:3151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  continue
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 3161 "configure"
#include "confdefs.h"
$ac_declaration
int main() {
exit (42);
; return 0; }
EOF
if { (eval echo configure:3168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi


    # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3187: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

      for ac_prog in $AS as
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3219: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$AS" in
  /*)
  ac_cv_path_AS="$AS" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_AS="$AS" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_AS="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
AS="$ac_cv_path_AS"
if test -n "$AS"; then
  echo "$ac_t""$AS" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AS" && break
done
test -n "$AS" || AS="$CC"

  if test "$msyshost"; then
    case "$AS" in
    /*)
      tmp_DIRNAME=`dirname "$AS"`
      tmp_BASENAME=`basename "$AS"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      AS="$tmp_PWD/$tmp_BASENAME"
      if test -e "$AS.exe"; then
        AS="$AS.exe"
      fi
    esac
  fi

    for ac_prog in ar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3273: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AR" && break
done
test -n "$AR" || AR=":"

    for ac_prog in ld
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3308: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LD"; then
  ac_cv_prog_LD="$LD" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LD="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
LD="$ac_cv_prog_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$LD" && break
done
test -n "$LD" || LD=":"

    for ac_prog in strip
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3343: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_STRIP="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
STRIP="$ac_cv_prog_STRIP"
if test -n "$STRIP"; then
  echo "$ac_t""$STRIP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$STRIP" && break
done
test -n "$STRIP" || STRIP=":"

    for ac_prog in windres
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3378: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$WINDRES"; then
  ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_WINDRES="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
WINDRES="$ac_cv_prog_WINDRES"
if test -n "$WINDRES"; then
  echo "$ac_t""$WINDRES" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$WINDRES" && break
done
test -n "$WINDRES" || WINDRES=":"

    if test -z "$HOST_CC"; then
        HOST_CC='$(CC)'
    fi
    if test -z "$HOST_CFLAGS"; then
        HOST_CFLAGS='$(CFLAGS)'
    fi
    if test -z "$HOST_CXX"; then
        HOST_CXX='$(CXX)'
    fi
    if test -z "$HOST_CXXFLAGS"; then
        HOST_CXXFLAGS='$(CXXFLAGS)'
    fi
    if test -z "$HOST_LDFLAGS"; then
        HOST_LDFLAGS='$(LDFLAGS)'
    fi
    if test -z "$HOST_RANLIB"; then
        HOST_RANLIB='$(RANLIB)'
    fi
    if test -z "$HOST_AR"; then
        HOST_AR='$(AR)'
    fi
    if test -z "$HOST_AR_FLAGS"; then
        HOST_AR_FLAGS='$(AR_FLAGS)'
    fi
fi

GNU_AS=
GNU_LD=
GNU_CC=
GNU_CXX=
CC_VERSION='N/A'
CXX_VERSION='N/A'
if test "$GCC" = "yes"; then
    GNU_CC=1
    CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
fi
if test "$GXX" = "yes"; then
    GNU_CXX=1
    CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then
    GNU_AS=1
fi
rm -f conftest.out
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
    GNU_LD=1
fi
if test "$GNU_CC"; then
    if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
        GCC_USE_GNU_LD=1
    fi
fi

INTEL_CC=
INTEL_CXX=
if test "$GCC" = yes; then
   if test "`$CC -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
     INTEL_CC=1
   fi
fi

if test "$GXX" = yes; then
   if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
     INTEL_CXX=1
   fi
fi

CLANG_CC=
CLANG_CXX=
if test "$GCC" = yes; then
   if test "`$CC -v 2>&1 | grep -c 'clang version'`" != "0"; then
     CLANG_CC=1
   fi
fi

if test "$GXX" = yes; then
   if test "`$CXX -v 2>&1 | grep -c 'clang version'`" != "0"; then
     CLANG_CXX=1
   fi
fi


# With win8, sdk target=602, WINVER=602
# Check whether --enable-metro or --disable-metro was given.
if test "${enable_metro+set}" = set; then
  enableval="$enable_metro"
  if test "$enableval" = "yes"; then
    MOZ_METRO=1
  elif test "$enableval" = "no"; then
    MOZ_METRO=
  else
    { echo "configure: error: Option, metro, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_METRO"; then
    cat >> confdefs.h <<\EOF
#define MOZ_METRO 1
EOF

    # Target the Windows 8 Kit
    WINSDK_TARGETVER=602
    # Allow a higher api set
    WINVER=602
    # toolkit/library/makefile.in needs these, see nsDllMain.
    CRTDLLVERSION=110
    CRTEXPDLLVERSION=1-1-0
else
    # Target the Windows 7 SDK by default
    WINSDK_TARGETVER=601
    WINVER=502
fi




if test -n "$MOZ_METRO"; then
  case "$target" in
  *-mingw*)
    ;;
  *)
    { echo "configure: error: Metro builds only valid on the windows platform." 1>&2; exit 1; };
    ;;
  esac
fi

# Check whether --with-windows-version or --without-windows-version was given.
if test "${with_windows_version+set}" = set; then
  withval="$with_windows_version"
  WINSDK_TARGETVER=$withval
fi


# Currently only two sdk versions allowed, 601 and 602
case "$WINSDK_TARGETVER" in
601|602)
    MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
    ;;

*)
    { echo "configure: error: Invalid value for --with-windows-version ($WINSDK_TARGETVER)" 1>&2; exit 1; };
    ;;
esac

case "$target" in
*-mingw*)
    if test "$GCC" != "yes"; then
        # Check to see if we are really running in a msvc environemnt
        _WIN32_MSVC=1
        for ac_prog in midl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3562: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MIDL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MIDL"; then
  ac_cv_prog_MIDL="$MIDL" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_MIDL="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MIDL="$ac_cv_prog_MIDL"
if test -n "$MIDL"; then
  echo "$ac_t""$MIDL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MIDL" && break
done


        # Make sure compilers are valid
        CFLAGS="$CFLAGS -TC -nologo"
        CXXFLAGS="$CXXFLAGS -TP -nologo"
        
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        cat > conftest.$ac_ext <<EOF
#line 3604 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
 printf("Hello World\n"); 
; return 0; }
EOF
if { (eval echo configure:3611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: \$(CC) test failed.  You must have MS VC++ in your path to build." 1>&2; exit 1; } 
fi
rm -f conftest*

        ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

        cat > conftest.$ac_ext <<EOF
#line 3629 "configure"
#include "confdefs.h"
#include <new.h>
int main() {
 unsigned *test = new unsigned(42); 
; return 0; }
EOF
if { (eval echo configure:3636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: \$(CXX) test failed.  You must have MS VC++ in your path to build." 1>&2; exit 1; } 
fi
rm -f conftest*
        ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


        
        _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
        

        # Determine compiler version
        CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
        _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
        _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
        _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
        _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
        _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}

        CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
        _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`

        if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
            { echo "configure: error: The major versions of \$CC and \$CXX do not match." 1>&2; exit 1; }
        fi

        if test "$_CC_MAJOR_VERSION" = "14"; then
                                    if test "$_CC_RELEASE" -lt 50727 -o \
                    \( "$_CC_RELEASE" -eq 50727 -a "$_CC_BUILD" -lt 762 \); then
              { echo "configure: error: This version ($CC_VERSION) of the MSVC compiler is unsupported. You probably need to install Service Pack 1 of Visual Studio 2005. See https://developer.mozilla.org/en/Windows_Build_Prerequisites." 1>&2; exit 1; }
            fi

            _CC_SUITE=8
            cat >> confdefs.h <<\EOF
#define _CRT_SECURE_NO_DEPRECATE 1
EOF

            cat >> confdefs.h <<\EOF
#define _CRT_NONSTDC_NO_DEPRECATE 1
EOF

        elif test "$_CC_MAJOR_VERSION" = "15"; then
            _CC_SUITE=9
            cat >> confdefs.h <<\EOF
#define _CRT_SECURE_NO_WARNINGS 1
EOF

            cat >> confdefs.h <<\EOF
#define _CRT_NONSTDC_NO_WARNINGS 1
EOF

        elif test "$_CC_MAJOR_VERSION" = "16"; then
            _CC_SUITE=10
            cat >> confdefs.h <<\EOF
#define _CRT_SECURE_NO_WARNINGS 1
EOF

            cat >> confdefs.h <<\EOF
#define _CRT_NONSTDC_NO_WARNINGS 1
EOF

        elif test "$_CC_MAJOR_VERSION" = "17"; then
            _CC_SUITE=11
            cat >> confdefs.h <<\EOF
#define _CRT_SECURE_NO_WARNINGS 1
EOF

            cat >> confdefs.h <<\EOF
#define _CRT_NONSTDC_NO_WARNINGS 1
EOF

        else
            { echo "configure: error: This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites." 1>&2; exit 1; }
        fi

        _MOZ_RTTI_FLAGS_ON='-GR'
        _MOZ_RTTI_FLAGS_OFF='-GR-'
        cat >> confdefs.h <<\EOF
#define HAVE_SEH_EXCEPTIONS 1
EOF


        if test -n "$WIN32_REDIST_DIR"; then
          if test ! -d "$WIN32_REDIST_DIR"; then
            { echo "configure: error: Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}" 1>&2; exit 1; }
          fi
          WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
        fi

                if test -n "$MOZ_METRO"; then
          echo $ac_n "checking for makepri""... $ac_c" 1>&6
echo "configure:3737: checking for makepri" >&5
          for ac_prog in makepri
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3743: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKEPRI'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MAKEPRI"; then
  ac_cv_prog_MAKEPRI="$MAKEPRI" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_MAKEPRI="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MAKEPRI="$ac_cv_prog_MAKEPRI"
if test -n "$MAKEPRI"; then
  echo "$ac_t""$MAKEPRI" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MAKEPRI" && break
done
test -n "$MAKEPRI" || MAKEPRI=""""

          if test -z "MAKEPRI" ; then
              { echo "configure: error: makepri.exe is required for generating metro browser install components. It should be in the Win8 SDK." 1>&2; exit 1; }
          fi
          
        fi

                        MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
        if test -z "$MSMT_TOOL"; then
          { echo "configure: error: Microsoft (R) Manifest Tool must be in your \$PATH." 1>&2; exit 1; }
        fi

        
        _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
        
        MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
        if test -z "$MSMANIFEST_TOOL_VERSION"; then
          echo "configure: warning: Unknown version of the Microsoft (R) Manifest Tool." 1>&2
        fi

        MSMANIFEST_TOOL=1
        unset MSMT_TOOL

        # Check linker version
        _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
        _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
        if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
            { echo "configure: error: The linker major version, $_LD_FULL_VERSION,  does not match the compiler suite version, $_CC_SUITE." 1>&2; exit 1; }
        fi

        INCREMENTAL_LINKER=1

        # Check midl version
        _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
        _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
        _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
        _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
        # Add flags if necessary
        echo $ac_n "checking for midl flags""... $ac_c" 1>&6
echo "configure:3811: checking for midl flags" >&5
        case "$target" in
        i*86-*)
            if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
                # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
                # MIDL version 7.00.0500 or later has no problem.
                MIDL_FLAGS="${MIDL_FLAGS} -env win32"
                echo "$ac_t""need -env win32" 1>&6
            else
                echo "$ac_t""none needed" 1>&6
            fi
            ;;
        x86_64-*)
            MIDL_FLAGS="${MIDL_FLAGS} -env x64"
            ;;
        *)
            echo "$ac_t""none needed" 1>&6
            ;;
        esac

        # Identify which version of the SDK we're building with
        # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
        # from there
         for ac_hdr in winsdkver.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3838: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 3843 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:3851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done

        if test "$ac_cv_header_winsdkver_h" = "yes"; then
            # Get the highest _WIN32_WINNT and NTDDI versions supported
            # Take the higher of the two
            # This is done because the Windows 7 beta SDK reports its
            # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
            echo $ac_n "checking for highest Windows version supported by this SDK""... $ac_c" 1>&6
echo "configure:3883: checking for highest Windows version supported by this SDK" >&5
if eval "test \"`echo '$''{'ac_cv_winsdk_maxver'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.h <<EOF
#include <winsdkver.h>
#include <sdkddkver.h>

#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
#else
#define WINSDK_MAXVER NTDDI_MAXVER
#endif

WINSDK_MAXVER
EOF
                            ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
                            rm -f conftest.h
                           
fi

echo "$ac_t""$ac_cv_winsdk_maxver" 1>&6
            MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
        else
            # Any SDK which doesn't have WinSDKVer.h is too old.
            { echo "configure: error: Your SDK does not have WinSDKVer.h. It is probably too old. Please upgrade to a newer SDK or try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this." 1>&2; exit 1; }
        fi

        unset _MSVC_VER_FILTER

        echo $ac_n "checking for std::_Throw""... $ac_c" 1>&6
echo "configure:3914: checking for std::_Throw" >&5
if eval "test \"`echo '$''{'ac_cv_have_std__Throw'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
                
                ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

                _SAVE_CXXFLAGS="$CXXFLAGS"
                CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
                cat > conftest.$ac_ext <<EOF
#line 3930 "configure"
#include "confdefs.h"
#include <exception>
int main() {
std::_Throw(std::exception()); return 0;
; return 0; }
EOF
if { (eval echo configure:3937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have_std__Throw="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_std__Throw="no"
fi
rm -f conftest*
                CXXFLAGS="$_SAVE_CXXFLAGS"
                ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

            
fi

echo "$ac_t""$ac_cv_have_std__Throw" 1>&6

        if test "$ac_cv_have_std__Throw" = "yes"; then
            echo $ac_n "checking for |class __declspec(dllimport) exception| bug""... $ac_c" 1>&6
echo "configure:3962: checking for |class __declspec(dllimport) exception| bug" >&5
if eval "test \"`echo '$''{'ac_cv_have_dllimport_exception_bug'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
                    
                    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

                    _SAVE_CXXFLAGS="$CXXFLAGS"
                    CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
                    cat > conftest.$ac_ext <<EOF
#line 3978 "configure"
#include "confdefs.h"
#include <vector>
int main() {
std::vector<int> v; return v.at(1);
; return 0; }
EOF
if { (eval echo configure:3985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_have_dllimport_exception_bug="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_dllimport_exception_bug="yes"
fi
rm -f conftest*
                    CXXFLAGS="$_SAVE_CXXFLAGS"
                    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

                
fi

echo "$ac_t""$ac_cv_have_dllimport_exception_bug" 1>&6
            if test "$ac_cv_have_dllimport_exception_bug" = "no"; then
                WRAP_STL_INCLUDES=1
                MOZ_MSVC_STL_WRAP__Throw=1
                cat >> confdefs.h <<\EOF
#define MOZ_MSVC_STL_WRAP__Throw 1
EOF

            fi
        else
            echo $ac_n "checking for overridable _RAISE""... $ac_c" 1>&6
echo "configure:4017: checking for overridable _RAISE" >&5
if eval "test \"`echo '$''{'ac_cv_have__RAISE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
                    
                    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

                    _SAVE_CXXFLAGS="$CXXFLAGS"
                    CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
                    cat > conftest.$ac_ext <<EOF
#line 4033 "configure"
#include "confdefs.h"
#include <xstddef>
                                    #undef _RAISE
                                    #define _RAISE(x) externallyDefinedFunction((x).what())
                                    #include <vector>
                                   
int main() {
std::vector<int> v; return v.at(1);
; return 0; }
EOF
if { (eval echo configure:4044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have__RAISE="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have__RAISE="yes"
fi
rm -f conftest*
                    CXXFLAGS="$_SAVE_CXXFLAGS"
                    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

                
fi

echo "$ac_t""$ac_cv_have__RAISE" 1>&6
            if test "$ac_cv_have__RAISE" = "yes"; then
                WRAP_STL_INCLUDES=1
                MOZ_MSVC_STL_WRAP__RAISE=1
                cat >> confdefs.h <<\EOF
#define MOZ_MSVC_STL_WRAP__RAISE 1
EOF

            else
                { echo "configure: error: Gecko exception wrapping doesn't understand your your MSVC/SDK.  Please file a bug describing this error and your build configuration." 1>&2; exit 1; }
            fi
        fi

        if test "$WRAP_STL_INCLUDES" = "1"; then
            STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers'
        fi
    else
        # Check w32api version
        _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
        _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
        echo $ac_n "checking for w32api version >= $W32API_VERSION""... $ac_c" 1>&6
echo "configure:4086: checking for w32api version >= $W32API_VERSION" >&5
        cat > conftest.$ac_ext <<EOF
#line 4088 "configure"
#include "confdefs.h"
#include <w32api.h>
int main() {
#if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
                (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
                 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
                #error "test failed."
            #endif
            
; return 0; }
EOF
if { (eval echo configure:4100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
   res=yes 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   res=no 
fi
rm -f conftest*
        echo "$ac_t""$res" 1>&6
        if test "$res" != "yes"; then
            { echo "configure: error: w32api version $W32API_VERSION or higher required." 1>&2; exit 1; }
        fi
        # Check windres version
        echo $ac_n "checking for windres version >= $WINDRES_VERSION""... $ac_c" 1>&6
echo "configure:4116: checking for windres version >= $WINDRES_VERSION" >&5
        _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
        echo "$ac_t""$_WINDRES_VERSION" 1>&6
        _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
        _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
        _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
        WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
        WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
        WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
        if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
                "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
                "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
                "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
                "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
                "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
        then
            { echo "configure: error: windres version $WINDRES_VERSION or higher is required to build." 1>&2; exit 1; }
        fi

        MOZ_WINSDK_MAXVER=0x06020000
    fi # !GNU_CC

    cat >> confdefs.h <<EOF
#define WINVER 0x$WINVER
EOF

    cat >> confdefs.h <<EOF
#define _WIN32_WINNT 0x$WINVER
EOF

    # Require OS features provided by IE 6.0 SP2 (XP SP2)
    cat >> confdefs.h <<EOF
#define _WIN32_IE 0x0603
EOF


    # If the maximum version supported by this SDK is lower than the target
    # version, error out
    echo $ac_n "checking for Windows SDK being recent enough""... $ac_c" 1>&6
echo "configure:4155: checking for Windows SDK being recent enough" >&5
    if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
        echo "$ac_t"""yes"" 1>&6
    else
        echo "$ac_t"""no"" 1>&6
        { echo "configure: error: You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. Alternatively, try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this." 1>&2; exit 1; }
    fi
    
    # Make sure the sdk / code we're targeting has the right toolset
    echo $ac_n "checking SDK and tools are in sync""... $ac_c" 1>&6
echo "configure:4165: checking SDK and tools are in sync" >&5
    if test -n "$MOZ_METRO"; then
      if test "$MOZ_MSVCVERSION" -gt "10"; then
        echo "$ac_t"""yes"" 1>&6
      else
        echo "$ac_t"""no"" 1>&6
        { echo "configure: error: Your MOZ_MSVCVERSION equals $MOZ_MSVCVERSION and you've enabled metro build support. You can't target metro without msvc 11 or higher. Disable metro support or switch to a newer set of tools." 1>&2; exit 1; }
      fi
    fi
      
    cat >> confdefs.h <<EOF
#define MOZ_WINSDK_TARGETVER 0x$MOZ_WINSDK_TARGETVER
EOF

    # Definitions matching sdkddkver.h
    cat >> confdefs.h <<EOF
#define MOZ_NTDDI_WIN7 0x06010000
EOF

    ;;
esac

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:4188: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 4203 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 4220 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 4237 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:4268: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
  CXXCPP="${CXX-g++} -E"
  cat > conftest.$ac_ext <<EOF
#line 4281 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CXXCPP=/lib/cpp
fi
rm -f conftest*
  ac_cv_prog_CXXCPP="$CXXCPP"
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
fi
fi
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6


if test -n "$_WIN32_MSVC"; then
    SKIP_PATH_CHECKS=1
    SKIP_COMPILER_CHECKS=1
    SKIP_LIBRARY_CHECKS=1

    # Since we're skipping compiler and library checks, hard-code
    # some facts here.
    cat >> confdefs.h <<\EOF
#define HAVE_IO_H 1
EOF

    cat >> confdefs.h <<\EOF
#define HAVE_SETBUF 1
EOF

    cat >> confdefs.h <<\EOF
#define HAVE_ISATTY 1
EOF

fi

fi # COMPILE_ENVIRONMENT


















# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:4363: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
fi
echo "$ac_t""$INSTALL" 1>&6

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:4416: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  ac_cv_prog_LN_S="ln -s"
else
  ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
echo $ac_n "checking for minimum required perl version >= $PERL_VERSION""... $ac_c" 1>&6
echo "configure:4439: checking for minimum required perl version >= $PERL_VERSION" >&5
_perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
_perl_res=$?
echo "$ac_t""$_perl_version" 1>&6

if test "$_perl_res" != 0; then
    { echo "configure: error: Perl $PERL_VERSION or higher is required." 1>&2; exit 1; }
fi
fi

echo $ac_n "checking for full perl installation""... $ac_c" 1>&6
echo "configure:4450: checking for full perl installation" >&5
_perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
_perl_res=$?
if test "$_perl_res" != 0; then
    echo "$ac_t""no" 1>&6
    { echo "configure: error: Cannot find Config.pm or \$Config{archlib}.  A full perl installation is required." 1>&2; exit 1; }
else
    echo "$ac_t""yes" 1>&6
fi

  for ac_prog in $PYTHON python2.7 python2.6 python2.5 python
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4465: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PYTHON'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PYTHON" in
  /*)
  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PYTHON="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PYTHON="$ac_cv_path_PYTHON"
if test -n "$PYTHON"; then
  echo "$ac_t""$PYTHON" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$PYTHON" && break
done

  if test "$msyshost"; then
    case "$PYTHON" in
    /*)
      tmp_DIRNAME=`dirname "$PYTHON"`
      tmp_BASENAME=`basename "$PYTHON"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      PYTHON="$tmp_PWD/$tmp_BASENAME"
      if test -e "$PYTHON.exe"; then
        PYTHON="$PYTHON.exe"
      fi
    esac
  fi

if test -z "$PYTHON"; then
    { echo "configure: error: python was not found in \$PATH" 1>&2; exit 1; }
fi

# Check whether --with-system-ply or --without-system-ply was given.
if test "${with_system_ply+set}" = set; then
  withval="$with_system_ply"
  if test "$withval" = "yes"; then
    if $PYTHON -c 'import ply' 2>&5; then
         MOZ_SYSTEM_PLY=1
     else
         { echo "configure: error: python ply library is not found but --with-system-ply was requested" 1>&2; exit 1; }
     fi
  elif test "$withval" = "no"; then
    :
  else
    { echo "configure: error: Option, system-ply, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi




if test -z "$COMPILE_ENVIRONMENT"; then
    NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
fi


 # Extract the first word of "doxygen", so it can be a program name with args.
set dummy doxygen; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4544: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_DOXYGEN'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$DOXYGEN" in
  /*)
  ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_DOXYGEN="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN=":"
  ;;
esac
fi
DOXYGEN="$ac_cv_path_DOXYGEN"
if test -n "$DOXYGEN"; then
  echo "$ac_t""$DOXYGEN" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$DOXYGEN" in
    /*)
      tmp_DIRNAME=`dirname "$DOXYGEN"`
      tmp_BASENAME=`basename "$DOXYGEN"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      DOXYGEN="$tmp_PWD/$tmp_BASENAME"
      if test -e "$DOXYGEN.exe"; then
        DOXYGEN="$DOXYGEN.exe"
      fi
    esac
  fi

 # Extract the first word of "autoconf", so it can be a program name with args.
set dummy autoconf; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4593: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_AUTOCONF'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$AUTOCONF" in
  /*)
  ac_cv_path_AUTOCONF="$AUTOCONF" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_AUTOCONF="$AUTOCONF" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_AUTOCONF="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_AUTOCONF" && ac_cv_path_AUTOCONF=":"
  ;;
esac
fi
AUTOCONF="$ac_cv_path_AUTOCONF"
if test -n "$AUTOCONF"; then
  echo "$ac_t""$AUTOCONF" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$AUTOCONF" in
    /*)
      tmp_DIRNAME=`dirname "$AUTOCONF"`
      tmp_BASENAME=`basename "$AUTOCONF"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      AUTOCONF="$tmp_PWD/$tmp_BASENAME"
      if test -e "$AUTOCONF.exe"; then
        AUTOCONF="$AUTOCONF.exe"
      fi
    esac
  fi

  for ac_prog in unzip
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4644: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_UNZIP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$UNZIP" in
  /*)
  ac_cv_path_UNZIP="$UNZIP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_UNZIP="$UNZIP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_UNZIP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
UNZIP="$ac_cv_path_UNZIP"
if test -n "$UNZIP"; then
  echo "$ac_t""$UNZIP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$UNZIP" && break
done

  if test "$msyshost"; then
    case "$UNZIP" in
    /*)
      tmp_DIRNAME=`dirname "$UNZIP"`
      tmp_BASENAME=`basename "$UNZIP"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      UNZIP="$tmp_PWD/$tmp_BASENAME"
      if test -e "$UNZIP.exe"; then
        UNZIP="$UNZIP.exe"
      fi
    esac
  fi

if test -z "$UNZIP" -o "$UNZIP" = ":"; then
    { echo "configure: error: unzip not found in \$PATH" 1>&2; exit 1; }
fi
  for ac_prog in zip
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4700: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ZIP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$ZIP" in
  /*)
  ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_ZIP="$ZIP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_ZIP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
ZIP="$ac_cv_path_ZIP"
if test -n "$ZIP"; then
  echo "$ac_t""$ZIP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$ZIP" && break
done

  if test "$msyshost"; then
    case "$ZIP" in
    /*)
      tmp_DIRNAME=`dirname "$ZIP"`
      tmp_BASENAME=`basename "$ZIP"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      ZIP="$tmp_PWD/$tmp_BASENAME"
      if test -e "$ZIP.exe"; then
        ZIP="$ZIP.exe"
      fi
    esac
  fi

if test -z "$ZIP" -o "$ZIP" = ":"; then
    { echo "configure: error: zip not found in \$PATH" 1>&2; exit 1; }
fi
 # Extract the first word of "makedepend", so it can be a program name with args.
set dummy makedepend; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4754: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SYSTEM_MAKEDEPEND'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$SYSTEM_MAKEDEPEND" in
  /*)
  ac_cv_path_SYSTEM_MAKEDEPEND="$SYSTEM_MAKEDEPEND" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_SYSTEM_MAKEDEPEND="$SYSTEM_MAKEDEPEND" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_SYSTEM_MAKEDEPEND="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
SYSTEM_MAKEDEPEND="$ac_cv_path_SYSTEM_MAKEDEPEND"
if test -n "$SYSTEM_MAKEDEPEND"; then
  echo "$ac_t""$SYSTEM_MAKEDEPEND" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$SYSTEM_MAKEDEPEND" in
    /*)
      tmp_DIRNAME=`dirname "$SYSTEM_MAKEDEPEND"`
      tmp_BASENAME=`basename "$SYSTEM_MAKEDEPEND"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      SYSTEM_MAKEDEPEND="$tmp_PWD/$tmp_BASENAME"
      if test -e "$SYSTEM_MAKEDEPEND.exe"; then
        SYSTEM_MAKEDEPEND="$SYSTEM_MAKEDEPEND.exe"
      fi
    esac
  fi

 # Extract the first word of "xargs", so it can be a program name with args.
set dummy xargs; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4802: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XARGS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$XARGS" in
  /*)
  ac_cv_path_XARGS="$XARGS" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_XARGS="$XARGS" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_XARGS="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
XARGS="$ac_cv_path_XARGS"
if test -n "$XARGS"; then
  echo "$ac_t""$XARGS" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$XARGS" in
    /*)
      tmp_DIRNAME=`dirname "$XARGS"`
      tmp_BASENAME=`basename "$XARGS"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      XARGS="$tmp_PWD/$tmp_BASENAME"
      if test -e "$XARGS.exe"; then
        XARGS="$XARGS.exe"
      fi
    esac
  fi

if test -z "$XARGS" -o "$XARGS" = ":"; then
    { echo "configure: error: xargs not found in \$PATH ." 1>&2; exit 1; }
fi

 # Extract the first word of "rpmbuild", so it can be a program name with args.
set dummy rpmbuild; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4854: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RPMBUILD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$RPMBUILD" in
  /*)
  ac_cv_path_RPMBUILD="$RPMBUILD" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_RPMBUILD="$RPMBUILD" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_RPMBUILD="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_RPMBUILD" && ac_cv_path_RPMBUILD=":"
  ;;
esac
fi
RPMBUILD="$ac_cv_path_RPMBUILD"
if test -n "$RPMBUILD"; then
  echo "$ac_t""$RPMBUILD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$RPMBUILD" in
    /*)
      tmp_DIRNAME=`dirname "$RPMBUILD"`
      tmp_BASENAME=`basename "$RPMBUILD"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      RPMBUILD="$tmp_PWD/$tmp_BASENAME"
      if test -e "$RPMBUILD.exe"; then
        RPMBUILD="$RPMBUILD.exe"
      fi
    esac
  fi



if test "$COMPILE_ENVIRONMENT"; then


case "$target_os" in
darwin*)
                    
    GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
    GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
    
    if test "$GCC_VERSION_FULL" = "4.0.0" ; then
                        
        GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
        
        if test "$GCC_BUILD" = "4061" ; then
            { echo "configure: error: You are attempting to use Apple gcc 4.0 build 4061.
This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
from building Mozilla. Upgrade to Xcode 2.1 or later." 1>&2; exit 1; }
        fi
    fi

                  for ac_prog in pbbuild xcodebuild pbxbuild
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4927: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PBBUILD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PBBUILD" in
  /*)
  ac_cv_path_PBBUILD="$PBBUILD" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PBBUILD="$PBBUILD" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PBBUILD="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PBBUILD="$ac_cv_path_PBBUILD"
if test -n "$PBBUILD"; then
  echo "$ac_t""$PBBUILD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$PBBUILD" && break
done

  if test "$msyshost"; then
    case "$PBBUILD" in
    /*)
      tmp_DIRNAME=`dirname "$PBBUILD"`
      tmp_BASENAME=`basename "$PBBUILD"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      PBBUILD="$tmp_PWD/$tmp_BASENAME"
      if test -e "$PBBUILD.exe"; then
        PBBUILD="$PBBUILD.exe"
      fi
    esac
  fi


             # Extract the first word of "sdp", so it can be a program name with args.
set dummy sdp; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4979: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SDP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$SDP" in
  /*)
  ac_cv_path_SDP="$SDP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_SDP="$SDP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH:/usr/bin:/Developer/Tools"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_SDP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_SDP" && ac_cv_path_SDP=":"
  ;;
esac
fi
SDP="$ac_cv_path_SDP"
if test -n "$SDP"; then
  echo "$ac_t""$SDP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$SDP" in
    /*)
      tmp_DIRNAME=`dirname "$SDP"`
      tmp_BASENAME=`basename "$SDP"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      SDP="$tmp_PWD/$tmp_BASENAME"
      if test -e "$SDP.exe"; then
        SDP="$SDP.exe"
      fi
    esac
  fi

    ;;
esac







# Check whether --enable-macos-target or --disable-macos-target was given.
if test "${enable_macos_target+set}" = set; then
  enableval="$enable_macos_target"
  _MACOSX_DEPLOYMENT_TARGET=$enableval
fi


case "$target" in
*-darwin*)
    if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
                export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
    else
                        case "${target_cpu}" in
          i*86)
            export MACOSX_DEPLOYMENT_TARGET=10.5
            ;;
          x86_64)
            export MACOSX_DEPLOYMENT_TARGET=10.6
            ;;
        esac
    fi
    ;;
esac



MACOS_SDK_DIR=
NEXT_ROOT=
# Check whether --with-macos-sdk or --without-macos-sdk was given.
if test "${with_macos_sdk+set}" = set; then
  withval="$with_macos_sdk"
  MACOS_SDK_DIR=$withval
fi





if test "$MACOS_SDK_DIR"; then
      
  if test ! -d "$MACOS_SDK_DIR"; then
    { echo "configure: error: SDK not found.  When using --with-macos-sdk, you must
specify a valid SDK.  SDKs are installed when the optional cross-development
tools are selected during the Xcode/Developer Tools installation." 1>&2; exit 1; }
  fi

  GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
  if test "$GCC_VERSION_MAJOR" -lt "4" ; then
    { echo "configure: error: You need to upgrade the compiler version to 4.x" 1>&2; exit 1; }
  else
    CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
    CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"

        CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
    CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"

    if test "$GCC_VERSION_FULL" = "4.0.0" ; then
                                    LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
    fi
  fi

  
  echo $ac_n "checking for valid compiler/Mac OS X SDK combination""... $ac_c" 1>&6
echo "configure:5097: checking for valid compiler/Mac OS X SDK combination" >&5
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

  cat > conftest.$ac_ext <<EOF
#line 5106 "configure"
#include "confdefs.h"
#include <new>
int main() {

; return 0; }
EOF
if { (eval echo configure:5113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  result=no
fi
rm -f conftest*
  ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  echo "$ac_t""$result" 1>&6

  if test "$result" = "no" ; then
    { echo "configure: error: The selected compiler and Mac OS X SDK are incompatible." 1>&2; exit 1; }
  fi
fi

fi # COMPILE_ENVIRONMENT

echo $ac_n "checking whether the C compiler is clang older than version 2.9""... $ac_c" 1>&6
echo "configure:5140: checking whether the C compiler is clang older than version 2.9" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext <<EOF
#line 5150 "configure"
#include "confdefs.h"

#if defined(__clang__)
# if __clang_major__<2 || (__clang_major__==2 && __clang_minor__<9)
#  error "clang older than 2.9 detected"
# endif
#endif
               
int main() {

; return 0; }
EOF
if { (eval echo configure:5163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  result="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  result="yes"
fi
rm -f conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$result" 1>&6
if test "$result" = "yes"; then
  MOZ_NO_THEORA_ASM=1
fi
echo $ac_n "checking bad gcc versions""... $ac_c" 1>&6
echo "configure:5185: checking bad gcc versions" >&5
if `$CC --version | grep -q "Apple Inc. build 5658"`; then
  echo "$ac_t""Apple build 5658" 1>&6
  MOZ_NO_THEORA_ASM=1
else
  echo "$ac_t""we're ok" 1>&6
fi



if test "x$MOZ_NO_THEORA_ASM" = x1; then
  echo "configure: warning: Disabling libtheora inline assembly" 1>&2
fi

if test -n "$MAKE"; then
  if test `echo $MAKE | grep -c make.py` != 1; then
     NOT_PYMAKE=$MAKE
  fi
fi

case "$host_os" in
mingw*)
      for ac_prog in $GMAKE $NOT_PYMAKE make gmake
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:5212: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$GMAKE" in
  /*)
  ac_cv_path_GMAKE="$GMAKE" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_GMAKE="$GMAKE" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_GMAKE="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
GMAKE="$ac_cv_path_GMAKE"
if test -n "$GMAKE"; then
  echo "$ac_t""$GMAKE" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$GMAKE" && break
done
test -n "$GMAKE" || GMAKE=":"

  if test "$msyshost"; then
    case "$GMAKE" in
    /*)
      tmp_DIRNAME=`dirname "$GMAKE"`
      tmp_BASENAME=`basename "$GMAKE"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      GMAKE="$tmp_PWD/$tmp_BASENAME"
      if test -e "$GMAKE.exe"; then
        GMAKE="$GMAKE.exe"
      fi
    esac
  fi

    ;;
*)
      for ac_prog in $GMAKE $NOT_PYMAKE gmake make
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:5268: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$GMAKE" in
  /*)
  ac_cv_path_GMAKE="$GMAKE" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_GMAKE="$GMAKE" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_GMAKE="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
GMAKE="$ac_cv_path_GMAKE"
if test -n "$GMAKE"; then
  echo "$ac_t""$GMAKE" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$GMAKE" && break
done
test -n "$GMAKE" || GMAKE=":"

  if test "$msyshost"; then
    case "$GMAKE" in
    /*)
      tmp_DIRNAME=`dirname "$GMAKE"`
      tmp_BASENAME=`basename "$GMAKE"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      GMAKE="$tmp_PWD/$tmp_BASENAME"
      if test -e "$GMAKE.exe"; then
        GMAKE="$GMAKE.exe"
      fi
    esac
  fi

    ;;
esac
if test "$GMAKE" = ":"; then
   { echo "configure: error: GNU make not found" 1>&2; exit 1; }
fi


if test -z "$MAKE"; then
  MAKE=$GMAKE
fi

if test "$COMPILE_ENVIRONMENT"; then

# If we find X, set shell vars x_includes and x_libraries to the
# paths, otherwise set no_x=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:5335: checking for X" >&5

# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
  withval="$with_x"
  :
fi

# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
if test "x$with_x" = xno; then
  # The user explicitly disabled X.
  have_x=disabled
else
  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
    # Both variables are already set.
    have_x=yes
  else
if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  # One or both of the vars are not set, and there is no cached value.
ac_x_includes=NO ac_x_libraries=NO
rm -fr conftestdir
if mkdir conftestdir; then
  cd conftestdir
  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
  cat > Imakefile <<'EOF'
acfindx:
	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
EOF
  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
    for ac_extension in a so sl; do
      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
        test -f $ac_im_libdir/libX11.$ac_extension; then
        ac_im_usrlibdir=$ac_im_libdir; break
      fi
    done
    # Screen out bogus values from the imake configuration.  They are
    # bogus both because they are the default anyway, and because
    # using them would break gcc on systems where it needs fixed includes.
    case "$ac_im_incroot" in
	/usr/include) ;;
	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
    esac
    case "$ac_im_usrlibdir" in
	/usr/lib | /lib) ;;
	*) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
    esac
  fi
  cd ..
  rm -fr conftestdir
fi

if test "$ac_x_includes" = NO; then
  # Guess where to find include files, by looking for this one X11 .h file.
  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h

  # First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
#line 5397 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  # We can compile using X headers with no special include directory.
ac_x_includes=
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  # Look for the header file in a standard set of common directories.
# Check X11 before X11Rn because it is often a symlink to the current release.
  for ac_dir in               \
    /usr/X11/include          \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
                              \
    /usr/include/X11          \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11/include    \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11    \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include/X11  \
                              \
    /usr/include              \
    /usr/local/include        \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
                              \
    /usr/openwin/include      \
    /usr/openwin/share/include \
    ; \
  do
    if test -r "$ac_dir/$x_direct_test_include"; then
      ac_x_includes=$ac_dir
      break
    fi
  done
fi
rm -f conftest*
fi # $ac_x_includes = NO

if test "$ac_x_libraries" = NO; then
  # Check for the libraries.

  test -z "$x_direct_test_library" && x_direct_test_library=Xt
  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc

  # See if we find them without any special options.
  # Don't add to $LIBS permanently.
  ac_save_LIBS="$LIBS"
  LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5471 "configure"
#include "confdefs.h"

int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:5478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
ac_x_libraries=
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="$ac_save_LIBS"
# First see if replacing the include by lib works.
# Check X11 before X11Rn because it is often a symlink to the current release.
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
    /usr/X11/lib          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11/lib    \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11    \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    /lib/usr/lib/X11	  \
                          \
    /usr/openwin/lib      \
    /usr/openwin/share/lib \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
      ac_x_libraries=$ac_dir
      break 2
    fi
  done
done
fi
rm -f conftest*
fi # $ac_x_libraries = NO

if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
  # Didn't find X anywhere.  Cache the known absence of X.
  ac_cv_have_x="have_x=no"
else
  # Record where we found X for the cache.
  ac_cv_have_x="have_x=yes \
	        ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
fi
fi
  fi
  eval "$ac_cv_have_x"
fi # $with_x != no

if test "$have_x" != yes; then
  echo "$ac_t""$have_x" 1>&6
  no_x=yes
else
  # If each of the values was on the command line, it overrides each guess.
  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
  # Update the cache value to reflect the command line values.
  ac_cv_have_x="have_x=yes \
		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
fi

if test "$no_x" = yes; then
  # Not all programs may use this symbol, but it does not hurt to define it.
  cat >> confdefs.h <<\EOF
#define X_DISPLAY_MISSING 1
EOF

  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
else
  if test -n "$x_includes"; then
    X_CFLAGS="$X_CFLAGS -I$x_includes"
  fi

  # It would also be nice to do this for all -L options, not just this one.
  if test -n "$x_libraries"; then
    X_LIBS="$X_LIBS -L$x_libraries"
    # For Solaris; some versions of Sun CC require a space after -R and
    # others require no space.  Words are not sufficient . . . .
    case "`(uname -sr) 2>/dev/null`" in
    "SunOS 5"*)
      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
echo "configure:5584: checking whether -R must be followed by a space" >&5
      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
      cat > conftest.$ac_ext <<EOF
#line 5587 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:5594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_R_nospace=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_R_nospace=no
fi
rm -f conftest*
      if test $ac_R_nospace = yes; then
	echo "$ac_t""no" 1>&6
	X_LIBS="$X_LIBS -R$x_libraries"
      else
	LIBS="$ac_xsave_LIBS -R $x_libraries"
	cat > conftest.$ac_ext <<EOF
#line 5610 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:5617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_R_space=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_R_space=no
fi
rm -f conftest*
	if test $ac_R_space = yes; then
	  echo "$ac_t""yes" 1>&6
	  X_LIBS="$X_LIBS -R $x_libraries"
	else
	  echo "$ac_t""neither works" 1>&6
	fi
      fi
      LIBS="$ac_xsave_LIBS"
    esac
  fi

  # Check for system-dependent libraries X programs must link with.
  # Do this before checking for the system-independent R6 libraries
  # (-lICE), since we may need -lsocket or whatever for X linking.

  if test "$ISC" = yes; then
    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
  else
    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
    # libraries were built with DECnet support.  And karl@cs.umb.edu says
    # the Alpha needs dnet_stub (dnet does not exist).
    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
echo "configure:5649: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldnet  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5657 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dnet_ntoa();

int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:5668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
echo "configure:5690: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5698 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dnet_ntoa();

int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:5709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
    # to get the SysV transport functions.
    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
    # needs -lnsl.
    # The nsl library prevents programs from opening the X display
    # on Irix 5.2, according to dickey@clark.net.
    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:5738: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5743 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gethostbyname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyname();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
choke me
#else
gethostbyname();
#endif

; return 0; }
EOF
if { (eval echo configure:5766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_gethostbyname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_gethostbyname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_gethostbyname = no; then
      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:5787: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5795 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyname();

int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:5806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # lieder@skyler.mavd.honeywell.com says without -lsocket,
    # socket/setsockopt and other routines are undefined under SCO ODT
    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
    # on later versions), says simon@lia.di.epfl.ch: it contains
    # gethostby* variants that don't use the nameserver (or something).
    # -lsocket must be given before -lnsl if both are needed.
    # We assume that if connect needs -lnsl, so does gethostbyname.
    echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:5836: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5841 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char connect(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char connect();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_connect) || defined (__stub___connect)
choke me
#else
connect();
#endif

; return 0; }
EOF
if { (eval echo configure:5864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_connect=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_connect=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_connect = no; then
      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:5885: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5893 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char connect();

int main() {
connect()
; return 0; }
EOF
if { (eval echo configure:5904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
    echo $ac_n "checking for remove""... $ac_c" 1>&6
echo "configure:5928: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5933 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char remove(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char remove();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_remove) || defined (__stub___remove)
choke me
#else
remove();
#endif

; return 0; }
EOF
if { (eval echo configure:5956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_remove=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_remove=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_remove = no; then
      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
echo "configure:5977: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lposix  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5985 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char remove();

int main() {
remove()
; return 0; }
EOF
if { (eval echo configure:5996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
    echo $ac_n "checking for shmat""... $ac_c" 1>&6
echo "configure:6020: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6025 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char shmat(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shmat();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_shmat) || defined (__stub___shmat)
choke me
#else
shmat();
#endif

; return 0; }
EOF
if { (eval echo configure:6048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_shmat=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_shmat=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_shmat = no; then
      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
echo "configure:6069: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lipc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6077 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shmat();

int main() {
shmat()
; return 0; }
EOF
if { (eval echo configure:6088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
else
  echo "$ac_t""no" 1>&6
fi

    fi
  fi

  # Check for libraries that X11R6 Xt/Xaw programs need.
  ac_save_LDFLAGS="$LDFLAGS"
  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  # check for ICE first), but we must link in the order -lSM -lICE or
  # we get undefined symbols.  So assume we have SM if we have ICE.
  # These have to be linked with before -lX11, unlike the other
  # libraries we check for below, so use a different variable.
  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
echo "configure:6121: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6129 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char IceConnectionNumber();

int main() {
IceConnectionNumber()
; return 0; }
EOF
if { (eval echo configure:6140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
else
  echo "$ac_t""no" 1>&6
fi

  LDFLAGS="$ac_save_LDFLAGS"

fi


XCFLAGS="$X_CFLAGS"

fi # COMPILE_ENVIRONMENT

AS_BIN=$AS
AR_LIST='$(AR) t'
AR_EXTRACT='$(AR) x'
AR_DELETE='$(AR) d'
AS='$(CC)'
AS_DASH_C_FLAG='-c'
DLL_PREFIX=lib
LIB_PREFIX=lib
DLL_SUFFIX=.so
OBJ_SUFFIX=o
LIB_SUFFIX=a
ASM_SUFFIX=s
IMPORT_LIB_SUFFIX=
TARGET_MD_ARCH=unix
DIRENT_INO=d_ino
WIN_TOP_SRC=
MOZ_USER_DIR=".mozilla"

MOZ_JPEG_CFLAGS=
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)'
MOZ_ZLIB_CFLAGS=
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
MOZ_BZ2_CFLAGS=
MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
MOZ_PNG_CFLAGS=
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'

MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core -lmozalloc'
MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom -lmozalloc'
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'

# These are specially defined on Windows only
case "$target" in
*-mingw*)
  XPCOM_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
  XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime.$(LIB_SUFFIX)'
  ;;
*)
  XPCOM_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_GLUE_LDOPTS
  XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_STANDALONE_GLUE_LDOPTS
  ;;
esac

MOZ_FS_LAYOUT=unix

MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'

USE_DEPENDENT_LIBS=1

_PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2

if test -n "$CROSS_COMPILE"; then
    OS_TARGET="${target_os}"
    OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
    OS_RELEASE=
    case "${target_os}" in
        linux*)       OS_ARCH=Linux OS_TARGET=Linux ;;
        kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
        gnu*)         OS_ARCH=GNU ;;
        solaris*)     OS_ARCH=SunOS OS_RELEASE=5 ;;
        mingw*)       OS_ARCH=WINNT OS_TARGET=WINNT ;;
        darwin*)      OS_ARCH=Darwin OS_TARGET=Darwin ;;
    esac
    case "${target}" in
        *-android*|*-linuxandroid*) OS_ARCH=Linux OS_TARGET=Android ;;
    esac
else
    OS_TARGET=`uname -s`
    OS_ARCH=`uname -s | sed -e 's|/|_|g'`
    OS_RELEASE=`uname -r`
fi

# Before this used `uname -m` when not cross compiling
# but that breaks when you have a 64 bit kernel with a 32 bit userland.
OS_TEST="${target_cpu}"

HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`

#######################################################################
# Master "Core Components" macros for getting the OS target           #
#######################################################################

#
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
# cross-compilation.
#

#
# Define and override various archtecture-specific variables, including
# HOST_OS_ARCH
# OS_ARCH
# OS_TEST
# OS_TARGET
# OS_RELEASE
# OS_MINOR_RELEASE
#

case "$HOST_OS_ARCH" in
mingw*)
    HOST_OS_ARCH=WINNT
    ;;
darwin*)
    HOST_OS_ARCH=Darwin
    ;;
linux*)
    HOST_OS_ARCH=Linux
    ;;
solaris*)
    HOST_OS_ARCH=SunOS
    SOLARIS_SUNPRO_CC=
    SOLARIS_SUNPRO_CXX=
    if test -z "$GNU_CC"; then
        if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
            SOLARIS_SUNPRO_CC=1
       fi
    fi

    if test -z "$GNU_CXX"; then
       if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
           SOLARIS_SUNPRO_CXX=1
       fi
    fi
    
    
    ;;
BSD_386)
    HOST_OS_ARCH=BSD
    ;;
OS_2)
    HOST_OS_ARCH=OS2
    ;;
esac

case "$OS_ARCH" in
WINNT)
    if test -z "$CROSS_COMPILE" ; then
        OS_TEST=`uname -p`
    fi
    ;;
Windows_NT)
#
# If uname -s returns "Windows_NT", we assume that we are using
# the uname.exe in MKS toolkit.
#
# The -r option of MKS uname only returns the major version number.
# So we need to use its -v option to get the minor version number.
# Moreover, it doesn't have the -p option, so we need to use uname -m.
#
    OS_ARCH=WINNT
    OS_TARGET=WINNT
    OS_MINOR_RELEASE=`uname -v`
    if test "$OS_MINOR_RELEASE" = "00"; then
        OS_MINOR_RELEASE=0
    fi
    OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
    ;;
MINGW*_NT*)
#
# If uname -s returns MINGW32_NT-5.1, we assume that we are using
# the uname.exe in the MSYS tools.
#
    OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
    OS_ARCH=WINNT
    OS_TARGET=WINNT
    ;;
AIX)
    OS_RELEASE=`uname -v`.`uname -r`
    OS_TEST=${target_cpu}
    ;;
BSD_386)
    OS_ARCH=BSD
    ;;
OS_2)
    OS_ARCH=OS2
    OS_TARGET=OS2
    OS_RELEASE=`uname -v`
    ;;
Darwin)
    case "${target_cpu}" in
    powerpc*)
        OS_TEST=ppc
        ;;
    i*86*)
        OS_TEST=i386
        ;;
    x86_64)
        OS_TEST=x86_64
        ;;
    *)
        if test -z "$CROSS_COMPILE" ; then
            OS_TEST=`uname -p`
        fi
        ;;
    esac
    ;;
esac

# Only set CPU_ARCH if we recognize the value of OS_TEST

case "$OS_TEST" in
*86 | i86pc)
    CPU_ARCH=x86
    ;;

powerpc64 | ppc64)
    CPU_ARCH=ppc64
    ;;

powerpc | ppc | rs6000)
    CPU_ARCH=ppc
    ;;

Alpha | alpha | ALPHA)
    CPU_ARCH=Alpha
    ;;

s390)
    CPU_ARCH=s390
    ;;

s390x)
    CPU_ARCH=s390x
    ;;

hppa* | parisc)
    CPU_ARCH=hppa
    ;;

sun4u | sparc*)
    CPU_ARCH=sparc
    ;;

x86_64 | ia64)
    CPU_ARCH="$OS_TEST"
    ;;

arm*)
    CPU_ARCH=arm
    ;;

mips|mipsel)
    CPU_ARCH="mips"
    ;;
esac

if test -z "$OS_TARGET"; then
    OS_TARGET=$OS_ARCH
fi
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"

INTEL_ARCHITECTURE=
case "$OS_TEST" in
    x86_64|i?86)
      INTEL_ARCHITECTURE=1
esac




MOZ_THUMB=toolchain-default
MOZ_THUMB_INTERWORK=toolchain-default
MOZ_FPU=toolchain-default
MOZ_FLOAT_ABI=toolchain-default
MOZ_SOFT_FLOAT=toolchain-default

# Check whether --with-arch or --without-arch was given.
if test "${with_arch+set}" = set; then
  withval="$with_arch"
  if test -z "$GNU_CC"; then
        { echo "configure: error: --with-arch is not supported on non-GNU toolchains" 1>&2; exit 1; }
    fi
    MOZ_ARCH=$withval
fi


if test -z "$MOZ_ARCH"; then
        case "${CPU_ARCH}-${OS_TARGET}" in
    arm-Android)
        MOZ_THUMB=yes
        MOZ_ARCH=armv7-a
        MOZ_FPU=vfp
        MOZ_FLOAT_ABI=softfp
        ;;
    arm-Darwin)
        MOZ_ARCH=toolchain-default
        MOZ_THUMB=yes
        ;;
    arm-*)
        if test -n "$MOZ_PLATFORM_MAEMO"; then
            MOZ_THUMB=no
            MOZ_ARCH=armv7-a
            MOZ_FLOAT_ABI=softfp
        fi
        if test "$MOZ_PLATFORM_MAEMO" = 6; then
            MOZ_THUMB=yes
        fi
        ;;
    esac
fi

# Check whether --with-thumb or --without-thumb was given.
if test "${with_thumb+set}" = set; then
  withval="$with_thumb"
  if test -z "$GNU_CC"; then
        { echo "configure: error: --with-thumb is not supported on non-GNU toolchains" 1>&2; exit 1; }
    fi
    MOZ_THUMB=$withval
fi


# Check whether --with-thumb-interwork or --without-thumb-interwork was given.
if test "${with_thumb_interwork+set}" = set; then
  withval="$with_thumb_interwork"
  if test -z "$GNU_CC"; then
        { echo "configure: error: --with-thumb-interwork is not supported on non-GNU toolchains" 1>&2; exit 1; }
    fi
    MOZ_THUMB_INTERWORK=$withval
fi


# Check whether --with-fpu or --without-fpu was given.
if test "${with_fpu+set}" = set; then
  withval="$with_fpu"
  if test -z "$GNU_CC"; then
        { echo "configure: error: --with-fpu is not supported on non-GNU toolchains" 1>&2; exit 1; }
    fi
    MOZ_FPU=$withval
fi


# Check whether --with-float-abi or --without-float-abi was given.
if test "${with_float_abi+set}" = set; then
  withval="$with_float_abi"
  if test -z "$GNU_CC"; then
        { echo "configure: error: --with-float-abi is not supported on non-GNU toolchains" 1>&2; exit 1; }
    fi
    MOZ_FLOAT_ABI=$withval
fi


# Check whether --with-soft-float or --without-soft-float was given.
if test "${with_soft_float+set}" = set; then
  withval="$with_soft_float"
  if test -z "$GNU_CC"; then
        { echo "configure: error: --with-soft-float is not supported on non-GNU toolchains" 1>&2; exit 1; }
    fi
    MOZ_SOFT_FLOAT=$withval
fi


case "$MOZ_ARCH" in
toolchain-default|"")
    arch_flag=""
    ;;
*)
    arch_flag="-march=$MOZ_ARCH"
    ;;
esac

case "$MOZ_THUMB" in
yes)
    MOZ_THUMB2=1
    thumb_flag="-mthumb"
    ;;
no)
    MOZ_THUMB2=
    thumb_flag="-marm"
    ;;
*)
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$arch_flag"
    cat > conftest.$ac_ext <<EOF
#line 6546 "configure"
#include "confdefs.h"

int main() {
return sizeof(__thumb2__);
; return 0; }
EOF
if { (eval echo configure:6553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  MOZ_THUMB2=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  MOZ_THUMB2=
fi
rm -f conftest*
    CFLAGS="$_SAVE_CFLAGS"
    thumb_flag=""
    ;;
esac

if test "$MOZ_THUMB2" = 1; then
    cat >> confdefs.h <<\EOF
#define MOZ_THUMB2 1
EOF

fi

case "$MOZ_THUMB_INTERWORK" in
yes)
    thumb_interwork_flag="-mthumb-interwork"
    ;;
no)
    thumb_interwork_flag="-mno-thumb-interwork"
    ;;
*) # toolchain-default
    thumb_interwork_flag=""
    ;;
esac

case "$MOZ_FPU" in
toolchain-default|"")
    fpu_flag=""
    ;;
*)
    fpu_flag="-mfpu=$MOZ_FPU"
    ;;
esac

case "$MOZ_FLOAT_ABI" in
toolchain-default|"")
    float_abi_flag=""
    ;;
*)
    float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
    ;;
esac

case "$MOZ_SOFT_FLOAT" in
yes)
    soft_float_flag="-msoft-float"
    ;;
no)
    soft_float_flag="-mno-soft-float"
    ;;
*) # toolchain-default
    soft_float_flag=""
    ;;
esac

all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
if test -n "$all_flags"; then
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$all_flags"
    echo $ac_n "checking whether the chosen combination of compiler flags ($all_flags) works""... $ac_c" 1>&6
echo "configure:6622: checking whether the chosen combination of compiler flags ($all_flags) works" >&5
    cat > conftest.$ac_ext <<EOF
#line 6624 "configure"
#include "confdefs.h"

int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:6631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: no" 1>&2; exit 1; }
fi
rm -f conftest*

    CFLAGS="$_SAVE_CFLAGS $all_flags"
    CXXFLAGS="$CXXFLAGS $all_flags"
    ASFLAGS="$ASFLAGS $all_flags"
    if test -n "$thumb_flag"; then
        LDFLAGS="$LDFLAGS $thumb_flag"
    fi
fi



if test "$CPU_ARCH" = "arm"; then
  echo $ac_n "checking for ARM SIMD support in compiler""... $ac_c" 1>&6
echo "configure:6654: checking for ARM SIMD support in compiler" >&5
  # We try to link so that this also fails when
  # building with LTO.
  cat > conftest.$ac_ext <<EOF
#line 6658 "configure"
#include "confdefs.h"

int main() {
asm("uqadd8 r1, r1, r2");
; return 0; }
EOF
if { (eval echo configure:6665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  result="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  result="no"
fi
rm -f conftest*
  echo "$ac_t"""$result"" 1>&6
  if test "$result" = "yes"; then
      cat >> confdefs.h <<\EOF
#define HAVE_ARM_SIMD 1
EOF

      HAVE_ARM_SIMD=1
  fi

  echo $ac_n "checking for ARM NEON support in compiler""... $ac_c" 1>&6
echo "configure:6685: checking for ARM NEON support in compiler" >&5
  # We try to link so that this also fails when
  # building with LTO.
  cat > conftest.$ac_ext <<EOF
#line 6689 "configure"
#include "confdefs.h"

int main() {
asm(".fpu neon\n vadd.i8 d0, d0, d0");
; return 0; }
EOF
if { (eval echo configure:6696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  result="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  result="no"
fi
rm -f conftest*
  echo "$ac_t"""$result"" 1>&6
  if test "$result" = "yes"; then
      cat >> confdefs.h <<\EOF
#define HAVE_ARM_NEON 1
EOF

      HAVE_ARM_NEON=1
  fi
fi # CPU_ARCH = arm




if test -n "$MOZ_ARCH"; then
  NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-arch=$MOZ_ARCH"
  NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-thumb=$MOZ_THUMB"
  NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-thumb-interwork=$MOZ_THUMB_INTERWORK"
  NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-fpu=$MOZ_FPU"
  NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-float-abi=$MOZ_FLOAT_ABI"
  NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-soft-float=$MOZ_SOFT_FLOAT"
fi



if test "$COMPILE_ENVIRONMENT"; then
configure_static_assert_macros='
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
'

echo $ac_n "checking that static assertion macros used in autoconf tests work""... $ac_c" 1>&6
echo "configure:6738: checking that static assertion macros used in autoconf tests work" >&5
if eval "test \"`echo '$''{'ac_cv_static_assertion_macros_work'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  ac_cv_static_assertion_macros_work="yes"
  cat > conftest.$ac_ext <<EOF
#line 6752 "configure"
#include "confdefs.h"
$configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(1)
; return 0; }
EOF
if { (eval echo configure:6759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_static_assertion_macros_work="no"
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 6769 "configure"
#include "confdefs.h"
$configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(0)
; return 0; }
EOF
if { (eval echo configure:6776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_static_assertion_macros_work="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

  cat > conftest.$ac_ext <<EOF
#line 6792 "configure"
#include "confdefs.h"
$configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(1)
; return 0; }
EOF
if { (eval echo configure:6799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_static_assertion_macros_work="no"
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 6809 "configure"
#include "confdefs.h"
$configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(0)
; return 0; }
EOF
if { (eval echo configure:6816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_static_assertion_macros_work="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
  ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

 
fi

echo "$ac_t"""$ac_cv_static_assertion_macros_work"" 1>&6
if test "$ac_cv_static_assertion_macros_work" = "no"; then
    { echo "configure: error: Compiler cannot compile macros used in autoconf tests." 1>&2; exit 1; }
fi
fi # COMPILE_ENVIRONMENT


if test "$OS_TARGET" = "Android"; then
    case "${CPU_ARCH}-${MOZ_ARCH}" in
    arm-armv7*)
      ANDROID_CPU_ARCH=armeabi-v7a
      ;;
    arm-*)
      ANDROID_CPU_ARCH=armeabi
      ;;
    x86-*)
      ANDROID_CPU_ARCH=x86
      ;;
    mips-*) # When target_cpu is mipsel, CPU_ARCH is mips
      ANDROID_CPU_ARCH=mips
      ;;
    esac
fi

if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
    if test -e "$android_ndk/sources/cxx-stl/stlport/src/iostream.cpp" ; then
       if test -e "$android_ndk/sources/cxx-stl/stlport/libs/$ANDROID_CPU_ARCH/libstlport_static.a"; then
          STLPORT_LDFLAGS="-L$_objdir/build/stlport -L$android_ndk/sources/cxx-stl/stlport/libs/$ANDROID_CPU_ARCH/"
       elif test -e "$android_ndk/tmp/ndk-digit/build/install/sources/cxx-stl/stlport/libs/$ANDROID_CPU_ARCH/libstlport_static.a"; then
          STLPORT_LDFLAGS="-L$_objdir/build/stlport -L$android_ndk/tmp/ndk-digit/build/install/sources/cxx-stl/stlport/libs/$ANDROID_CPU_ARCH/"
       else
          { echo "configure: error: Couldn't find path to stlport in the android ndk" 1>&2; exit 1; }
       fi
       STLPORT_SOURCES="$android_ndk/sources/cxx-stl/stlport"
       STLPORT_CPPFLAGS="-I$_objdir/build/stlport -I$android_ndk/sources/cxx-stl/stlport/stlport"
       STLPORT_LIBS="-lstlport_static"
    elif test "$target" != "arm-android-eabi"; then
              { echo "configure: error: Couldn't find path to stlport in the android ndk" 1>&2; exit 1; }
    fi
    CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS"
    LDFLAGS="$LDFLAGS $STLPORT_LDFLAGS"
    LIBS="$LIBS $STLPORT_LIBS"
fi



if test -n "$CLANG_CC"; then
    _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
    CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
fi
if test -n "$CLANG_CXX"; then
    _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
fi

# Check whether --enable-address-sanitizer or --disable-address-sanitizer was given.
if test "${enable_address_sanitizer+set}" = set; then
  enableval="$enable_address_sanitizer"
  if test "$enableval" = "yes"; then
    MOZ_ASAN=1
  elif test "$enableval" = "no"; then
    MOZ_ASAN= 
  else
    { echo "configure: error: Option, address-sanitizer, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_ASAN"; then
    MOZ_LLVM_HACKS=1
    cat >> confdefs.h <<\EOF
#define MOZ_ASAN 1
EOF

fi


# Check whether --enable-llvm-hacks or --disable-llvm-hacks was given.
if test "${enable_llvm_hacks+set}" = set; then
  enableval="$enable_llvm_hacks"
  if test "$enableval" = "yes"; then
    MOZ_LLVM_HACKS=1
  elif test "$enableval" = "no"; then
    MOZ_LLVM_HACKS= 
  else
    { echo "configure: error: Option, llvm-hacks, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_LLVM_HACKS"; then
    MOZ_NO_WLZDEFS=1
    MOZ_CFLAGS_NSS=1
fi



if test "$GNU_CC"; then
    # FIXME: Let us build with strict aliasing. bug 414641.
    CFLAGS="$CFLAGS -fno-strict-aliasing"
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
    DSO_LDOPTS='-shared'
    if test "$GCC_USE_GNU_LD"; then
        # Some tools like ASan use a runtime library that is only
        # linked against executables, so we must allow undefined
        # symbols for shared objects in some cases.
        if test -z "$MOZ_NO_WLZDEFS"; then
            # Don't allow undefined symbols in libraries
            DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
        fi
    fi
    WARNINGS_AS_ERRORS='-Werror -Wno-error=uninitialized'
    DSO_CFLAGS=''
    DSO_PIC_CFLAGS='-fPIC'
    ASFLAGS="$ASFLAGS -fPIC"
    echo $ac_n "checking for --noexecstack option to as""... $ac_c" 1>&6
echo "configure:6948: checking for --noexecstack option to as" >&5
    _SAVE_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS -Wa,--noexecstack"
    cat > conftest.$ac_ext <<EOF
#line 6952 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:6959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
                     ASFLAGS="$ASFLAGS -Wa,--noexecstack"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    CFLAGS=$_SAVE_CFLAGS
    echo $ac_n "checking for -z noexecstack option to ld""... $ac_c" 1>&6
echo "configure:6972: checking for -z noexecstack option to ld" >&5
    _SAVE_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
    cat > conftest.$ac_ext <<EOF
#line 6976 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:6983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
                  LDFLAGS=$_SAVE_LDFLAGS
fi
rm -f conftest*
    _MOZ_RTTI_FLAGS_ON=-frtti
    _MOZ_RTTI_FLAGS_OFF=-fno-rtti

    # Check for -mssse3 on $CC
    echo $ac_n "checking for -mssse3 option to $CC""... $ac_c" 1>&6
echo "configure:6999: checking for -mssse3 option to $CC" >&5
    HAVE_COMPILER_FLAG_MSSSE3=
    _SAVE_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS -mssse3"
    cat > conftest.$ac_ext <<EOF
#line 7004 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:7011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
                     HAVE_COMPILER_FLAG_MSSSE3=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    CFLAGS=$_SAVE_CFLAGS
    

    # Turn on GNU-specific warnings:
    # -Wall - turn on a lot of warnings
    # -pedantic - this is turned on below
    # -Wpointer-arith - enabled with -pedantic, but good to have even if not
    # -Wdeclaration-after-statement - MSVC doesn't like these
    # -Werror=return-type - catches missing returns, zero false positives
    # -Wtype-limits - catches overflow bugs, few false positives
    # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
    #
    _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
    
    echo $ac_n "checking whether the C compiler supports -Werror=return-type""... $ac_c" 1>&6
echo "configure:7037: checking whether the C compiler supports -Werror=return-type" >&5
if eval "test \"`echo '$''{'ac_c_has_werror_return_type'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

            _SAVE_CFLAGS="$CFLAGS"
            CFLAGS="$CFLAGS -Werror -Werror=return-type"
            cat > conftest.$ac_ext <<EOF
#line 7053 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_c_has_werror_return_type="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_c_has_werror_return_type="no"
fi
rm -f conftest*
            CFLAGS="$_SAVE_CFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_c_has_werror_return_type" 1>&6
    if test "${ac_c_has_werror_return_type}" = "yes"; then
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=return-type"
    fi

    
    echo $ac_n "checking whether the C compiler supports -Wtype-limits""... $ac_c" 1>&6
echo "configure:7088: checking whether the C compiler supports -Wtype-limits" >&5
if eval "test \"`echo '$''{'ac_c_has_wtype_limits'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

            _SAVE_CFLAGS="$CFLAGS"
            CFLAGS="$CFLAGS -Werror -Wtype-limits"
            cat > conftest.$ac_ext <<EOF
#line 7104 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_c_has_wtype_limits="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_c_has_wtype_limits="no"
fi
rm -f conftest*
            CFLAGS="$_SAVE_CFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_c_has_wtype_limits" 1>&6
    if test "${ac_c_has_wtype_limits}" = "yes"; then
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
    fi

    
    echo $ac_n "checking whether the C compiler supports -Wempty-body""... $ac_c" 1>&6
echo "configure:7139: checking whether the C compiler supports -Wempty-body" >&5
if eval "test \"`echo '$''{'ac_c_has_wempty_body'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

            _SAVE_CFLAGS="$CFLAGS"
            CFLAGS="$CFLAGS -Werror -Wempty-body"
            cat > conftest.$ac_ext <<EOF
#line 7155 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_c_has_wempty_body="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_c_has_wempty_body="no"
fi
rm -f conftest*
            CFLAGS="$_SAVE_CFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_c_has_wempty_body" 1>&6
    if test "${ac_c_has_wempty_body}" = "yes"; then
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wempty-body"
    fi

    
    # Turn off the following warnings that -Wall/-pedantic turn on:
    # -Wno-unused - lots of violations in third-party code
    # -Wno-overlength-strings - we exceed the minimum maximum length frequently
    #
    _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused"
    
    echo $ac_n "checking whether the C compiler supports -Wno-overlength-strings""... $ac_c" 1>&6
echo "configure:7196: checking whether the C compiler supports -Wno-overlength-strings" >&5
if eval "test \"`echo '$''{'ac_c_has_wno_overlength_strings'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

            _SAVE_CFLAGS="$CFLAGS"
            CFLAGS="$CFLAGS -Werror -Woverlength-strings"
            cat > conftest.$ac_ext <<EOF
#line 7212 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_c_has_wno_overlength_strings="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_c_has_wno_overlength_strings="no"
fi
rm -f conftest*
            CFLAGS="$_SAVE_CFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_c_has_wno_overlength_strings" 1>&6
    if test "${ac_c_has_wno_overlength_strings}" = "yes"; then
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-overlength-strings"
    fi


    if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then
       # Don't use -Wcast-align with ICC or clang
       case "$CPU_ARCH" in
           # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
           hppa | ia64 | sparc | arm)
           ;;
           *)
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
           ;;
       esac
    fi

        _PEDANTIC=1

    _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
    _USE_CPP_INCLUDE_FLAG=1

elif test "$SOLARIS_SUNPRO_CC"; then
    DSO_CFLAGS=''
    if test "$CPU_ARCH" = "sparc"; then
        # for Sun Studio on Solaris/SPARC
        DSO_PIC_CFLAGS='-xcode=pic32'
    else
        DSO_PIC_CFLAGS='-KPIC'
    fi
    _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else
    MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
    MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'

    DSO_LDOPTS='-shared'
    if test "$GNU_LD"; then
        # Don't allow undefined symbols in libraries
        DSO_LDOPTS="$DSO_LDOPTS -z defs"
    fi

    DSO_CFLAGS=''
    DSO_PIC_CFLAGS='-KPIC'
    _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
fi

if test "$GNU_CXX"; then
    # FIXME: Let us build with strict aliasing. bug 414641.
    CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"

    # Turn on GNU-specific warnings:
    # -Wall - turn on a lot of warnings
    # -pedantic - this is turned on below
    # -Wpointer-arith - enabled with -pedantic, but good to have even if not
    # -Woverloaded-virtual - ???
    # -Werror=return-type - catches missing returns, zero false positives
    # -Wtype-limits - catches overflow bugs, few false positives
    # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
    #
    _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
    
    echo $ac_n "checking whether the C++ compiler supports -Werror=return-type""... $ac_c" 1>&6
echo "configure:7303: checking whether the C++ compiler supports -Werror=return-type" >&5
if eval "test \"`echo '$''{'ac_cxx_has_werror_return_type'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            _SAVE_CXXFLAGS="$CXXFLAGS"
            CXXFLAGS="$CXXFLAGS -Werror -Werror=return-type"
            cat > conftest.$ac_ext <<EOF
#line 7319 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cxx_has_werror_return_type="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cxx_has_werror_return_type="no"
fi
rm -f conftest*
            CXXFLAGS="$_SAVE_CXXFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_cxx_has_werror_return_type" 1>&6
    if test "${ac_cxx_has_werror_return_type}" = "yes"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type"
    fi

    
    echo $ac_n "checking whether the C++ compiler supports -Wtype-limits""... $ac_c" 1>&6
echo "configure:7354: checking whether the C++ compiler supports -Wtype-limits" >&5
if eval "test \"`echo '$''{'ac_cxx_has_wtype_limits'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            _SAVE_CXXFLAGS="$CXXFLAGS"
            CXXFLAGS="$CXXFLAGS -Werror -Wtype-limits"
            cat > conftest.$ac_ext <<EOF
#line 7370 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cxx_has_wtype_limits="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cxx_has_wtype_limits="no"
fi
rm -f conftest*
            CXXFLAGS="$_SAVE_CXXFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_cxx_has_wtype_limits" 1>&6
    if test "${ac_cxx_has_wtype_limits}" = "yes"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wtype-limits"
    fi

    
    echo $ac_n "checking whether the C++ compiler supports -Wempty-body""... $ac_c" 1>&6
echo "configure:7405: checking whether the C++ compiler supports -Wempty-body" >&5
if eval "test \"`echo '$''{'ac_cxx_has_wempty_body'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            _SAVE_CXXFLAGS="$CXXFLAGS"
            CXXFLAGS="$CXXFLAGS -Werror -Wempty-body"
            cat > conftest.$ac_ext <<EOF
#line 7421 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cxx_has_wempty_body="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cxx_has_wempty_body="no"
fi
rm -f conftest*
            CXXFLAGS="$_SAVE_CXXFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_cxx_has_wempty_body" 1>&6
    if test "${ac_cxx_has_wempty_body}" = "yes"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wempty-body"
    fi


    # Turn off the following warnings that -Wall/-pedantic turn on:
    # -Wno-ctor-dtor-privacy - ???
    # -Wno-overlength-strings - we exceed the minimum maximum length frequently 
    # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently
    # -Wno-variadic-macros - ???
    #
    _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-ctor-dtor-privacy"
    
    echo $ac_n "checking whether the C++ compiler supports -Wno-overlength-strings""... $ac_c" 1>&6
echo "configure:7464: checking whether the C++ compiler supports -Wno-overlength-strings" >&5
if eval "test \"`echo '$''{'ac_cxx_has_wno_overlength_strings'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            _SAVE_CXXFLAGS="$CXXFLAGS"
            CXXFLAGS="$CXXFLAGS -Werror -Woverlength-strings"
            cat > conftest.$ac_ext <<EOF
#line 7480 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cxx_has_wno_overlength_strings="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cxx_has_wno_overlength_strings="no"
fi
rm -f conftest*
            CXXFLAGS="$_SAVE_CXXFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_cxx_has_wno_overlength_strings" 1>&6
    if test "${ac_cxx_has_wno_overlength_strings}" = "yes"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-overlength-strings"
    fi

    
    echo $ac_n "checking whether the C++ compiler supports -Wno-invalid-offsetof""... $ac_c" 1>&6
echo "configure:7515: checking whether the C++ compiler supports -Wno-invalid-offsetof" >&5
if eval "test \"`echo '$''{'ac_cxx_has_wno_invalid_offsetof'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            _SAVE_CXXFLAGS="$CXXFLAGS"
            CXXFLAGS="$CXXFLAGS -Werror -Winvalid-offsetof"
            cat > conftest.$ac_ext <<EOF
#line 7531 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cxx_has_wno_invalid_offsetof="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cxx_has_wno_invalid_offsetof="no"
fi
rm -f conftest*
            CXXFLAGS="$_SAVE_CXXFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_cxx_has_wno_invalid_offsetof" 1>&6
    if test "${ac_cxx_has_wno_invalid_offsetof}" = "yes"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof"
    fi

    
    echo $ac_n "checking whether the C++ compiler supports -Wno-variadic-macros""... $ac_c" 1>&6
echo "configure:7566: checking whether the C++ compiler supports -Wno-variadic-macros" >&5
if eval "test \"`echo '$''{'ac_cxx_has_wno_variadic_macros'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            _SAVE_CXXFLAGS="$CXXFLAGS"
            CXXFLAGS="$CXXFLAGS -Werror -Wvariadic-macros"
            cat > conftest.$ac_ext <<EOF
#line 7582 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cxx_has_wno_variadic_macros="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cxx_has_wno_variadic_macros="no"
fi
rm -f conftest*
            CXXFLAGS="$_SAVE_CXXFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_cxx_has_wno_variadic_macros" 1>&6
    if test "${ac_cxx_has_wno_variadic_macros}" = "yes"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros"
    fi


    if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then
       # Don't use -Wcast-align with ICC or clang
       case "$CPU_ARCH" in
           # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
           hppa | ia64 | sparc | arm)
           ;;
           *)
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
           ;;
       esac
    fi

    _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
    _USE_CPP_INCLUDE_FLAG=1

    # Recent clang and gcc support C++11 deleted functions without warnings if
    # compiling with -std=c++0x or -std=gnu++0x (or c++11 or gnu++11 in very new
    # versions).  We can't use -std=c++0x yet, so gcc's support must remain
    # unused.  But clang's warning can be disabled, so when compiling with clang
    # we use it to opt out of the warning, enabling (macro-encapsulated) use of
    # deleted function syntax.
    if test "$CLANG_CXX"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions"
        
    echo $ac_n "checking whether the C++ compiler supports -Wno-extended-offsetof""... $ac_c" 1>&6
echo "configure:7641: checking whether the C++ compiler supports -Wno-extended-offsetof" >&5
if eval "test \"`echo '$''{'ac_cxx_has_wno_extended_offsetof'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            _SAVE_CXXFLAGS="$CXXFLAGS"
            CXXFLAGS="$CXXFLAGS -Werror -Wextended-offsetof"
            cat > conftest.$ac_ext <<EOF
#line 7657 "configure"
#include "confdefs.h"

int main() {
return(0);
; return 0; }
EOF
if { (eval echo configure:7664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cxx_has_wno_extended_offsetof="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cxx_has_wno_extended_offsetof="no"
fi
rm -f conftest*
            CXXFLAGS="$_SAVE_CXXFLAGS"
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

        
fi

echo "$ac_t""$ac_cxx_has_wno_extended_offsetof" 1>&6
    if test "${ac_cxx_has_wno_extended_offsetof}" = "yes"; then
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-extended-offsetof"
    fi

    fi

else
    _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
fi

MKSHLIB_FORCE_ALL=
MKSHLIB_UNFORCE_ALL=

if test "$COMPILE_ENVIRONMENT"; then
if test "$GNU_CC"; then
  echo $ac_n "checking whether ld has archive extraction flags""... $ac_c" 1>&6
echo "configure:7702: checking whether ld has archive extraction flags" >&5
  if eval "test \"`echo '$''{'ac_cv_mkshlib_force_and_unforce'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  _SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
    ac_cv_mkshlib_force_and_unforce="no"
    exec 3<&0 <<LOOP_INPUT
	force="-Wl,--whole-archive";   unforce="-Wl,--no-whole-archive"
	force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
	force="-Wl,-all";              unforce="-Wl,-none"
LOOP_INPUT
    while read line
    do
      eval $line
      LDFLAGS=$force
      LIBS=$unforce
      cat > conftest.$ac_ext <<EOF
#line 7719 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:7726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_mkshlib_force_and_unforce=$line; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
    done
    exec 0<&3 3<&-
    LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
   
fi

  if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
    echo "$ac_t""no" 1>&6
  else
    echo "$ac_t""yes" 1>&6
    eval $ac_cv_mkshlib_force_and_unforce
    MKSHLIB_FORCE_ALL=$force
    MKSHLIB_UNFORCE_ALL=$unforce
  fi
fi # GNU_CC
fi # COMPILE_ENVIRONMENT

if test "$COMPILE_ENVIRONMENT"; then

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking for 64-bit OS""... $ac_c" 1>&6
echo "configure:7761: checking for 64-bit OS" >&5
cat > conftest.$ac_ext <<EOF
#line 7763 "configure"
#include "confdefs.h"
$configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)
; return 0; }
EOF
if { (eval echo configure:7770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  result="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  result="no"
fi
rm -f conftest*
echo "$ac_t"""$result"" 1>&6
if test "$result" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_64BIT_OS 1
EOF

    HAVE_64BIT_OS=1
fi

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

fi # COMPILE_ENVIRONMENT

MOZ_OS2_HIGH_MEMORY=1
# Check whether --enable-os2-high-mem or --disable-os2-high-mem was given.
if test "${enable_os2_high_mem+set}" = set; then
  enableval="$enable_os2_high_mem"
  if test "$enableval" = "no"; then
    MOZ_OS2_HIGH_MEMORY=
  elif test "$enableval" = "yes"; then
    MOZ_OS2_HIGH_MEMORY=1 
  else
    { echo "configure: error: Option, os2-high-mem, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



# Check whether --enable-profiling or --disable-profiling was given.
if test "${enable_profiling+set}" = set; then
  enableval="$enable_profiling"
  if test "$enableval" = "yes"; then
    MOZ_PROFILING=1
  elif test "$enableval" = "no"; then
    MOZ_PROFILING= 
  else
    { echo "configure: error: Option, profiling, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# For profiling builds keep the symbol information
if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
    STRIP_FLAGS="--strip-debug"
fi

# Check whether --enable-valgrind or --disable-valgrind was given.
if test "${enable_valgrind+set}" = set; then
  enableval="$enable_valgrind"
  if test "$enableval" = "yes"; then
    MOZ_VALGRIND=1
  elif test "$enableval" = "no"; then
    MOZ_VALGRIND= 
  else
    { echo "configure: error: Option, valgrind, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_VALGRIND"; then
       ac_safe=`echo "valgrind/valgrind.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for valgrind/valgrind.h""... $ac_c" 1>&6
echo "configure:7846: checking for valgrind/valgrind.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 7851 "configure"
#include "confdefs.h"

#include <valgrind/valgrind.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:7859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    :
  else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: --enable-valgrind specified but Valgrind is not installed" 1>&2; exit 1; }
  fi

    cat >> confdefs.h <<\EOF
#define MOZ_VALGRIND 1
EOF

fi


# Check whether --enable-dmd or --disable-dmd was given.
if test "${enable_dmd+set}" = set; then
  enableval="$enable_dmd"
  if test "$enableval" = "yes"; then
    MOZ_DMD=1
  elif test "$enableval" = "no"; then
    MOZ_DMD= 
  else
    { echo "configure: error: Option, dmd, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_DMD"; then
       ac_safe=`echo "valgrind/valgrind.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for valgrind/valgrind.h""... $ac_c" 1>&6
echo "configure:7901: checking for valgrind/valgrind.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 7906 "configure"
#include "confdefs.h"

#include <valgrind/valgrind.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:7914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    :
  else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: --enable-dmd specified but Valgrind is not installed" 1>&2; exit 1; }
  fi

    cat >> confdefs.h <<\EOF
#define MOZ_DMD 1
EOF

fi


# Check whether --enable-jprof or --disable-jprof was given.
if test "${enable_jprof+set}" = set; then
  enableval="$enable_jprof"
  if test "$enableval" = "yes"; then
    MOZ_JPROF=1
  elif test "$enableval" = "no"; then
    MOZ_JPROF= 
  else
    { echo "configure: error: Option, jprof, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_JPROF"; then
    MOZ_PROFILING=1
    cat >> confdefs.h <<\EOF
#define MOZ_JPROF 1
EOF

fi

MOZ_ENABLE_PROFILER_SPS=1

case "${OS_TARGET}" in
Android)
    case "${CPU_ARCH}" in
    x86 | arm) ;;
    *)
        MOZ_ENABLE_PROFILER_SPS=
    esac
    ;;
Linux)
    case "${CPU_ARCH}" in
    x86 | x86_64) ;;
    *)
        MOZ_ENABLE_PROFILER_SPS=
    esac
    ;;
WINNT|Darwin) ;;
*)
    MOZ_ENABLE_PROFILER_SPS=
    ;;
esac

if test -n "$MOZ_ENABLE_PROFILER_SPS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_PROFILER_SPS 1
EOF

fi

# Check whether --enable-shark or --disable-shark was given.
if test "${enable_shark+set}" = set; then
  enableval="$enable_shark"
  if test "$enableval" = "yes"; then
    MOZ_SHARK=1
  elif test "$enableval" = "no"; then
    MOZ_SHARK= 
  else
    { echo "configure: error: Option, shark, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_SHARK"; then
    MOZ_PROFILING=1
    cat >> confdefs.h <<\EOF
#define MOZ_SHARK 1
EOF

fi

# Check whether --enable-callgrind or --disable-callgrind was given.
if test "${enable_callgrind+set}" = set; then
  enableval="$enable_callgrind"
  if test "$enableval" = "yes"; then
    MOZ_CALLGRIND=1
  elif test "$enableval" = "no"; then
    MOZ_CALLGRIND= 
  else
    { echo "configure: error: Option, callgrind, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_CALLGRIND"; then
    MOZ_PROFILING=1
    cat >> confdefs.h <<\EOF
#define MOZ_CALLGRIND 1
EOF

fi

# Check whether --enable-vtune or --disable-vtune was given.
if test "${enable_vtune+set}" = set; then
  enableval="$enable_vtune"
  if test "$enableval" = "yes"; then
    MOZ_VTUNE=1
  elif test "$enableval" = "no"; then
    MOZ_VTUNE= 
  else
    { echo "configure: error: Option, vtune, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_VTUNE"; then
    MOZ_PROFILING=1
    cat >> confdefs.h <<\EOF
#define MOZ_VTUNE 1
EOF

fi

if test -n "$MOZ_PROFILING"; then
    cat >> confdefs.h <<\EOF
#define MOZ_PROFILING 1
EOF

fi

case "$host" in
*mingw*)
    if test -n "$_WIN32_MSVC"; then
        HOST_AR=lib
        HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
        HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
        HOST_RANLIB='echo ranlib'
    else
        HOST_CFLAGS="$HOST_CFLAGS -mwindows"
    fi
    HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
    HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
    HOST_BIN_SUFFIX=.exe
    case "$host" in
    *mingw*)
        PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper"
        ;;
    esac

    case "${host_cpu}" in
    i*86)
        if test -n "$_WIN32_MSVC"; then
            HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
        fi
        ;;
    x86_64)
        if test -n "$_WIN32_MSVC"; then
            HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
        fi
        HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
        ;;
    esac
    ;;

*-darwin*)
    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
    HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
    ;;

*-linux*|*-kfreebsd*-gnu|*-gnu*)
    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
    HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
    ;;

*os2*)
    HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
    HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
    HOST_BIN_SUFFIX=.exe
    MOZ_FIX_LINK_PATHS=
    ;;

*)
    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
    ;;
esac

echo $ac_n "checking for Python version >= $PYTHON_VERSION but not 3.x""... $ac_c" 1>&6
echo "configure:8120: checking for Python version >= $PYTHON_VERSION but not 3.x" >&5

$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1] or sys.version[:2] != '2.')" $PYTHON_VERSION
_python_res=$?

if test "$_python_res" != 0; then
    { echo "configure: error: Python $PYTHON_VERSION or higher (but not Python 3.x) is required." 1>&2; exit 1; }
fi
echo "$ac_t""yes" 1>&6

echo $ac_n "checking for custom <stdint.h> implementation""... $ac_c" 1>&6
echo "configure:8131: checking for custom <stdint.h> implementation" >&5
if test "$MOZ_CUSTOM_STDINT_H"; then
  cat >> confdefs.h <<EOF
#define MOZ_CUSTOM_STDINT_H "$MOZ_CUSTOM_STDINT_H"
EOF

  
  echo "$ac_t""using $MOZ_CUSTOM_STDINT_H" 1>&6
else
  echo "$ac_t""none specified" 1>&6
fi

MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`

FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`

if test -z "$FIREFOX_VERSION"; then
    { echo "configure: error: FIREFOX_VERSION is unexpectedly blank." 1>&2; exit 1; }
fi

cat >> confdefs.h <<EOF
#define MOZILLA_VERSION "$MOZILLA_VERSION"
EOF

cat >> confdefs.h <<EOF
#define MOZILLA_VERSION_U $MOZILLA_VERSION
EOF

cat >> confdefs.h <<EOF
#define MOZILLA_UAVERSION "$MOZILLA_UAVERSION"
EOF



  cat > conftest.c <<EOF
                  int foo = 1;
EOF
  lto_is_enabled=no
  if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
    if grep '^target triple =' conftest.s; then
      lto_is_enabled=yes
    fi
  fi
  rm -f conftest.cs



case "$target" in
*-aix*)
    cat >> confdefs.h <<\EOF
#define AIX 1
EOF

    if test ! "$GNU_CC"; then
        if test ! "$HAVE_64BIT_OS"; then
            # Compiling with Visual Age C++ object model compat is the
            # default. To compile with object model ibm, add
            # AIX_OBJMODEL=ibm to .mozconfig.
            if test "$AIX_OBJMODEL" = "ibm"; then
                CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
            else
                AIX_OBJMODEL=compat
            fi
        else
            AIX_OBJMODEL=compat
        fi
        
        DSO_LDOPTS='-qmkshrobj=1'
        DSO_CFLAGS='-qflag=w:w'
        DSO_PIC_CFLAGS=
        LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
        MOZ_FIX_LINK_PATHS=
        MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
        MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
        if test "$COMPILE_ENVIRONMENT"; then
            
            ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

            echo $ac_n "checking for IBM XLC/C++ compiler version >= 9.0.0.7""... $ac_c" 1>&6
echo "configure:8216: checking for IBM XLC/C++ compiler version >= 9.0.0.7" >&5
            cat > conftest.$ac_ext <<EOF
#line 8218 "configure"
#include "confdefs.h"

int main() {
#if (__IBMCPP__ < 900)
                 #error "Bad compiler"
                 #endif
; return 0; }
EOF
if { (eval echo configure:8227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  _BAD_COMPILER=
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _BAD_COMPILER=1
fi
rm -f conftest*
            if test -n "$_BAD_COMPILER"; then
                echo "$ac_t""no" 1>&6
                { echo "configure: error: IBM XLC/C++ 9.0.0.7 or higher is required to build." 1>&2; exit 1; }
            else
                echo "$ac_t""yes" 1>&6
            fi
            ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

            TARGET_COMPILER_ABI="ibmc"
            CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
            CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
        fi
    fi
    case "${target_os}" in
    aix4.1*)
        DLL_SUFFIX='_shr.a'
        ;;
    esac
    if test "$COMPILE_ENVIRONMENT"; then
         for ac_hdr in sys/inttypes.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8265: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 8270 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:8278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done

    fi
    cat >> confdefs.h <<\EOF
#define NSCAP_DISABLE_DEBUG_PTR_TYPES 1
EOF

    ;;

*-bsdi*)
        _PEDANTIC=
    case $OS_RELEASE in
	4.*|5.*)
            STRIP="$STRIP -d"
            ;;
	*)
	    DSO_CFLAGS=''
	    DSO_LDOPTS='-r'
	    _WARNINGS_CFLAGS="-Wall"
	    _WARNINGS_CXXFLAGS="-Wall"
	    # The test above doesn't work properly, at least on 3.1.
	    MKSHLIB_FORCE_ALL=''
	    MKSHLIB_UNFORCE_ALL=''
	;;
    esac
    ;;

*-darwin*)
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
    MOZ_OPTIMIZE_FLAGS="-O3"
    _PEDANTIC=
    # Statically disable jemalloc on 10.5 and 32-bit 10.6.  See bug 702250.
    if test "$HAVE_64BIT_OS"; then
        MOZ_MEMORY=1
    fi
    DLL_SUFFIX=".dylib"
    DSO_LDOPTS=''
    STRIP="$STRIP -x -S"
    # Check whether we're targeting OS X or iOS
    echo $ac_n "checking for iOS target""... $ac_c" 1>&6
echo "configure:8343: checking for iOS target" >&5
if eval "test \"`echo '$''{'ac_cv_ios_target'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8348 "configure"
#include "confdefs.h"
#include <TargetConditionals.h>
#if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
#error not iOS
#endif
int main() {

; return 0; }
EOF
if { (eval echo configure:8358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_ios_target="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_ios_target="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_ios_target" 1>&6
    if test "$ac_cv_ios_target" = "yes"; then
        cat >> confdefs.h <<\EOF
#define XP_IOS 1
EOF

        cat >> confdefs.h <<\EOF
#define XP_DARWIN 1
EOF

        _PLATFORM_DEFAULT_TOOLKIT='cairo-uikit'
    else
        cat >> confdefs.h <<\EOF
#define XP_MACOSX 1
EOF

        cat >> confdefs.h <<\EOF
#define XP_DARWIN 1
EOF

        _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
        # The ExceptionHandling framework is needed for Objective-C exception
        # logging code in nsObjCExceptions.h. Currently we only use that in debug
        # builds.
        MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
    fi
    TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'


    if test "x$lto_is_enabled" = "xyes"; then
        echo "Skipping -dead_strip because lto is enabled."
            elif test "x$enable_dtrace" = "xyes"; then
        echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
    else
                echo $ac_n "checking for -dead_strip option to ld""... $ac_c" 1>&6
echo "configure:8405: checking for -dead_strip option to ld" >&5
        _SAVE_LDFLAGS=$LDFLAGS
        LDFLAGS="$LDFLAGS -Wl,-dead_strip"
        cat > conftest.$ac_ext <<EOF
#line 8409 "configure"
#include "confdefs.h"

int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:8416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  _HAVE_DEAD_STRIP=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _HAVE_DEAD_STRIP=
fi
rm -f conftest*
        if test -n "$_HAVE_DEAD_STRIP" ; then
            echo "$ac_t""yes" 1>&6
            MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
        else
            echo "$ac_t""no" 1>&6
        fi

        LDFLAGS=$_SAVE_LDFLAGS
    fi

            echo $ac_n "checking for -allow_heap_execute option to ld""... $ac_c" 1>&6
echo "configure:8437: checking for -allow_heap_execute option to ld" >&5
    _SAVE_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS -Wl,-allow_heap_execute"
    cat > conftest.$ac_ext <<EOF
#line 8441 "configure"
#include "confdefs.h"

int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:8448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  _HAVE_ALLOW_HEAP_EXECUTE=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _HAVE_ALLOW_HEAP_EXECUTE=
fi
rm -f conftest*
    if test -n "$_HAVE_ALLOW_HEAP_EXECUTE" ; then
        echo "$ac_t""yes" 1>&6
        MOZ_ALLOW_HEAP_EXECUTE_FLAGS="-Wl,-allow_heap_execute"
    else
        echo "$ac_t""no" 1>&6
    fi
    LDFLAGS=$_SAVE_LDFLAGS

    MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
    ;;

*-freebsd*)
    if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
	DLL_SUFFIX=".so.1.0"
	DSO_LDOPTS="-shared"
    fi
    if test ! "$GNU_CC"; then
	DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
    fi
    ;;

ia64*-hpux*)
    DLL_SUFFIX=".so"
    if test ! "$GNU_CC"; then
       DSO_LDOPTS='-b'
       DSO_CFLAGS=""
       DSO_PIC_CFLAGS=
       MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
       MKCSHLIB='$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
       CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
    else
       DSO_LDOPTS='-b -E'
       MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
       MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
    fi
    MOZ_FIX_LINK_PATHS=
    SYSTEM_MAKEDEPEND=
    cat >> confdefs.h <<\EOF
#define NSCAP_DISABLE_DEBUG_PTR_TYPES 1
EOF

    cat >> confdefs.h <<\EOF
#define _LARGEFILE64_SOURCE 1
EOF

    ;;

*-hpux*)
    DLL_SUFFIX=".sl"
    if test ! "$GNU_CC"; then
    	DSO_LDOPTS='-b -Wl,+s'
    	DSO_CFLAGS=""
    	DSO_PIC_CFLAGS="+Z"
    	MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
    	MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
        CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
    else
        DSO_LDOPTS='-b -E +s'
        MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
        MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
    fi
    MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
    cat >> confdefs.h <<\EOF
#define NSCAP_DISABLE_DEBUG_PTR_TYPES 1
EOF

    ;;

*-android*|*-linuxandroid*)
    cat >> confdefs.h <<\EOF
#define NO_PW_GECOS 1
EOF

    no_x=yes
    if test -n "$gonkdir"; then
        _PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
        MOZ_B2G_RIL=1
        MOZ_B2G_BT=1
    else
        _PLATFORM_DEFAULT_TOOLKIT=cairo-android
        MOZ_LINKER=1
    fi
    TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'

    MOZ_GFX_OPTIMIZE_MOBILE=1
    MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions"
    ;;

*-*linux*)
    # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
    # Similarly for GNU_CXX and INTEL_CXX.
    if test "$INTEL_CC" -o "$INTEL_CXX"; then
        # -Os has been broken on Intel's C/C++ compilers for quite a
        # while; Intel recommends against using it.
        MOZ_OPTIMIZE_FLAGS="-O2"
        MOZ_DEBUG_FLAGS="-g"
    elif test "$GNU_CC" -o "$GNU_CXX"; then
        GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
        case $GCC_VERSION in
        4.1.*|4.2.*|4.5.*)
            # -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results.
            MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
        esac
        MOZ_PGO_OPTIMIZE_FLAGS="-O3"
        MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK"
        MOZ_DEBUG_FLAGS="-g"
    fi

    TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'

    MOZ_MEMORY=1

    case "${target_cpu}" in
    alpha*)
    	CFLAGS="$CFLAGS -mieee"
    	CXXFLAGS="$CXXFLAGS -mieee"
    ;;
    i*86)
    	USE_ELF_DYNSTR_GC=1
    ;;
    mips*)
        MOZ_DEBUG_FLAGS="-g" # We want inlining
    ;;
    esac

    if test -z "$MC"; then
        MC=mc.exe
    fi
    ;;
*-mingw*)
    DSO_CFLAGS=
    DSO_PIC_CFLAGS=
    DLL_SUFFIX=.dll
    RC=rc.exe
    MC=mc.exe
    # certain versions of cygwin's makedepend barf on the
    # #include <string> vs -I./dist/include/string issue so don't use it
    SYSTEM_MAKEDEPEND=
    if test -n "$GNU_CC"; then
        CC="$CC -mwindows"
        CXX="$CXX -mwindows"
        CPP="$CPP -mwindows"
        CFLAGS="$CFLAGS -mms-bitfields"
        CXXFLAGS="$CXXFLAGS -mms-bitfields"
        DSO_LDOPTS='-shared'
        MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
        MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
        RC='$(WINDRES)'
        # Use temp file for windres (bug 213281)
        RCFLAGS='-O coff --use-temp-file'
        # mingw doesn't require kernel32, user32, and advapi32 explicitly
        LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv"
        MOZ_FIX_LINK_PATHS=
        DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc'
        XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
        DLL_PREFIX=
        IMPORT_LIB_SUFFIX=dll.a
        GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
    else
        TARGET_COMPILER_ABI=msvc
        HOST_CC='$(CC)'
        HOST_CXX='$(CXX)'
        HOST_LD='$(LD)'
        if test "$AS_BIN"; then
            AS="$(basename "$AS_BIN")"
        fi
        AR='lib'
        AR_FLAGS='-NOLOGO -OUT:"$@"'
        AR_EXTRACT=
        RANLIB='echo not_ranlib'
        STRIP='echo not_strip'
        PKG_SKIP_STRIP=1
        XARGS=xargs
        ZIP=zip
        UNZIP=unzip
        DOXYGEN=:
        ASM_SUFFIX=asm
        OBJ_SUFFIX=obj
        LIB_SUFFIX=lib
        DLL_PREFIX=
        LIB_PREFIX=
        IMPORT_LIB_SUFFIX=lib
        MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
        MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
        MKSHLIB_FORCE_ALL=
        MKSHLIB_UNFORCE_ALL=
        DSO_LDOPTS=-SUBSYSTEM:WINDOWS
        _USE_CPP_INCLUDE_FLAG=1
        _DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
        _DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
        CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
        CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
        CXXFLAGS="$CXXFLAGS -wd4800" # disable warning "forcing value to bool"
        # make 'foo == bar;' error out
        CFLAGS="$CFLAGS -we4553"
        CXXFLAGS="$CXXFLAGS -we4553"
        LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
        MOZ_DEBUG_FLAGS='-Zi'
        MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
        WARNINGS_AS_ERRORS='-WX'
        MOZ_OPTIMIZE_FLAGS='-O1'
        MOZ_FIX_LINK_PATHS=
        DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
        XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
        LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
        MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
        if test $_MSC_VER -ge 1400; then
            LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
                        PROFILE_GEN_CFLAGS="-GL"
            PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
                                                                                                PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
                                    PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
            LDFLAGS="$LDFLAGS -DYNAMICBASE"
        fi
    fi
    MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg32$(VERSION_NUMBER),$(DEPTH)/media/libjpeg)'
    MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/media/libpng)'
    cat >> confdefs.h <<\EOF
#define HAVE_SNPRINTF 1
EOF

    cat >> confdefs.h <<\EOF
#define _WINDOWS 1
EOF

    cat >> confdefs.h <<\EOF
#define WIN32 1
EOF

    cat >> confdefs.h <<\EOF
#define XP_WIN 1
EOF

    cat >> confdefs.h <<\EOF
#define XP_WIN32 1
EOF

    cat >> confdefs.h <<\EOF
#define HW_THREADS 1
EOF

    cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

    cat >> confdefs.h <<\EOF
#define NEW_H <new>
EOF

    cat >> confdefs.h <<\EOF
#define WIN32_LEAN_AND_MEAN 1
EOF

    TARGET_MD_ARCH=win32
    _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
    BIN_SUFFIX='.exe'
    MOZ_USER_DIR="Mozilla"

        TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'

        no_x=yes
    cat >> confdefs.h <<\EOF
#define NO_X11 1
EOF


    case "$host" in
    *-mingw*)
        MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
        L10NBASEDIR=`cd $L10NBASEDIR && pwd -W`
        ;;
    esac

    case "$host" in
    *-mingw*)
        if test -z "$MOZ_TOOLS"; then
            { echo "configure: error: MOZ_TOOLS is not set" 1>&2; exit 1; }
        fi
        MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
        if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then
            { echo "configure: error: cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS" 1>&2; exit 1; }
        fi
        MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
        if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
            { echo "configure: error: \$MOZ_TOOLS\\bin must be in your path." 1>&2; exit 1; }
        fi
        ;;
    esac

    case "$host_os" in
    cygwin*|msvc*|mks*)
        { echo "configure: error: Using a Cygwin build environment is unsupported. Configure cannot check for presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites." 1>&2; exit 1; }
        ;;
    esac

    case "$target" in
    i*86-*)
        if test "$HAVE_64BIT_OS"; then
            { echo "configure: error: You are targeting i386 but using the 64-bit compiler." 1>&2; exit 1; }
        fi

        if test $_MSC_VER -ge 1400; then
            LDFLAGS="$LDFLAGS -SAFESEH"
        fi

        if test -n "$GNU_CC"; then
            CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
            CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
        else
            cat >> confdefs.h <<\EOF
#define HAVE_STDCALL 1
EOF

            DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
        fi

         for ac_hdr in mmintrin.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8778: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 8783 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:8791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done

    	cat >> confdefs.h <<\EOF
#define _X86_ 1
EOF

	;;
    x86_64-*)
        if test -n "$_WIN32_MSVC"; then
            DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
        fi
        cat >> confdefs.h <<\EOF
#define _AMD64_ 1
EOF

        ;;
    *)
    	cat >> confdefs.h <<\EOF
#define _CPU_ARCH_NOT_DEFINED 1
EOF

	;;
    esac

    if test "$HAVE_64BIT_OS"; then
    	cat >> confdefs.h <<\EOF
#define _WIN64 1
EOF

    fi
    ;;

*-netbsd*)
    DSO_CFLAGS=''
    CFLAGS="$CFLAGS -Dunix"
    CXXFLAGS="$CXXFLAGS -Dunix"
    if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
        DLL_SUFFIX=".so"
        DSO_PIC_CFLAGS='-fPIC -DPIC'
        DSO_LDOPTS='-shared'
	BIN_FLAGS='-Wl,--export-dynamic'
    else
    	DSO_PIC_CFLAGS='-fPIC -DPIC'
    	DLL_SUFFIX=".so.1.0"
    	DSO_LDOPTS='-shared'
    fi
    # This will fail on a.out systems prior to 1.5.1_ALPHA.
    MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
    MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
    if test "$LIBRUNPATH"; then
	DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
    fi
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
    ;;

*-openbsd*)
    if test "$SO_VERSION"; then
        DLL_SUFFIX=".so.$SO_VERSION"
    else
        DLL_SUFFIX=".so.1.0"
    fi
    MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib'
    DSO_CFLAGS=''
    DSO_PIC_CFLAGS='-fPIC'
    DSO_LDOPTS='-shared -fPIC'
    if test "$LIBRUNPATH"; then
	DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
    fi
    ;;

*-os2*)
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
    cat >> confdefs.h <<\EOF
#define OS2 1
EOF

    cat >> confdefs.h <<\EOF
#define XP_OS2 1
EOF

    cat >> confdefs.h <<\EOF
#define OS2EMX_PLAIN_CHAR 1
EOF

    cat >> confdefs.h <<\EOF
#define TCPV40HDRS 1
EOF

    DLL_PREFIX=
    LIB_PREFIX=
    LIB_SUFFIX=lib
    BIN_SUFFIX=".exe"
    DLL_SUFFIX=".dll"
    IMPORT_LIB_SUFFIX=lib
    DSO_PIC_CFLAGS=
    AR=emxomfar
    AR_FLAGS='r $@'
    CFLAGS="$CFLAGS -Zomf"
    CXXFLAGS="$CXXFLAGS -Zomf"
    DSO_LDOPTS='-Zdll'
    BIN_FLAGS='-Zlinker /ST:0x100000'
    IMPLIB='emximp -o'
    FILTER='true'
    LDFLAGS='-Zmap'
    WARNINGS_AS_ERRORS='-Werror'
    MOZ_DEBUG_FLAGS="-g -fno-inline"
    MOZ_OPTIMIZE_FLAGS="-O2"
    MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
    DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
    LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
    TARGET_MD_ARCH=os2
    _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
    RC=rc.exe
    MC=mc.exe
    RCFLAGS='-n'
    MOZ_USER_DIR="Mozilla"
    ZIP="$ZIP -X"

    if test "$MOZTOOLS"; then
        MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
    else
        { echo "configure: error: MOZTOOLS is not set" 1>&2; exit 1; }
    fi
    if test -n "$MOZ_OS2_HIGH_MEMORY"; then
        DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
        LDFLAGS="$LDFLAGS -Zhigh-mem"
        MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
        cat >> confdefs.h <<\EOF
#define MOZ_OS2_HIGH_MEMORY 1
EOF

    fi

    # GCC for OS/2 currently predefines these, but we don't want them
    _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
    _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"

    echo $ac_n "checking for __declspec(dllexport)""... $ac_c" 1>&6
echo "configure:8955: checking for __declspec(dllexport)" >&5
if eval "test \"`echo '$''{'ac_os2_declspec'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8960 "configure"
#include "confdefs.h"
__declspec(dllexport) void ac_os2_declspec(void) {}
int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:8967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_os2_declspec="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_os2_declspec="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_os2_declspec" 1>&6
    if test "$ac_os2_declspec" != "yes"; then
        { echo "configure: error: Compiler does not support __declspec(dllexport), install GCC-4.3.2 or newer" 1>&2; exit 1; }
    fi
    ;;

*-solaris*)
    cat >> confdefs.h <<\EOF
#define SOLARIS 1
EOF

    TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
    SYSTEM_MAKEDEPEND=
    MOZ_FIX_LINK_PATHS=
    # $ORIGIN/.. is for shared libraries under components/ to locate shared
    # libraries one level up (e.g. libnspr4.so)
    if test "$SOLARIS_SUNPRO_CC"; then
       LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs"
       LIBS="-lCrun -lCstd -lc $LIBS"
       cat >> confdefs.h <<\EOF
#define NSCAP_DISABLE_DEBUG_PTR_TYPES 1
EOF

       CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
       LDFLAGS="-xildoff $LDFLAGS"
       if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
           _SAVE_LDFLAGS=$LDFLAGS
           LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
           cat > conftest.$ac_ext <<EOF
#line 9009 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello World\n");
; return 0; }
EOF
if { (eval echo configure:9016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LDFLAGS=$_SAVE_LDFLAGS
fi
rm -f conftest*
       fi
       MOZ_OPTIMIZE_FLAGS="-xO4"
       MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
       MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
       MKSHLIB_FORCE_ALL='-z allextract'
       MKSHLIB_UNFORCE_ALL='-z defaultextract'
       DSO_LDOPTS='-G'
       AR_LIST="$AR t"
       AR_EXTRACT="$AR x"
       AR_DELETE="$AR d"
       AR='$(CXX) -xar'
       AR_FLAGS='-o $@'
       AS='/usr/ccs/bin/as'
       ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
       AS_DASH_C_FLAG=''
       TARGET_COMPILER_ABI="sunc"
       CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
       CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
       echo $ac_n "checking for Sun C++ compiler version >= 5.9""... $ac_c" 1>&6
echo "configure:9044: checking for Sun C++ compiler version >= 5.9" >&5
       
       ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

       cat > conftest.$ac_ext <<EOF
#line 9054 "configure"
#include "confdefs.h"

int main() {
#if (__SUNPRO_CC < 0x590)
           #error "Denied"
           #endif
; return 0; }
EOF
if { (eval echo configure:9063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  _BAD_COMPILER=
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _BAD_COMPILER=1
fi
rm -f conftest*
       if test -n "$_BAD_COMPILER"; then
           _res="no"
           { echo "configure: error: Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION ." 1>&2; exit 1; }
       else
           _res="yes"
       fi
       cat > conftest.$ac_ext <<EOF
#line 9080 "configure"
#include "confdefs.h"

int main() {
#if (__SUNPRO_CC >= 0x5100)
           #error "Sun C++ 5.10 or above"
           #endif
; return 0; }
EOF
if { (eval echo configure:9089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  _ABOVE_SS12U1=
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _ABOVE_SS12U1=1
fi
rm -f conftest*
       if test "$_ABOVE_SS12U1"; then
           # disable xannotate
           CXXFLAGS="$CXXFLAGS -xannotate=no"
       fi
       echo "$ac_t""$_res" 1>&6
       ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    else
       LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs"
       LIBS="-lc $LIBS"
       MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract'
       MKSHLIB_UNFORCE_ALL='-Wl,-z -Wl,defaultextract'
       ASFLAGS="$ASFLAGS -fPIC"
       DSO_LDOPTS='-shared'
       WARNINGS_AS_ERRORS='-Werror'
       _WARNINGS_CFLAGS=''
       _WARNINGS_CXXFLAGS=''
       if test "$OS_RELEASE" = "5.3"; then
           cat >> confdefs.h <<\EOF
#define MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES 1
EOF

       fi
    fi
    if test "$OS_RELEASE" = "5.5.1"; then
        cat >> confdefs.h <<\EOF
#define NEED_USLEEP_PROTOTYPE 1
EOF

    fi
    ;;

*-sunos*)
    DSO_LDOPTS='-Bdynamic'
    MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
    MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
    cat >> confdefs.h <<\EOF
#define SUNOS4 1
EOF

    cat >> confdefs.h <<\EOF
#define SPRINTF_RETURNS_STRING 1
EOF

    case "$(target_os)" in
    sunos4.1*)
        DLL_SUFFIX='.so.1.0'
        ;;
    esac
    ;;

*-os2*)
    HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
    ;;

esac


if test -n "$MOZ_LINKER"; then
  cat >> confdefs.h <<\EOF
#define MOZ_LINKER 1
EOF

fi


cat >> confdefs.h <<EOF
#define D_INO $DIRENT_INO
EOF


NO_LD_ARCHIVE_FLAGS=
if test -z "$MKSHLIB_FORCE_ALL" -o -z "$MKSHLIB_UNFORCE_ALL"; then
    NO_LD_ARCHIVE_FLAGS=1
fi
case "$target" in
*-os2*)
    NO_LD_ARCHIVE_FLAGS=
    ;;
*-aix4.3*|*-aix5*)
    NO_LD_ARCHIVE_FLAGS=
    ;;
*-mingw*)
    if test -z "$GNU_CC"; then
        NO_LD_ARCHIVE_FLAGS=
    fi
    ;;
esac


case "$target" in
    *-linux*|*-kfreebsd*-gnu|*-gnu*)
        MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
        ;;
    *-solaris*)
        if test -z "$GNU_CC"; then
         MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
        else
         if test -z "$GCC_USE_GNU_LD"; then
          MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
         else
          MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
         fi
        fi
        ;;
    *-darwin*)
        MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
        ;;
    *-mingw*)
        if test -n "$GNU_CC"; then
           MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
        fi
        ;;
esac

if test -z "$COMPILE_ENVIRONMENT"; then
    SKIP_COMPILER_CHECKS=1
    SKIP_LIBRARY_CHECKS=1
fi

if test -z "$SKIP_COMPILER_CHECKS"; then
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:9226: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9231 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 9256 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 9274 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 9295 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

EOF
if { (eval echo configure:9306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_header_stdc=no
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:9330: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9335 "configure"
#include "confdefs.h"

int main() {

/* Ultrix mips cc rejects this.  */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this.  */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this.  */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
   It does not let you subtract one const X* pointer from another in an arm
   of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this.  */
  char *t;
  char const *s = 0 ? (char *) 0 : (char const *) 0;

  *t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  int x[] = {25, 17};
  const int *foo = &x[0];
  ++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  typedef const int *iptr;
  iptr p = 0;
  ++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  struct s { int j; const int *ap[3]; };
  struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  const int foo = 10;
}

; return 0; }
EOF
if { (eval echo configure:9384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_const=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_const=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
  cat >> confdefs.h <<\EOF
#define const 
EOF

fi

echo $ac_n "checking for mode_t""... $ac_c" 1>&6
echo "configure:9405: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9410 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_mode_t=yes
else
  rm -rf conftest*
  ac_cv_type_mode_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_mode_t" 1>&6
if test $ac_cv_type_mode_t = no; then
  cat >> confdefs.h <<\EOF
#define mode_t int
EOF

fi

echo $ac_n "checking for off_t""... $ac_c" 1>&6
echo "configure:9438: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9443 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_off_t=yes
else
  rm -rf conftest*
  ac_cv_type_off_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_off_t" 1>&6
if test $ac_cv_type_off_t = no; then
  cat >> confdefs.h <<\EOF
#define off_t long
EOF

fi

echo $ac_n "checking for pid_t""... $ac_c" 1>&6
echo "configure:9471: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9476 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_pid_t=yes
else
  rm -rf conftest*
  ac_cv_type_pid_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_pid_t" 1>&6
if test $ac_cv_type_pid_t = no; then
  cat >> confdefs.h <<\EOF
#define pid_t int
EOF

fi

echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:9504: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9509 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking for __stdcall""... $ac_c" 1>&6
echo "configure:9544: checking for __stdcall" >&5
if eval "test \"`echo '$''{'ac_cv___stdcall'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9549 "configure"
#include "confdefs.h"
template <typename Method> struct foo;
                  template <> struct foo<void (*)()> {};
                  template <> struct foo<void (__stdcall*)()> {};
int main() {

; return 0; }
EOF
if { (eval echo configure:9558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv___stdcall=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv___stdcall=false
fi
rm -f conftest*
fi

if test "$ac_cv___stdcall" = true ; then
  cat >> confdefs.h <<\EOF
#define HAVE_STDCALL 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
echo "configure:9587: checking for ssize_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9592 "configure"
#include "confdefs.h"
#include <stdio.h>
                  #include <sys/types.h>
int main() {
ssize_t foo = 0;
; return 0; }
EOF
if { (eval echo configure:9600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_type_ssize_t=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_type_ssize_t=false
fi
rm -f conftest*
fi

if test "$ac_cv_type_ssize_t" = true ; then
  cat >> confdefs.h <<\EOF
#define HAVE_SSIZE_T 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
echo "configure:9622: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9627 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
if { (eval echo configure:9635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_st_blksize=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_st_blksize=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
if test $ac_cv_struct_st_blksize = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_ST_BLKSIZE 1
EOF

fi

echo $ac_n "checking for siginfo_t""... $ac_c" 1>&6
echo "configure:9656: checking for siginfo_t" >&5
if eval "test \"`echo '$''{'ac_cv_siginfo_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9661 "configure"
#include "confdefs.h"
#define _POSIX_C_SOURCE 199506L
                  #include <signal.h>
int main() {
siginfo_t* info;
; return 0; }
EOF
if { (eval echo configure:9669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_siginfo_t=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_siginfo_t=false
fi
rm -f conftest*
fi

if test "$ac_cv_siginfo_t" = true ; then
  cat >> confdefs.h <<\EOF
#define HAVE_SIGINFO_T 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for int64""... $ac_c" 1>&6
echo "configure:9692: checking for int64" >&5
if eval "test \"`echo '$''{'ac_cv_int64'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9697 "configure"
#include "confdefs.h"
#include <stdio.h>
                  #include <sys/types.h>
int main() {
int64 foo = 0;
; return 0; }
EOF
if { (eval echo configure:9705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_int64=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_int64=false
fi
rm -f conftest*
fi

if test "$ac_cv_int64" = true ; then
  cat >> confdefs.h <<\EOF
#define HAVE_INT64 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for uint""... $ac_c" 1>&6
echo "configure:9727: checking for uint" >&5
if eval "test \"`echo '$''{'ac_cv_uint'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9732 "configure"
#include "confdefs.h"
#include <stdio.h>
                  #include <sys/types.h>
int main() {
uint foo = 0;
; return 0; }
EOF
if { (eval echo configure:9740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_uint=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_uint=false
fi
rm -f conftest*
fi

if test "$ac_cv_uint" = true ; then
  cat >> confdefs.h <<\EOF
#define HAVE_UINT 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for uint_t""... $ac_c" 1>&6
echo "configure:9762: checking for uint_t" >&5
if eval "test \"`echo '$''{'ac_cv_uint_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9767 "configure"
#include "confdefs.h"
#include <stdio.h>
                  #include <sys/types.h>
int main() {
uint_t foo = 0;
; return 0; }
EOF
if { (eval echo configure:9775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_uint_t=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_uint_t=false
fi
rm -f conftest*
fi

if test "$ac_cv_uint_t" = true ; then
  cat >> confdefs.h <<\EOF
#define HAVE_UINT_T 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross


echo $ac_n "checking for uname.domainname""... $ac_c" 1>&6
echo "configure:9806: checking for uname.domainname" >&5
if eval "test \"`echo '$''{'ac_cv_have_uname_domainname_field'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9811 "configure"
#include "confdefs.h"
#include <sys/utsname.h>
int main() {
 struct utsname *res; char *domain;
            (void)uname(res);  if (res != 0) { domain = res->domainname; } 
; return 0; }
EOF
if { (eval echo configure:9819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have_uname_domainname_field=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_uname_domainname_field=false
fi
rm -f conftest*
fi


if test "$ac_cv_have_uname_domainname_field" = "true"; then
    cat >> confdefs.h <<\EOF
#define HAVE_UNAME_DOMAINNAME_FIELD 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for uname.__domainname""... $ac_c" 1>&6
echo "configure:9843: checking for uname.__domainname" >&5
if eval "test \"`echo '$''{'ac_cv_have_uname_us_domainname_field'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9848 "configure"
#include "confdefs.h"
#include <sys/utsname.h>
int main() {
 struct utsname *res; char *domain;
            (void)uname(res);  if (res != 0) { domain = res->__domainname; } 
; return 0; }
EOF
if { (eval echo configure:9856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have_uname_us_domainname_field=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_uname_us_domainname_field=false
fi
rm -f conftest*
fi


if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
    cat >> confdefs.h <<\EOF
#define HAVE_UNAME_US_DOMAINNAME_FIELD 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi


# Check whether --enable-cpp-rtti or --disable-cpp-rtti was given.
if test "${enable_cpp_rtti+set}" = set; then
  enableval="$enable_cpp_rtti"
  if test "$enableval" = "yes"; then
     _MOZ_USE_RTTI=1 
  elif test "$enableval" = "no"; then
     _MOZ_USE_RTTI= 
  else
    { echo "configure: error: Option, cpp-rtti, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$_MOZ_USE_RTTI"; then
   _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
else
   _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
fi



ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross


if test "$GNU_CXX"; then
    _SAVE_CXXFLAGS=$CXXFLAGS
    CXXFLAGS="$CXXFLAGS -std=gnu++0x"

    if test -z "$_MOZ_USE_RTTI"; then
        CXXFLAGS="$CXXFLAGS $_MOZ_RTTI_FLAGS"
        echo $ac_n "checking for gcc c++0x headers bug without rtti""... $ac_c" 1>&6
echo "configure:9916: checking for gcc c++0x headers bug without rtti" >&5
if eval "test \"`echo '$''{'ac_cv_cxx0x_headers_bug'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9921 "configure"
#include "confdefs.h"
#include <memory>
int main() {

; return 0; }
EOF
if { (eval echo configure:9928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_cxx0x_headers_bug="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cxx0x_headers_bug="yes"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_cxx0x_headers_bug" 1>&6
        CXXFLAGS="$_SAVE_CXXFLAGS"
        if test "$ac_cv_cxx0x_headers_bug" = "no"; then
            CXXFLAGS="$CXXFLAGS -std=gnu++0x"
        fi
    fi
fi

echo $ac_n "checking for usable char16_t (2 bytes, unsigned)""... $ac_c" 1>&6
echo "configure:9949: checking for usable char16_t (2 bytes, unsigned)" >&5
if eval "test \"`echo '$''{'ac_cv_have_usable_char16_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9954 "configure"
#include "confdefs.h"
$configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
                     CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
                     CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
                     CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
                     CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')
; return 0; }
EOF
if { (eval echo configure:9965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have_usable_char16_t="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_usable_char16_t="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_have_usable_char16_t" 1>&6
if test "$ac_cv_have_usable_char16_t" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_CPP_CHAR16_T 1
EOF

    HAVE_CPP_CHAR16_T=1
elif test "$GNU_CXX"; then
    CXXFLAGS="$_SAVE_CXXFLAGS"
fi


echo $ac_n "checking for usable wchar_t (2 bytes, unsigned)""... $ac_c" 1>&6
echo "configure:9990: checking for usable wchar_t (2 bytes, unsigned)" >&5
if eval "test \"`echo '$''{'ac_cv_have_usable_wchar_v2'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9995 "configure"
#include "confdefs.h"
#include <stddef.h>
                     $configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
                     CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)
; return 0; }
EOF
if { (eval echo configure:10004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have_usable_wchar_v2="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_usable_wchar_v2="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_have_usable_wchar_v2" 1>&6
if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_CPP_2BYTE_WCHAR_T 1
EOF

    HAVE_CPP_2BYTE_WCHAR_T=1
elif test "$ac_cv_have_usable_char16_t" != "yes"; then

    _SAVE_CXXFLAGS=$CXXFLAGS
    CXXFLAGS="$CXXFLAGS -fshort-wchar"

    echo $ac_n "checking for compiler -fshort-wchar option""... $ac_c" 1>&6
echo "configure:10029: checking for compiler -fshort-wchar option" >&5
if eval "test \"`echo '$''{'ac_cv_have_usable_wchar_option_v2'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10034 "configure"
#include "confdefs.h"
#include <stddef.h>
                      $configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
                      CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)
; return 0; }
EOF
if { (eval echo configure:10043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_have_usable_wchar_option_v2="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_usable_wchar_option_v2="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_have_usable_wchar_option_v2" 1>&6

    if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
        cat >> confdefs.h <<\EOF
#define HAVE_CPP_2BYTE_WCHAR_T 1
EOF

        HAVE_CPP_2BYTE_WCHAR_T=1
        if test "$OS_TARGET" = Android; then
            WCHAR_CFLAGS="-fshort-wchar -Wl,--no-wchar-size-warning"
            CXXFLAGS="$CXXFLAGS -Wl,--no-wchar-size-warning"
            CFLAGS="$CFLAGS -Wl,--no-wchar-size-warning"
            DSO_LDOPTS="$DSO_LDOPTS -Wl,--no-wchar-size-warning"
        else
            WCHAR_CFLAGS="-fshort-wchar"
        fi
    else
        CXXFLAGS=$_SAVE_CXXFLAGS
    fi
fi

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


if test "$GNU_CC"; then
  echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
echo "configure:10086: checking for visibility(hidden) attribute" >&5
if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
                  int foo __attribute__ ((visibility ("hidden"))) = 1;
EOF
                  ac_cv_visibility_hidden=no
                  if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
                    if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
                      ac_cv_visibility_hidden=yes
                    fi
                  fi
                  rm -f conftest.cs
                 
fi

echo "$ac_t""$ac_cv_visibility_hidden" 1>&6
  if test "$ac_cv_visibility_hidden" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_VISIBILITY_HIDDEN_ATTRIBUTE 1
EOF


    echo $ac_n "checking for visibility(default) attribute""... $ac_c" 1>&6
echo "configure:10111: checking for visibility(default) attribute" >&5
if eval "test \"`echo '$''{'ac_cv_visibility_default'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
                    int foo __attribute__ ((visibility ("default"))) = 1;
EOF
                    ac_cv_visibility_default=no
                    if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
                      if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
                        ac_cv_visibility_default=yes
                      fi
                    fi
                    rm -f conftest.cs
                   
fi

echo "$ac_t""$ac_cv_visibility_default" 1>&6
    if test "$ac_cv_visibility_default" = "yes"; then
      cat >> confdefs.h <<\EOF
#define HAVE_VISIBILITY_ATTRIBUTE 1
EOF


      echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6
echo "configure:10136: checking for visibility pragma support" >&5
if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#pragma GCC visibility push(hidden)
                      int foo_hidden = 1;
#pragma GCC visibility push(default)
                      int foo_default = 1;
EOF
                      ac_cv_visibility_pragma=no
                      if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
                        if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
                          if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
                            ac_cv_visibility_pragma=yes
                          fi
                        fi
                      fi
                      rm -f conftest.cs
                    
fi

echo "$ac_t""$ac_cv_visibility_pragma" 1>&6
      if test "$ac_cv_visibility_pragma" = "yes"; then
        echo $ac_n "checking For gcc visibility bug with class-level attributes (GCC bug 26905)""... $ac_c" 1>&6
echo "configure:10161: checking For gcc visibility bug with class-level attributes (GCC bug 26905)" >&5
if eval "test \"`echo '$''{'ac_cv_have_visibility_class_bug'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#pragma GCC visibility push(hidden)
struct __attribute__ ((visibility ("default"))) TestStruct {
  static void Init();
};
__attribute__ ((visibility ("default"))) void TestFunc() {
  TestStruct::Init();
}
EOF
                       ac_cv_have_visibility_class_bug=no
                       if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
                         ac_cv_have_visibility_class_bug=yes
                       else
                         if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
                           ac_cv_have_visibility_class_bug=yes
                         fi
                       fi
                       rm -rf conftest.{c,S}
                       
fi

echo "$ac_t""$ac_cv_have_visibility_class_bug" 1>&6

        echo $ac_n "checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)""... $ac_c" 1>&6
echo "configure:10189: checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)" >&5
if eval "test \"`echo '$''{'ac_cv_have_visibility_builtin_bug'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#pragma GCC visibility push(hidden)
#pragma GCC visibility push(default)
#include <string.h>
#pragma GCC visibility pop

__attribute__ ((visibility ("default"))) void Func() {
  char c[100];
  memset(c, 0, sizeof(c));
}
EOF
                       ac_cv_have_visibility_builtin_bug=no
                       if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
                         ac_cv_have_visibility_builtin_bug=yes
                       else
                         if test `grep -c "@PLT" conftest.S` = 0; then
                           ac_cv_visibility_builtin_bug=yes
                         fi
                       fi
                       rm -f conftest.{c,S}
                       
fi

echo "$ac_t""$ac_cv_have_visibility_builtin_bug" 1>&6
        if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
                "$ac_cv_have_visibility_class_bug" = "no"; then
          VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
          WRAP_SYSTEM_INCLUDES=1
          STL_FLAGS='-I$(DIST)/stl_wrappers'
          WRAP_STL_INCLUDES=1
        else
          VISIBILITY_FLAGS='-fvisibility=hidden'
        fi # have visibility pragma bug
      fi   # have visibility pragma
    fi     # have visibility(default) attribute
  fi       # have visibility(hidden) attribute
fi         # GNU_CC

# visibility hidden flag for Sun Studio on Solaris
if test "$SOLARIS_SUNPRO_CC"; then
VISIBILITY_FLAGS='-xldscope=hidden'
fi         # Sun Studio on Solaris





if test "$GNU_CC"; then

echo $ac_n "checking for gcc PR49911""... $ac_c" 1>&6
echo "configure:10243: checking for gcc PR49911" >&5
ac_have_gcc_pr49911="no"

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross


_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-O2"
if test "$cross_compiling" = yes; then
  true
else
  cat > conftest.$ac_ext <<EOF
#line 10260 "configure"
#include "confdefs.h"

extern "C" void abort(void);
typedef enum {
eax,         ecx,         edx,         ebx,         esp,         ebp,
esi,         edi     }
RegisterID;
union StateRemat {
  RegisterID reg_;
  int offset_;
};
static StateRemat FromRegister(RegisterID reg) {
  StateRemat sr;
  sr.reg_ = reg;
  return sr;
}
static StateRemat FromAddress3(int address) {
  StateRemat sr;
  sr.offset_ = address;
  if (address < 46 &&    address >= 0) {
    abort();
  }
  return sr;
}
struct FrameState {
  StateRemat dataRematInfo2(bool y, int z) {
    if (y)         return FromRegister(RegisterID(1));
    return FromAddress3(z);
  }
};
FrameState frame;
StateRemat x;
__attribute__((noinline)) void jsop_setelem(bool y, int z) {
  x = frame.dataRematInfo2(y, z);
}
int main(void) {
  jsop_setelem(0, 47);
}

EOF
if { (eval echo configure:10301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_have_gcc_pr49911="yes"
fi
rm -fr conftest*
fi

CXXFLAGS="$_SAVE_CXXFLAGS"

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


if test "$ac_have_gcc_pr49911" = "yes"; then
   echo "$ac_t""yes" 1>&6
   CFLAGS="$CFLAGS -fno-tree-vrp"
   CXXFLAGS="$CXXFLAGS -fno-tree-vrp"
else
   echo "$ac_t""no" 1>&6
fi
fi


if test "$CLANG_CXX"; then
    ## We disable return-type-c-linkage because jsval is defined as a C++ type but is
    ## returned by C functions. This is possible because we use knowledge about the ABI
    ## to typedef it to a C type with the same layout when the headers are included
    ## from C.
    _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage"
fi

if test "$GNU_CC"; then
    CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
    CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
fi


# Check whether --enable-icf or --disable-icf was given.
if test "${enable_icf+set}" = set; then
  enableval="$enable_icf"
  if test "$enableval" = "no"; then
    MOZ_DISABLE_ICF=1
  elif test "$enableval" = "yes"; then
    MOZ_DISABLE_ICF= 
  else
    { echo "configure: error: Option, icf, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF"; then
    echo $ac_n "checking whether the linker supports Identical Code Folding""... $ac_c" 1>&6
echo "configure:10362: checking whether the linker supports Identical Code Folding" >&5
if eval "test \"`echo '$''{'LD_SUPPORTS_ICF'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'int foo() {return 42;}' \
              'int bar() {return 42;}' \
              'int main() {return foo() - bar();}' > conftest.${ac_ext}
        # If the linker supports ICF, foo and bar symbols will have
        # the same address
        if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:10371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
           test -s conftest${ac_exeext} &&
           objdump -t conftest${ac_exeext} | awk '{a[$6] = $1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'; then
            LD_SUPPORTS_ICF=yes
        else
            LD_SUPPORTS_ICF=no
        fi
        rm -rf conftest*
fi

echo "$ac_t""$LD_SUPPORTS_ICF" 1>&6
    if test "$LD_SUPPORTS_ICF" = yes; then
        _SAVE_LDFLAGS="$LDFLAGS -Wl,--icf=safe"
        LDFLAGS="$LDFLAGS -Wl,--icf=safe -Wl,--print-icf-sections"
        cat > conftest.$ac_ext <<EOF
#line 10386 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:10393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  LD_PRINT_ICF_SECTIONS=-Wl,--print-icf-sections
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LD_PRINT_ICF_SECTIONS=
fi
rm -f conftest*
        
        LDFLAGS="$_SAVE_LDFLAGS"
    fi
fi


if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -n "$MOZ_DEBUG_FLAGS"; then
      echo $ac_n "checking whether removing dead symbols breaks debugging""... $ac_c" 1>&6
echo "configure:10411: checking whether removing dead symbols breaks debugging" >&5
if eval "test \"`echo '$''{'GC_SECTIONS_BREAKS_DEBUG_RANGES'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'int foo() {return 42;}' \
             'int bar() {return 1;}' \
             'int main() {return foo();}' > conftest.${ac_ext}
        if { ac_try='${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2'; { (eval echo configure:10418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
           { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2'; { (eval echo configure:10419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
           test -s conftest${ac_exeext} -a -s conftest.${ac_objext}; then
            if test "`$PYTHON "$_topsrcdir"/build/autoconf/check_debug_ranges.py conftest.${ac_objext} conftest.${ac_ext}`" = \
                    "`$PYTHON "$_topsrcdir"/build/autoconf/check_debug_ranges.py conftest${ac_exeext} conftest.${ac_ext}`"; then
                GC_SECTIONS_BREAKS_DEBUG_RANGES=no
            else
                GC_SECTIONS_BREAKS_DEBUG_RANGES=yes
            fi
        else
                          GC_SECTIONS_BREAKS_DEBUG_RANGES="no, but it's broken in some other way"
        fi
        rm -rf conftest*
fi

echo "$ac_t""$GC_SECTIONS_BREAKS_DEBUG_RANGES" 1>&6
    if test "$GC_SECTIONS_BREAKS_DEBUG_RANGES" = no; then
        DSO_LDOPTS="$DSO_LDOPTS -Wl,--gc-sections"
    fi
fi



if test "$GNU_CC"; then
  CFLAGS_save="${CFLAGS}"
  CFLAGS="${CFLAGS} -Werror"
  echo $ac_n "checking for __force_align_arg_pointer__ attribute""... $ac_c" 1>&6
echo "configure:10445: checking for __force_align_arg_pointer__ attribute" >&5
if eval "test \"`echo '$''{'ac_cv_force_align_arg_pointer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10450 "configure"
#include "confdefs.h"
__attribute__ ((__force_align_arg_pointer__)) void test() {}
int main() {

; return 0; }
EOF
if { (eval echo configure:10457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_force_align_arg_pointer="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_force_align_arg_pointer="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_force_align_arg_pointer" 1>&6
  CFLAGS="${CFLAGS_save}"
  if test "$ac_cv_force_align_arg_pointer" = "yes"; then
    HAVE_GCC_ALIGN_ARG_POINTER=1
  else
    HAVE_GCC_ALIGN_ARG_POINTER=
  fi
fi


ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
echo "configure:10484: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10489 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:10497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 ac_header_dirent=$ac_hdr; break
else
  echo "$ac_t""no" 1>&6
fi
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
echo "configure:10522: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldir  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10530 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:10541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LIBS="$LIBS -ldir"
else
  echo "$ac_t""no" 1>&6
fi

else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
echo "configure:10563: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lx  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10571 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:10582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LIBS="$LIBS -lx"
else
  echo "$ac_t""no" 1>&6
fi

fi

case "$target_os" in
freebsd*|openbsd*)
# for stuff like -lXshm
    CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
    ;;
esac
 for ac_hdr in sys/byteorder.h compat.h getopt.h sys/bitypes.h \
        memory.h unistd.h gnu/libc-version.h nl_types.h malloc.h \
        X11/XKBlib.h io.h cpuid.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10616: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10621 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:10629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done



 for ac_hdr in sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10661: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10666 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:10674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done


 for ac_hdr in sys/quota.h sys/sysmacros.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10705: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10710 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:10718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done

 for ac_hdr in linux/quota.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10748: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10753 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:10761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done


 for ac_hdr in mmintrin.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10792: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10797 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:10805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done


ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

NEW_H=new.h
   ac_safe=`echo "new" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for new""... $ac_c" 1>&6
echo "configure:10842: checking for new" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10847 "configure"
#include "confdefs.h"

#include <new>
int main() {

; return 0; }
EOF
if { (eval echo configure:10855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    NEW_H=new
  else
    echo "$ac_t""no" 1>&6
    
  fi

cat >> confdefs.h <<EOF
#define NEW_H <$NEW_H>
EOF

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


# Check whether --enable-dtrace or --disable-dtrace was given.
if test "${enable_dtrace+set}" = set; then
  enableval="$enable_dtrace"
  enable_dtrace="yes"
fi

if test "x$enable_dtrace" = "xyes"; then
     ac_safe=`echo "sys/sdt.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for sys/sdt.h""... $ac_c" 1>&6
echo "configure:10896: checking for sys/sdt.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10901 "configure"
#include "confdefs.h"

#include <sys/sdt.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:10909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    HAVE_DTRACE=1
  else
    echo "$ac_t""no" 1>&6
    
  fi

  if test -n "$HAVE_DTRACE"; then
      cat >> confdefs.h <<\EOF
#define INCLUDE_MOZILLA_DTRACE 1
EOF

  else
      { echo "configure: error: dtrace enabled but sys/sdt.h not found" 1>&2; exit 1; };
  fi
fi


case $target in
*-aix4.3*|*-aix5*)
	;;
*)
	 for ac_hdr in sys/cdefs.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10948: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 10953 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:10961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done

	;;
esac

case $target in
*-hpux11.*)
	;;
*)
	echo $ac_n "checking for gethostbyname_r in -lc_r""... $ac_c" 1>&6
echo "configure:10995: checking for gethostbyname_r in -lc_r" >&5
ac_lib_var=`echo c_r'_'gethostbyname_r | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc_r  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11003 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyname_r();

int main() {
gethostbyname_r()
; return 0; }
EOF
if { (eval echo configure:11014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo c_r | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lc_r $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

	;;
esac

case $target in
*-darwin*)
    ;;
*-os2*)
    ;;
*)
    
echo $ac_n "checking for library containing dlopen""... $ac_c" 1>&6
echo "configure:11052: checking for library containing dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_search_dlopen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_dlopen="no"
cat > conftest.$ac_ext <<EOF
#line 11059 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:11070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_dlopen="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_dlopen" = "no" && for i in dl; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 11081 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:11092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_dlopen="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_dlopen" 1>&6
if test "$ac_cv_search_dlopen" != "no"; then
  test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS"
     ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
echo "configure:11110: checking for dlfcn.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 11115 "configure"
#include "confdefs.h"

#include <dlfcn.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:11123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_DLOPEN 1
EOF

  else
    echo "$ac_t""no" 1>&6
    
  fi

else :
  
fi
    ;;
esac

_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_GNU_SOURCE"
for ac_func in dladdr memmem
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:11157: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 11162 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:11185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

CFLAGS="$_SAVE_CFLAGS"

if test ! "$GNU_CXX"; then

    case $target in
    *-aix*)
	echo $ac_n "checking for demangle in -lC_r""... $ac_c" 1>&6
echo "configure:11216: checking for demangle in -lC_r" >&5
ac_lib_var=`echo C_r'_'demangle | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lC_r  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11224 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char demangle();

int main() {
demangle()
; return 0; }
EOF
if { (eval echo configure:11235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo C_r | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lC_r $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

	;;
     *)
	echo $ac_n "checking for demangle in -lC""... $ac_c" 1>&6
echo "configure:11265: checking for demangle in -lC" >&5
ac_lib_var=`echo C'_'demangle | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lC  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11273 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char demangle();

int main() {
demangle()
; return 0; }
EOF
if { (eval echo configure:11284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo C | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lC $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

	;;
     esac
fi

case $target in
*-os2*)
    ;;
*)
    echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:11320: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11328 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:11339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lsocket $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

esac

XLDFLAGS="$X_LIBS"
XLIBS="$X_EXTRA_LIBS"

if test "$no_x" = "yes"; then
    cat >> confdefs.h <<\EOF
#define NO_X11 1
EOF

else
    cat >> confdefs.h <<EOF
#define FUNCPROTO 15
EOF

	XLIBS="-lX11 $XLIBS"
	_SAVE_LDFLAGS="$LDFLAGS"
	LDFLAGS="$XLDFLAGS $LDFLAGS"
	echo $ac_n "checking for XDrawLines in -lX11""... $ac_c" 1>&6
echo "configure:11385: checking for XDrawLines in -lX11" >&5
ac_lib_var=`echo X11'_'XDrawLines | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lX11 $XLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11393 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XDrawLines();

int main() {
XDrawLines()
; return 0; }
EOF
if { (eval echo configure:11404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X11_LIBS="-lX11"
else
  echo "$ac_t""no" 1>&6
MISSING_X="$MISSING_X -lX11"
fi

	echo $ac_n "checking for XextAddDisplay in -lXext""... $ac_c" 1>&6
echo "configure:11426: checking for XextAddDisplay in -lXext" >&5
ac_lib_var=`echo Xext'_'XextAddDisplay | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXext $XLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11434 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XextAddDisplay();

int main() {
XextAddDisplay()
; return 0; }
EOF
if { (eval echo configure:11445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XEXT_LIBS="-lXext"
else
  echo "$ac_t""no" 1>&6
MISSING_X="$MISSING_X -lXext"
fi


	echo $ac_n "checking for XtFree in -lXt""... $ac_c" 1>&6
echo "configure:11468: checking for XtFree in -lXt" >&5
ac_lib_var=`echo Xt'_'XtFree | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXt  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11476 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XtFree();

int main() {
XtFree()
; return 0; }
EOF
if { (eval echo configure:11487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   XT_LIBS="-lXt"
else
  echo "$ac_t""no" 1>&6

        unset ac_cv_lib_Xt_XtFree
	    echo $ac_n "checking for IceFlush in -lICE""... $ac_c" 1>&6
echo "configure:11508: checking for IceFlush in -lICE" >&5
ac_lib_var=`echo ICE'_'IceFlush | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lICE $XT_LIBS $XLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11516 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char IceFlush();

int main() {
IceFlush()
; return 0; }
EOF
if { (eval echo configure:11527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XT_LIBS="-lICE $XT_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

	    echo $ac_n "checking for SmcCloseConnection in -lSM""... $ac_c" 1>&6
echo "configure:11548: checking for SmcCloseConnection in -lSM" >&5
ac_lib_var=`echo SM'_'SmcCloseConnection | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lSM $XT_LIBS $XLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11556 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char SmcCloseConnection();

int main() {
SmcCloseConnection()
; return 0; }
EOF
if { (eval echo configure:11567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XT_LIBS="-lSM $XT_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

        echo $ac_n "checking for XtFree in -lXt""... $ac_c" 1>&6
echo "configure:11588: checking for XtFree in -lXt" >&5
ac_lib_var=`echo Xt'_'XtFree | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXt $X_PRE_LIBS $XT_LIBS $XLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11596 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XtFree();

int main() {
XtFree()
; return 0; }
EOF
if { (eval echo configure:11607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   XT_LIBS="-lXt $XT_LIBS"
else
  echo "$ac_t""no" 1>&6
MISSING_X="$MISSING_X -lXt"
fi

        
fi


    # AIX needs the motif library linked before libXt to prevent
    # crashes in plugins linked against Motif - Bug #98892
    case "${target_os}" in
    aix*)
        XT_LIBS="-lXm $XT_LIBS"
        ;;
    esac

                echo $ac_n "checking for XShmCreateImage in -lXext""... $ac_c" 1>&6
echo "configure:11641: checking for XShmCreateImage in -lXext" >&5
ac_lib_var=`echo Xext'_'XShmCreateImage | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXext $XLIBS $XEXT_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11649 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XShmCreateImage();

int main() {
XShmCreateImage()
; return 0; }
EOF
if { (eval echo configure:11660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  _HAVE_XSHM_XEXT=1
else
  echo "$ac_t""no" 1>&6
fi


                   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
echo "configure:11683: checking for X11/extensions/scrnsaver.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 11688 "configure"
#include "confdefs.h"

#include <X11/extensions/scrnsaver.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:11696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    echo $ac_n "checking for XScreenSaverQueryInfo in -lXss""... $ac_c" 1>&6
echo "configure:11711: checking for XScreenSaverQueryInfo in -lXss" >&5
ac_lib_var=`echo Xss'_'XScreenSaverQueryInfo | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXss $XEXT_LIBS $XLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11719 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XScreenSaverQueryInfo();

int main() {
XScreenSaverQueryInfo()
; return 0; }
EOF
if { (eval echo configure:11730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XSS_LIBS="-lXss $XEXT_LIBS $XLIBS"
             cat >> confdefs.h <<\EOF
#define HAVE_LIBXSS 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

  else
    echo "$ac_t""no" 1>&6
    
  fi


	LDFLAGS="$_SAVE_LDFLAGS"

                succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:11768: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for freetype2 >= 6.1.0""... $ac_c" 1>&6
echo "configure:11812: checking for freetype2 >= 6.1.0" >&5

        if $PKG_CONFIG --exists "freetype2 >= 6.1.0" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking FT2_CFLAGS""... $ac_c" 1>&6
echo "configure:11819: checking FT2_CFLAGS" >&5
            FT2_CFLAGS=`$PKG_CONFIG --cflags "freetype2 >= 6.1.0"`
            echo "$ac_t""$FT2_CFLAGS" 1>&6

            echo $ac_n "checking FT2_LIBS""... $ac_c" 1>&6
echo "configure:11824: checking FT2_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            FT2_LIBS="`$PKG_CONFIG --libs \"freetype2 >= 6.1.0\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$FT2_LIBS" 1>&6
        else
            FT2_CFLAGS=""
            FT2_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            FT2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "freetype2 >= 6.1.0"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _HAVE_FREETYPE2=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _HAVE_FREETYPE2=
     fi
  fi


    if test "$_HAVE_FREETYPE2"; then
    	_SAVE_LIBS="$LIBS"
    	_SAVE_CFLAGS="$CFLAGS"
    	LIBS="$LIBS $FT2_LIBS"
    	CFLAGS="$CFLAGS $FT2_CFLAGS"

        echo $ac_n "checking for FT_Bitmap_Size.y_ppem""... $ac_c" 1>&6
echo "configure:11861: checking for FT_Bitmap_Size.y_ppem" >&5
if eval "test \"`echo '$''{'ac_cv_member_FT_Bitmap_Size_y_ppem'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 11866 "configure"
#include "confdefs.h"
#include <ft2build.h>
                             #include FT_FREETYPE_H
int main() {
FT_Bitmap_Size s;
                             if (sizeof s.y_ppem) return 0;
                             return 1
; return 0; }
EOF
if { (eval echo configure:11876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_member_FT_Bitmap_Size_y_ppem=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_member_FT_Bitmap_Size_y_ppem=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_member_FT_Bitmap_Size_y_ppem" 1>&6
        if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
            HAVE_FT_BITMAP_SIZE_Y_PPEM=1
        else
            HAVE_FT_BITMAP_SIZE_Y_PPEM=0
        fi
        cat >> confdefs.h <<EOF
#define HAVE_FT_BITMAP_SIZE_Y_PPEM $HAVE_FT_BITMAP_SIZE_Y_PPEM
EOF


        for ac_func in FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:11902: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 11907 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:11930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


    	LIBS="$_SAVE_LIBS"
    	CFLAGS="$_SAVE_CFLAGS"
    fi

fi # $no_x








case "$target_os" in
darwin*)
    USE_PTHREADS=1
    ;;
*)
    
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:11975: checking for pthread_create in -lpthreads" >&5
echo "
    #include <pthread.h>
    #include <stdlib.h>
    void *foo(void *v) { int a = 1;  } 
    int main() { 
        pthread_t t;
        if (!pthread_create(&t, 0, &foo, 0)) {
            pthread_join(t, 0);
        }
        exit(0);
    }" > dummy.c ;
    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS" 1>&5;
    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS 2>&5;
    _res=$? ;
    rm -f dummy.c dummy${ac_exeext} ;
    if test "$_res" = "0"; then
        echo "$ac_t""yes" 1>&6
        USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
    else
        echo "$ac_t""no" 1>&6
        
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:11998: checking for pthread_create in -lpthread" >&5
echo "
    #include <pthread.h>
    #include <stdlib.h>
    void *foo(void *v) { int a = 1;  } 
    int main() { 
        pthread_t t;
        if (!pthread_create(&t, 0, &foo, 0)) {
            pthread_join(t, 0);
        }
        exit(0);
    }" > dummy.c ;
    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS" 1>&5;
    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS 2>&5;
    _res=$? ;
    rm -f dummy.c dummy${ac_exeext} ;
    if test "$_res" = "0"; then
        echo "$ac_t""yes" 1>&6
        USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
    else
        echo "$ac_t""no" 1>&6
        
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:12021: checking for pthread_create in -lc_r" >&5
echo "
    #include <pthread.h>
    #include <stdlib.h>
    void *foo(void *v) { int a = 1;  } 
    int main() { 
        pthread_t t;
        if (!pthread_create(&t, 0, &foo, 0)) {
            pthread_join(t, 0);
        }
        exit(0);
    }" > dummy.c ;
    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS" 1>&5;
    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS 2>&5;
    _res=$? ;
    rm -f dummy.c dummy${ac_exeext} ;
    if test "$_res" = "0"; then
        echo "$ac_t""yes" 1>&6
        USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
    else
        echo "$ac_t""no" 1>&6
        
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
echo "configure:12044: checking for pthread_create in -lc" >&5
echo "
    #include <pthread.h>
    #include <stdlib.h>
    void *foo(void *v) { int a = 1;  } 
    int main() { 
        pthread_t t;
        if (!pthread_create(&t, 0, &foo, 0)) {
            pthread_join(t, 0);
        }
        exit(0);
    }" > dummy.c ;
    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS" 1>&5;
    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS 2>&5;
    _res=$? ;
    rm -f dummy.c dummy${ac_exeext} ;
    if test "$_res" = "0"; then
        echo "$ac_t""yes" 1>&6
        USE_PTHREADS=1
                
    else
        echo "$ac_t""no" 1>&6
        
    fi

            
    fi

        
    fi

    
    fi

    ;;
esac

# Check whether --with-pthreads or --without-pthreads was given.
if test "${with_pthreads+set}" = set; then
  withval="$with_pthreads"
  if test "$withval" = "yes"; then
     if test "$USE_PTHREADS"x = x; then
    { echo "configure: error:  --with-pthreads specified for a system without pthread support " 1>&2; exit 1; };
fi
  elif test "$withval" = "no"; then
    USE_PTHREADS=
    _PTHREAD_LDFLAGS=

  else
    { echo "configure: error: Option, pthreads, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi


if test "$USE_PTHREADS"x != x
then
				rm -f conftest*
	ac_cv_have_dash_pthread=no
	echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
echo "configure:12103: checking whether ${CC-cc} accepts -pthread" >&5
	echo 'int main() { return 0; }' | cat > conftest.c
	${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
	if test $? -eq 0; then
		if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
			ac_cv_have_dash_pthread=yes
	        case "$target_os" in
	        freebsd*)
# Freebsd doesn't use -pthread for compiles, it uses them for linking
                ;;
	        *)
			    CFLAGS="$CFLAGS -pthread"
			    CXXFLAGS="$CXXFLAGS -pthread"
                ;;
	        esac
		fi
	fi
	rm -f conftest*
    echo "$ac_t""$ac_cv_have_dash_pthread" 1>&6

			    ac_cv_have_dash_pthreads=no
    if test "$ac_cv_have_dash_pthread" = "no"; then
	    echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
echo "configure:12126: checking whether ${CC-cc} accepts -pthreads" >&5
    	echo 'int main() { return 0; }' | cat > conftest.c
	    ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
    	if test $? -eq 0; then
	    	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
			    ac_cv_have_dash_pthreads=yes
			    CFLAGS="$CFLAGS -pthreads"
			    CXXFLAGS="$CXXFLAGS -pthreads"
		    fi
	    fi
	    rm -f conftest*
    	echo "$ac_t""$ac_cv_have_dash_pthreads" 1>&6
    fi

	case "$target" in
	    *-*-freebsd*)
			cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

			cat >> confdefs.h <<\EOF
#define _THREAD_SAFE 1
EOF

						if test "$ac_cv_have_dash_pthread" = "yes"; then
				_PTHREAD_LDFLAGS="-pthread"
			else
				_PTHREAD_LDFLAGS="-lc_r"
			fi
			;;

	    *-*-openbsd*|*-*-bsdi*)
			cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

			cat >> confdefs.h <<\EOF
#define _THREAD_SAFE 1
EOF

						if test "$ac_cv_have_dash_pthread" = "yes"; then
                _PTHREAD_LDFLAGS="-pthread"
			fi
			;;

	    *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
			cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

			;;

	    *-aix4.3*|*-aix5*)
			cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

			;;

	    *-hpux11.*)
			cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

			;;

	    *-*-solaris*)
			cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

			if test "$SOLARIS_SUNPRO_CC"; then
				CFLAGS="$CFLAGS -mt"
				CXXFLAGS="$CXXFLAGS -mt"
			fi
			;;
	esac
    LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
fi


if test $ac_cv_prog_gcc = yes; then
    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:12209: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    ac_pattern="Autoconf.*'x'"
  cat > conftest.$ac_ext <<EOF
#line 12215 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
else
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*


  if test $ac_cv_prog_gcc_traditional = no; then
    cat > conftest.$ac_ext <<EOF
#line 12233 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
fi
rm -f conftest*

  fi
fi

echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
  if test $ac_cv_prog_gcc_traditional = yes; then
    CC="$CC -traditional"
  fi
fi

echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
echo "configure:12255: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_memcmp_clean=no
else
  cat > conftest.$ac_ext <<EOF
#line 12263 "configure"
#include "confdefs.h"

main()
{
  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
}

EOF
if { (eval echo configure:12273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_memcmp_clean=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_memcmp_clean=no
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"

for ac_func in random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:12293: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12298 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:12321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in flockfile getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:12348: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12353 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:12376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in localtime_r strtok_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:12403: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12408 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:12431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


echo $ac_n "checking for clock_gettime(CLOCK_MONOTONIC)""... $ac_c" 1>&6
echo "configure:12457: checking for clock_gettime(CLOCK_MONOTONIC)" >&5
if eval "test \"`echo '$''{'ac_cv_clock_monotonic'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  for libs in "" -lrt; do
                    _SAVE_LIBS="$LIBS"
                    LIBS="$LIBS $libs"
                    cat > conftest.$ac_ext <<EOF
#line 12465 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
 struct timespec ts;
                                   clock_gettime(CLOCK_MONOTONIC, &ts); 
; return 0; }
EOF
if { (eval echo configure:12473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_clock_monotonic=$libs
                                 break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_clock_monotonic=no
fi
rm -f conftest*
                    LIBS="$_SAVE_LIBS"
                done
fi

echo "$ac_t""$ac_cv_clock_monotonic" 1>&6
if test "$ac_cv_clock_monotonic" != "no"; then
    HAVE_CLOCK_MONOTONIC=1
    REALTIME_LIBS=$ac_cv_clock_monotonic
    cat >> confdefs.h <<\EOF
#define HAVE_CLOCK_MONOTONIC 1
EOF

    
    
fi

if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking for wcrtomb""... $ac_c" 1>&6
echo "configure:12510: checking for wcrtomb" >&5
if eval "test \"`echo '$''{'ac_cv_have_wcrtomb'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12515 "configure"
#include "confdefs.h"
#include <wchar.h>
int main() {
mbstate_t ps={0};wcrtomb(0,'f',&ps);
; return 0; }
EOF
if { (eval echo configure:12522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_have_wcrtomb="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_wcrtomb="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_have_wcrtomb" 1>&6
if test "$ac_cv_have_wcrtomb" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_WCRTOMB 1
EOF

fi
echo $ac_n "checking for mbrtowc""... $ac_c" 1>&6
echo "configure:12542: checking for mbrtowc" >&5
if eval "test \"`echo '$''{'ac_cv_have_mbrtowc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12547 "configure"
#include "confdefs.h"
#include <wchar.h>
int main() {
mbstate_t ps={0};mbrtowc(0,0,0,&ps);
; return 0; }
EOF
if { (eval echo configure:12554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_have_mbrtowc="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_mbrtowc="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_have_mbrtowc" 1>&6
if test "$ac_cv_have_mbrtowc" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_MBRTOWC 1
EOF

fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

fi

echo $ac_n "checking for res_ninit()""... $ac_c" 1>&6
echo "configure:12583: checking for res_ninit()" >&5
if eval "test \"`echo '$''{'ac_cv_func_res_ninit'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12588 "configure"
#include "confdefs.h"

        #ifdef linux
        #define _BSD_SOURCE 1
        #endif
        #include <resolv.h>
        
int main() {
int foo = res_ninit(&_res);
; return 0; }
EOF
if { (eval echo configure:12600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_func_res_ninit=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_res_ninit=no
fi
rm -f conftest*
    
fi

echo "$ac_t""$ac_cv_func_res_ninit" 1>&6

if test "$ac_cv_func_res_ninit" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_RES_NINIT 1
EOF

fi

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking for gnu_get_libc_version()""... $ac_c" 1>&6
echo "configure:12630: checking for gnu_get_libc_version()" >&5
if eval "test \"`echo '$''{'ac_cv_func_gnu_get_libc_version'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12635 "configure"
#include "confdefs.h"

        #ifdef HAVE_GNU_LIBC_VERSION_H
        #include <gnu/libc-version.h>
        #endif
        
int main() {
const char *glibc_version = gnu_get_libc_version();
; return 0; }
EOF
if { (eval echo configure:12646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_func_gnu_get_libc_version=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_gnu_get_libc_version=no
        
fi
rm -f conftest*
    
fi

echo "$ac_t""$ac_cv_func_gnu_get_libc_version" 1>&6

if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_GNU_GET_LIBC_VERSION 1
EOF

fi

case $target_os in
    darwin*|mingw*|os2*)
        ;;
    *)

echo $ac_n "checking for iconv in -lc""... $ac_c" 1>&6
echo "configure:12675: checking for iconv in -lc" >&5
ac_lib_var=`echo c'_'iconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12683 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv();

int main() {
iconv()
; return 0; }
EOF
if { (eval echo configure:12697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  _ICONV_LIBS="$_ICONV_LIBS"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
echo "configure:12716: checking for iconv in -liconv" >&5
ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-liconv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12724 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv();

int main() {
iconv()
; return 0; }
EOF
if { (eval echo configure:12738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  _ICONV_LIBS="$_ICONV_LIBS -liconv"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for libiconv in -liconv""... $ac_c" 1>&6
echo "configure:12757: checking for libiconv in -liconv" >&5
ac_lib_var=`echo iconv'_'libiconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-liconv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12765 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char libiconv();

int main() {
libiconv()
; return 0; }
EOF
if { (eval echo configure:12779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  _ICONV_LIBS="$_ICONV_LIBS -liconv"
else
  echo "$ac_t""no" 1>&6
fi

fi

fi

_SAVE_LIBS=$LIBS
LIBS="$LIBS $_ICONV_LIBS"
echo $ac_n "checking for iconv()""... $ac_c" 1>&6
echo "configure:12806: checking for iconv()" >&5
if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12811 "configure"
#include "confdefs.h"

        #include <stdlib.h>
        #include <iconv.h>
        
int main() {

            iconv_t h = iconv_open("", "");
            iconv(h, NULL, NULL, NULL, NULL);
            iconv_close(h);
        
; return 0; }
EOF
if { (eval echo configure:12825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_func_iconv=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_iconv=no
        
fi
rm -f conftest*
    
fi

echo "$ac_t""$ac_cv_func_iconv" 1>&6
if test "$ac_cv_func_iconv" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_ICONV 1
EOF

    DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
    LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
    LIBICONV="$_ICONV_LIBS"
    echo $ac_n "checking for iconv() with const input""... $ac_c" 1>&6
echo "configure:12849: checking for iconv() with const input" >&5
if eval "test \"`echo '$''{'ac_cv_func_const_iconv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12854 "configure"
#include "confdefs.h"

            #include <stdlib.h>
            #include <iconv.h>
            
int main() {

                const char *input = "testing";
                iconv_t h = iconv_open("", "");
                iconv(h, &input, NULL, NULL, NULL);
                iconv_close(h);
            
; return 0; }
EOF
if { (eval echo configure:12869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_func_const_iconv=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_const_iconv=no
            
fi
rm -f conftest*
        
fi

echo "$ac_t""$ac_cv_func_const_iconv" 1>&6
    if test "$ac_cv_func_const_iconv" = "yes"; then
        cat >> confdefs.h <<\EOF
#define HAVE_ICONV_WITH_CONST_INPUT 1
EOF

    fi
fi
LIBS=$_SAVE_LIBS

    ;;
esac


  echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
echo "configure:12898: checking for nl_langinfo and CODESET" >&5
if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12903 "configure"
#include "confdefs.h"
#include <langinfo.h>
int main() {
char* cs = nl_langinfo(CODESET);
; return 0; }
EOF
if { (eval echo configure:12910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_langinfo_codeset=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  am_cv_langinfo_codeset=no
fi
rm -f conftest*
    
fi

echo "$ac_t""$am_cv_langinfo_codeset" 1>&6
  if test $am_cv_langinfo_codeset = yes; then
    cat >> confdefs.h <<\EOF
#define HAVE_LANGINFO_CODESET 1
EOF

      HAVE_LANGINFO_CODESET=1
  fi


ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


echo $ac_n "checking for an implementation of va_copy()""... $ac_c" 1>&6
echo "configure:12942: checking for an implementation of va_copy()" >&5
if eval "test \"`echo '$''{'ac_cv_va_copy'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test "$cross_compiling" = yes; then
  ac_cv_va_copy=no
    
else
  cat > conftest.$ac_ext <<EOF
#line 12952 "configure"
#include "confdefs.h"

        #include <stdarg.h>
        void f (int i, ...) {
            va_list args1, args2;
            va_start (args1, i);
            va_copy (args2, args1);
            if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
                exit (1);
            va_end (args1); va_end (args2);
        }
        int main() { f (0, 42); return 0; }
EOF
if { (eval echo configure:12966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_va_copy=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_va_copy=no
fi
rm -fr conftest*
fi


fi

echo "$ac_t""$ac_cv_va_copy" 1>&6
echo $ac_n "checking for an implementation of __va_copy()""... $ac_c" 1>&6
echo "configure:12983: checking for an implementation of __va_copy()" >&5
if eval "test \"`echo '$''{'ac_cv___va_copy'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test "$cross_compiling" = yes; then
  ac_cv___va_copy=no
    
else
  cat > conftest.$ac_ext <<EOF
#line 12993 "configure"
#include "confdefs.h"

        #include <stdarg.h>
        void f (int i, ...) {
            va_list args1, args2;
            va_start (args1, i);
            __va_copy (args2, args1);
            if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
                exit (1);
            va_end (args1); va_end (args2);
        }
        int main() { f (0, 42); return 0; }
EOF
if { (eval echo configure:13007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv___va_copy=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv___va_copy=no
fi
rm -fr conftest*
fi


fi

echo "$ac_t""$ac_cv___va_copy" 1>&6
echo $ac_n "checking whether va_lists can be copied by value""... $ac_c" 1>&6
echo "configure:13024: checking whether va_lists can be copied by value" >&5
if eval "test \"`echo '$''{'ac_cv_va_val_copy'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test "$cross_compiling" = yes; then
  ac_cv_va_val_copy=yes
    
else
  cat > conftest.$ac_ext <<EOF
#line 13034 "configure"
#include "confdefs.h"

        #include <stdarg.h>
        void f (int i, ...) {
            va_list args1, args2;
            va_start (args1, i);
            args2 = args1;
            if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
                exit (1);
            va_end (args1); va_end (args2);
        }
        int main() { f (0, 42); return 0; }
EOF
if { (eval echo configure:13048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_va_val_copy=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_va_val_copy=no
fi
rm -fr conftest*
fi


fi

if test "x$ac_cv_va_copy" = "xyes"; then
    cat >> confdefs.h <<\EOF
#define VA_COPY va_copy
EOF

    cat >> confdefs.h <<\EOF
#define HAVE_VA_COPY 1
EOF

elif test "x$ac_cv___va_copy" = "xyes"; then
    cat >> confdefs.h <<\EOF
#define VA_COPY __va_copy
EOF

    cat >> confdefs.h <<\EOF
#define HAVE_VA_COPY 1
EOF

fi

if test "x$ac_cv_va_val_copy" = "xno"; then
   cat >> confdefs.h <<\EOF
#define HAVE_VA_LIST_AS_ARRAY 1
EOF

fi
echo "$ac_t""$ac_cv_va_val_copy" 1>&6

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross


ARM_ABI_PREFIX=
if test "$GNU_CC"; then
  if test "$CPU_ARCH" = "arm" ; then
    echo $ac_n "checking for ARM EABI""... $ac_c" 1>&6
echo "configure:13103: checking for ARM EABI" >&5
if eval "test \"`echo '$''{'ac_cv_gcc_arm_eabi'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13108 "configure"
#include "confdefs.h"

int main() {

#if defined(__ARM_EABI__)
  return 0;
#else
#error Not ARM EABI.
#endif
                        
; return 0; }
EOF
if { (eval echo configure:13121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_gcc_arm_eabi="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_gcc_arm_eabi="no"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_gcc_arm_eabi" 1>&6
    if test "$ac_cv_gcc_arm_eabi" = "yes"; then
        HAVE_ARM_EABI=1
        ARM_ABI_PREFIX=eabi-
    else
        ARM_ABI_PREFIX=oabi-
    fi
  fi

  TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
fi

echo $ac_n "checking for modern C++ template specialization syntax support""... $ac_c" 1>&6
echo "configure:13146: checking for modern C++ template specialization syntax support" >&5
if eval "test \"`echo '$''{'ac_cv_cpp_modern_specialize_template_syntax'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13151 "configure"
#include "confdefs.h"
template <class T> struct X { int a; };
                               class Y {};
                               template <> struct X<Y> { double a; };
int main() {
X<int> int_x;
                               X<Y> y_x;
; return 0; }
EOF
if { (eval echo configure:13161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_cpp_modern_specialize_template_syntax=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cpp_modern_specialize_template_syntax=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_cpp_modern_specialize_template_syntax" 1>&6
if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
  { echo "configure: error: The C++ compiler does not support template specialization" 1>&2; exit 1; }
fi

echo $ac_n "checking whether partial template specialization works""... $ac_c" 1>&6
echo "configure:13179: checking whether partial template specialization works" >&5
if eval "test \"`echo '$''{'ac_cv_cpp_partial_specialization'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13184 "configure"
#include "confdefs.h"
template <class T> class Foo {};
                               template <class T> class Foo<T*> {};
int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:13192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_cpp_partial_specialization=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cpp_partial_specialization=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_cpp_partial_specialization" 1>&6
if test "$ac_cv_cpp_partial_specialization" = yes ; then
  cat >> confdefs.h <<\EOF
#define HAVE_CPP_PARTIAL_SPECIALIZATION 1
EOF

fi

echo $ac_n "checking whether the C++ \"using\" keyword resolves ambiguity""... $ac_c" 1>&6
echo "configure:13213: checking whether the C++ \"using\" keyword resolves ambiguity" >&5
if eval "test \"`echo '$''{'ac_cv_cpp_ambiguity_resolving_using'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13218 "configure"
#include "confdefs.h"
class X {
                                 public: int go(const X&) {return 3;}
                                         int jo(const X&) {return 3;}
                               };
                               class Y : public X {
                                 public:  int go(int) {return 2;}
                                          int jo(int) {return 2;}
                                          using X::jo;
                                 private: using X::go;
                               };
int main() {
X x; Y y; y.jo(x);
; return 0; }
EOF
if { (eval echo configure:13234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_cpp_ambiguity_resolving_using=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cpp_ambiguity_resolving_using=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_cpp_ambiguity_resolving_using" 1>&6
if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
   cat >> confdefs.h <<\EOF
#define HAVE_CPP_AMBIGUITY_RESOLVING_USING 1
EOF

fi

echo $ac_n "checking for C++ dynamic_cast to void*""... $ac_c" 1>&6
echo "configure:13255: checking for C++ dynamic_cast to void*" >&5
if eval "test \"`echo '$''{'ac_cv_cpp_dynamic_cast_void_ptr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_cpp_dynamic_cast_void_ptr=no
else
  cat > conftest.$ac_ext <<EOF
#line 13263 "configure"
#include "confdefs.h"
class X { int i; public: virtual ~X() { } };
                            class Y { int j; public: virtual ~Y() { } };
                            class Z : public X, public Y { int k; };

                            int main() {
                                 Z mdo;
                                 X *subx = (X*)&mdo;
                                 Y *suby = (Y*)&mdo;
                                 return !((((void*)&mdo != (void*)subx) &&
                                           ((void*)&mdo == dynamic_cast<void*>(subx))) ||
                                          (((void*)&mdo != (void*)suby) &&
                                           ((void*)&mdo == dynamic_cast<void*>(suby))));
                            }
EOF
if { (eval echo configure:13279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_cpp_dynamic_cast_void_ptr=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_cpp_dynamic_cast_void_ptr=no
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_cpp_dynamic_cast_void_ptr" 1>&6
if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
   cat >> confdefs.h <<\EOF
#define HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR 1
EOF

fi


echo $ac_n "checking whether C++ requires implementation of unused virtual methods""... $ac_c" 1>&6
echo "configure:13303: checking whether C++ requires implementation of unused virtual methods" >&5
if eval "test \"`echo '$''{'ac_cv_cpp_unused_required'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13308 "configure"
#include "confdefs.h"
class X {private: virtual void never_called();};
int main() {
X x;
; return 0; }
EOF
if { (eval echo configure:13315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_cpp_unused_required=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cpp_unused_required=yes
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_cpp_unused_required" 1>&6
if test "$ac_cv_cpp_unused_required" = yes ; then
   cat >> confdefs.h <<\EOF
#define NEED_CPP_UNUSED_IMPLEMENTATIONS 1
EOF

fi



echo $ac_n "checking for trouble comparing to zero near std::operator!=()""... $ac_c" 1>&6
echo "configure:13338: checking for trouble comparing to zero near std::operator!=()" >&5
if eval "test \"`echo '$''{'ac_cv_trouble_comparing_to_zero'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13343 "configure"
#include "confdefs.h"
#include <algorithm>
                                template <class T> class Foo {};
                                class T2;
                                template <class T> int operator==(const T2*, const T&) { return 0; }
                                template <class T> int operator!=(const T2*, const T&) { return 0; }
int main() {
Foo<int> f; return (0 != f);
; return 0; }
EOF
if { (eval echo configure:13354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_trouble_comparing_to_zero=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_trouble_comparing_to_zero=yes
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_trouble_comparing_to_zero" 1>&6
if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
  cat >> confdefs.h <<\EOF
#define HAVE_CPP_TROUBLE_COMPARING_TO_ZERO 1
EOF

fi

# try harder, when checking for __thread support, see bug 521750 comment #33 and below
# We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
# enabled, the linker in xcode 4.1 will crash. Without this it would crash when
# linking XUL.
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
echo $ac_n "checking for __thread keyword for TLS variables""... $ac_c" 1>&6
echo "configure:13381: checking for __thread keyword for TLS variables" >&5
if eval "test \"`echo '$''{'ac_cv_thread_keyword'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13386 "configure"
#include "confdefs.h"
__thread bool tlsIsMainThread = false;
int main() {
return tlsIsMainThread;
; return 0; }
EOF
if { (eval echo configure:13393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_thread_keyword=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_thread_keyword=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_thread_keyword" 1>&6
LDFLAGS=$_SAVE_LDFLAGS
# The custom dynamic linker doesn't support TLS variables
if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
  # mips builds fail with TLS variables because of a binutils bug.
  # See bug 528687
  case "${target}" in
    mips*-*)
      :
      ;;
    *-android*|*-linuxandroid*)
      :
      ;;
    *)
      cat >> confdefs.h <<\EOF
#define HAVE_THREAD_TLS_KEYWORD 1
EOF

      ;;
  esac
fi

if test -n "$MOZ_LINKER"; then
  if test "$CPU_ARCH" = arm; then
        ARM_ARCH=`${CC-cc} ${CFLAGS} -dM -E - < /dev/null | sed -n 's/.*__ARM_ARCH_\([0-9]*\).*/\1/p'`
        if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then
      LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=0x4000"
      _SUBDIR_LDFLAGS="$_SUBDIR_LDFLAGS -Wl,-z,max-page-size=0x4000"
    fi
  fi
fi

if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$OS_TARGET" = "Android"; then
  echo $ac_n "checking whether the CRT objects have text relocations""... $ac_c" 1>&6
echo "configure:13439: checking whether the CRT objects have text relocations" >&5
if eval "test \"`echo '$''{'ac_cv_crt_has_text_relocations'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'int foo() { return 0; }' > conftest.cpp
     if { ac_try='${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5'; { (eval echo configure:13444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
        test -s conftest${DLL_SUFFIX}; then
       if readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then
         ac_cv_crt_has_text_relocations=yes
       else
         ac_cv_crt_has_text_relocations=no
       fi
     else
       { echo "configure: error: couldn't compile a simple C file" 1>&2; exit 1; }
     fi
     rm -rf conftest*
fi

echo "$ac_t""$ac_cv_crt_has_text_relocations" 1>&6
  if test "$ac_cv_crt_has_text_relocations" = yes; then
                            DSO_LDOPTS="$DSO_LDOPTS -nostartfiles"
    NSPR_LDFLAGS=-nostartfiles
  fi
fi


MALLOC_H=
   ac_safe=`echo "malloc.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for malloc.h""... $ac_c" 1>&6
echo "configure:13468: checking for malloc.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 13473 "configure"
#include "confdefs.h"

#include <malloc.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:13481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    MALLOC_H=malloc.h
  else
    echo "$ac_t""no" 1>&6
    
  fi

if test "$MALLOC_H" = ""; then
     ac_safe=`echo "malloc/malloc.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for malloc/malloc.h""... $ac_c" 1>&6
echo "configure:13504: checking for malloc/malloc.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 13509 "configure"
#include "confdefs.h"

#include <malloc/malloc.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:13517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    MALLOC_H=malloc/malloc.h
  else
    echo "$ac_t""no" 1>&6
    
  fi

  if test "$MALLOC_H" = ""; then
       ac_safe=`echo "sys/malloc.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for sys/malloc.h""... $ac_c" 1>&6
echo "configure:13540: checking for sys/malloc.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 13545 "configure"
#include "confdefs.h"

#include <sys/malloc.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:13553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    MALLOC_H=sys/malloc.h
  else
    echo "$ac_t""no" 1>&6
    
  fi

  fi
fi
if test "$MALLOC_H" != ""; then
   cat >> confdefs.h <<EOF
#define MALLOC_H <$MALLOC_H>
EOF

fi

MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc"
for ac_func in strndup posix_memalign memalign valloc
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:13586: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13591 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:13617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done



echo $ac_n "checking for __attribute__((always_inline))""... $ac_c" 1>&6
echo "configure:13644: checking for __attribute__((always_inline))" >&5
if eval "test \"`echo '$''{'ac_cv_attribute_always_inline'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13649 "configure"
#include "confdefs.h"
inline void f(void) __attribute__((always_inline));
int main() {

; return 0; }
EOF
if { (eval echo configure:13656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_attribute_always_inline=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_attribute_always_inline=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_attribute_always_inline" 1>&6

echo $ac_n "checking for __attribute__((malloc))""... $ac_c" 1>&6
echo "configure:13671: checking for __attribute__((malloc))" >&5
if eval "test \"`echo '$''{'ac_cv_attribute_malloc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13676 "configure"
#include "confdefs.h"
void* f(int) __attribute__((malloc));
int main() {

; return 0; }
EOF
if { (eval echo configure:13683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_attribute_malloc=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_attribute_malloc=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_attribute_malloc" 1>&6

echo $ac_n "checking for __attribute__((warn_unused_result))""... $ac_c" 1>&6
echo "configure:13698: checking for __attribute__((warn_unused_result))" >&5
if eval "test \"`echo '$''{'ac_cv_attribute_warn_unused'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13703 "configure"
#include "confdefs.h"
int f(void) __attribute__((warn_unused_result));
int main() {

; return 0; }
EOF
if { (eval echo configure:13710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_attribute_warn_unused=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_attribute_warn_unused=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_attribute_warn_unused" 1>&6

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross



echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
echo "configure:13734: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'ac_cv_i18n_lc_messages'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13739 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
int category = LC_MESSAGES;
; return 0; }
EOF
if { (eval echo configure:13746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_i18n_lc_messages=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_i18n_lc_messages=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_i18n_lc_messages" 1>&6
if test "$ac_cv_i18n_lc_messages" = yes; then
   cat >> confdefs.h <<\EOF
#define HAVE_I18N_LC_MESSAGES 1
EOF

fi

for ac_func in localeconv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:13769: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 13774 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:13797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

fi # ! SKIP_COMPILER_CHECKS

TARGET_XPCOM_ABI=
if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
    TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
fi


if test "$ac_cv_attribute_always_inline" = yes ; then
  cat >> confdefs.h <<\EOF
#define NS_ALWAYS_INLINE __attribute__((always_inline))
EOF

else
  cat >> confdefs.h <<\EOF
#define NS_ALWAYS_INLINE 
EOF

fi

if test "$ac_cv_attribute_malloc" = yes ; then
  cat >> confdefs.h <<\EOF
#define NS_ATTR_MALLOC __attribute__((malloc))
EOF

else
  cat >> confdefs.h <<\EOF
#define NS_ATTR_MALLOC 
EOF

fi

if test "$ac_cv_attribute_warn_unused" = yes ; then
  cat >> confdefs.h <<\EOF
#define NS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
EOF

else
  cat >> confdefs.h <<\EOF
#define NS_WARN_UNUSED_RESULT 
EOF

fi


if test -n "$SKIP_COMPILER_CHECKS"; then
      cat >> confdefs.h <<\EOF
#define MALLOC_H <malloc.h>
EOF

   cat >> confdefs.h <<\EOF
#define HAVE_FORCEINLINE 1
EOF

   cat >> confdefs.h <<\EOF
#define HAVE_LOCALECONV 1
EOF

fi # SKIP_COMPILER_CHECKS

# External Packages

# Check whether --with-libxul-sdk or --without-libxul-sdk was given.
if test "${with_libxul_sdk+set}" = set; then
  withval="$with_libxul_sdk"
  LIBXUL_SDK_DIR=$withval
fi


if test "$LIBXUL_SDK_DIR" = "yes"; then
    { echo "configure: error: --with-libxul-sdk must specify a path" 1>&2; exit 1; }
elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
    LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`

    if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
        { echo "configure: error: $LIBXUL_SDK/include/xpcom-config.h doesn't exist" 1>&2; exit 1; }
    fi

fi


if test -n "$LIBXUL_SDK"; then
    LIBXUL_DIST="$LIBXUL_SDK"
else
    LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
fi


SYSTEM_LIBXUL=

# Check whether --with-system-libxul or --without-system-libxul was given.
if test "${with_system_libxul+set}" = set; then
  withval="$with_system_libxul"
  if test "$withval" = "yes"; then
    SYSTEM_LIBXUL=1
  elif test "$withval" = "no"; then
    :
  else
    { echo "configure: error: Option, system-libxul, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi


# Check whether --with-system-nspr or --without-system-nspr was given.
if test "${with_system_nspr+set}" = set; then
  withval="$with_system_nspr"
  if test "$withval" = "yes"; then
    _USE_SYSTEM_NSPR=1 
  elif test "$withval" = "no"; then
    :
  else
    { echo "configure: error: Option, system-nspr, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi


if test -n "$_USE_SYSTEM_NSPR"; then
    
# Check whether --with-nspr-prefix or --without-nspr-prefix was given.
if test "${with_nspr_prefix+set}" = set; then
  withval="$with_nspr_prefix"
  nspr_config_prefix="$withval"
else
  nspr_config_prefix=""
fi


# Check whether --with-nspr-exec-prefix or --without-nspr-exec-prefix was given.
if test "${with_nspr_exec_prefix+set}" = set; then
  withval="$with_nspr_exec_prefix"
  nspr_config_exec_prefix="$withval"
else
  nspr_config_exec_prefix=""
fi


	if test -n "$nspr_config_exec_prefix"; then
		nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix"
		if test -z "$NSPR_CONFIG"; then
			NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config
		fi
	fi
	if test -n "$nspr_config_prefix"; then
		nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix"
		if test -z "$NSPR_CONFIG"; then
			NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config
		fi
	fi

	unset ac_cv_path_NSPR_CONFIG
	# Extract the first word of "nspr-config", so it can be a program name with args.
set dummy nspr-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13974: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_NSPR_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NSPR_CONFIG" in
  /*)
  ac_cv_path_NSPR_CONFIG="$NSPR_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NSPR_CONFIG="$NSPR_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_NSPR_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_NSPR_CONFIG" && ac_cv_path_NSPR_CONFIG="no"
  ;;
esac
fi
NSPR_CONFIG="$ac_cv_path_NSPR_CONFIG"
if test -n "$NSPR_CONFIG"; then
  echo "$ac_t""$NSPR_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	min_nspr_version=4.9.0
	echo $ac_n "checking for NSPR - version >= $min_nspr_version""... $ac_c" 1>&6
echo "configure:14009: checking for NSPR - version >= $min_nspr_version" >&5

	no_nspr=""
	if test "$NSPR_CONFIG" != "no"; then
		NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags`
		NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs`
		NSPR_VERSION_STRING=`$NSPR_CONFIG $nspr_config_args --version`	
	elif test -n "${NO_NSPR_CONFIG_SYSTEM_VERSION}"; then
	    NSPR_CFLAGS="${NO_NSPR_CONFIG_SYSTEM_CFLAGS}"
		NSPR_LIBS="${NO_NSPR_CONFIG_SYSTEM_LDFLAGS}"
		NSPR_VERSION_STRING="$NO_NSPR_CONFIG_SYSTEM_VERSION"
	else
	    no_nspr="yes"
	fi

	if test -z "$no_nspr"; then
		nspr_config_major_version=`echo $NSPR_VERSION_STRING | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
		nspr_config_minor_version=`echo $NSPR_VERSION_STRING | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
		nspr_config_micro_version=`echo $NSPR_VERSION_STRING | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
		min_nspr_major_version=`echo $min_nspr_version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
		min_nspr_minor_version=`echo $min_nspr_version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
		min_nspr_micro_version=`echo $min_nspr_version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
		if test "$nspr_config_major_version" -ne "$min_nspr_major_version"; then
			no_nspr="yes"
		elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" &&
		     test "$nspr_config_minor_version" -lt "$min_nspr_minor_version"; then
			no_nspr="yes"
		elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" &&
		     test "$nspr_config_minor_version" -eq "$min_nspr_minor_version" &&
		     test "$nspr_config_micro_version" -lt "$min_nspr_micro_version"; then
			no_nspr="yes"
		fi
	fi

	if test -z "$no_nspr"; then
		echo "$ac_t""yes" 1>&6
		MOZ_NATIVE_NSPR=1     
	else
		echo "$ac_t""no" 1>&6
		{ echo "configure: error: your don't have NSPR installed or your version is too old" 1>&2; exit 1; }
	fi


	
	


fi

if test -n "$MOZ_NATIVE_NSPR"; then
    _SAVE_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS $NSPR_CFLAGS"
    cat > conftest.$ac_ext <<EOF
#line 14068 "configure"
#include "confdefs.h"
#include "prtypes.h"
int main() {
#ifndef PR_STATIC_ASSERT
                 #error PR_STATIC_ASSERT not defined or requires including prtypes.h
                 #endif
; return 0; }
EOF
if { (eval echo configure:14077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  MOZ_NATIVE_NSPR=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it" 1>&2; exit 1; }
fi
rm -f conftest*
    cat > conftest.$ac_ext <<EOF
#line 14088 "configure"
#include "confdefs.h"
#include "prtypes.h"
int main() {
#ifndef PR_UINT64
                 #error PR_UINT64 not defined or requires including prtypes.h
                 #endif
; return 0; }
EOF
if { (eval echo configure:14097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  MOZ_NATIVE_NSPR=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: system NSPR does not support PR_UINT64 or including prtypes.h does not provide it" 1>&2; exit 1; }
fi
rm -f conftest*
    CFLAGS=$_SAVE_CFLAGS
else
    if test "$OS_ARCH" = "WINNT"; then
        NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
        if test -n "$GNU_CC"; then
            NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
        else
            NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
        fi
    else
        NSPR_CFLAGS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
        NSPR_LIBS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
    fi
fi

# Check whether --with-system-libevent or --without-system-libevent was given.
if test "${with_system_libevent+set}" = set; then
  withval="$with_system_libevent"
  LIBEVENT_DIR=$withval
fi


_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
    MOZ_NATIVE_LIBEVENT=
else
    if test "${LIBEVENT_DIR}" = "yes"; then
        LIBEVENT_DIR=/usr
    fi
    CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
    LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
       ac_safe=`echo "event.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for event.h""... $ac_c" 1>&6
echo "configure:14142: checking for event.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 14147 "configure"
#include "confdefs.h"

#include <event.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:14155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
             { echo "configure: error: event.h found, but is not in ${LIBEVENT_DIR}/include" 1>&2; exit 1; }
         fi
  else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: --with-system-libevent requested but event.h not found" 1>&2; exit 1; }
  fi

    echo $ac_n "checking for event_init in -levent""... $ac_c" 1>&6
echo "configure:14178: checking for event_init in -levent" >&5
ac_lib_var=`echo event'_'event_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-levent  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14186 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char event_init();

int main() {
event_init()
; return 0; }
EOF
if { (eval echo configure:14197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MOZ_NATIVE_LIBEVENT=1
                  MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
                  MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"
else
  echo "$ac_t""no" 1>&6
MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=
fi

fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS






# Check whether --with-system-nss or --without-system-nss was given.
if test "${with_system_nss+set}" = set; then
  withval="$with_system_nss"
  if test "$withval" = "yes"; then
    _USE_SYSTEM_NSS=1 
  elif test "$withval" = "no"; then
    :
  else
    { echo "configure: error: Option, system-nss, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi


if test -n "$_USE_SYSTEM_NSS"; then
    
# Check whether --with-nss-prefix or --without-nss-prefix was given.
if test "${with_nss_prefix+set}" = set; then
  withval="$with_nss_prefix"
  nss_config_prefix="$withval"
else
  nss_config_prefix=""
fi


# Check whether --with-nss-exec-prefix or --without-nss-exec-prefix was given.
if test "${with_nss_exec_prefix+set}" = set; then
  withval="$with_nss_exec_prefix"
  nss_config_exec_prefix="$withval"
else
  nss_config_exec_prefix=""
fi


	if test -n "$nss_config_exec_prefix"; then
		nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
		if test -z "$NSS_CONFIG"; then
			NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
		fi
	fi
	if test -n "$nss_config_prefix"; then
		nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
		if test -z "$NSS_CONFIG"; then
			NSS_CONFIG=$nss_config_prefix/bin/nss-config
		fi
	fi

	unset ac_cv_path_NSS_CONFIG
	# Extract the first word of "nss-config", so it can be a program name with args.
set dummy nss-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:14280: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_NSS_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NSS_CONFIG" in
  /*)
  ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_NSS_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_NSS_CONFIG" && ac_cv_path_NSS_CONFIG="no"
  ;;
esac
fi
NSS_CONFIG="$ac_cv_path_NSS_CONFIG"
if test -n "$NSS_CONFIG"; then
  echo "$ac_t""$NSS_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	min_nss_version=3.13.2
	echo $ac_n "checking for NSS - version >= $min_nss_version""... $ac_c" 1>&6
echo "configure:14315: checking for NSS - version >= $min_nss_version" >&5

	no_nss=""
	if test "$NSS_CONFIG" = "no"; then
		no_nss="yes"
	else
		NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
		NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`

		nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
		nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
		nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
		min_nss_major_version=`echo $min_nss_version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
		min_nss_minor_version=`echo $min_nss_version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
		min_nss_micro_version=`echo $min_nss_version | \
			sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
		if test "$nss_config_major_version" -lt "$min_nss_major_version"; then
			no_nss="yes"
		elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
		     test "$nss_config_minor_version" -lt "$min_nss_minor_version"; then
			no_nss="yes"
		elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
		     test "$nss_config_minor_version" -eq "$min_nss_minor_version" &&
		     test "$nss_config_micro_version" -lt "$min_nss_micro_version"; then
			no_nss="yes"
		fi
	fi

	if test -z "$no_nss"; then
		echo "$ac_t""yes" 1>&6
		MOZ_NATIVE_NSS=1     
	else
		echo "$ac_t""no" 1>&6
		{ echo "configure: error: you don't have NSS installed or your version is too old" 1>&2; exit 1; }
	fi


	
	


fi

if test -n "$MOZ_NATIVE_NSS"; then
   NSS_LIBS="$NSS_LIBS -lcrmf"
else
   NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
   NSS_DEP_LIBS="\
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX)"

   if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2"; then
       NSS_LIBS="\
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)"
   else
       NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
   fi
fi


echo $ac_n "checking for YASM assembler""... $ac_c" 1>&6
echo "configure:14388: checking for YASM assembler" >&5
for ac_prog in yasm
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:14394: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YASM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$YASM"; then
  ac_cv_prog_YASM="$YASM" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_YASM="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
YASM="$ac_cv_prog_YASM"
if test -n "$YASM"; then
  echo "$ac_t""$YASM" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$YASM" && break
done
test -n "$YASM" || YASM=""""


if test -n "$YASM"; then
    
  _YASM_VER_FILTER='s|.* \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*|\1|p'
  

  YASM_VERSION=`yasm --version | sed -ne "$_YASM_VER_FILTER"`
  _YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'`
  _YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'`
  _YASM_RELEASE=`      echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'`
  _YASM_BUILD=`        echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
fi

if test -z "$SKIP_LIBRARY_CHECKS"; then
# Check whether --with-system-jpeg or --without-system-jpeg was given.
if test "${with_system_jpeg+set}" = set; then
  withval="$with_system_jpeg"
  JPEG_DIR=$withval
fi


_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
    CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
    LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
fi
if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
    SYSTEM_JPEG=
else
    echo $ac_n "checking for jpeg_destroy_compress in -ljpeg""... $ac_c" 1>&6
echo "configure:14456: checking for jpeg_destroy_compress in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_destroy_compress | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ljpeg $JPEG_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14464 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char jpeg_destroy_compress();

int main() {
jpeg_destroy_compress()
; return 0; }
EOF
if { (eval echo configure:14475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"
else
  echo "$ac_t""no" 1>&6
SYSTEM_JPEG=
fi

fi

if test "$SYSTEM_JPEG" = 1; then
    LIBS="$JPEG_LIBS $LIBS"
    cat > conftest.$ac_ext <<EOF
#line 14501 "configure"
#include "confdefs.h"
 #include <stdio.h>
                     #include <sys/types.h>
                     #include <jpeglib.h> 
int main() {
 #if JPEG_LIB_VERSION < $MOZJPEG
                     #error "Insufficient JPEG library version ($MOZJPEG required)."
                     #endif 
; return 0; }
EOF
if { (eval echo configure:14512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  SYSTEM_JPEG=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=
fi
rm -f conftest*
fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS

if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
    JPEG_CFLAGS="-I${JPEG_DIR}/include"
    JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
fi

# Check whether --with-system-zlib or --without-system-zlib was given.
if test "${with_system_zlib+set}" = set; then
  withval="$with_system_zlib"
  ZLIB_DIR=$withval
fi


_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
    CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
    LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
fi
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
    SYSTEM_ZLIB=
else
    echo $ac_n "checking for gzread in -lz""... $ac_c" 1>&6
echo "configure:14550: checking for gzread in -lz" >&5
ac_lib_var=`echo z'_'gzread | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lz $ZLIB_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14558 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gzread();

int main() {
gzread()
; return 0; }
EOF
if { (eval echo configure:14569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"
else
  echo "$ac_t""no" 1>&6
SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=
fi

fi
if test "$SYSTEM_ZLIB" = 1; then
    LIBS="$ZLIB_LIBS $LIBS"
    cat > conftest.$ac_ext <<EOF
#line 14594 "configure"
#include "confdefs.h"
 #include <stdio.h>
                     #include <string.h>
                     #include <zlib.h> 
int main() {
 #if ZLIB_VERNUM < $MOZZLIB
                     #error "Insufficient zlib version ($MOZZLIB required)."
                     #endif 
; return 0; }
EOF
if { (eval echo configure:14605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  SYSTEM_ZLIB=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=
fi
rm -f conftest*
fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS

if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
    ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
    ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
fi

if test "$MOZ_LINKER" = 1 -a "$SYSTEM_ZLIB" != 1; then
    { echo "configure: error: Custom dynamic linker requires --with-system-zlib" 1>&2; exit 1; }
fi

# Check whether --with-system-bz2 or --without-system-bz2 was given.
if test "${with_system_bz2+set}" = set; then
  withval="$with_system_bz2"
  BZ2_DIR=$withval
fi


_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
    CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
    LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
fi
if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
    SYSTEM_BZ2=
else
    echo $ac_n "checking for BZ2_bzread in -lbz2""... $ac_c" 1>&6
echo "configure:14647: checking for BZ2_bzread in -lbz2" >&5
ac_lib_var=`echo bz2'_'BZ2_bzread | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lbz2  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14655 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char BZ2_bzread();

int main() {
BZ2_bzread()
; return 0; }
EOF
if { (eval echo configure:14666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"
else
  echo "$ac_t""no" 1>&6
SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=
fi

fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS

if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
    BZ2_CFLAGS="-I${BZ2_DIR}/include"
    BZ2_LIBS="-L${BZ2_DIR}/lib ${BZ2_LIBS}"
fi

# Check whether --with-system-png or --without-system-png was given.
if test "${with_system_png+set}" = set; then
  withval="$with_system_png"
  PNG_DIR=$withval
fi


_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
CFLAGS="$ZLIB_CFLAGS $CFLAGS"
LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
    CFLAGS="-I${PNG_DIR}/include $CFLAGS"
    LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
fi
if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
    SYSTEM_PNG=
else
    _SAVE_PNG_LIBS=$PNG_LIBS
    echo $ac_n "checking for png_get_valid in -lpng""... $ac_c" 1>&6
echo "configure:14718: checking for png_get_valid in -lpng" >&5
ac_lib_var=`echo png'_'png_get_valid | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpng $PNG_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14726 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char png_get_valid();

int main() {
png_get_valid()
; return 0; }
EOF
if { (eval echo configure:14737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: --with-system-png requested but no working libpng found" 1>&2; exit 1; }
fi

    echo $ac_n "checking for png_get_acTL in -lpng""... $ac_c" 1>&6
echo "configure:14759: checking for png_get_acTL in -lpng" >&5
ac_lib_var=`echo png'_'png_get_acTL | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpng $_SAVE_PNG_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14767 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char png_get_acTL();

int main() {
png_get_acTL()
; return 0; }
EOF
if { (eval echo configure:14778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo png | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lpng $LIBS"

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: --with-system-png won't work because the system's libpng doesn't have APNG support" 1>&2; exit 1; }
fi

fi
if test "$SYSTEM_PNG" = 1; then
    LIBS="$PNG_LIBS $LIBS"
    cat > conftest.$ac_ext <<EOF
#line 14810 "configure"
#include "confdefs.h"
 #include <stdio.h>
                     #include <sys/types.h>
                     #include <png.h> 
int main() {
 #if PNG_LIBPNG_VER < $MOZPNG
                     #error "Insufficient libpng version ($MOZPNG required)."
                     #endif
                     #ifndef PNG_UINT_31_MAX
                     #error "Insufficient libpng version."
                     #endif 
; return 0; }
EOF
if { (eval echo configure:14824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  SYSTEM_PNG=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: --with-system-png requested but no working libpng found" 1>&2; exit 1; }
fi
rm -f conftest*
fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS

if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
    PNG_CFLAGS="-I${PNG_DIR}/include"
    PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
fi

fi # SKIP_LIBRARY_CHECKS

# Check whether --enable-system-hunspell or --disable-system-hunspell was given.
if test "${enable_system_hunspell+set}" = set; then
  enableval="$enable_system_hunspell"
  if test "$enableval" = "yes"; then
    SYSTEM_HUNSPELL=1 
  elif test "$enableval" = "no"; then
    :
  else
    { echo "configure: error: Option, system-hunspell, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$SYSTEM_HUNSPELL"; then
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:14866: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for hunspell""... $ac_c" 1>&6
echo "configure:14910: checking for hunspell" >&5

        if $PKG_CONFIG --exists "hunspell" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_HUNSPELL_CFLAGS""... $ac_c" 1>&6
echo "configure:14917: checking MOZ_HUNSPELL_CFLAGS" >&5
            MOZ_HUNSPELL_CFLAGS=`$PKG_CONFIG --cflags "hunspell"`
            echo "$ac_t""$MOZ_HUNSPELL_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_HUNSPELL_LIBS""... $ac_c" 1>&6
echo "configure:14922: checking MOZ_HUNSPELL_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_HUNSPELL_LIBS="`$PKG_CONFIG --libs \"hunspell\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_HUNSPELL_LIBS" 1>&6
        else
            MOZ_HUNSPELL_CFLAGS=""
            MOZ_HUNSPELL_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_HUNSPELL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "hunspell"`
            echo $MOZ_HUNSPELL_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (hunspell) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

fi



# Check whether --enable-system-ffi or --disable-system-ffi was given.
if test "${enable_system_ffi+set}" = set; then
  enableval="$enable_system_ffi"
  if test "$enableval" = "yes"; then
    MOZ_NATIVE_FFI=1 
  elif test "$enableval" = "no"; then
    :
  else
    { echo "configure: error: Option, system-ffi, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_NATIVE_FFI"; then
    # Vanilla libffi 3.0.9 needs a few patches from upcoming version 3.0.10
    # for non-GCC compilers.
    if test -z "$GNU_CC"; then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:14978: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libffi > 3.0.9""... $ac_c" 1>&6
echo "configure:15022: checking for libffi > 3.0.9" >&5

        if $PKG_CONFIG --exists "libffi > 3.0.9" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6
echo "configure:15029: checking MOZ_FFI_CFLAGS" >&5
            MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi > 3.0.9"`
            echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6
echo "configure:15034: checking MOZ_FFI_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi > 3.0.9\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_FFI_LIBS" 1>&6
        else
            MOZ_FFI_CFLAGS=""
            MOZ_FFI_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_FFI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libffi > 3.0.9"`
            echo $MOZ_FFI_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (libffi > 3.0.9) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    else
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15070: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libffi >= 3.0.9""... $ac_c" 1>&6
echo "configure:15114: checking for libffi >= 3.0.9" >&5

        if $PKG_CONFIG --exists "libffi >= 3.0.9" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6
echo "configure:15121: checking MOZ_FFI_CFLAGS" >&5
            MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi >= 3.0.9"`
            echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6
echo "configure:15126: checking MOZ_FFI_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi >= 3.0.9\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_FFI_LIBS" 1>&6
        else
            MOZ_FFI_CFLAGS=""
            MOZ_FFI_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_FFI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libffi >= 3.0.9"`
            echo $MOZ_FFI_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (libffi >= 3.0.9) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    fi
    MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
fi


JAVA_BIN_PATH=
# Check whether --with-java-bin-path or --without-java-bin-path was given.
if test "${with_java_bin_path+set}" = set; then
  withval="$with_java_bin_path"
  JAVA_BIN_PATH=$withval
fi



# Application

ENABLE_TESTS=1
ENABLE_SYSTEM_EXTENSION_DIRS=1
MOZ_BRANDING_DIRECTORY=
MOZ_OFFICIAL_BRANDING=
MOZ_FEEDS=1
MOZ_FLEXBOX=
MOZ_WEBAPP_RUNTIME=
MOZ_JSDEBUGGER=1
MOZ_AUTH_EXTENSION=1
MOZ_OGG=1
MOZ_RAW=
MOZ_SYDNEYAUDIO=
MOZ_SPEEX_RESAMPLER=1
MOZ_CUBEB=
MOZ_VORBIS=
MOZ_TREMOR=
MOZ_WAVE=1
MOZ_MEDIA=
MOZ_OPUS=1
MOZ_WEBM=1
MOZ_MEDIA_PLUGINS=
MOZ_MEDIA_NAVIGATOR=
MOZ_OMX_PLUGIN=
MOZ_VP8_ERROR_CONCEALMENT=
MOZ_VP8_ENCODER=
VPX_AS=
VPX_ASFLAGS=
VPX_AS_DASH_C_FLAG=
VPX_AS_CONVERSION=
VPX_ASM_SUFFIX=
VPX_X86_ASM=
VPX_ARM_ASM=
LIBJPEG_TURBO_AS=
LIBJPEG_TURBO_ASFLAGS=
LIBJPEG_TURBO_X86_ASM=
LIBJPEG_TURBO_X64_ASM=
LIBJPEG_TURBO_ARM_ASM=
MOZ_PANGO=1
MOZ_PERMISSIONS=1
MOZ_PLACES=1
MOZ_PREF_EXTENSIONS=1
MOZ_PROFILELOCKING=1
MOZ_PSM=1
MOZ_REFLOW_PERF=
MOZ_SAFE_BROWSING=
MOZ_HELP_VIEWER=
MOZ_SPELLCHECK=1
MOZ_JAVA_COMPOSITOR=
MOZ_ONLY_TOUCH_EVENTS=
MOZ_SVG_DLISTS=
MOZ_TOOLKIT_SEARCH=1
MOZ_UI_LOCALE=en-US
MOZ_UNIVERSALCHARDET=1
MOZ_URL_CLASSIFIER=
MOZ_XTF=1
MOZ_XUL=1
MOZ_ZIPWRITER=1
NS_PRINTING=1
MOZ_PDF_PRINTING=
MOZ_DISABLE_DOMCRYPTO=
NSS_DISABLE_DBM=
NECKO_WIFI=1
NECKO_COOKIES=1
NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
USE_ARM_KUSER=
BUILD_CTYPES=1
MOZ_USE_NATIVE_POPUP_WINDOWS=
MOZ_ANDROID_HISTORY=
MOZ_WEBSMS_BACKEND=
MOZ_GRAPHITE=1

case "${target}" in
*darwin*)
    ACCESSIBILITY=
    ;;
*)
    ACCESSIBILITY=1
    ;;
esac

case "$target_os" in
    mingw*)
        NS_ENABLE_TSF=1
        cat >> confdefs.h <<\EOF
#define NS_ENABLE_TSF 1
EOF

        ;;
esac

case "${target}" in
    *-android*|*-linuxandroid*)
        if test "$CPU_ARCH" = "arm" ; then
          USE_ARM_KUSER=1
        fi

        NSS_DISABLE_DBM=1
        NECKO_WIFI=
        MOZ_THEME_FASTSTRIPE=1
        MOZ_TREE_FREETYPE=1
        MOZ_MEMORY=1
        MOZ_RAW=1
        ;;
esac

# Check whether --enable-application or --disable-application was given.
if test "${enable_application+set}" = set; then
  enableval="$enable_application"
   MOZ_BUILD_APP=$enableval  
fi


# Check whether --with-xulrunner-stub-name or --without-xulrunner-stub-name was given.
if test "${with_xulrunner_stub_name+set}" = set; then
  withval="$with_xulrunner_stub_name"
  XULRUNNER_STUB_NAME=$withval
fi


if test -z "$XULRUNNER_STUB_NAME"; then
  case "$target_os" in
  darwin*)
    XULRUNNER_STUB_NAME=xulrunner
    ;;
  *)
    XULRUNNER_STUB_NAME=xulrunner-stub
  esac
fi


echo $ac_n "checking for application to build""... $ac_c" 1>&6
echo "configure:15302: checking for application to build" >&5
if test -z "$MOZ_BUILD_APP"; then
  echo "$ac_t""browser" 1>&6
  MOZ_BUILD_APP=browser
else
  # default mobile to be mobile/xul
  if test "$MOZ_BUILD_APP" = "mobile" ; then
    MOZ_BUILD_APP=mobile/xul
  fi
  # We have a valid application only if it has a build.mk file in its top
  # directory.
  if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
    echo "$ac_t""none" 1>&6
    { echo "configure: error: --enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist)." 1>&2; exit 1; }
  else
    echo "$ac_t""$MOZ_BUILD_APP" 1>&6
  fi
fi

# Allow the application to influence configure with a confvars.sh script.

echo $ac_n "checking if app-specific confvars.sh exists""... $ac_c" 1>&6
echo "configure:15324: checking if app-specific confvars.sh exists" >&5
if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
  echo "$ac_t""${srcdir}/${MOZ_BUILD_APP}/confvars.sh" 1>&6
  . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
else
  echo "$ac_t""no" 1>&6
fi

# Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
# Check whether --with-app-name or --without-app-name was given.
if test "${with_app_name+set}" = set; then
  withval="$with_app_name"
  WITH_APP_NAME=$withval
fi


if test -n "$WITH_APP_NAME" ; then
    MOZ_APP_NAME="$WITH_APP_NAME"
fi

# Check whether --with-app-basename or --without-app-basename was given.
if test "${with_app_basename+set}" = set; then
  withval="$with_app_basename"
  WITH_APP_BASENAME=$withval
fi


if test -n "$WITH_APP_BASENAME" ; then
    MOZ_APP_BASENAME="$WITH_APP_BASENAME"
fi

# Now is a good time to test for logic errors, define mismatches, etc.
case "$MOZ_BUILD_APP" in
xulrunner)
  if test "$LIBXUL_SDK"; then
    { echo "configure: error: Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK." 1>&2; exit 1; }
  fi
  ;;
esac

# Special cases where we need to AC_DEFINE something. Also a holdover for apps
# that haven't made a confvars.sh yet. Don't add new stuff here, use
# MOZ_BUILD_APP.
case "$MOZ_BUILD_APP" in
browser)
  cat >> confdefs.h <<\EOF
#define MOZ_PHOENIX 1
EOF

  ;;

xulrunner)
  cat >> confdefs.h <<\EOF
#define MOZ_XULRUNNER 1
EOF

  ;;
esac





cat >> confdefs.h <<EOF
#define MOZ_BUILD_APP $MOZ_BUILD_APP
EOF


# Toolkit Options

            	# Check whether --enable-default-toolkit or --disable-default-toolkit was given.
if test "${enable_default_toolkit+set}" = set; then
  enableval="$enable_default_toolkit"
   _DEFAULT_TOOLKIT=$enableval 
else
   _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT
fi


    if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-android" \
        -o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
    then
                        MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
    else
        { echo "configure: error: You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT)." 1>&2; exit 1; }
    fi

# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
  withval="$with_x"
  if test "$withval" = "no"; then
    WITHOUT_X11=1
  elif test "$withval" = "yes"; then
    :
  else
    { echo "configure: error: Option, x, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi



case "$MOZ_WIDGET_TOOLKIT" in

cairo-windows)
    MOZ_WIDGET_TOOLKIT=windows
    MOZ_WEBGL=1
    MOZ_PDF_PRINTING=1
    MOZ_INSTRUMENT_EVENT_LOOP=1
    ;;

cairo-gtk2|cairo-gtk2-x11)
    MOZ_WIDGET_TOOLKIT=gtk2
    MOZ_ENABLE_GTK2=1
    MOZ_ENABLE_XREMOTE=1
    MOZ_WEBGL=1
    MOZ_GL_DEFAULT_PROVIDER=GLX

    cat >> confdefs.h <<\EOF
#define MOZ_X11 1
EOF

    MOZ_X11=1
    USE_FC_FREETYPE=1

    TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
    TK_LIBS='$(MOZ_GTK2_LIBS)'
    cat >> confdefs.h <<\EOF
#define MOZ_WIDGET_GTK2 1
EOF

    MOZ_PDF_PRINTING=1
    MOZ_INSTRUMENT_EVENT_LOOP=1
    ;;

cairo-qt)
    MOZ_WIDGET_TOOLKIT=qt
    MOZ_ENABLE_QT=1
    if test -z "$WITHOUT_X11"; then
      MOZ_ENABLE_XREMOTE=1
      MOZ_GL_DEFAULT_PROVIDER=GLX
      MOZ_X11=1
      cat >> confdefs.h <<\EOF
#define MOZ_X11 1
EOF

      XT_LIBS=
    fi

    MOZ_WEBGL=1
    USE_ELF_DYNSTR_GC=
    USE_FC_FREETYPE=1
    TK_CFLAGS='$(MOZ_QT_CFLAGS)'
    TK_LIBS='$(MOZ_QT_LIBS)'
    cat >> confdefs.h <<\EOF
#define MOZ_WIDGET_QT 1
EOF

    MOZ_PDF_PRINTING=1
    ;;

cairo-os2)
    MOZ_WIDGET_TOOLKIT=os2
    USE_FC_FREETYPE=1
    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
    TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
    MOZ_PDF_PRINTING=1
    ;;

cairo-cocoa)
    MOZ_WIDGET_TOOLKIT=cocoa
    cat >> confdefs.h <<\EOF
#define MOZ_WIDGET_COCOA 1
EOF

    LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
    TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
    TK_CFLAGS="-DNO_X11"
    CFLAGS="$CFLAGS $TK_CFLAGS"
    CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
    LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
    MOZ_USER_DIR="Mozilla"
    MOZ_FS_LAYOUT=bundle
    MOZ_WEBGL=1
    MOZ_INSTRUMENT_EVENT_LOOP=1
    ;;

cairo-uikit)
    MOZ_WIDGET_TOOLKIT=uikit
    cat >> confdefs.h <<\EOF
#define MOZ_WIDGET_UIKIT 1
EOF

    LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
    TK_CFLAGS="-DNO_X11"
    TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
    CFLAGS="$CFLAGS $TK_CFLAGS"
    CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
    LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
    MOZ_USER_DIR="Mozilla"
    MOZ_FS_LAYOUT=bundle
    ;;

cairo-android)
    cat >> confdefs.h <<\EOF
#define MOZ_WIDGET_ANDROID 1
EOF

    MOZ_WIDGET_TOOLKIT=android
    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
    TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
    MOZ_WEBGL=1
    MOZ_PDF_PRINTING=1
    MOZ_INSTRUMENT_EVENT_LOOP=1
    if test "$MOZ_BUILD_APP" = "mobile/xul"; then
        MOZ_OLD_LINKER=1
    fi
    ;;

cairo-gonk)
    cat >> confdefs.h <<\EOF
#define MOZ_WIDGET_GONK 1
EOF

    cat >> confdefs.h <<\EOF
#define MOZ_TOUCH 1
EOF

    MOZ_WIDGET_TOOLKIT=gonk
    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
    TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
    MOZ_WEBGL=1
    MOZ_PDF_PRINTING=1
    MOZ_TOUCH=1
    ;;

esac



if test "$MOZ_PDF_PRINTING"; then
   PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
   cat >> confdefs.h <<\EOF
#define MOZ_PDF_PRINTING 1
EOF

fi

if test "$MOZ_ENABLE_XREMOTE"; then
    cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_XREMOTE 1
EOF

fi

if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
   cat >> confdefs.h <<\EOF
#define MOZ_INSTRUMENT_EVENT_LOOP 1
EOF

fi

if test "$COMPILE_ENVIRONMENT"; then
  if test "$MOZ_ENABLE_GTK2"; then
    if test "$MOZ_X11"; then
      GDK_PACKAGES=gdk-x11-2.0
    fi

    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15604: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES""... $ac_c" 1>&6
echo "configure:15648: checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" >&5

        if $PKG_CONFIG --exists "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_GTK2_CFLAGS""... $ac_c" 1>&6
echo "configure:15655: checking MOZ_GTK2_CFLAGS" >&5
            MOZ_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES"`
            echo "$ac_t""$MOZ_GTK2_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_GTK2_LIBS""... $ac_c" 1>&6
echo "configure:15660: checking MOZ_GTK2_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_GTK2_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_GTK2_LIBS" 1>&6
        else
            MOZ_GTK2_CFLAGS=""
            MOZ_GTK2_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_GTK2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES"`
            echo $MOZ_GTK2_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

  fi

fi # COMPILE_ENVIRONMENT



# Check whether --with-arm-kuser or --without-arm-kuser was given.
if test "${with_arm_kuser+set}" = set; then
  withval="$with_arm_kuser"
  if test "$withval" = "yes"; then
    USE_ARM_KUSER=1
  elif test "$withval" = "no"; then
    :
  else
    { echo "configure: error: Option, arm-kuser, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi

if test -n "$USE_ARM_KUSER"; then
   cat >> confdefs.h <<\EOF
#define USE_ARM_KUSER 1
EOF

fi


if test "$MOZ_ENABLE_GTK2"
then
    MOZ_ENABLE_STARTUP_NOTIFICATION=

    # Check whether --enable-startup-notification or --disable-startup-notification was given.
if test "${enable_startup_notification+set}" = set; then
  enableval="$enable_startup_notification"
  if test "$enableval" = "yes"; then
    MOZ_ENABLE_STARTUP_NOTIFICATION=force
  elif test "$enableval" = "no"; then
    MOZ_ENABLE_STARTUP_NOTIFICATION=
  else
    { echo "configure: error: Option, startup-notification, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

    if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15739: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION""... $ac_c" 1>&6
echo "configure:15783: checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" >&5

        if $PKG_CONFIG --exists "libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_STARTUP_NOTIFICATION_CFLAGS""... $ac_c" 1>&6
echo "configure:15790: checking MOZ_STARTUP_NOTIFICATION_CFLAGS" >&5
            MOZ_STARTUP_NOTIFICATION_CFLAGS=`$PKG_CONFIG --cflags "libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION"`
            echo "$ac_t""$MOZ_STARTUP_NOTIFICATION_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_STARTUP_NOTIFICATION_LIBS""... $ac_c" 1>&6
echo "configure:15795: checking MOZ_STARTUP_NOTIFICATION_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_STARTUP_NOTIFICATION_LIBS="`$PKG_CONFIG --libs \"libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_STARTUP_NOTIFICATION_LIBS" 1>&6
        else
            MOZ_STARTUP_NOTIFICATION_CFLAGS=""
            MOZ_STARTUP_NOTIFICATION_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_STARTUP_NOTIFICATION_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     MOZ_ENABLE_STARTUP_NOTIFICATION=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       
            if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
            then
                { echo "configure: error: * * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION" 1>&2; exit 1; }
            fi
            MOZ_ENABLE_STARTUP_NOTIFICATION=
        
     fi
  fi

    fi

    if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
        cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_STARTUP_NOTIFICATION 1
EOF

    fi

    TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
fi




if test "$MOZ_ENABLE_QT"
then
    # Check whether --with-qtdir or --without-qtdir was given.
if test "${with_qtdir+set}" = set; then
  withval="$with_qtdir"
   QTDIR=$withval
fi


    if test -z "$QTDIR"; then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15861: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for QtGui QtNetwork QtCore QtOpenGL""... $ac_c" 1>&6
echo "configure:15905: checking for QtGui QtNetwork QtCore QtOpenGL" >&5

        if $PKG_CONFIG --exists "QtGui QtNetwork QtCore QtOpenGL" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_QT_CFLAGS""... $ac_c" 1>&6
echo "configure:15912: checking MOZ_QT_CFLAGS" >&5
            MOZ_QT_CFLAGS=`$PKG_CONFIG --cflags "QtGui QtNetwork QtCore QtOpenGL"`
            echo "$ac_t""$MOZ_QT_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_QT_LIBS""... $ac_c" 1>&6
echo "configure:15917: checking MOZ_QT_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_QT_LIBS="`$PKG_CONFIG --libs \"QtGui QtNetwork QtCore QtOpenGL\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_QT_LIBS" 1>&6
        else
            MOZ_QT_CFLAGS=""
            MOZ_QT_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_QT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "QtGui QtNetwork QtCore QtOpenGL"`
            echo $MOZ_QT_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (QtGui QtNetwork QtCore QtOpenGL) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15952: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for QtWidgets QtMultimedia QtPrintSupport QtQuick1""... $ac_c" 1>&6
echo "configure:15996: checking for QtWidgets QtMultimedia QtPrintSupport QtQuick1" >&5

        if $PKG_CONFIG --exists "QtWidgets QtMultimedia QtPrintSupport QtQuick1" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_QT5_CFLAGS""... $ac_c" 1>&6
echo "configure:16003: checking MOZ_QT5_CFLAGS" >&5
            MOZ_QT5_CFLAGS=`$PKG_CONFIG --cflags "QtWidgets QtMultimedia QtPrintSupport QtQuick1"`
            echo "$ac_t""$MOZ_QT5_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_QT5_LIBS""... $ac_c" 1>&6
echo "configure:16008: checking MOZ_QT5_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_QT5_LIBS="`$PKG_CONFIG --libs \"QtWidgets QtMultimedia QtPrintSupport QtQuick1\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_QT5_LIBS" 1>&6
        else
            MOZ_QT5_CFLAGS=""
            MOZ_QT5_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_QT5_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "QtWidgets QtMultimedia QtPrintSupport QtQuick1"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     MOZ_ENABLE_QT5=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       MOZ_ENABLE_QT5=
     fi
  fi

        if test "$MOZ_ENABLE_QT5"; then
            echo "Using qt5"
            MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $MOZ_QT5_CFLAGS"
            MOZ_QT_LIBS="$MOZ_QT_LIBS $MOZ_QT5_LIBS"
        fi

        for ac_prog in $MOC moc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16048: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_HOST_MOC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$HOST_MOC"; then
  ac_cv_prog_HOST_MOC="$HOST_MOC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_HOST_MOC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
HOST_MOC="$ac_cv_prog_HOST_MOC"
if test -n "$HOST_MOC"; then
  echo "$ac_t""$HOST_MOC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$HOST_MOC" && break
done
test -n "$HOST_MOC" || HOST_MOC=""""

        for ac_prog in $RCC rcc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16083: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_HOST_RCC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$HOST_RCC"; then
  ac_cv_prog_HOST_RCC="$HOST_RCC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_HOST_RCC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
HOST_RCC="$ac_cv_prog_HOST_RCC"
if test -n "$HOST_RCC"; then
  echo "$ac_t""$HOST_RCC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$HOST_RCC" && break
done
test -n "$HOST_RCC" || HOST_RCC=""""

    else
        MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtXml -lQtOpenGL"

        MOZ_QT_CFLAGS="-DQT_SHARED"
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDeclarative"
        HOST_MOC="$QTDIR/bin/moc"
        HOST_RCC="$QTDIR/bin/rcc"

        # QtWidgets was introduced only in Qt5
        if test -d $QTDIR/include/QtWidgets; then
            echo "Using qt5"
            MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtWidgets"
            MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMultimedia"
            MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport"
            MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtQuick1"
            MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtWidgets -lQtMultimedia -lQtPrintSupport -lQtQuick1"
        fi
    fi
    if test -z "$HOST_MOC"; then
        { echo "configure: error: No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
incorrect" 1>&2; exit 1; }
    fi
    if test -z "$HOST_RCC"; then
        { echo "configure: error: No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is
incorrect" 1>&2; exit 1; }
    fi

    MOC=$HOST_MOC
    RCC=$HOST_RCC

    MOZ_ENABLE_QMSYSTEM2=
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16156: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for qmsystem2""... $ac_c" 1>&6
echo "configure:16200: checking for qmsystem2" >&5

        if $PKG_CONFIG --exists "qmsystem2" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking _QMSYSTEM2_CFLAGS""... $ac_c" 1>&6
echo "configure:16207: checking _QMSYSTEM2_CFLAGS" >&5
            _QMSYSTEM2_CFLAGS=`$PKG_CONFIG --cflags "qmsystem2"`
            echo "$ac_t""$_QMSYSTEM2_CFLAGS" 1>&6

            echo $ac_n "checking _QMSYSTEM2_LIBS""... $ac_c" 1>&6
echo "configure:16212: checking _QMSYSTEM2_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            _QMSYSTEM2_LIBS="`$PKG_CONFIG --libs \"qmsystem2\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$_QMSYSTEM2_LIBS" 1>&6
        else
            _QMSYSTEM2_CFLAGS=""
            _QMSYSTEM2_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            _QMSYSTEM2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "qmsystem2"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     MOZ_ENABLE_QMSYSTEM2=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       MOZ_ENABLE_QMSYSTEM2=
     fi
  fi


    if test "$MOZ_ENABLE_QMSYSTEM2"; then
      MOZ_ENABLE_QMSYSTEM2=1
      MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QMSYSTEM2_CFLAGS"
      MOZ_QT_LIBS="$MOZ_QT_LIBS $_QMSYSTEM2_LIBS"
      cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_QMSYSTEM2 1
EOF

    fi

    MOZ_ENABLE_QTNETWORK=
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16259: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for QtNetwork >= 4.7""... $ac_c" 1>&6
echo "configure:16303: checking for QtNetwork >= 4.7" >&5

        if $PKG_CONFIG --exists "QtNetwork >= 4.7" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking _QTNETWORK_CFLAGS""... $ac_c" 1>&6
echo "configure:16310: checking _QTNETWORK_CFLAGS" >&5
            _QTNETWORK_CFLAGS=`$PKG_CONFIG --cflags "QtNetwork >= 4.7"`
            echo "$ac_t""$_QTNETWORK_CFLAGS" 1>&6

            echo $ac_n "checking _QTNETWORK_LIBS""... $ac_c" 1>&6
echo "configure:16315: checking _QTNETWORK_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            _QTNETWORK_LIBS="`$PKG_CONFIG --libs \"QtNetwork >= 4.7\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$_QTNETWORK_LIBS" 1>&6
        else
            _QTNETWORK_CFLAGS=""
            _QTNETWORK_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            _QTNETWORK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "QtNetwork >= 4.7"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     MOZ_ENABLE_QTNETWORK=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       MOZ_ENABLE_QTNETWORK=
     fi
  fi


    if test "$MOZ_ENABLE_QTNETWORK"; then
      MOZ_ENABLE_QTNETWORK=1
      cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_QTNETWORK 1
EOF

    fi

    MOZ_ENABLE_QTMOBILITY=
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16360: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for QtSensors QtFeedback QtLocation""... $ac_c" 1>&6
echo "configure:16404: checking for QtSensors QtFeedback QtLocation" >&5

        if $PKG_CONFIG --exists "QtSensors QtFeedback QtLocation" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking _QTMOBILITY_CFLAGS""... $ac_c" 1>&6
echo "configure:16411: checking _QTMOBILITY_CFLAGS" >&5
            _QTMOBILITY_CFLAGS=`$PKG_CONFIG --cflags "QtSensors QtFeedback QtLocation"`
            echo "$ac_t""$_QTMOBILITY_CFLAGS" 1>&6

            echo $ac_n "checking _QTMOBILITY_LIBS""... $ac_c" 1>&6
echo "configure:16416: checking _QTMOBILITY_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            _QTMOBILITY_LIBS="`$PKG_CONFIG --libs \"QtSensors QtFeedback QtLocation\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$_QTMOBILITY_LIBS" 1>&6
        else
            _QTMOBILITY_CFLAGS=""
            _QTMOBILITY_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            _QTMOBILITY_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "QtSensors QtFeedback QtLocation"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     MOZ_ENABLE_QTMOBILITY=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       MOZ_ENABLE_QTMOBILITY=
     fi
  fi

    if test "$MOZ_ENABLE_QTMOBILITY"; then
       MOZ_ENABLE_QTMOBILITY=1
       MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
       MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
    else
       echo $ac_n "checking for main in -lQtSensors""... $ac_c" 1>&6
echo "configure:16451: checking for main in -lQtSensors" >&5
ac_lib_var=`echo QtSensors'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lQtSensors  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 16459 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:16466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
          MOZ_ENABLE_QTMOBILITY=1
          MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMobility"
          MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtSensors"
          MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtFeedback"
          MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtLocation"
          MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation"
       
else
  echo "$ac_t""no" 1>&6
fi

    fi
    if test "$MOZ_ENABLE_QTMOBILITY"; then
       cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_QTMOBILITY 1
EOF

    fi
fi





















# Components and Features

# Check whether --enable-ui-locale or --disable-ui-locale was given.
if test "${enable_ui_locale+set}" = set; then
  enableval="$enable_ui_locale"
  MOZ_UI_LOCALE=$enableval 
fi



# Check whether --enable-official-branding or --disable-official-branding was given.
if test "${enable_official_branding+set}" = set; then
  enableval="$enable_official_branding"
  if test "$enableval" = "yes"; then
    
  if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
    { echo "configure: error: You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding." 1>&2; exit 1; }
  else
    MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
    MOZ_OFFICIAL_BRANDING=1
  fi

  elif test "$enableval" = "no"; then
    MOZ_OFFICIAL_BRANDING=
  else
    { echo "configure: error: Option, official-branding, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



if test -n "$MOZ_OFFICIAL_BRANDING"; then
  cat >> confdefs.h <<\EOF
#define MOZ_OFFICIAL_BRANDING 1
EOF

fi

# Check whether --with-branding or --without-branding was given.
if test "${with_branding+set}" = set; then
  withval="$with_branding"
  MOZ_BRANDING_DIRECTORY=$withval
fi


REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
if test -z "$REAL_BRANDING_DIRECTORY"; then
  REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
fi

if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
  . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
fi



# Check whether --with-distribution-id or --without-distribution-id was given.
if test "${with_distribution_id+set}" = set; then
  withval="$with_distribution_id"
   val=`echo $withval`
    MOZ_DISTRIBUTION_ID="$val"
fi


if test -z "$MOZ_DISTRIBUTION_ID"; then
   MOZ_DISTRIBUTION_ID="org.mozilla"
fi

cat >> confdefs.h <<EOF
#define MOZ_DISTRIBUTION_ID "$MOZ_DISTRIBUTION_ID"
EOF




# Check whether --enable-pango or --disable-pango was given.
if test "${enable_pango+set}" = set; then
  enableval="$enable_pango"
  if test "$enableval" = "no"; then
    MOZ_PANGO=
  elif test "$enableval" = "yes"; then
    MOZ_PANGO=1
  else
    { echo "configure: error: Option, pango, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$MOZ_ENABLE_GTK2"
then
    

    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16620: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for pango >= $PANGO_VERSION""... $ac_c" 1>&6
echo "configure:16664: checking for pango >= $PANGO_VERSION" >&5

        if $PKG_CONFIG --exists "pango >= $PANGO_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking _PANGOCHK_CFLAGS""... $ac_c" 1>&6
echo "configure:16671: checking _PANGOCHK_CFLAGS" >&5
            _PANGOCHK_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION"`
            echo "$ac_t""$_PANGOCHK_CFLAGS" 1>&6

            echo $ac_n "checking _PANGOCHK_LIBS""... $ac_c" 1>&6
echo "configure:16676: checking _PANGOCHK_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            _PANGOCHK_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$_PANGOCHK_LIBS" 1>&6
        else
            _PANGOCHK_CFLAGS=""
            _PANGOCHK_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            _PANGOCHK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pango >= $PANGO_VERSION"`
            echo $_PANGOCHK_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (pango >= $PANGO_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi


    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16712: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION""... $ac_c" 1>&6
echo "configure:16756: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5

        if $PKG_CONFIG --exists "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_PANGO_CFLAGS""... $ac_c" 1>&6
echo "configure:16763: checking MOZ_PANGO_CFLAGS" >&5
            MOZ_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION"`
            echo "$ac_t""$MOZ_PANGO_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_PANGO_LIBS""... $ac_c" 1>&6
echo "configure:16768: checking MOZ_PANGO_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_PANGO_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_PANGO_LIBS" 1>&6
        else
            MOZ_PANGO_CFLAGS=""
            MOZ_PANGO_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_PANGO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION"`
            echo $MOZ_PANGO_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    
    
    if test "$MOZ_PANGO"
    then
        cat >> confdefs.h <<\EOF
#define MOZ_PANGO 1
EOF

    else
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16812: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for freetype2 > 6.1.0 fontconfig""... $ac_c" 1>&6
echo "configure:16856: checking for freetype2 > 6.1.0 fontconfig" >&5

        if $PKG_CONFIG --exists "freetype2 > 6.1.0 fontconfig" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking FT2_CFLAGS""... $ac_c" 1>&6
echo "configure:16863: checking FT2_CFLAGS" >&5
            FT2_CFLAGS=`$PKG_CONFIG --cflags "freetype2 > 6.1.0 fontconfig"`
            echo "$ac_t""$FT2_CFLAGS" 1>&6

            echo $ac_n "checking FT2_LIBS""... $ac_c" 1>&6
echo "configure:16868: checking FT2_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            FT2_LIBS="`$PKG_CONFIG --libs \"freetype2 > 6.1.0 fontconfig\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$FT2_LIBS" 1>&6
        else
            FT2_CFLAGS=""
            FT2_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            FT2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "freetype2 > 6.1.0 fontconfig"`
            echo $FT2_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (freetype2 > 6.1.0 fontconfig) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        
        
    fi
fi

if test "$MOZ_ENABLE_QT"
then
    if test "$MOZ_PANGO"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16912: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION""... $ac_c" 1>&6
echo "configure:16956: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5

        if $PKG_CONFIG --exists "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_PANGO_CFLAGS""... $ac_c" 1>&6
echo "configure:16963: checking MOZ_PANGO_CFLAGS" >&5
            MOZ_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION"`
            echo "$ac_t""$MOZ_PANGO_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_PANGO_LIBS""... $ac_c" 1>&6
echo "configure:16968: checking MOZ_PANGO_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_PANGO_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_PANGO_LIBS" 1>&6
        else
            MOZ_PANGO_CFLAGS=""
            MOZ_PANGO_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_PANGO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     
            
            
            cat >> confdefs.h <<\EOF
#define MOZ_PANGO 1
EOF

        
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       
            echo "Pango library not found, will use FT2 font engine"
            MOZ_PANGO=
        
     fi
  fi

    fi
    
fi


if test "$MOZ_X11"
then
            if test "$MOZ_ENABLE_GTK2"
    then
        MOZ_ENABLE_GNOMEVFS=1
        MOZ_ENABLE_GCONF=1
    fi

                # Check whether --enable-gnomevfs or --disable-gnomevfs was given.
if test "${enable_gnomevfs+set}" = set; then
  enableval="$enable_gnomevfs"
  if test "$enableval" = "no"; then
    MOZ_ENABLE_GNOMEVFS=
  elif test "$enableval" = "yes"; then
    MOZ_ENABLE_GNOMEVFS=force
  else
    { echo "configure: error: Option, gnomevfs, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


    if test "$MOZ_ENABLE_GNOMEVFS"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17041: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION""... $ac_c" 1>&6
echo "configure:17085: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5

        if $PKG_CONFIG --exists "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_GNOMEVFS_CFLAGS""... $ac_c" 1>&6
echo "configure:17092: checking MOZ_GNOMEVFS_CFLAGS" >&5
            MOZ_GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION"`
            echo "$ac_t""$MOZ_GNOMEVFS_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_GNOMEVFS_LIBS""... $ac_c" 1>&6
echo "configure:17097: checking MOZ_GNOMEVFS_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_GNOMEVFS_LIBS="`$PKG_CONFIG --libs \"gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_GNOMEVFS_LIBS" 1>&6
        else
            MOZ_GNOMEVFS_CFLAGS=""
            MOZ_GNOMEVFS_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_GNOMEVFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     
            MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
            MOZ_ENABLE_GNOMEVFS=1
            cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_GNOMEVFS 1
EOF

        
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       
            if test "$MOZ_ENABLE_GNOMEVFS" = "force"
            then
                { echo "configure: error: * * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" 1>&2; exit 1; }
            fi
            MOZ_ENABLE_GNOMEVFS=
        
     fi
  fi

    else
        if test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
            succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17147: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION""... $ac_c" 1>&6
echo "configure:17191: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5

        if $PKG_CONFIG --exists "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_GNOMEVFS_CFLAGS""... $ac_c" 1>&6
echo "configure:17198: checking MOZ_GNOMEVFS_CFLAGS" >&5
            MOZ_GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION"`
            echo "$ac_t""$MOZ_GNOMEVFS_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_GNOMEVFS_LIBS""... $ac_c" 1>&6
echo "configure:17203: checking MOZ_GNOMEVFS_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_GNOMEVFS_LIBS="`$PKG_CONFIG --libs \"gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_GNOMEVFS_LIBS" 1>&6
        else
            MOZ_GNOMEVFS_CFLAGS=""
            MOZ_GNOMEVFS_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_GNOMEVFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION"`
            echo $MOZ_GNOMEVFS_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     
              MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
            
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        fi
    fi

    
    
    

                # Check whether --enable-gio or --disable-gio was given.
if test "${enable_gio+set}" = set; then
  enableval="$enable_gio"
  if test "$enableval" = "yes"; then
    MOZ_ENABLE_GIO=force
  elif test "$enableval" = "no"; then
    MOZ_ENABLE_GIO=
  else
    { echo "configure: error: Option, gio, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


    if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17262: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gtk+-2.0 >= 2.14""... $ac_c" 1>&6
echo "configure:17306: checking for gtk+-2.0 >= 2.14" >&5

        if $PKG_CONFIG --exists "gtk+-2.0 >= 2.14" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking _GTKCHECK_CFLAGS""... $ac_c" 1>&6
echo "configure:17313: checking _GTKCHECK_CFLAGS" >&5
            _GTKCHECK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.14"`
            echo "$ac_t""$_GTKCHECK_CFLAGS" 1>&6

            echo $ac_n "checking _GTKCHECK_LIBS""... $ac_c" 1>&6
echo "configure:17318: checking _GTKCHECK_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            _GTKCHECK_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= 2.14\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$_GTKCHECK_LIBS" 1>&6
        else
            _GTKCHECK_CFLAGS=""
            _GTKCHECK_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            _GTKCHECK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= 2.14"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: * * * Could not find gtk+-2.0 > 2.14. Required for build with gio." 1>&2; exit 1; }
     fi
  fi

        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17353: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gio-2.0 >= $GIO_VERSION""... $ac_c" 1>&6
echo "configure:17397: checking for gio-2.0 >= $GIO_VERSION" >&5

        if $PKG_CONFIG --exists "gio-2.0 >= $GIO_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_GIO_CFLAGS""... $ac_c" 1>&6
echo "configure:17404: checking MOZ_GIO_CFLAGS" >&5
            MOZ_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= $GIO_VERSION"`
            echo "$ac_t""$MOZ_GIO_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_GIO_LIBS""... $ac_c" 1>&6
echo "configure:17409: checking MOZ_GIO_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_GIO_LIBS="`$PKG_CONFIG --libs \"gio-2.0 >= $GIO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_GIO_LIBS" 1>&6
        else
            MOZ_GIO_CFLAGS=""
            MOZ_GIO_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_GIO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gio-2.0 >= $GIO_VERSION"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     
            MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
            MOZ_ENABLE_GIO=1
            cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_GIO 1
EOF

        
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       
            if test "$MOZ_ENABLE_GIO" = "force"
            then
                { echo "configure: error: * * * Could not find gio-2.0 >= $GIO_VERSION" 1>&2; exit 1; }
            fi
            MOZ_ENABLE_GIO=
        
     fi
  fi

    fi

    
    
    

                # Check whether --enable-gconf or --disable-gconf was given.
if test "${enable_gconf+set}" = set; then
  enableval="$enable_gconf"
  if test "$enableval" = "no"; then
    MOZ_ENABLE_GCONF=
  elif test "$enableval" = "yes"; then
    MOZ_ENABLE_GCONF=force
  else
    { echo "configure: error: Option, gconf, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


    if test "$MOZ_ENABLE_GCONF"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17478: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 ""... $ac_c" 1>&6
echo "configure:17522: checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 " >&5

        if $PKG_CONFIG --exists "gconf-2.0 >= $GCONF_VERSION gobject-2.0 " ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_GCONF_CFLAGS""... $ac_c" 1>&6
echo "configure:17529: checking MOZ_GCONF_CFLAGS" >&5
            MOZ_GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= $GCONF_VERSION gobject-2.0 "`
            echo "$ac_t""$MOZ_GCONF_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_GCONF_LIBS""... $ac_c" 1>&6
echo "configure:17534: checking MOZ_GCONF_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_GCONF_LIBS="`$PKG_CONFIG --libs \"gconf-2.0 >= $GCONF_VERSION gobject-2.0 \" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_GCONF_LIBS" 1>&6
        else
            MOZ_GCONF_CFLAGS=""
            MOZ_GCONF_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_GCONF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gconf-2.0 >= $GCONF_VERSION gobject-2.0 "`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     
            MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0`
            MOZ_ENABLE_GCONF=1
        
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       
            if test "$MOZ_ENABLE_GCONF" = "force"
            then
                { echo "configure: error: * * * Could not find gconf-2.0 " 1>&2; exit 1; }
            fi
            MOZ_ENABLE_GCONF=
        
     fi
  fi

    fi

    if test "$MOZ_ENABLE_GCONF"; then
        cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_GCONF 1
EOF

    fi

    
    
    
fi


if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
then
    MOZ_ENABLE_LIBPROXY=

    # Check whether --enable-libproxy or --disable-libproxy was given.
if test "${enable_libproxy+set}" = set; then
  enableval="$enable_libproxy"
  if test "$enableval" = "yes"; then
    MOZ_ENABLE_LIBPROXY=1
  elif test "$enableval" = "no"; then
    MOZ_ENABLE_LIBPROXY=
  else
    { echo "configure: error: Option, libproxy, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


    if test "$MOZ_ENABLE_LIBPROXY"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17612: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libproxy-1.0""... $ac_c" 1>&6
echo "configure:17656: checking for libproxy-1.0" >&5

        if $PKG_CONFIG --exists "libproxy-1.0" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_LIBPROXY_CFLAGS""... $ac_c" 1>&6
echo "configure:17663: checking MOZ_LIBPROXY_CFLAGS" >&5
            MOZ_LIBPROXY_CFLAGS=`$PKG_CONFIG --cflags "libproxy-1.0"`
            echo "$ac_t""$MOZ_LIBPROXY_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_LIBPROXY_LIBS""... $ac_c" 1>&6
echo "configure:17668: checking MOZ_LIBPROXY_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_LIBPROXY_LIBS="`$PKG_CONFIG --libs \"libproxy-1.0\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_LIBPROXY_LIBS" 1>&6
        else
            MOZ_LIBPROXY_CFLAGS=""
            MOZ_LIBPROXY_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_LIBPROXY_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libproxy-1.0"`
            echo $MOZ_LIBPROXY_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (libproxy-1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_LIBPROXY 1
EOF

    fi
fi





if test "$MOZ_ENABLE_GTK2"
then
    MOZ_ENABLE_LIBNOTIFY=1

    # Check whether --enable-libnotify or --disable-libnotify was given.
if test "${enable_libnotify+set}" = set; then
  enableval="$enable_libnotify"
  if test "$enableval" = "no"; then
    MOZ_ENABLE_LIBNOTIFY=
  elif test "$enableval" = "yes"; then
    MOZ_ENABLE_LIBNOTIFY=1
  else
    { echo "configure: error: Option, libnotify, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


    if test "$MOZ_ENABLE_LIBNOTIFY"
    then
        cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_LIBNOTIFY 1
EOF

    fi
fi

if test -z "$SKIP_LIBRARY_CHECKS"
then
    if test "$MOZ_ENABLE_GTK2"
    then
        if test "$MOZ_ENABLE_LIBNOTIFY"
        then
            succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17746: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libnotify >= $LIBNOTIFY_VERSION""... $ac_c" 1>&6
echo "configure:17790: checking for libnotify >= $LIBNOTIFY_VERSION" >&5

        if $PKG_CONFIG --exists "libnotify >= $LIBNOTIFY_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_LIBNOTIFY_CFLAGS""... $ac_c" 1>&6
echo "configure:17797: checking MOZ_LIBNOTIFY_CFLAGS" >&5
            MOZ_LIBNOTIFY_CFLAGS=`$PKG_CONFIG --cflags "libnotify >= $LIBNOTIFY_VERSION"`
            echo "$ac_t""$MOZ_LIBNOTIFY_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_LIBNOTIFY_LIBS""... $ac_c" 1>&6
echo "configure:17802: checking MOZ_LIBNOTIFY_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_LIBNOTIFY_LIBS="`$PKG_CONFIG --libs \"libnotify >= $LIBNOTIFY_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_LIBNOTIFY_LIBS" 1>&6
        else
            MOZ_LIBNOTIFY_CFLAGS=""
            MOZ_LIBNOTIFY_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_LIBNOTIFY_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libnotify >= $LIBNOTIFY_VERSION"`
            echo $MOZ_LIBNOTIFY_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (libnotify >= $LIBNOTIFY_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        fi
    fi
fi





# The GNOME component is built if one of
# gnome-vfs, gio, gconf or libnotify is available.
if test "$MOZ_ENABLE_GCONF" -o \
   "$MOZ_ENABLE_GNOMEVFS" -o \
   "$MOZ_ENABLE_GIO" -o \
   "$MOZ_ENABLE_LIBNOTIFY"; then
    MOZ_ENABLE_GNOME_COMPONENT=1
else
    MOZ_ENABLE_GNOME_COMPONENT=
fi



if test "$MOZ_ENABLE_GTK2"
then
    MOZ_ENABLE_GNOMEUI=1

    # Check whether --enable-gnomeui or --disable-gnomeui was given.
if test "${enable_gnomeui+set}" = set; then
  enableval="$enable_gnomeui"
  if test "$enableval" = "no"; then
    MOZ_ENABLE_GNOMEUI=
  elif test "$enableval" = "yes"; then
    MOZ_ENABLE_GNOMEUI=force
  else
    { echo "configure: error: Option, gnomeui, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


    if test "$MOZ_ENABLE_GNOMEUI"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:17877: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libgnomeui-2.0 >= $GNOMEUI_VERSION""... $ac_c" 1>&6
echo "configure:17921: checking for libgnomeui-2.0 >= $GNOMEUI_VERSION" >&5

        if $PKG_CONFIG --exists "libgnomeui-2.0 >= $GNOMEUI_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_GNOMEUI_CFLAGS""... $ac_c" 1>&6
echo "configure:17928: checking MOZ_GNOMEUI_CFLAGS" >&5
            MOZ_GNOMEUI_CFLAGS=`$PKG_CONFIG --cflags "libgnomeui-2.0 >= $GNOMEUI_VERSION"`
            echo "$ac_t""$MOZ_GNOMEUI_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_GNOMEUI_LIBS""... $ac_c" 1>&6
echo "configure:17933: checking MOZ_GNOMEUI_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_GNOMEUI_LIBS="`$PKG_CONFIG --libs \"libgnomeui-2.0 >= $GNOMEUI_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_GNOMEUI_LIBS" 1>&6
        else
            MOZ_GNOMEUI_CFLAGS=""
            MOZ_GNOMEUI_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_GNOMEUI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libgnomeui-2.0 >= $GNOMEUI_VERSION"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     
            MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
            MOZ_ENABLE_GNOMEUI=1
        
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       
            if test "$MOZ_ENABLE_GNOMEUI" = "force"
            then
                { echo "configure: error: * * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION" 1>&2; exit 1; }
            fi
            MOZ_ENABLE_GNOMEUI=
        
     fi
  fi

    fi

    if test "$MOZ_ENABLE_GNOMEUI"; then
        cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_GNOMEUI 1
EOF

    fi
fi






if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
then
    MOZ_ENABLE_DBUS=1

    # Check whether --enable-dbus or --disable-dbus was given.
if test "${enable_dbus+set}" = set; then
  enableval="$enable_dbus"
  if test "$enableval" = "no"; then
    MOZ_ENABLE_DBUS=
  elif test "$enableval" = "yes"; then
    MOZ_ENABLE_DBUS=1
  else
    { echo "configure: error: Option, dbus, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


    if test "$MOZ_ENABLE_DBUS"
    then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:18011: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for dbus-1 >= $DBUS_VERSION""... $ac_c" 1>&6
echo "configure:18055: checking for dbus-1 >= $DBUS_VERSION" >&5

        if $PKG_CONFIG --exists "dbus-1 >= $DBUS_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_DBUS_CFLAGS""... $ac_c" 1>&6
echo "configure:18062: checking MOZ_DBUS_CFLAGS" >&5
            MOZ_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= $DBUS_VERSION"`
            echo "$ac_t""$MOZ_DBUS_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_DBUS_LIBS""... $ac_c" 1>&6
echo "configure:18067: checking MOZ_DBUS_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_DBUS_LIBS="`$PKG_CONFIG --libs \"dbus-1 >= $DBUS_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_DBUS_LIBS" 1>&6
        else
            MOZ_DBUS_CFLAGS=""
            MOZ_DBUS_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_DBUS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "dbus-1 >= $DBUS_VERSION"`
            echo $MOZ_DBUS_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (dbus-1 >= $DBUS_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:18102: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for dbus-glib-1 >= $DBUS_VERSION""... $ac_c" 1>&6
echo "configure:18146: checking for dbus-glib-1 >= $DBUS_VERSION" >&5

        if $PKG_CONFIG --exists "dbus-glib-1 >= $DBUS_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_DBUS_GLIB_CFLAGS""... $ac_c" 1>&6
echo "configure:18153: checking MOZ_DBUS_GLIB_CFLAGS" >&5
            MOZ_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= $DBUS_VERSION"`
            echo "$ac_t""$MOZ_DBUS_GLIB_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_DBUS_GLIB_LIBS""... $ac_c" 1>&6
echo "configure:18158: checking MOZ_DBUS_GLIB_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_DBUS_GLIB_LIBS="`$PKG_CONFIG --libs \"dbus-glib-1 >= $DBUS_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_DBUS_GLIB_LIBS" 1>&6
        else
            MOZ_DBUS_GLIB_CFLAGS=""
            MOZ_DBUS_GLIB_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "dbus-glib-1 >= $DBUS_VERSION"`
            echo $MOZ_DBUS_GLIB_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (dbus-glib-1 >= $DBUS_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_DBUS 1
EOF

    fi
fi






if test -n "$MOZ_ANDROID_HISTORY"; then
          cat >> confdefs.h <<\EOF
#define MOZ_ANDROID_HISTORY 1
EOF

fi


if test -n "$MOZ_JAVA_COMPOSITOR"; then
          cat >> confdefs.h <<\EOF
#define MOZ_JAVA_COMPOSITOR 1
EOF

fi

# Check whether --enable-websms-backend or --disable-websms-backend was given.
if test "${enable_websms_backend+set}" = set; then
  enableval="$enable_websms_backend"
  if test "$enableval" = "no"; then
    MOZ_WEBSMS_BACKEND=
  elif test "$enableval" = "yes"; then
    MOZ_WEBSMS_BACKEND=1
  else
    { echo "configure: error: Option, websms-backend, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_WEBSMS_BACKEND"; then
    cat >> confdefs.h <<\EOF
#define MOZ_WEBSMS_BACKEND 1
EOF

fi

# Check whether --enable-crypto or --disable-crypto was given.
if test "${enable_crypto+set}" = set; then
  enableval="$enable_crypto"
  if test "$enableval" = "no"; then
    MOZ_PSM=
  elif test "$enableval" = "yes"; then
    MOZ_PSM=1 
  else
    { echo "configure: error: Option, crypto, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-jsd or --disable-jsd was given.
if test "${enable_jsd+set}" = set; then
  enableval="$enable_jsd"
  if test "$enableval" = "no"; then
    MOZ_JSDEBUGGER=
  elif test "$enableval" = "yes"; then
    MOZ_JSDEBUGGER=1
  else
    { echo "configure: error: Option, jsd, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



MOZ_IPDL_TESTS=

# Check whether --enable-ipdl-tests or --disable-ipdl-tests was given.
if test "${enable_ipdl_tests+set}" = set; then
  enableval="$enable_ipdl_tests"
  if test "$enableval" = "yes"; then
    MOZ_IPDL_TESTS=1
  elif test "$enableval" = "no"; then
    MOZ_IPDL_TESTS=
  else
    { echo "configure: error: Option, ipdl-tests, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_IPDL_TESTS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_IPDL_TESTS 1
EOF

fi




MOZ_E10S_COMPAT=

# Check whether --enable-e10s-compat or --disable-e10s-compat was given.
if test "${enable_e10s_compat+set}" = set; then
  enableval="$enable_e10s_compat"
  if test "$enableval" = "yes"; then
    MOZ_E10S_COMPAT=1
  elif test "$enableval" = "no"; then
    MOZ_E10S_COMPAT=
  else
    { echo "configure: error: Option, e10s-compat, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_E10S_COMPAT"; then
    cat >> confdefs.h <<\EOF
#define MOZ_E10S_COMPAT 1
EOF

fi

# Check whether --enable-dbm or --disable-dbm was given.
if test "${enable_dbm+set}" = set; then
  enableval="$enable_dbm"
  if test "$enableval" = "no"; then
    NSS_DISABLE_DBM=1
  elif test "$enableval" = "yes"; then
    NSS_DISABLE_DBM=
  else
    { echo "configure: error: Option, dbm, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


IBMBIDI=1
cat >> confdefs.h <<\EOF
#define IBMBIDI 1
EOF


# Check whether --enable-accessibility or --disable-accessibility was given.
if test "${enable_accessibility+set}" = set; then
  enableval="$enable_accessibility"
  if test "$enableval" = "no"; then
    ACCESSIBILITY=
  elif test "$enableval" = "yes"; then
    ACCESSIBILITY=1 
  else
    { echo "configure: error: Option, accessibility, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$ACCESSIBILITY"; then
    cat >> confdefs.h <<\EOF
#define ACCESSIBILITY 1
EOF

fi

# Check whether --enable-printing or --disable-printing was given.
if test "${enable_printing+set}" = set; then
  enableval="$enable_printing"
  if test "$enableval" = "no"; then
    NS_PRINTING=
  elif test "$enableval" = "yes"; then
    NS_PRINTING=1
  else
    { echo "configure: error: Option, printing, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$NS_PRINTING"; then
    cat >> confdefs.h <<\EOF
#define NS_PRINTING 1
EOF

    cat >> confdefs.h <<\EOF
#define NS_PRINT_PREVIEW 1
EOF

fi

# Check whether --enable-raw or --disable-raw was given.
if test "${enable_raw+set}" = set; then
  enableval="$enable_raw"
  if test "$enableval" = "yes"; then
    MOZ_RAW=1
  elif test "$enableval" = "no"; then
    MOZ_RAW=
  else
    { echo "configure: error: Option, raw, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_RAW"; then
    cat >> confdefs.h <<\EOF
#define MOZ_RAW 1
EOF

    MOZ_MEDIA=1
fi



# Check whether --enable-ogg or --disable-ogg was given.
if test "${enable_ogg+set}" = set; then
  enableval="$enable_ogg"
  if test "$enableval" = "no"; then
    MOZ_OGG=
  elif test "$enableval" = "yes"; then
    MOZ_OGG=1
  else
    { echo "configure: error: Option, ogg, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_OGG"; then
    cat >> confdefs.h <<\EOF
#define MOZ_OGG 1
EOF

    MOZ_SYDNEYAUDIO=1
    MOZ_CUBEB=1
    MOZ_MEDIA=1
    case "$target_cpu" in
    arm*)
        MOZ_TREMOR=1
    ;;
    *)
        MOZ_VORBIS=1
    ;;
    esac

        echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
echo "configure:18424: checking __attribute__ ((aligned ())) support" >&5
if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_c_attribute_aligned=0
         CFLAGS_save="${CFLAGS}"
         CFLAGS="${CFLAGS} -Werror"
         for ac_cv_c_attr_align_try in 64 32 16 8; do
           echo "trying $ac_cv_c_attr_align_try"
           cat > conftest.$ac_ext <<EOF
#line 18434 "configure"
#include "confdefs.h"

int main() {
static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;
; return 0; }
EOF
if { (eval echo configure:18441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
           if test "$ac_cv_c_attribute_aligned" != 0; then
             break;
           fi
         done
           CFLAGS="${CFLAGS_save}"
fi

echo "$ac_t""$ac_cv_c_attribute_aligned" 1>&6
    if test "${ac_cv_c_attribute_aligned}" != "0"; then
      cat >> confdefs.h <<EOF
#define ATTRIBUTE_ALIGNED_MAX ${ac_cv_c_attribute_aligned}
EOF

    fi
fi

# Check whether --enable-opus or --disable-opus was given.
if test "${enable_opus+set}" = set; then
  enableval="$enable_opus"
  if test "$enableval" = "no"; then
    MOZ_OPUS=
  elif test "$enableval" = "yes"; then
    MOZ_OPUS=1
  else
    { echo "configure: error: Option, opus, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-webm or --disable-webm was given.
if test "${enable_webm+set}" = set; then
  enableval="$enable_webm"
  if test "$enableval" = "no"; then
    MOZ_WEBM=
  elif test "$enableval" = "yes"; then
    MOZ_WEBM=1
  else
    { echo "configure: error: Option, webm, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-media-plugins or --disable-media-plugins was given.
if test "${enable_media_plugins+set}" = set; then
  enableval="$enable_media_plugins"
  if test "$enableval" = "yes"; then
    MOZ_MEDIA_PLUGINS=1
  elif test "$enableval" = "no"; then
    MOZ_MEDIA_PLUGINS=
  else
    { echo "configure: error: Option, media-plugins, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_MEDIA_PLUGINS"; then
  cat >> confdefs.h <<\EOF
#define MOZ_MEDIA_PLUGINS 1
EOF

fi

# Check whether --enable-media-navigator or --disable-media-navigator was given.
if test "${enable_media_navigator+set}" = set; then
  enableval="$enable_media_navigator"
  if test "$enableval" = "yes"; then
    MOZ_MEDIA_NAVIGATOR=1
  elif test "$enableval" = "no"; then
    MOZ_MEDIA_NAVIGATOR=
  else
    { echo "configure: error: Option, media-navigator, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_MEDIA_NAVIGATOR"; then
  cat >> confdefs.h <<\EOF
#define MOZ_MEDIA_NAVIGATOR 1
EOF

fi

# Check whether --enable-omx-plugin or --disable-omx-plugin was given.
if test "${enable_omx_plugin+set}" = set; then
  enableval="$enable_omx_plugin"
  if test "$enableval" = "yes"; then
    MOZ_OMX_PLUGIN=1
  elif test "$enableval" = "no"; then
    MOZ_OMX_PLUGIN=
  else
    { echo "configure: error: Option, omx-plugin, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_OMX_PLUGIN"; then
    if test "$OS_TARGET" = "Android" -a -n "$gonkdir"; then
                cat >> confdefs.h <<\EOF
#define MOZ_OMX_PLUGIN 1
EOF

    else
              { echo "configure: error: OMX media plugin can only be built on B2G" 1>&2; exit 1; }
    fi
fi

# Check whether --with-system-libvpx or --without-system-libvpx was given.
if test "${with_system_libvpx+set}" = set; then
  withval="$with_system_libvpx"
  if test "$withval" = "yes"; then
    MOZ_NATIVE_LIBVPX=1
  elif test "$withval" = "no"; then
    :
  else
    { echo "configure: error: Option, system-libvpx, does not take an argument ($withval)." 1>&2; exit 1; }
  fi
fi


MOZ_LIBVPX_INCLUDES=
MOZ_LIBVPX_LIBS=

if test -n "$MOZ_WEBM"; then
    cat >> confdefs.h <<\EOF
#define MOZ_WEBM 1
EOF

    if test -n "$MOZ_VP8_ERROR_CONCEALMENT" ; then
        cat >> confdefs.h <<\EOF
#define MOZ_VP8_ERROR_CONCEALMENT 1
EOF

    fi
    if test -n "$MOZ_VP8_ENCODER" ; then
        cat >> confdefs.h <<\EOF
#define MOZ_VP8_ENCODER 1
EOF

    fi

    if test -n "$MOZ_NATIVE_LIBVPX"; then
                                        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:18596: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for vpx >= 1.0.0""... $ac_c" 1>&6
echo "configure:18640: checking for vpx >= 1.0.0" >&5

        if $PKG_CONFIG --exists "vpx >= 1.0.0" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBVPX_CFLAGS""... $ac_c" 1>&6
echo "configure:18647: checking LIBVPX_CFLAGS" >&5
            LIBVPX_CFLAGS=`$PKG_CONFIG --cflags "vpx >= 1.0.0"`
            echo "$ac_t""$LIBVPX_CFLAGS" 1>&6

            echo $ac_n "checking LIBVPX_LIBS""... $ac_c" 1>&6
echo "configure:18652: checking LIBVPX_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBVPX_LIBS="`$PKG_CONFIG --libs \"vpx >= 1.0.0\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBVPX_LIBS" 1>&6
        else
            LIBVPX_CFLAGS=""
            LIBVPX_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBVPX_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vpx >= 1.0.0"`
            echo $LIBVPX_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (vpx >= 1.0.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi


           ac_safe=`echo "vpx/vpx_decoder.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for vpx/vpx_decoder.h""... $ac_c" 1>&6
echo "configure:18684: checking for vpx/vpx_decoder.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 18689 "configure"
#include "confdefs.h"

#include <vpx/vpx_decoder.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:18697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    :
  else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx." 1>&2; exit 1; }
  fi


        echo $ac_n "checking for vpx_codec_dec_init_ver in -lvpx""... $ac_c" 1>&6
echo "configure:18719: checking for vpx_codec_dec_init_ver in -lvpx" >&5
ac_lib_var=`echo vpx'_'vpx_codec_dec_init_ver | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lvpx  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 18727 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char vpx_codec_dec_init_ver();

int main() {
vpx_codec_dec_init_ver()
; return 0; }
EOF
if { (eval echo configure:18738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo vpx | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lvpx $LIBS"

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: --with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found" 1>&2; exit 1; }
fi

    fi
fi





if test -n "$MOZ_WEBM" -a -z "$MOZ_NATIVE_LIBVPX"; then
    MOZ_SYDNEYAUDIO=1
    MOZ_CUBEB=1
    MOZ_MEDIA=1
    case "$target_cpu" in
    arm*)
        MOZ_TREMOR=1
    ;;
    *)
        MOZ_VORBIS=1
    ;;
    esac


                VPX_AS=$YASM
    VPX_ASM_SUFFIX=asm
    VPX_NEED_OBJ_INT_EXTRACT=

        case "$OS_ARCH:$CPU_ARCH" in
    Linux:x86)
      VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
      VPX_X86_ASM=1
    ;;
    Linux:x86_64)
      VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
      VPX_X86_ASM=1
    ;;
    SunOS:x86)
      VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
      VPX_X86_ASM=1
    ;;
    SunOS:x86_64)
      VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
      VPX_X86_ASM=1
    ;;
    Darwin:x86)
      VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
      VPX_X86_ASM=1
    ;;
    Darwin:x86_64)
      VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC"
      VPX_X86_ASM=1
    ;;
    WINNT:x86_64)
      VPX_ASFLAGS="-f x64 -rnasm -pnasm"
      VPX_X86_ASM=1
    ;;
    WINNT:x86)
            if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
        { echo "configure: error: yasm 1.1 or greater is required to build libvpx on Win32, but it appears not to be installed.  Install it (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details." 1>&2; exit 1; }
      elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
        { echo "configure: error: yasm 1.1 or greater is required to build libvpx on Win32, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.  Upgrade to the newest version (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details." 1>&2; exit 1; }
      else
        VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC"
        VPX_X86_ASM=1
              fi
    ;;
    *:arm*)
      if test -n "$GNU_AS" ; then
        VPX_AS=$AS
                        VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
        VPX_DASH_C_FLAG="-c"
        VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
        VPX_ASM_SUFFIX="$ASM_SUFFIX"
        VPX_ARM_ASM=1
      fi
    esac

    if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
      { echo "configure: error: yasm is a required build tool for this architecture when webm is enabled. You may either install yasm or --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details." 1>&2; exit 1; }
    fi

    if test -n "$MOZ_VP8_ENCODER" -a \
            -z "$GNU_CC" -a -z "$INTEL_CC" -a -z "$CLANG_CC" ; then
                                    VPX_NEED_OBJ_INT_EXTRACT=1
    fi

    if test -n "$VPX_X86_ASM"; then
      cat >> confdefs.h <<\EOF
#define VPX_X86_ASM 1
EOF

    elif test -n "$VPX_ARM_ASM"; then
      cat >> confdefs.h <<\EOF
#define VPX_ARM_ASM 1
EOF

    else
      echo "configure: warning: No assembler or assembly support for libvpx. Using unoptimized C routines." 1>&2
    fi
fi

# Check whether --enable-wave or --disable-wave was given.
if test "${enable_wave+set}" = set; then
  enableval="$enable_wave"
  if test "$enableval" = "no"; then
    MOZ_WAVE=
  elif test "$enableval" = "yes"; then
    MOZ_WAVE=1
  else
    { echo "configure: error: Option, wave, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_WAVE"; then
    cat >> confdefs.h <<\EOF
#define MOZ_WAVE 1
EOF

    MOZ_SYDNEYAUDIO=1
    MOZ_CUBEB=1
    MOZ_MEDIA=1
fi


if test -n "$MOZ_SYDNEYAUDIO"; then
    cat >> confdefs.h <<\EOF
#define MOZ_SYDNEYAUDIO 1
EOF

fi

if test -n "$MOZ_SPEEX_RESAMPLER"; then
    cat >> confdefs.h <<\EOF
#define MOZ_SPEEX_RESAMPLER 1
EOF

fi

if test -n "$MOZ_CUBEB"; then
    case "$target" in
    *-android*|*-linuxandroid*)
                ;;
    *-linux*)
        cat >> confdefs.h <<\EOF
#define MOZ_CUBEB 1
EOF

        ;;
    *-mingw*)
        cat >> confdefs.h <<\EOF
#define MOZ_CUBEB 1
EOF

        ;;
    *-openbsd*)
        cat >> confdefs.h <<\EOF
#define MOZ_CUBEB 1
EOF

        ;;
    *)
                ;;
    esac
fi

if test -n "$MOZ_MEDIA"; then
    cat >> confdefs.h <<\EOF
#define MOZ_MEDIA 1
EOF

fi

if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
    { echo "configure: error: MOZ_VORBIS and MOZ_TREMOR are mutually exclusive!  The build system should not allow them both to be set, but they are.  Please file a bug at https://bugzilla.mozilla.org/" 1>&2; exit 1; }
fi

if test -n "$MOZ_VORBIS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_VORBIS 1
EOF

fi

if test -n "$MOZ_TREMOR"; then
    cat >> confdefs.h <<\EOF
#define MOZ_TREMOR 1
EOF

fi

if test -n "$MOZ_OPUS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_OPUS 1
EOF

fi


if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux"; then
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:18970: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for alsa""... $ac_c" 1>&6
echo "configure:19014: checking for alsa" >&5

        if $PKG_CONFIG --exists "alsa" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_ALSA_CFLAGS""... $ac_c" 1>&6
echo "configure:19021: checking MOZ_ALSA_CFLAGS" >&5
            MOZ_ALSA_CFLAGS=`$PKG_CONFIG --cflags "alsa"`
            echo "$ac_t""$MOZ_ALSA_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_ALSA_LIBS""... $ac_c" 1>&6
echo "configure:19026: checking MOZ_ALSA_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_ALSA_LIBS="`$PKG_CONFIG --libs \"alsa\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_ALSA_LIBS" 1>&6
        else
            MOZ_ALSA_CFLAGS=""
            MOZ_ALSA_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_ALSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "alsa"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       echo "$MOZ_ALSA_PKG_ERRORS"
          { echo "configure: error: Need alsa for Ogg, Wave or WebM decoding on Linux.  Disable with --disable-ogg --disable-wave --disable-webm.  (On Ubuntu, you might try installing the package libasound2-dev.)" 1>&2; exit 1; }
     fi
  fi

fi

# Check whether --enable-gstreamer or --disable-gstreamer was given.
if test "${enable_gstreamer+set}" = set; then
  enableval="$enable_gstreamer"
  if test "$enableval" = "yes"; then
    MOZ_GSTREAMER=1
  elif test "$enableval" = "no"; then
    MOZ_GSTREAMER=
  else
    { echo "configure: error: Option, gstreamer, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$MOZ_GSTREAMER"; then
    # API version, eg 0.10, 1.0 etc
    GST_API_VERSION=0.10
    # core/base release number
    # depend on >= 0.10.33 as that's when the playbin2 source-setup signal was
    # introduced
    GST_VERSION=0.10.33
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:19084: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gstreamer-$GST_API_VERSION >= $GST_VERSION
                      gstreamer-app-$GST_API_VERSION
                      gstreamer-plugins-base-$GST_API_VERSION""... $ac_c" 1>&6
echo "configure:19130: checking for gstreamer-$GST_API_VERSION >= $GST_VERSION
                      gstreamer-app-$GST_API_VERSION
                      gstreamer-plugins-base-$GST_API_VERSION" >&5

        if $PKG_CONFIG --exists "gstreamer-$GST_API_VERSION >= $GST_VERSION
                      gstreamer-app-$GST_API_VERSION
                      gstreamer-plugins-base-$GST_API_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking GSTREAMER_CFLAGS""... $ac_c" 1>&6
echo "configure:19141: checking GSTREAMER_CFLAGS" >&5
            GSTREAMER_CFLAGS=`$PKG_CONFIG --cflags "gstreamer-$GST_API_VERSION >= $GST_VERSION
                      gstreamer-app-$GST_API_VERSION
                      gstreamer-plugins-base-$GST_API_VERSION"`
            echo "$ac_t""$GSTREAMER_CFLAGS" 1>&6

            echo $ac_n "checking GSTREAMER_LIBS""... $ac_c" 1>&6
echo "configure:19148: checking GSTREAMER_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            GSTREAMER_LIBS="`$PKG_CONFIG --libs \"gstreamer-$GST_API_VERSION >= $GST_VERSION
                      gstreamer-app-$GST_API_VERSION
                      gstreamer-plugins-base-$GST_API_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$GSTREAMER_LIBS" 1>&6
        else
            GSTREAMER_CFLAGS=""
            GSTREAMER_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            GSTREAMER_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gstreamer-$GST_API_VERSION >= $GST_VERSION
                      gstreamer-app-$GST_API_VERSION
                      gstreamer-plugins-base-$GST_API_VERSION"`
            echo $GSTREAMER_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (gstreamer-$GST_API_VERSION >= $GST_VERSION
                      gstreamer-app-$GST_API_VERSION
                      gstreamer-plugins-base-$GST_API_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    if test -n "$GSTREAMER_LIBS"; then
       _SAVE_LDFLAGS=$LDFLAGS
       LDFLAGS="$LDFLAGS -lgstvideo-$GST_API_VERSION"
       cat > conftest.$ac_ext <<EOF
#line 19187 "configure"
#include "confdefs.h"

int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:19194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  _HAVE_LIBGSTVIDEO=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _HAVE_LIBGSTVIDEO=
fi
rm -f conftest*
       if test -n "$_HAVE_LIBGSTVIDEO" ; then
          GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
       else
          { echo "configure: error: gstreamer video backend requires libgstvideo" 1>&2; exit 1; }
       fi
       LDFLAGS=$_SAVE_LDFLAGS
    else
       { echo "configure: error: gstreamer backend requires the gstreamer packages" 1>&2; exit 1; }
    fi
fi




if test -n "$MOZ_GSTREAMER"; then
   cat >> confdefs.h <<\EOF
#define MOZ_GSTREAMER 1
EOF

   MOZ_MEDIA=1
fi


# Check whether --enable-permissions or --disable-permissions was given.
if test "${enable_permissions+set}" = set; then
  enableval="$enable_permissions"
  if test "$enableval" = "no"; then
    MOZ_PERMISSIONS=
  elif test "$enableval" = "yes"; then
    MOZ_PERMISSIONS=1

  else
    { echo "configure: error: Option, permissions, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-negotiateauth or --disable-negotiateauth was given.
if test "${enable_negotiateauth+set}" = set; then
  enableval="$enable_negotiateauth"
  if test "$enableval" = "no"; then
    MOZ_AUTH_EXTENSION=
  elif test "$enableval" = "yes"; then
    MOZ_AUTH_EXTENSION=1 
  else
    { echo "configure: error: Option, negotiateauth, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-xtf or --disable-xtf was given.
if test "${enable_xtf+set}" = set; then
  enableval="$enable_xtf"
  if test "$enableval" = "no"; then
    MOZ_XTF=
  elif test "$enableval" = "yes"; then
    MOZ_XTF=1 
  else
    { echo "configure: error: Option, xtf, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$MOZ_XTF"; then
  cat >> confdefs.h <<\EOF
#define MOZ_XTF 1
EOF

fi

# Check whether --enable-pref-extensions or --disable-pref-extensions was given.
if test "${enable_pref_extensions+set}" = set; then
  enableval="$enable_pref_extensions"
  if test "$enableval" = "no"; then
    MOZ_PREF_EXTENSIONS=
  elif test "$enableval" = "yes"; then
    MOZ_PREF_EXTENSIONS=1 
  else
    { echo "configure: error: Option, pref-extensions, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-system-extension-dirs or --disable-system-extension-dirs was given.
if test "${enable_system_extension_dirs+set}" = set; then
  enableval="$enable_system_extension_dirs"
  if test "$enableval" = "no"; then
    ENABLE_SYSTEM_EXTENSION_DIRS=
  elif test "$enableval" = "yes"; then
    ENABLE_SYSTEM_EXTENSION_DIRS=1 
  else
    { echo "configure: error: Option, system-extension-dirs, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then
  cat >> confdefs.h <<\EOF
#define ENABLE_SYSTEM_EXTENSION_DIRS 1
EOF

fi

# Check whether --enable-universalchardet or --disable-universalchardet was given.
if test "${enable_universalchardet+set}" = set; then
  enableval="$enable_universalchardet"
  if test "$enableval" = "no"; then
    MOZ_UNIVERSALCHARDET=
  elif test "$enableval" = "yes"; then
    MOZ_UNIVERSALCHARDET=1 
  else
    { echo "configure: error: Option, universalchardet, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "${JAVA_BIN_PATH}"; then
    JAVA_PATH="$JAVA_BIN_PATH"
else
    JAVA_PATH="$JAVA_HOME/bin:$PATH"
fi

 # Extract the first word of "java", so it can be a program name with args.
set dummy java; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:19327: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAVA'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$JAVA" in
  /*)
  ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_JAVA="$JAVA" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$JAVA_PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_JAVA="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_JAVA" && ac_cv_path_JAVA=":"
  ;;
esac
fi
JAVA="$ac_cv_path_JAVA"
if test -n "$JAVA"; then
  echo "$ac_t""$JAVA" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$JAVA" in
    /*)
      tmp_DIRNAME=`dirname "$JAVA"`
      tmp_BASENAME=`basename "$JAVA"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      JAVA="$tmp_PWD/$tmp_BASENAME"
      if test -e "$JAVA.exe"; then
        JAVA="$JAVA.exe"
      fi
    esac
  fi

 # Extract the first word of "javac", so it can be a program name with args.
set dummy javac; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:19376: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAVAC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$JAVAC" in
  /*)
  ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$JAVA_PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_JAVAC="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_JAVAC" && ac_cv_path_JAVAC=":"
  ;;
esac
fi
JAVAC="$ac_cv_path_JAVAC"
if test -n "$JAVAC"; then
  echo "$ac_t""$JAVAC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$JAVAC" in
    /*)
      tmp_DIRNAME=`dirname "$JAVAC"`
      tmp_BASENAME=`basename "$JAVAC"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      JAVAC="$tmp_PWD/$tmp_BASENAME"
      if test -e "$JAVAC.exe"; then
        JAVAC="$JAVAC.exe"
      fi
    esac
  fi

 # Extract the first word of "jar", so it can be a program name with args.
set dummy jar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:19425: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$JAR" in
  /*)
  ac_cv_path_JAR="$JAR" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_JAR="$JAR" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$JAVA_PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_JAR="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_JAR" && ac_cv_path_JAR=":"
  ;;
esac
fi
JAR="$ac_cv_path_JAR"
if test -n "$JAR"; then
  echo "$ac_t""$JAR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test "$msyshost"; then
    case "$JAR" in
    /*)
      tmp_DIRNAME=`dirname "$JAR"`
      tmp_BASENAME=`basename "$JAR"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      JAR="$tmp_PWD/$tmp_BASENAME"
      if test -e "$JAR.exe"; then
        JAR="$JAR.exe"
      fi
    esac
  fi


if test -n "${JAVA_BIN_PATH}" -o \
  \( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then
  if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAR" -o "$JAR" = ":"; then
    { echo "configure: error: The programs java, javac and jar were not found.  Set \$JAVA_HOME to your java sdk directory or use --with-java-bin-path={java-bin-dir}" 1>&2; exit 1; }
  fi
fi

MOZ_ANGLE=
MOZ_DIRECTX_SDK_PATH=
MOZ_DIRECTX_SDK_CPU_SUFFIX=
MOZ_D3DX9_VERSION=
MOZ_D3DX9_CAB=
MOZ_D3DCOMPILER_CAB=
MOZ_D3DX9_DLL=
MOZ_D3DCOMPILER_DLL=
case "$target_os" in
*mingw*)
    MOZ_ANGLE=1
    ;;
esac

# The DirectX SDK libraries are split into x86 and x64 sub-directories
case "${target_cpu}" in
i*86)
  MOZ_DIRECTX_SDK_CPU_SUFFIX=x86
  ;;
x86_64)
  MOZ_DIRECTX_SDK_CPU_SUFFIX=x64
  ;;
esac

if test -n "$MOZ_ANGLE"; then
# Check whether --enable-angle or --disable-angle was given.
if test "${enable_angle+set}" = set; then
  enableval="$enable_angle"
  if test "$enableval" = "no"; then
    MOZ_ANGLE=
  elif test "$enableval" = "yes"; then
    MOZ_ANGLE=1
  else
    { echo "configure: error: Option, angle, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_ANGLE"; then
  # Get the SDK path from the registry.
  # First try to get the June 2010 SDK
  MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1`
  if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then
    # Otherwise just take whatever comes first
    MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
  fi

  if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then
    { echo "configure: error: Found the February 2010 DirectX SDK. This is too old. We now require the June 2010 DirectX SDK, or newer.  Upgrade your SDK or to explicitly build without ANGLE, reconfigure with --disable-angle." 1>&2; exit 1; }
  else
    MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([a-zA-Z]\)\\:\\\\/\\1\\:\\\\/'`
  fi

  MOZ_ANGLE=

  if test -n "$MOZ_DIRECTX_SDK_PATH" ; then
    if test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h && test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
      echo "$ac_t""Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH" 1>&6
      MOZ_ANGLE=1
    fi
  fi

  if test -z "$MOZ_ANGLE" ; then
    { echo "configure: error: Couldn't find the DirectX SDK, needed for ANGLE. Please install it (June 2010 or newer). To explicitly build without ANGLE, reconfigure with --disable-angle." 1>&2; exit 1; }
  fi

  if test -n "$MOZ_ANGLE" ; then
    # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib
    MOZ_D3DX9_VERSION=`dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[0-9][0-9]\.dll | head -n1 | sed 's/.*\([0-9][0-9]\).*/\\1/g'`

    if test -z "$MOZ_D3DX9_VERSION" ; then
      { echo "configure: error: Couldn't determine the D3DX9 version, needed for ANGLE. To explicitly build without ANGLE, reconfigure with --disable-angle." 1>&2; exit 1; }
    fi

    if test -n "$MOZ_ANGLE" ; then
      MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
      MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`

      MOZ_D3DX9_DLL=d3dx9_$MOZ_D3DX9_VERSION.dll
      MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll
    fi
  fi
fi
fi


case $target in
i?86-*-mingw*|x86_64-*-mingw*)
  MOZ_CRASHREPORTER=1
  ;;
i?86-apple-darwin*|powerpc-apple-darwin*|x86_64-apple-darwin*)
  MOZ_CRASHREPORTER=1
  ;;
i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
  if test "$MOZ_ENABLE_GTK2"; then
    MOZ_CRASHREPORTER=1
  fi
  ;;
*-android*|*-linuxandroid*)
  MOZ_CRASHREPORTER=1
  ;;
*solaris*)
  MOZ_CRASHREPORTER=1
  ;;
esac

# Check whether --enable-crashreporter or --disable-crashreporter was given.
if test "${enable_crashreporter+set}" = set; then
  enableval="$enable_crashreporter"
  if test "$enableval" = "no"; then
    MOZ_CRASHREPORTER=
  elif test "$enableval" = "yes"; then
    MOZ_CRASHREPORTER=1
  else
    { echo "configure: error: Option, crashreporter, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_CRASHREPORTER"; then
   cat >> confdefs.h <<\EOF
#define MOZ_CRASHREPORTER 1
EOF


  if (test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS") && \
    test -z "$SKIP_LIBRARY_CHECKS"; then
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:19612: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for gthread-2.0""... $ac_c" 1>&6
echo "configure:19656: checking for gthread-2.0" >&5

        if $PKG_CONFIG --exists "gthread-2.0" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_GTHREAD_CFLAGS""... $ac_c" 1>&6
echo "configure:19663: checking MOZ_GTHREAD_CFLAGS" >&5
            MOZ_GTHREAD_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0"`
            echo "$ac_t""$MOZ_GTHREAD_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_GTHREAD_LIBS""... $ac_c" 1>&6
echo "configure:19668: checking MOZ_GTHREAD_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_GTHREAD_LIBS="`$PKG_CONFIG --libs \"gthread-2.0\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_GTHREAD_LIBS" 1>&6
        else
            MOZ_GTHREAD_CFLAGS=""
            MOZ_GTHREAD_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_GTHREAD_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gthread-2.0"`
            echo $MOZ_GTHREAD_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (gthread-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    
    

     for ac_hdr in curl/curl.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:19704: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 19709 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:19717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: Couldn't find curl/curl.h which is required for the crash reporter.  Use --disable-crashreporter to disable the crash reporter." 1>&2; exit 1; }
  fi

  done

  fi

  if (test "$OS_ARCH" != "$HOST_OS_ARCH"); then
    { echo "configure: error: Breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH.  Use --disable-crashreporter." 1>&2; exit 1; }
  fi

  if test "$OS_ARCH" == "WINNT" -a -z "$HAVE_64BIT_OS"; then
    MOZ_CRASHREPORTER_INJECTOR=1
    cat >> confdefs.h <<\EOF
#define MOZ_CRASHREPORTER_INJECTOR 1
EOF

  fi
fi

# Check whether --with-crashreporter-enable-percent or --without-crashreporter-enable-percent was given.
if test "${with_crashreporter_enable_percent+set}" = set; then
  withval="$with_crashreporter_enable_percent"
   val=`echo $withval | sed 's/^0-9//g'`
    MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"
fi


if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
   MOZ_CRASHREPORTER_ENABLE_PERCENT=100
fi
cat >> confdefs.h <<EOF
#define MOZ_CRASHREPORTER_ENABLE_PERCENT $MOZ_CRASHREPORTER_ENABLE_PERCENT
EOF


MOZ_LIBJPEG_TURBO=
if test -z "$SYSTEM_JPEG"; then
    MOZ_LIBJPEG_TURBO=1
fi

# Check whether --enable-libjpeg_turbo or --disable-libjpeg_turbo was given.
if test "${enable_libjpeg_turbo+set}" = set; then
  enableval="$enable_libjpeg_turbo"
  if test "$enableval" = "no"; then
    MOZ_LIBJPEG_TURBO=
  elif test "$enableval" = "yes"; then
    MOZ_LIBJPEG_TURBO=1
  else
    { echo "configure: error: Option, libjpeg_turbo, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$SYSTEM_JPEG" = 1 -a "$MOZ_LIBJPEG_TURBO" = 1; then
    { echo "configure: error: cannot use --with-system-jpeg with --enable-libjpeg-turbo." 1>&2; exit 1; }
fi


if test -n "$MOZ_LIBJPEG_TURBO"; then

    case "$OS_ARCH:$OS_TEST" in
  Linux:x86|Linux:i?86)
    LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
    LIBJPEG_TURBO_X86_ASM=1
  ;;
  Linux:x86_64)
    LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
    LIBJPEG_TURBO_X64_ASM=1
  ;;
  SunOS:i?86)
    LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
    LIBJPEG_TURBO_X86_ASM=1
  ;;
  SunOS:x86_64)
    LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
    LIBJPEG_TURBO_X64_ASM=1
  ;;
  Darwin:i?86)
    LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
    LIBJPEG_TURBO_X86_ASM=1
  ;;
  Darwin:x86_64)
    LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
    LIBJPEG_TURBO_X64_ASM=1
  ;;
  WINNT:x86|WINNT:i?86)
    LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
    LIBJPEG_TURBO_X86_ASM=1
  ;;
  WINNT:x86_64)
    LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
    LIBJPEG_TURBO_X64_ASM=1
  ;;
  *:arm*)
    LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
    LIBJPEG_TURBO_ARM_ASM=1
  ;;
  esac

fi

if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
    echo $ac_n "checking for Yasm assembler""... $ac_c" 1>&6
echo "configure:19842: checking for Yasm assembler" >&5
    for ac_prog in yasm
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:19848: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LIBJPEG_TURBO_AS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LIBJPEG_TURBO_AS"; then
  ac_cv_prog_LIBJPEG_TURBO_AS="$LIBJPEG_TURBO_AS" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LIBJPEG_TURBO_AS="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
LIBJPEG_TURBO_AS="$ac_cv_prog_LIBJPEG_TURBO_AS"
if test -n "$LIBJPEG_TURBO_AS"; then
  echo "$ac_t""$LIBJPEG_TURBO_AS" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$LIBJPEG_TURBO_AS" && break
done
test -n "$LIBJPEG_TURBO_AS" || LIBJPEG_TURBO_AS=""""


    if test -z "$LIBJPEG_TURBO_AS" ; then
        { echo "configure: error: Yasm is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you do not appear to have Yasm installed.  Either install it or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder.  See https://developer.mozilla.org/en/YASM for more details." 1>&2; exit 1; }
    fi

            if test "$OS_ARCH" = "Linux" ; then
        if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -eq "0" -a "$_YASM_RELEASE" -lt "1" \) ; then
            { echo "configure: error: Yasm 1.0.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.$_YASM_RELEASE.  Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder.  See https://developer.mozilla.org/en/YASM for more details." 1>&2; exit 1; }
        fi
    else
        if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
            { echo "configure: error: Yasm 1.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.  Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder.  See https://developer.mozilla.org/en/YASM for more details." 1>&2; exit 1; }
        fi
    fi
fi

if test -n "$LIBJPEG_TURBO_ARM_ASM" ; then
    echo "Using $AS as the assembler for ARM code."
    LIBJPEG_TURBO_AS=$AS
fi

if test -n "$LIBJPEG_TURBO_X86_ASM"; then
    cat >> confdefs.h <<\EOF
#define LIBJPEG_TURBO_X86_ASM 1
EOF

elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
    cat >> confdefs.h <<\EOF
#define LIBJPEG_TURBO_X64_ASM 1
EOF

elif test -n "$LIBJPEG_TURBO_ARM_ASM"; then
    cat >> confdefs.h <<\EOF
#define LIBJPEG_TURBO_ARM_ASM 1
EOF

elif test -n "$MOZ_LIBJPEG_TURBO"; then
            echo "configure: warning: No assembler or assembly support for libjpeg-turbo.  Using unoptimized C routines." 1>&2
fi


# Check whether --enable-extensions or --disable-extensions was given.
if test "${enable_extensions+set}" = set; then
  enableval="$enable_extensions"
   for option in `echo $enableval | sed 's/,/ /g'`; do
    if test "$option" = "yes" -o "$option" = "all"; then
        { echo "configure: error: --enable-extensions=$option is no longer supported." 1>&2; exit 1; }
    elif test "$option" = "no" -o "$option" = "none"; then
        MOZ_EXTENSIONS=""
    elif test "$option" = "default"; then
        MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
    elif test `echo "$option" | grep -c \^-` != 0; then
        option=`echo $option | sed 's/^-//'`
        MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
    else
        MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
    fi
done
else
  MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT"
fi


if test -z "$MOZ_ENABLE_GNOMEVFS" -a -z "$MOZ_GNOMEVFS_LIBS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
    # Suppress warning on non-X11 platforms
    if test -n "$MOZ_X11"; then
        echo "configure: warning: Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS." 1>&2
    fi
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
fi

if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
fi

if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
    # Suppress warning on non-X11 platforms
    if test -n "$MOZ_X11"; then
        echo "configure: warning: Cannot build gio without required libraries. Removing gio from MOZ_EXTENSIONS." 1>&2
    fi
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
fi

if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
fi

if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
    echo "configure: warning: Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS." 1>&2
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
fi

if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
    echo "configure: warning: Cannot build XForms without XTF support.  Removing XForms from MOZ_EXTENSIONS." 1>&2
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
fi

MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`

for extension in $MOZ_EXTENSIONS; do
    if test ! -d "${srcdir}/extensions/${extension}"; then
        { echo "configure: error: Unrecognized extension provided to --enable-extensions: ${extension}." 1>&2; exit 1; }
    fi
done

if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
  cat >> confdefs.h <<\EOF
#define MOZ_USE_NATIVE_POPUP_WINDOWS 1
EOF

fi

if test -n "$MOZ_FLEXBOX"; then
  cat >> confdefs.h <<\EOF
#define MOZ_FLEXBOX 1
EOF

fi

if test -n "$MOZ_SVG_DLISTS"; then
  cat >> confdefs.h <<\EOF
#define MOZ_SVG_DLISTS 1
EOF

fi

# Check whether --enable-tree-freetype or --disable-tree-freetype was given.
if test "${enable_tree_freetype+set}" = set; then
  enableval="$enable_tree_freetype"
  if test "$enableval" = "yes"; then
    MOZ_TREE_FREETYPE=1
  elif test "$enableval" = "no"; then
    MOZ_TREE_FREETYPE= 
  else
    { echo "configure: error: Option, tree-freetype, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_TREE_FREETYPE"; then
   if test -n "$_WIN32_MSVC"; then
      { echo "configure: error: "building with in-tree freetype is not supported on MSVC"" 1>&2; exit 1; }
   fi
   cat >> confdefs.h <<\EOF
#define MOZ_TREE_FREETYPE 1
EOF

   
   MOZ_ENABLE_CAIRO_FT=1
   FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
   FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
   CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
   FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
   CAIRO_FT_OSLIBS=''
   CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
   cat >> confdefs.h <<\EOF
#define HAVE_FT_BITMAP_SIZE_Y_PPEM 1
EOF

   cat >> confdefs.h <<\EOF
#define HAVE_FT_GLYPHSLOT_EMBOLDEN 1
EOF

   cat >> confdefs.h <<\EOF
#define HAVE_FT_LOAD_SFNT_TABLE 1
EOF

   
fi

if test "$OS_ARCH" = "WINNT"; then
    REQ_NSIS_MAJOR_VER=2
    MIN_NSIS_MINOR_VER=33
      for ac_prog in $MAKENSISU makensisu-2.46 makensisu makensis
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:20055: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MAKENSISU'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MAKENSISU" in
  /*)
  ac_cv_path_MAKENSISU="$MAKENSISU" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MAKENSISU="$MAKENSISU" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MAKENSISU="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
MAKENSISU="$ac_cv_path_MAKENSISU"
if test -n "$MAKENSISU"; then
  echo "$ac_t""$MAKENSISU" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MAKENSISU" && break
done

  if test "$msyshost"; then
    case "$MAKENSISU" in
    /*)
      tmp_DIRNAME=`dirname "$MAKENSISU"`
      tmp_BASENAME=`basename "$MAKENSISU"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      MAKENSISU="$tmp_PWD/$tmp_BASENAME"
      if test -e "$MAKENSISU.exe"; then
        MAKENSISU="$MAKENSISU.exe"
      fi
    esac
  fi

    if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then
      echo "$ac_t""yes" 1>&6
      
      MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'`
      
      if test ! "$MAKENSISU_VER" = ""; then
          MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'`
          MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'`
      fi
      echo $ac_n "checking for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER""... $ac_c" 1>&6
echo "configure:20113: checking for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER" >&5
      if test "$MAKENSISU_VER" = "" || \
         test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \
              ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then
          echo "$ac_t""no" 1>&6
          if test -z "$CROSS_COMPILE"; then
            { echo "configure: error: To build the installer you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path." 1>&2; exit 1; }
          else
            MAKENSISU=
          fi
      fi
    elif test -z "$CROSS_COMPILE"; then
      { echo "configure: error: To build the installer you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path." 1>&2; exit 1; }
    else
      MAKENSISU=
    fi
fi

# Check whether --enable-webapp-runtime or --disable-webapp-runtime was given.
if test "${enable_webapp_runtime+set}" = set; then
  enableval="$enable_webapp_runtime"
  if test "$enableval" = "no"; then
    MOZ_WEBAPP_RUNTIME=
  elif test "$enableval" = "yes"; then
    MOZ_WEBAPP_RUNTIME=1
  else
    { echo "configure: error: Option, webapp-runtime, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$MOZ_WIDGET_TOOLKIT" != "windows" -a "$MOZ_WIDGET_TOOLKIT" != "cocoa" -a "$MOZ_WIDGET_TOOLKIT" != "gtk2"; then
    MOZ_WEBAPP_RUNTIME=
fi
if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then
    MOZ_WEBAPP_RUNTIME=
fi

if test "$MOZ_WEBAPP_RUNTIME"; then
    cat >> confdefs.h <<\EOF
#define MOZ_WEBAPP_RUNTIME 1
EOF

fi

echo $ac_n "checking for tar archiver""... $ac_c" 1>&6
echo "configure:20158: checking for tar archiver" >&5
for ac_prog in gnutar gtar tar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:20164: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$TAR"; then
  ac_cv_prog_TAR="$TAR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_TAR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
TAR="$ac_cv_prog_TAR"
if test -n "$TAR"; then
  echo "$ac_t""$TAR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$TAR" && break
done
test -n "$TAR" || TAR=""""

if test -z "$TAR"; then
    { echo "configure: error: no tar archiver found in \$PATH" 1>&2; exit 1; }
fi
echo "$ac_t""$TAR" 1>&6


echo $ac_n "checking for wget""... $ac_c" 1>&6
echo "configure:20201: checking for wget" >&5
for ac_prog in wget
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:20207: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WGET'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$WGET"; then
  ac_cv_prog_WGET="$WGET" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_WGET="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
WGET="$ac_cv_prog_WGET"
if test -n "$WGET"; then
  echo "$ac_t""$WGET" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$WGET" && break
done
test -n "$WGET" || WGET=""""

echo "$ac_t""$WGET" 1>&6



# Check whether --enable-maintenance-service or --disable-maintenance-service was given.
if test "${enable_maintenance_service+set}" = set; then
  enableval="$enable_maintenance_service"
  if test "$enableval" = "yes"; then
    MOZ_MAINTENANCE_SERVICE=1
  elif test "$enableval" = "no"; then
    MOZ_MAINTENANCE_SERVICE= 
  else
    { echo "configure: error: Option, maintenance-service, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_MAINTENANCE_SERVICE"; then
  if test "$OS_ARCH" = "WINNT"; then
    cat >> confdefs.h <<\EOF
#define MOZ_MAINTENANCE_SERVICE 1
EOF

  else
    { echo "configure: error: Can only build with --enable-maintenance-service with a Windows target" 1>&2; exit 1; }
  fi
fi


# Check whether --enable-verify-mar or --disable-verify-mar was given.
if test "${enable_verify_mar+set}" = set; then
  enableval="$enable_verify_mar"
  if test "$enableval" = "yes"; then
    MOZ_VERIFY_MAR_SIGNATURE=1
  elif test "$enableval" = "no"; then
    MOZ_VERIFY_MAR_SIGNATURE= 
  else
    { echo "configure: error: Option, verify-mar, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then
  if test "$OS_ARCH" = "WINNT"; then
    cat >> confdefs.h <<\EOF
#define MOZ_VERIFY_MAR_SIGNATURE 1
EOF

  else
    { echo "configure: error: Can only build with --enable-verify-mar with a Windows target" 1>&2; exit 1; }
  fi
fi


# Check whether --enable-signmar or --disable-signmar was given.
if test "${enable_signmar+set}" = set; then
  enableval="$enable_signmar"
  if test "$enableval" = "yes"; then
    MOZ_ENABLE_SIGNMAR=1
  elif test "$enableval" = "no"; then
    MOZ_ENABLE_SIGNMAR= 
  else
    { echo "configure: error: Option, signmar, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_ENABLE_SIGNMAR"; then
  cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_SIGNMAR 1
EOF

fi


# Check whether --enable-updater or --disable-updater was given.
if test "${enable_updater+set}" = set; then
  enableval="$enable_updater"
  if test "$enableval" = "no"; then
    MOZ_UPDATER=
  elif test "$enableval" = "yes"; then
    MOZ_UPDATER=1 
  else
    { echo "configure: error: Option, updater, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_UPDATER"; then
    cat >> confdefs.h <<\EOF
#define MOZ_UPDATER 1
EOF

fi

# app update channel is 'default' when not supplied.
# Check whether --enable-update-channel or --disable-update-channel was given.
if test "${enable_update_channel+set}" = set; then
  enableval="$enable_update_channel"
  MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`
fi


if test -z "$MOZ_UPDATE_CHANNEL"; then
    MOZ_UPDATE_CHANNEL=default
fi
cat >> confdefs.h <<EOF
#define MOZ_UPDATE_CHANNEL $MOZ_UPDATE_CHANNEL
EOF



# tools/update-packaging is not checked out by default.
# Check whether --enable-update-packaging or --disable-update-packaging was given.
if test "${enable_update_packaging+set}" = set; then
  enableval="$enable_update_packaging"
  if test "$enableval" = "yes"; then
    MOZ_UPDATE_PACKAGING=1
  elif test "$enableval" = "no"; then
    MOZ_UPDATE_PACKAGING= 
  else
    { echo "configure: error: Option, update-packaging, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



# Check whether --enable-tests or --disable-tests was given.
if test "${enable_tests+set}" = set; then
  enableval="$enable_tests"
  if test "$enableval" = "no"; then
    ENABLE_TESTS=
  elif test "$enableval" = "yes"; then
    ENABLE_TESTS=1 
  else
    { echo "configure: error: Option, tests, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-parental-controls or --disable-parental-controls was given.
if test "${enable_parental_controls+set}" = set; then
  enableval="$enable_parental_controls"
  if test "$enableval" = "no"; then
    MOZ_DISABLE_PARENTAL_CONTROLS=1
  elif test "$enableval" = "yes"; then
    MOZ_DISABLE_PARENTAL_CONTROLS=
  else
    { echo "configure: error: Option, parental-controls, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_DISABLE_PARENTAL_CONTROLS 1
EOF

fi



if test -n "$MOZ_DISABLE_DOMCRYPTO"; then
    cat >> confdefs.h <<\EOF
#define MOZ_DISABLE_DOMCRYPTO 1
EOF

fi

# Individual module options

# Check whether --enable-feeds or --disable-feeds was given.
if test "${enable_feeds+set}" = set; then
  enableval="$enable_feeds"
  if test "$enableval" = "no"; then
    MOZ_FEEDS=
  elif test "$enableval" = "yes"; then
    MOZ_FEEDS=1 
  else
    { echo "configure: error: Option, feeds, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_FEEDS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_FEEDS 1
EOF

else
    if test "$MOZ_BUILD_APP" = "browser"; then
        { echo "configure: error: Cannot build Firefox with --disable-feeds." 1>&2; exit 1; }
    fi
fi


MOZ_NATIVE_SQLITE=
# Check whether --enable-system-sqlite or --disable-system-sqlite was given.
if test "${enable_system_sqlite+set}" = set; then
  enableval="$enable_system_sqlite"
  if test "$enableval" = "yes"; then
    MOZ_NATIVE_SQLITE=1
  elif test "$enableval" = "no"; then
    MOZ_NATIVE_SQLITE= 
  else
    { echo "configure: error: Option, system-sqlite, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -z "$MOZ_NATIVE_SQLITE"
then
    SQLITE_CFLAGS=
    SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
else
                    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:20456: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for sqlite3 >= $SQLITE_VERSION""... $ac_c" 1>&6
echo "configure:20500: checking for sqlite3 >= $SQLITE_VERSION" >&5

        if $PKG_CONFIG --exists "sqlite3 >= $SQLITE_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking SQLITE_CFLAGS""... $ac_c" 1>&6
echo "configure:20507: checking SQLITE_CFLAGS" >&5
            SQLITE_CFLAGS=`$PKG_CONFIG --cflags "sqlite3 >= $SQLITE_VERSION"`
            echo "$ac_t""$SQLITE_CFLAGS" 1>&6

            echo $ac_n "checking SQLITE_LIBS""... $ac_c" 1>&6
echo "configure:20512: checking SQLITE_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            SQLITE_LIBS="`$PKG_CONFIG --libs \"sqlite3 >= $SQLITE_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$SQLITE_LIBS" 1>&6
        else
            SQLITE_CFLAGS=""
            SQLITE_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            SQLITE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sqlite3 >= $SQLITE_VERSION"`
            echo $SQLITE_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (sqlite3 >= $SQLITE_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi


                        echo $ac_n "checking for SQLITE_SECURE_DELETE support in system SQLite""... $ac_c" 1>&6
echo "configure:20543: checking for SQLITE_SECURE_DELETE support in system SQLite" >&5
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
    _SAVE_LIBS="$LIBS"
    LIBS="$LIBS $SQLITE_LIBS"
    if eval "test \"`echo '$''{'ac_cv_sqlite_secure_delete'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        if test "$cross_compiling" = yes; then
  ac_cv_sqlite_secure_delete=no
        
else
  cat > conftest.$ac_ext <<EOF
#line 20557 "configure"
#include "confdefs.h"

            #include "sqlite3.h"

            int main(int argc, char **argv){
              return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
            }
EOF
if { (eval echo configure:20566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sqlite_secure_delete=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sqlite_secure_delete=no
fi
rm -fr conftest*
fi

    
fi

    echo "$ac_t""$ac_cv_sqlite_secure_delete" 1>&6
    CFLAGS="$_SAVE_CFLAGS"
    LIBS="$_SAVE_LIBS"
    if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
        { echo "configure: error: System SQLite library is not compiled with SQLITE_SECURE_DELETE." 1>&2; exit 1; }
    fi

                        echo $ac_n "checking for SQLITE_THREADSAFE support in system SQLite""... $ac_c" 1>&6
echo "configure:20589: checking for SQLITE_THREADSAFE support in system SQLite" >&5
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
    _SAVE_LIBS="$LIBS"
    LIBS="$LIBS $SQLITE_LIBS"
    if eval "test \"`echo '$''{'ac_cv_sqlite_threadsafe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        if test "$cross_compiling" = yes; then
  ac_cv_sqlite_threadsafe=no
        
else
  cat > conftest.$ac_ext <<EOF
#line 20603 "configure"
#include "confdefs.h"

            #include "sqlite3.h"

            int main(int argc, char **argv){
              return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
            }
EOF
if { (eval echo configure:20612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sqlite_threadsafe=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sqlite_threadsafe=no
fi
rm -fr conftest*
fi

    
fi

    echo "$ac_t""$ac_cv_sqlite_threadsafe" 1>&6
    CFLAGS="$_SAVE_CFLAGS"
    LIBS="$_SAVE_LIBS"
    if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
        { echo "configure: error: System SQLite library is not compiled with SQLITE_THREADSAFE." 1>&2; exit 1; }
    fi

                        echo $ac_n "checking for SQLITE_ENABLE_FTS3 support in system SQLite""... $ac_c" 1>&6
echo "configure:20635: checking for SQLITE_ENABLE_FTS3 support in system SQLite" >&5
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
    _SAVE_LIBS="$LIBS"
    LIBS="$LIBS $SQLITE_LIBS"
    if eval "test \"`echo '$''{'ac_cv_sqlite_enable_fts3'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        if test "$cross_compiling" = yes; then
  ac_cv_sqlite_enable_fts3=no
        
else
  cat > conftest.$ac_ext <<EOF
#line 20649 "configure"
#include "confdefs.h"

            #include "sqlite3.h"

            int main(int argc, char **argv){
              return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
            }
EOF
if { (eval echo configure:20658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sqlite_enable_fts3=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sqlite_enable_fts3=no
fi
rm -fr conftest*
fi

    
fi

    echo "$ac_t""$ac_cv_sqlite_enable_fts3" 1>&6
    CFLAGS="$_SAVE_CFLAGS"
    LIBS="$_SAVE_LIBS"
    if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
        { echo "configure: error: System SQLite library is not compiled with SQLITE_ENABLE_FTS3." 1>&2; exit 1; }
    fi

                        echo $ac_n "checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite""... $ac_c" 1>&6
echo "configure:20681: checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite" >&5
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
    _SAVE_LIBS="$LIBS"
    LIBS="$LIBS $SQLITE_LIBS"
    if eval "test \"`echo '$''{'ac_cv_sqlite_enable_unlock_notify'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        if test "$cross_compiling" = yes; then
  ac_cv_sqlite_enable_unlock_notify=no
        
else
  cat > conftest.$ac_ext <<EOF
#line 20695 "configure"
#include "confdefs.h"

            #include "sqlite3.h"

            int main(int argc, char **argv){
              return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
            }
EOF
if { (eval echo configure:20704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sqlite_enable_unlock_notify=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sqlite_enable_unlock_notify=no
fi
rm -fr conftest*
fi

    
fi

    echo "$ac_t""$ac_cv_sqlite_enable_unlock_notify" 1>&6
    CFLAGS="$_SAVE_CFLAGS"
    LIBS="$_SAVE_LIBS"
    if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
        { echo "configure: error: System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY." 1>&2; exit 1; }
    fi
fi

if test -n "$MOZ_NATIVE_SQLITE"; then
    cat >> confdefs.h <<\EOF
#define MOZ_NATIVE_SQLITE 1
EOF

fi


if test -n "$MOZ_HELP_VIEWER"; then
          cat >> confdefs.h <<\EOF
#define MOZ_HELP_VIEWER 1
EOF

fi

# Check whether --enable-safe-browsing or --disable-safe-browsing was given.
if test "${enable_safe_browsing+set}" = set; then
  enableval="$enable_safe_browsing"
  if test "$enableval" = "yes"; then
    MOZ_SAFE_BROWSING=1
  elif test "$enableval" = "no"; then
    MOZ_SAFE_BROWSING= 
  else
    { echo "configure: error: Option, safe-browsing, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_SAFE_BROWSING"; then
    cat >> confdefs.h <<\EOF
#define MOZ_SAFE_BROWSING 1
EOF

fi


if test -n "$MOZ_SAFE_BROWSING"; then
    MOZ_URL_CLASSIFIER=1
fi
# Check whether --enable-url-classifier or --disable-url-classifier was given.
if test "${enable_url_classifier+set}" = set; then
  enableval="$enable_url_classifier"
  if test "$enableval" = "yes"; then
    MOZ_URL_CLASSIFIER=1
  elif test "$enableval" = "no"; then
    MOZ_URL_CLASSIFIER= 
  else
    { echo "configure: error: Option, url-classifier, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_URL_CLASSIFIER"; then
    cat >> confdefs.h <<\EOF
#define MOZ_URL_CLASSIFIER 1
EOF

fi


# Check whether --enable-zipwriter or --disable-zipwriter was given.
if test "${enable_zipwriter+set}" = set; then
  enableval="$enable_zipwriter"
  if test "$enableval" = "no"; then
    MOZ_ZIPWRITER=
  elif test "$enableval" = "yes"; then
    MOZ_ZIPWRITER=1 
  else
    { echo "configure: error: Option, zipwriter, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



MOZ_ENABLE_LIBCONIC=1

if test -n "$MOZ_ENABLE_QT"; then
  if test "$MOZ_ENABLE_QTNETWORK"; then
    MOZ_ENABLE_LIBCONIC=
  fi
fi

# Check whether --enable-libconic or --disable-libconic was given.
if test "${enable_libconic+set}" = set; then
  enableval="$enable_libconic"
  if test "$enableval" = "no"; then
    MOZ_ENABLE_LIBCONIC=
  elif test "$enableval" = "yes"; then
    MOZ_ENABLE_LIBCONIC=1 
  else
    { echo "configure: error: Option, libconic, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_ENABLE_LIBCONIC"; then
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:20827: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for conic""... $ac_c" 1>&6
echo "configure:20871: checking for conic" >&5

        if $PKG_CONFIG --exists "conic" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBCONIC_CFLAGS""... $ac_c" 1>&6
echo "configure:20878: checking LIBCONIC_CFLAGS" >&5
            LIBCONIC_CFLAGS=`$PKG_CONFIG --cflags "conic"`
            echo "$ac_t""$LIBCONIC_CFLAGS" 1>&6

            echo $ac_n "checking LIBCONIC_LIBS""... $ac_c" 1>&6
echo "configure:20883: checking LIBCONIC_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBCONIC_LIBS="`$PKG_CONFIG --libs \"conic\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBCONIC_LIBS" 1>&6
        else
            LIBCONIC_CFLAGS=""
            LIBCONIC_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBCONIC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "conic"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     MOZ_ENABLE_LIBCONIC=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       MOZ_ENABLE_LIBCONIC=
     fi
  fi

fi
if test "$MOZ_ENABLE_LIBCONIC"; then
    cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_LIBCONIC 1
EOF

fi






MAEMO_SDK_TARGET_VER=-1

# Check whether --with-maemo-version or --without-maemo-version was given.
if test "${with_maemo_version+set}" = set; then
  withval="$with_maemo_version"
  MAEMO_SDK_TARGET_VER=$withval
fi


case "$MAEMO_SDK_TARGET_VER" in
5)
    MOZ_PLATFORM_MAEMO=5
    ;;

6)
    MOZ_PLATFORM_MAEMO=6
    ;;

-1)
        ;;
*)
    { echo "configure: error: Unknown Maemo Version.  Try setting --with-maemo-version to 5 or 6." 1>&2; exit 1; }
    ;;
esac

if test $MOZ_PLATFORM_MAEMO; then
   cat >> confdefs.h <<EOF
#define MOZ_PLATFORM_MAEMO $MOZ_PLATFORM_MAEMO
EOF


   if test -z "$MOZ_ENABLE_DBUS"; then
       { echo "configure: error: DBus is required when building for Maemo" 1>&2; exit 1; }
   fi

   MOZ_GFX_OPTIMIZE_MOBILE=1
   MOZ_GL_DEFAULT_PROVIDER=EGL
   MOZ_MAEMO_LIBLOCATION=

   if test $MOZ_PLATFORM_MAEMO = 5; then
             for ac_hdr in X11/extensions/Xdamage.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:20969: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 20974 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:20982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: Couldn't find X11/extensions/Xdamage.h which is required for composited plugins." 1>&2; exit 1; }
  fi

  done

      echo $ac_n "checking for XCompositeRedirectWindow in -lXcomposite""... $ac_c" 1>&6
echo "configure:21009: checking for XCompositeRedirectWindow in -lXcomposite" >&5
ac_lib_var=`echo Xcomposite'_'XCompositeRedirectWindow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXcomposite $XLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21017 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XCompositeRedirectWindow();

int main() {
XCompositeRedirectWindow()
; return 0; }
EOF
if { (eval echo configure:21028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"
else
  echo "$ac_t""no" 1>&6
MISSING_X="$MISSING_X -lXcomposite"
fi


      

      succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21058: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libhildonmime""... $ac_c" 1>&6
echo "configure:21102: checking for libhildonmime" >&5

        if $PKG_CONFIG --exists "libhildonmime" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBHILDONMIME_CFLAGS""... $ac_c" 1>&6
echo "configure:21109: checking LIBHILDONMIME_CFLAGS" >&5
            LIBHILDONMIME_CFLAGS=`$PKG_CONFIG --cflags "libhildonmime"`
            echo "$ac_t""$LIBHILDONMIME_CFLAGS" 1>&6

            echo $ac_n "checking LIBHILDONMIME_LIBS""... $ac_c" 1>&6
echo "configure:21114: checking LIBHILDONMIME_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBHILDONMIME_LIBS="`$PKG_CONFIG --libs \"libhildonmime\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBHILDONMIME_LIBS" 1>&6
        else
            LIBHILDONMIME_CFLAGS=""
            LIBHILDONMIME_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBHILDONMIME_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libhildonmime"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
      if test -z "$_LIB_FOUND"; then
         { echo "configure: error: Hildon Mime is required when building for Maemo" 1>&2; exit 1; }
      fi


      succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21156: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for libosso""... $ac_c" 1>&6
echo "configure:21200: checking for libosso" >&5

        if $PKG_CONFIG --exists "libosso" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBOSSO_CFLAGS""... $ac_c" 1>&6
echo "configure:21207: checking LIBOSSO_CFLAGS" >&5
            LIBOSSO_CFLAGS=`$PKG_CONFIG --cflags "libosso"`
            echo "$ac_t""$LIBOSSO_CFLAGS" 1>&6

            echo $ac_n "checking LIBOSSO_LIBS""... $ac_c" 1>&6
echo "configure:21212: checking LIBOSSO_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBOSSO_LIBS="`$PKG_CONFIG --libs \"libosso\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBOSSO_LIBS" 1>&6
        else
            LIBOSSO_CFLAGS=""
            LIBOSSO_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBOSSO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libosso"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
      if test -z "$_LIB_FOUND"; then
         { echo "configure: error: LibOSSO is required when building for Maemo" 1>&2; exit 1; }
      fi

      succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21253: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for hildon-fm-2""... $ac_c" 1>&6
echo "configure:21297: checking for hildon-fm-2" >&5

        if $PKG_CONFIG --exists "hildon-fm-2" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBHILDONFM_CFLAGS""... $ac_c" 1>&6
echo "configure:21304: checking LIBHILDONFM_CFLAGS" >&5
            LIBHILDONFM_CFLAGS=`$PKG_CONFIG --cflags "hildon-fm-2"`
            echo "$ac_t""$LIBHILDONFM_CFLAGS" 1>&6

            echo $ac_n "checking LIBHILDONFM_LIBS""... $ac_c" 1>&6
echo "configure:21309: checking LIBHILDONFM_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBHILDONFM_LIBS="`$PKG_CONFIG --libs \"hildon-fm-2\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBHILDONFM_LIBS" 1>&6
        else
            LIBHILDONFM_CFLAGS=""
            LIBHILDONFM_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBHILDONFM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "hildon-fm-2"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
      if test -z "$_LIB_FOUND"; then
         { echo "configure: error: Hildon FM-2 is required when building for Maemo" 1>&2; exit 1; }
      fi

   fi
   if test $MOZ_PLATFORM_MAEMO = 6; then

      succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21353: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for ContentManager QtSparql""... $ac_c" 1>&6
echo "configure:21397: checking for ContentManager QtSparql" >&5

        if $PKG_CONFIG --exists "ContentManager QtSparql" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBCONTENTMANAGER_CFLAGS""... $ac_c" 1>&6
echo "configure:21404: checking LIBCONTENTMANAGER_CFLAGS" >&5
            LIBCONTENTMANAGER_CFLAGS=`$PKG_CONFIG --cflags "ContentManager QtSparql"`
            echo "$ac_t""$LIBCONTENTMANAGER_CFLAGS" 1>&6

            echo $ac_n "checking LIBCONTENTMANAGER_LIBS""... $ac_c" 1>&6
echo "configure:21409: checking LIBCONTENTMANAGER_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBCONTENTMANAGER_LIBS="`$PKG_CONFIG --libs \"ContentManager QtSparql\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBCONTENTMANAGER_LIBS" 1>&6
        else
            LIBCONTENTMANAGER_CFLAGS=""
            LIBCONTENTMANAGER_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBCONTENTMANAGER_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "ContentManager QtSparql"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

      if test "$_LIB_FOUND"; then
         MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTMANAGER_LIBS"
         MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTMANAGER_CFLAGS"
         MOZ_ENABLE_CONTENTMANAGER=1
         cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_CONTENTMANAGER 1
EOF

      else
         echo "configure: warning: Cannot find libcontentmanager and or QtSparql building for Maemo 6" 1>&2
      fi
      

                        # Check whether --enable-meegocontentaction or --disable-meegocontentaction was given.
if test "${enable_meegocontentaction+set}" = set; then
  enableval="$enable_meegocontentaction"
  if test "$enableval" = "yes"; then
    MOZ_MEEGOCONTENTACTION=1
  elif test "$enableval" = "no"; then
    MOZ_MEEGOCONTENTACTION=
  else
    { echo "configure: error: Option, meegocontentaction, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


      if test -n "$MOZ_MEEGOCONTENTACTION"; then

         succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21472: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for contentaction-0.1""... $ac_c" 1>&6
echo "configure:21516: checking for contentaction-0.1" >&5

        if $PKG_CONFIG --exists "contentaction-0.1" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBCONTENTACTION_CFLAGS""... $ac_c" 1>&6
echo "configure:21523: checking LIBCONTENTACTION_CFLAGS" >&5
            LIBCONTENTACTION_CFLAGS=`$PKG_CONFIG --cflags "contentaction-0.1"`
            echo "$ac_t""$LIBCONTENTACTION_CFLAGS" 1>&6

            echo $ac_n "checking LIBCONTENTACTION_LIBS""... $ac_c" 1>&6
echo "configure:21528: checking LIBCONTENTACTION_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBCONTENTACTION_LIBS="`$PKG_CONFIG --libs \"contentaction-0.1\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBCONTENTACTION_LIBS" 1>&6
        else
            LIBCONTENTACTION_CFLAGS=""
            LIBCONTENTACTION_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBCONTENTACTION_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "contentaction-0.1"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

         if test "$_LIB_FOUND"; then
            MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
            MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
            MOZ_ENABLE_CONTENTACTION=1
            cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_CONTENTACTION 1
EOF

            
         fi
      fi

      # Check whether --enable-meegotouch or --disable-meegotouch was given.
if test "${enable_meegotouch+set}" = set; then
  enableval="$enable_meegotouch"
  if test "$enableval" = "yes"; then
    MOZ_MEEGOTOUCHENABLED=1
  elif test "$enableval" = "no"; then
    MOZ_MEEGOTOUCHENABLED=
  else
    { echo "configure: error: Option, meegotouch, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


      if test -n "$MOZ_MEEGOTOUCHENABLED"; then
          succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21589: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for meegotouchcore""... $ac_c" 1>&6
echo "configure:21633: checking for meegotouchcore" >&5

        if $PKG_CONFIG --exists "meegotouchcore" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking MOZ_MEEGOTOUCH_CFLAGS""... $ac_c" 1>&6
echo "configure:21640: checking MOZ_MEEGOTOUCH_CFLAGS" >&5
            MOZ_MEEGOTOUCH_CFLAGS=`$PKG_CONFIG --cflags "meegotouchcore"`
            echo "$ac_t""$MOZ_MEEGOTOUCH_CFLAGS" 1>&6

            echo $ac_n "checking MOZ_MEEGOTOUCH_LIBS""... $ac_c" 1>&6
echo "configure:21645: checking MOZ_MEEGOTOUCH_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            MOZ_MEEGOTOUCH_LIBS="`$PKG_CONFIG --libs \"meegotouchcore\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$MOZ_MEEGOTOUCH_LIBS" 1>&6
        else
            MOZ_MEEGOTOUCH_CFLAGS=""
            MOZ_MEEGOTOUCH_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            MOZ_MEEGOTOUCH_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "meegotouchcore"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

          if test "$_LIB_FOUND"; then
              MOZ_QT_CFLAGS="$MOZ_MEEGOTOUCH_CFLAGS $MOZ_QT_CFLAGS"
              MOZ_QT_LIBS="$MOZ_MEEGOTOUCH_LIBS $MOZ_QT_LIBS"
              cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_MEEGOTOUCH 1
EOF

          else
              echo "configure: warning: Cannot meegotouchcore-dev. Disabling Meegotouch support." 1>&2
          fi
      fi
   fi

   succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21693: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for liblocation""... $ac_c" 1>&6
echo "configure:21737: checking for liblocation" >&5

        if $PKG_CONFIG --exists "liblocation" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBLOCATION_CFLAGS""... $ac_c" 1>&6
echo "configure:21744: checking LIBLOCATION_CFLAGS" >&5
            LIBLOCATION_CFLAGS=`$PKG_CONFIG --cflags "liblocation"`
            echo "$ac_t""$LIBLOCATION_CFLAGS" 1>&6

            echo $ac_n "checking LIBLOCATION_LIBS""... $ac_c" 1>&6
echo "configure:21749: checking LIBLOCATION_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBLOCATION_LIBS="`$PKG_CONFIG --libs \"liblocation\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBLOCATION_LIBS" 1>&6
        else
            LIBLOCATION_CFLAGS=""
            LIBLOCATION_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBLOCATION_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "liblocation"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

   MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBLOCATION_LIBS"
   MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBLOCATION_CFLAGS"
   if test "$_LIB_FOUND"; then
      MOZ_MAEMO_LIBLOCATION=1
      cat >> confdefs.h <<\EOF
#define MOZ_MAEMO_LIBLOCATION 1
EOF

   else
      echo "configure: warning: Cannot liblocation-dev. Disabling Maemo geolocation." 1>&2
   fi
   

   succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:21797: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri""... $ac_c" 1>&6
echo "configure:21841: checking for ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri" >&5

        if $PKG_CONFIG --exists "ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking LIBMEEGOTOUCHSHARE_CFLAGS""... $ac_c" 1>&6
echo "configure:21848: checking LIBMEEGOTOUCHSHARE_CFLAGS" >&5
            LIBMEEGOTOUCHSHARE_CFLAGS=`$PKG_CONFIG --cflags "ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri"`
            echo "$ac_t""$LIBMEEGOTOUCHSHARE_CFLAGS" 1>&6

            echo $ac_n "checking LIBMEEGOTOUCHSHARE_LIBS""... $ac_c" 1>&6
echo "configure:21853: checking LIBMEEGOTOUCHSHARE_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            LIBMEEGOTOUCHSHARE_LIBS="`$PKG_CONFIG --libs \"ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$LIBMEEGOTOUCHSHARE_LIBS" 1>&6
        else
            LIBMEEGOTOUCHSHARE_CFLAGS=""
            LIBMEEGOTOUCHSHARE_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            LIBMEEGOTOUCHSHARE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri"`
            
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     _LIB_FOUND=1
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       _LIB_FOUND=
     fi
  fi

   MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBMEEGOTOUCHSHARE_LIBS"
   MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBMEEGOTOUCHSHARE_CFLAGS"
   if test "$_LIB_FOUND"; then
      MOZ_ENABLE_MEEGOTOUCHSHARE=1
      cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_MEEGOTOUCHSHARE 1
EOF

   else
      echo "configure: warning: Cannot find maemo-meegotouch-interfaces-dev or libmdatauri-dev. Disabling meegotouch share ui." 1>&2
   fi
   

   
   
fi

# Check whether --enable-egl-xrender-composite or --disable-egl-xrender-composite was given.
if test "${enable_egl_xrender_composite+set}" = set; then
  enableval="$enable_egl_xrender_composite"
  if test "$enableval" = "yes"; then
    MOZ_EGL_XRENDER_COMPOSITE=1
  elif test "$enableval" = "no"; then
    :
  else
    { echo "configure: error: Option, egl-xrender-composite, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_EGL_XRENDER_COMPOSITE"; then
    cat >> confdefs.h <<\EOF
#define MOZ_EGL_XRENDER_COMPOSITE 1
EOF

fi



MOZ_GL_PROVIDER=
# Check whether --with-gl-provider or --without-gl-provider was given.
if test "${with_gl_provider+set}" = set; then
  withval="$with_gl_provider"
   val=`echo $withval`
    MOZ_GL_PROVIDER="$val"
fi


if test -n "$MOZ_GL_PROVIDER"; then
MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER

cat >> confdefs.h <<EOF
#define MOZ_GL_PROVIDER GLContextProvider$MOZ_GL_PROVIDER
EOF

fi


# Check whether --enable-faststripe or --disable-faststripe was given.
if test "${enable_faststripe+set}" = set; then
  enableval="$enable_faststripe"
  if test "$enableval" = "yes"; then
    MOZ_THEME_FASTSTRIPE=1
  elif test "$enableval" = "no"; then
    MOZ_THEME_FASTSTRIPE= 
  else
    { echo "configure: error: Option, faststripe, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi




# Debugging and Optimizations

if test -z "$MOZ_DEBUG_FLAGS"; then
  MOZ_DEBUG_FLAGS="-g"
fi

# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
   if test "$enableval" != "no"; then
    MOZ_DEBUG=1
    if test -n "$enableval" -a "$enableval" != "yes"; then
        MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
        _MOZ_DEBUG_FLAGS_SET=1
    fi
  else
    MOZ_DEBUG=
  fi 
else
  MOZ_DEBUG=
fi


MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
# Check whether --with-debug-label or --without-debug-label was given.
if test "${with_debug_label+set}" = set; then
  withval="$with_debug_label"
   for option in `echo $withval | sed 's/,/ /g'`; do
    MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
done
fi


MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"

if test -n "$MOZ_DEBUG"; then
    echo $ac_n "checking for valid debug flags""... $ac_c" 1>&6
echo "configure:21992: checking for valid debug flags" >&5
    _SAVE_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
    cat > conftest.$ac_ext <<EOF
#line 21996 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello World\n");
; return 0; }
EOF
if { (eval echo configure:22003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  _results=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _results=no
fi
rm -f conftest*
    echo "$ac_t""$_results" 1>&6
    if test "$_results" = "no"; then
        { echo "configure: error: These compiler flags are invalid: $MOZ_DEBUG_FLAGS" 1>&2; exit 1; }
    fi
    CFLAGS=$_SAVE_CFLAGS
fi

# Check whether --enable-mobile-optimize or --disable-mobile-optimize was given.
if test "${enable_mobile_optimize+set}" = set; then
  enableval="$enable_mobile_optimize"
  if test "$enableval" = "yes"; then
    MOZ_GFX_OPTIMIZE_MOBILE=1
  elif test "$enableval" = "no"; then
    :
  else
    { echo "configure: error: Option, mobile-optimize, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi




if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
    cat >> confdefs.h <<\EOF
#define MOZ_GFX_OPTIMIZE_MOBILE 1
EOF

fi

if test -z "$MOZ_OPTIMIZE_FLAGS"; then
	MOZ_OPTIMIZE_FLAGS="-O"
fi

# Check whether --enable-optimize or --disable-optimize was given.
if test "${enable_optimize+set}" = set; then
  enableval="$enable_optimize"
   if test "$enableval" != "no"; then
    MOZ_OPTIMIZE=1
    if test -n "$enableval" -a "$enableval" != "yes"; then
        MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
        MOZ_OPTIMIZE=2
    fi
else
    MOZ_OPTIMIZE=
fi 
else
  MOZ_OPTIMIZE=1
fi



  case "$target" in
  *android*)
    unwind_tables="-funwind-tables"
    ;;
  esac
  if test "$GNU_CC"; then
    MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables"
    MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer"
  else
    case "$target" in
    *-mingw*)
      MOZ_ENABLE_FRAME_PTR="-Oy-"
      MOZ_DISABLE_FRAME_PTR="-Oy"
    ;;
    esac
  fi

  # if we are debugging or profiling, we want a frame pointer.
  if test -z "$MOZ_OPTIMIZE" -o \
          -n "$MOZ_PROFILING" -o -n "$MOZ_DEBUG"; then
    MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
  else
    MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
  fi


if test "$COMPILE_ENVIRONMENT"; then
if test -n "$MOZ_OPTIMIZE"; then
    echo $ac_n "checking for valid optimization flags""... $ac_c" 1>&6
echo "configure:22093: checking for valid optimization flags" >&5
    _SAVE_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
    cat > conftest.$ac_ext <<EOF
#line 22097 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello World\n");
; return 0; }
EOF
if { (eval echo configure:22104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  _results=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  _results=no
fi
rm -f conftest*
    echo "$ac_t""$_results" 1>&6
    if test "$_results" = "no"; then
        { echo "configure: error: These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS" 1>&2; exit 1; }
    fi
    CFLAGS=$_SAVE_CFLAGS
fi
fi # COMPILE_ENVIRONMENT









# Check whether --enable-debug-symbols or --disable-debug-symbols was given.
if test "${enable_debug_symbols+set}" = set; then
  enableval="$enable_debug_symbols"
   if test "$enableval" != "no"; then
      MOZ_DEBUG_SYMBOLS=1
      if test -n "$enableval" -a "$enableval" != "yes"; then
          if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
              MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
          else
              { echo "configure: error: --enable-debug-symbols flags cannot be used with --enable-debug flags" 1>&2; exit 1; }
          fi
      fi
  else
      MOZ_DEBUG_SYMBOLS=
  fi 
else
  MOZ_DEBUG_SYMBOLS=1
fi


if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_DEBUG_SYMBOLS 1
EOF

    export MOZ_DEBUG_SYMBOLS
fi

# Check whether --enable-warnings-as-errors or --disable-warnings-as-errors was given.
if test "${enable_warnings_as_errors+set}" = set; then
  enableval="$enable_warnings_as_errors"
  if test "$enableval" = "yes"; then
    MOZ_ENABLE_WARNINGS_AS_ERRORS=1
  elif test "$enableval" = "no"; then
    MOZ_ENABLE_WARNINGS_AS_ERRORS=
  else
    { echo "configure: error: Option, warnings-as-errors, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
   WARNINGS_AS_ERRORS=''
fi

# Check whether --enable-logging or --disable-logging was given.
if test "${enable_logging+set}" = set; then
  enableval="$enable_logging"
  if test "$enableval" = "no"; then
    NS_DISABLE_LOGGING=1
  elif test "$enableval" = "yes"; then
    NS_DISABLE_LOGGING= 
  else
    { echo "configure: error: Option, logging, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$NS_DISABLE_LOGGING"; then
    cat >> confdefs.h <<\EOF
#define NS_DISABLE_LOGGING 1
EOF

else
    cat >> confdefs.h <<\EOF
#define MOZ_LOGGING 1
EOF

fi

_ENABLE_LOGREFCNT=42
# Check whether --enable-logrefcnt or --disable-logrefcnt was given.
if test "${enable_logrefcnt+set}" = set; then
  enableval="$enable_logrefcnt"
  if test "$enableval" = "yes"; then
    _ENABLE_LOGREFCNT=1
  elif test "$enableval" = "no"; then
    _ENABLE_LOGREFCNT= 
  else
    { echo "configure: error: Option, logrefcnt, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$_ENABLE_LOGREFCNT" = "1"; then
    cat >> confdefs.h <<\EOF
#define FORCE_BUILD_REFCNT_LOGGING 1
EOF

elif test -z "$_ENABLE_LOGREFCNT"; then
    cat >> confdefs.h <<\EOF
#define NO_BUILD_REFCNT_LOGGING 1
EOF

fi

# Check whether --enable-dump-painting or --disable-dump-painting was given.
if test "${enable_dump_painting+set}" = set; then
  enableval="$enable_dump_painting"
  if test "$enableval" = "yes"; then
    MOZ_DUMP_PAINTING=1
  elif test "$enableval" = "no"; then
    MOZ_DUMP_PAINTING= 
  else
    { echo "configure: error: Option, dump-painting, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_DUMP_PAINTING"; then
    cat >> confdefs.h <<\EOF
#define MOZ_DUMP_PAINTING 1
EOF

    cat >> confdefs.h <<\EOF
#define MOZ_LAYERS_HAVE_LOG 1
EOF

fi
if test -n "$MOZ_DEBUG"; then
    cat >> confdefs.h <<\EOF
#define MOZ_DUMP_PAINTING 1
EOF

fi

NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
# Check whether --enable-trace-malloc or --disable-trace-malloc was given.
if test "${enable_trace_malloc+set}" = set; then
  enableval="$enable_trace_malloc"
  if test "$enableval" = "yes"; then
    NS_TRACE_MALLOC=1
  elif test "$enableval" = "no"; then
    NS_TRACE_MALLOC= 
  else
    { echo "configure: error: Option, trace-malloc, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$NS_TRACE_MALLOC"; then
  # Please, Mr. Linker Man, don't take away our symbol names
  MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
  USE_ELF_DYNSTR_GC=
  cat >> confdefs.h <<\EOF
#define NS_TRACE_MALLOC 1
EOF

fi


# Check whether --enable-jemalloc or --disable-jemalloc was given.
if test "${enable_jemalloc+set}" = set; then
  enableval="$enable_jemalloc"
  if test "$enableval" = "yes"; then
    MOZ_MEMORY=1
  elif test "$enableval" = "no"; then
    MOZ_MEMORY=
  else
    { echo "configure: error: Option, jemalloc, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$NS_TRACE_MALLOC"; then
    MOZ_MEMORY=
fi
if test "$MOZ_DMD"; then
    MOZ_MEMORY=
fi

if test "${OS_TARGET}" = "Android"; then
    :
elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
    if test -z "$GNU_CC"; then
    MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
  else
    MOZ_GLUE_LDFLAGS='-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
  fi
else
    MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
      if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then
    MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)'
  fi
  MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)'
  if test -n "$GNU_CC"; then
        MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
  fi
  if test "$MOZ_LINKER" = 1; then
    MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $ZLIB_LIBS"
  fi
fi

if test -z "$MOZ_MEMORY"; then
  case "${target}" in
    *-mingw*)
      if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
        echo "configure: warning: When not building jemalloc, you need to set WIN32_REDIST_DIR to the path to the Visual C++ Redist (usually VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT, for VC++ v8) if you intend to distribute your build." 1>&2
      fi
      ;;
  esac
else
    if test "$OS_ARCH" = "WINNT"; then
    if test -z "$HAVE_64BIT_OS"; then
      cat >> confdefs.h <<EOF
#define MOZ_MEMORY_SIZEOF_PTR_2POW 2
EOF

    else
      cat >> confdefs.h <<EOF
#define MOZ_MEMORY_SIZEOF_PTR_2POW 3
EOF

    fi
  else
    echo $ac_n "checking size of int *""... $ac_c" 1>&6
echo "configure:22341: checking size of int *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int_p=4
else
  cat > conftest.$ac_ext <<EOF
#line 22349 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) return(1);
  fprintf(f, "%d\n", sizeof(int *));
  return(0);
}
EOF
if { (eval echo configure:22360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int_p=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int_p=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int_p" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT_P $ac_cv_sizeof_int_p
EOF


    case "${ac_cv_sizeof_int_p}" in
    4)
      cat >> confdefs.h <<EOF
#define MOZ_MEMORY_SIZEOF_PTR_2POW 2
EOF

      ;;
    8)
      cat >> confdefs.h <<EOF
#define MOZ_MEMORY_SIZEOF_PTR_2POW 3
EOF

      ;;
    *)
      { echo "configure: error: Unexpected pointer size" 1>&2; exit 1; }
      ;;
    esac
  fi

  cat >> confdefs.h <<\EOF
#define MOZ_MEMORY 1
EOF

  if test "x$MOZ_DEBUG" = "x1"; then
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_DEBUG 1
EOF

  fi
        case "${target}" in
  *-darwin*)
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_DARWIN 1
EOF

    ;;
  *-*freebsd*)
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_BSD 1
EOF

    ;;
  *-android*|*-linuxandroid*)
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_LINUX 1
EOF

    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_ANDROID 1
EOF

    _WRAP_MALLOC=1
    MOZ_GLUE_LDFLAGS=
    ;;
  *-*linux*)
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_LINUX 1
EOF

    ;;
  *-netbsd*)
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_BSD 1
EOF

    ;;
  *-solaris*)
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_SOLARIS 1
EOF

    ;;
  *-mingw*)
    cat >> confdefs.h <<\EOF
#define MOZ_MEMORY_WINDOWS 1
EOF

    if test -z "$MOZ_DEBUG"; then
      WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
    else
      WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
    fi
        WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
    lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
    if grep -q '__imp__\{0,1\}free' crtdll.obj; then
      MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
            DLLFLAGS="$DLLFLAGS $MOZ_GLUE_LDFLAGS"
    else
      DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue"
    fi
    rm crtdll.obj

    export DLLFLAGS
    ;;
  *)
    { echo "configure: error: --enable-jemalloc not supported on ${target}" 1>&2; exit 1; }
    ;;
  esac
fi # MOZ_MEMORY






if test "$OS_TARGET" = Android; then
    WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue"
    if test -n "$MOZ_OLD_LINKER"; then
        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
    fi
    WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
    WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise"
fi

# Check whether --enable-wrap-malloc or --disable-wrap-malloc was given.
if test "${enable_wrap_malloc+set}" = set; then
  enableval="$enable_wrap_malloc"
  if test "$enableval" = "yes"; then
    _WRAP_MALLOC=1
  elif test "$enableval" = "no"; then
    _WRAP_MALLOC= 
  else
    { echo "configure: error: Option, wrap-malloc, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$_WRAP_MALLOC"; then
    if test -n "$GNU_CC"; then
        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
                if test "$OS_TARGET" = "Android"; then
            WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv"
        fi
    else
        { echo "configure: error: --enable-wrap-malloc is not supported for non-GNU toolchains" 1>&2; exit 1; }
    fi
fi

# Check whether --with-wrap-malloc or --without-wrap-malloc was given.
if test "${with_wrap_malloc+set}" = set; then
  withval="$with_wrap_malloc"
  WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval"
fi


# Check whether --enable-trace-jscalls or --disable-trace-jscalls was given.
if test "${enable_trace_jscalls+set}" = set; then
  enableval="$enable_trace_jscalls"
  if test "$enableval" = "yes"; then
    MOZ_TRACE_JSCALLS=1
  elif test "$enableval" = "no"; then
    MOZ_TRACE_JSCALLS= 
  else
    { echo "configure: error: Option, trace-jscalls, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_TRACE_JSCALLS"; then
    cat >> confdefs.h <<\EOF
#define MOZ_TRACE_JSCALLS 1
EOF

fi

JSGC_INCREMENTAL=1
# Check whether --enable-gcincremental or --disable-gcincremental was given.
if test "${enable_gcincremental+set}" = set; then
  enableval="$enable_gcincremental"
  if test "$enableval" = "no"; then
    JSGC_INCREMENTAL= 
  elif test "$enableval" = "yes"; then
    :
  else
    { echo "configure: error: Option, gcincremental, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$JSGC_INCREMENTAL"; then
    cat >> confdefs.h <<\EOF
#define JSGC_INCREMENTAL 1
EOF

fi

# Check whether --enable-ETW or --disable-ETW was given.
if test "${enable_ETW+set}" = set; then
  enableval="$enable_ETW"
  if test "$enableval" = "yes"; then
    MOZ_ETW=1
  elif test "$enableval" = "no"; then
    MOZ_ETW= 
  else
    { echo "configure: error: Option, ETW, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_ETW"; then
    cat >> confdefs.h <<\EOF
#define MOZ_ETW 1
EOF

fi

if test -n "$MOZ_ETW"; then
    if test -z "$MOZ_WINSDK_TARGETVER"; then
        { echo "configure: error: --enable-ETW is only valid on Windows" 1>&2; exit 1; }
    fi
fi

# Check whether --enable-gczeal or --disable-gczeal was given.
if test "${enable_gczeal+set}" = set; then
  enableval="$enable_gczeal"
  if test "$enableval" = "yes"; then
    JS_GC_ZEAL=1
  elif test "$enableval" = "no"; then
    JS_GC_ZEAL= 
  else
    { echo "configure: error: Option, gczeal, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$JS_GC_ZEAL"; then
    cat >> confdefs.h <<\EOF
#define JS_GC_ZEAL 1
EOF

fi

# Check whether --enable-js-diagnostics or --disable-js-diagnostics was given.
if test "${enable_js_diagnostics+set}" = set; then
  enableval="$enable_js_diagnostics"
  if test "$enableval" = "yes"; then
    JS_CRASH_DIAGNOSTICS=1
  elif test "$enableval" = "no"; then
    JS_CRASH_DIAGNOSTICS= 
  else
    { echo "configure: error: Option, js-diagnostics, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$JS_CRASH_DIAGNOSTICS"; then
    cat >> confdefs.h <<\EOF
#define JS_CRASH_DIAGNOSTICS 1
EOF

fi

# Check whether --with-ccache or --without-ccache was given.
if test "${with_ccache+set}" = set; then
  withval="$with_ccache"
  CCACHE=$withval
else
  CCACHE="no"
fi


if test "$CCACHE" != "no"; then
    if test -z "$CCACHE" -o "$CCACHE" = "yes"; then
        CCACHE=
    else
        if test ! -e "$CCACHE"; then
            { echo "configure: error: $CCACHE not found" 1>&2; exit 1; }
        fi
    fi
      for ac_prog in $CCACHE ccache
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:22651: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$CCACHE" in
  /*)
  ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_CCACHE="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
CCACHE="$ac_cv_path_CCACHE"
if test -n "$CCACHE"; then
  echo "$ac_t""$CCACHE" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CCACHE" && break
done

  if test "$msyshost"; then
    case "$CCACHE" in
    /*)
      tmp_DIRNAME=`dirname "$CCACHE"`
      tmp_BASENAME=`basename "$CCACHE"`
      tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
      CCACHE="$tmp_PWD/$tmp_BASENAME"
      if test -e "$CCACHE.exe"; then
        CCACHE="$CCACHE.exe"
      fi
    esac
  fi

    if test -z "$CCACHE" -o "$CCACHE" = ":"; then
        { echo "configure: error: ccache not found" 1>&2; exit 1; }
    elif test -x "$CCACHE"; then
        CC="$CCACHE $CC"
        CXX="$CCACHE $CXX"
    else
        { echo "configure: error: $CCACHE is not executable" 1>&2; exit 1; }
    fi
fi


# Check whether --with-static-checking or --without-static-checking was given.
if test "${with_static_checking+set}" = set; then
  withval="$with_static_checking"
  DEHYDRA_PATH=$withval
else
  DEHYDRA_PATH= 
fi


if test -n "$DEHYDRA_PATH"; then
    if test ! -f "$DEHYDRA_PATH"; then
        { echo "configure: error: The dehydra plugin is not at the specified path." 1>&2; exit 1; }
    fi
    cat >> confdefs.h <<\EOF
#define NS_STATIC_CHECKING 1
EOF

fi


# Check whether --enable-strip or --disable-strip was given.
if test "${enable_strip+set}" = set; then
  enableval="$enable_strip"
  if test "$enableval" = "yes"; then
    ENABLE_STRIP=1
  elif test "$enableval" = "no"; then
    ENABLE_STRIP= 
  else
    { echo "configure: error: Option, strip, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-install-strip or --disable-install-strip was given.
if test "${enable_install_strip+set}" = set; then
  enableval="$enable_install_strip"
  if test "$enableval" = "yes"; then
    PKG_SKIP_STRIP= 
  elif test "$enableval" = "no"; then
    PKG_SKIP_STRIP=1
  else
    { echo "configure: error: Option, install-strip, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-elf-dynstr-gc or --disable-elf-dynstr-gc was given.
if test "${enable_elf_dynstr_gc+set}" = set; then
  enableval="$enable_elf_dynstr_gc"
  if test "$enableval" = "yes"; then
    USE_ELF_DYNSTR_GC=1
  elif test "$enableval" = "no"; then
    USE_ELF_DYNSTR_GC= 
  else
    { echo "configure: error: Option, elf-dynstr-gc, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



USE_ELF_HACK=1
# Check whether --enable-elf-hack or --disable-elf-hack was given.
if test "${enable_elf_hack+set}" = set; then
  enableval="$enable_elf_hack"
  if test "$enableval" = "no"; then
    USE_ELF_HACK=
  elif test "$enableval" = "yes"; then
    USE_ELF_HACK=1
  else
    { echo "configure: error: Option, elf-hack, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Disable elf hack for profiling because the built in profiler
# doesn't read the segments properly with elf hack. This is
# temporary and should be fixed soon in the profiler.
if test "$MOZ_PROFILING" = 1; then
  USE_ELF_HACK=
fi

# Only enable elfhack where supported
if test "$USE_ELF_HACK" = 1; then
    case "${HOST_OS_ARCH},${OS_ARCH}" in
    Linux,Linux)
        case "${CPU_ARCH}" in
        arm | x86 | x86_64)
            USE_ELF_HACK=1
            ;;
        *)
            USE_ELF_HACK=
            ;;
        esac
        ;;
    *)
        USE_ELF_HACK=
        ;;
    esac
fi

if test "$USE_ELF_HACK" = 1; then
                                    echo $ac_n "checking whether linker creates PT_GNU_RELRO segments""... $ac_c" 1>&6
echo "configure:22812: checking whether linker creates PT_GNU_RELRO segments" >&5
if eval "test \"`echo '$''{'LINK_WITH_PT_GNU_RELRO'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo "int main() {return 0;}" > conftest.${ac_ext}
         if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:22817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } &&
            test -s conftest${ac_exeext}; then
            if readelf -l conftest${ac_exeext} | grep GNU_RELRO > /dev/null; then
                LINK_WITH_PT_GNU_RELRO=yes
            else
                LINK_WITH_PT_GNU_RELRO=no
            fi
         else
                          { echo "configure: error: couldn't compile a simple C file" 1>&2; exit 1; }
         fi
         rm -rf conftest*
fi

echo "$ac_t""$LINK_WITH_PT_GNU_RELRO" 1>&6
    if test "$LINK_WITH_PT_GNU_RELRO" = yes; then
        echo "configure: warning: Disabling elfhack" 1>&2
        USE_ELF_HACK=
    fi
fi


STDCXX_COMPAT=
# Check whether --enable-stdcxx-compat or --disable-stdcxx-compat was given.
if test "${enable_stdcxx_compat+set}" = set; then
  enableval="$enable_stdcxx_compat"
  if test "$enableval" = "yes"; then
    STDCXX_COMPAT=1
  elif test "$enableval" = "no"; then
    :
  else
    { echo "configure: error: Option, stdcxx-compat, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi




if test -n "$STDCXX_COMPAT"; then
   eval $(CXX="$CXX" MACOS_SDK_DIR="$MACOS_SDK_DIR" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
   
   
fi

# Profiling and Instrumenting

# Check whether --enable-functiontimer or --disable-functiontimer was given.
if test "${enable_functiontimer+set}" = set; then
  enableval="$enable_functiontimer"
  if test "$enableval" = "yes"; then
    NS_FUNCTION_TIMER=1
  elif test "$enableval" = "no"; then
    NS_FUNCTION_TIMER= 
  else
    { echo "configure: error: Option, functiontimer, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$NS_FUNCTION_TIMER"; then
    cat >> confdefs.h <<\EOF
#define NS_FUNCTION_TIMER 1
EOF

fi

# Check whether --enable-reflow-perf or --disable-reflow-perf was given.
if test "${enable_reflow_perf+set}" = set; then
  enableval="$enable_reflow_perf"
  if test "$enableval" = "yes"; then
    MOZ_REFLOW_PERF=1
  elif test "$enableval" = "no"; then
    MOZ_REFLOW_PERF= 
  else
    { echo "configure: error: Option, reflow-perf, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_REFLOW_PERF"; then
    cat >> confdefs.h <<\EOF
#define MOZ_REFLOW_PERF 1
EOF

fi

# Check whether --enable-codesighs or --disable-codesighs was given.
if test "${enable_codesighs+set}" = set; then
  enableval="$enable_codesighs"
  if test "$enableval" = "yes"; then
    _ENABLE_CODESIGHS=1
  elif test "$enableval" = "no"; then
    _ENABLE_CODESIGHS= 
  else
    { echo "configure: error: Option, codesighs, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$_ENABLE_CODESIGHS"; then
    if test -d $srcdir/tools/codesighs; then
        MOZ_MAPINFO=1
    else
        { echo "configure: error: Codesighs directory $srcdir/tools/codesighs required." 1>&2; exit 1; }
    fi
fi

# Check whether --enable-b2g-ril or --disable-b2g-ril was given.
if test "${enable_b2g_ril+set}" = set; then
  enableval="$enable_b2g_ril"
  if test "$enableval" = "yes"; then
    MOZ_B2G_RIL=1
  elif test "$enableval" = "no"; then
    MOZ_B2G_RIL= 
  else
    { echo "configure: error: Option, b2g-ril, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_B2G_RIL"; then
   cat >> confdefs.h <<\EOF
#define MOZ_B2G_RIL 1
EOF

fi


# Check whether --enable-b2g-bt or --disable-b2g-bt was given.
if test "${enable_b2g_bt+set}" = set; then
  enableval="$enable_b2g_bt"
  if test "$enableval" = "yes"; then
    MOZ_B2G_BT=1
  elif test "$enableval" = "no"; then
    MOZ_B2G_BT= 
  else
    { echo "configure: error: Option, b2g-bt, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test -n "$MOZ_B2G_BT"; then
   cat >> confdefs.h <<\EOF
#define MOZ_B2G_BT 1
EOF

fi


if test -z "$SKIP_LIBRARY_CHECKS"; then
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    for ac_func in __cxa_demangle
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:22972: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 22977 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:23003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 HAVE_DEMANGLE=1
else
  echo "$ac_t""no" 1>&6
HAVE_DEMANGLE=
fi
done

    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

fi

# Demangle only for debug or trace-malloc builds
MOZ_DEMANGLE_SYMBOLS=
if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
    MOZ_DEMANGLE_SYMBOLS=1
    cat >> confdefs.h <<\EOF
#define MOZ_DEMANGLE_SYMBOLS 1
EOF

fi


if test -z "$SKIP_LIBRARY_CHECKS"; then
       ac_safe=`echo "unwind.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for unwind.h""... $ac_c" 1>&6
echo "configure:23051: checking for unwind.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 23056 "configure"
#include "confdefs.h"

#include <unwind.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:23064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    for ac_func in _Unwind_Backtrace
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:23081: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 23086 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:23109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

  else
    echo "$ac_t""no" 1>&6
    
  fi

fi


# Check whether --with-jitreport-granularity or --without-jitreport-granularity was given.
if test "${with_jitreport_granularity+set}" = set; then
  withval="$with_jitreport_granularity"
  JITREPORT_GRANULARITY=$withval
else
  JITREPORT_GRANULARITY=3
fi


cat >> confdefs.h <<EOF
#define JS_DEFAULT_JITREPORT_GRANULARITY $JITREPORT_GRANULARITY
EOF


# Misc. Options

# Check whether --enable-xterm-updates or --disable-xterm-updates was given.
if test "${enable_xterm_updates+set}" = set; then
  enableval="$enable_xterm_updates"
  if test "$enableval" = "yes"; then
    MOZ_UPDATE_XTERM=1
  elif test "$enableval" = "no"; then
    MOZ_UPDATE_XTERM= 
  else
    { echo "configure: error: Option, xterm-updates, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


# Check whether --enable-chrome-format or --disable-chrome-format was given.
if test "${enable_chrome_format+set}" = set; then
  enableval="$enable_chrome_format"
  MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`
fi


if test -z "$MOZ_CHROME_FILE_FORMAT"; then
    MOZ_CHROME_FILE_FORMAT=jar
fi

if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
    test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
    test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
    test "$MOZ_CHROME_FILE_FORMAT" != "both" &&
    test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then
    { echo "configure: error: --enable-chrome-format must be set to either jar, flat, both, symlink, or omni" 1>&2; exit 1; }
fi

if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
    MOZ_OMNIJAR=1
    cat >> confdefs.h <<\EOF
#define MOZ_OMNIJAR 1
EOF

    if test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2" -o "$OS_TARGET" = "Android"; then
        MOZ_CHROME_FILE_FORMAT=flat
    else
        MOZ_CHROME_FILE_FORMAT=symlink
    fi
elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
    cat >> confdefs.h <<\EOF
#define MOZ_CHROME_FILE_FORMAT_JAR 1
EOF

fi

OMNIJAR_NAME=omni.ja



# Check whether --with-default-mozilla-five-home or --without-default-mozilla-five-home was given.
if test "${with_default_mozilla_five_home+set}" = set; then
  withval="$with_default_mozilla_five_home"
   val=`echo $withval`
  cat >> confdefs.h <<EOF
#define MOZ_DEFAULT_MOZILLA_FIVE_HOME "$val"
EOF
 
fi


# Check whether --with-user-appdir or --without-user-appdir was given.
if test "${with_user_appdir+set}" = set; then
  withval="$with_user_appdir"
   val=`echo $withval`
if echo "$val" | grep "\/" >/dev/null; then
    { echo "configure: error: "Homedir must be single relative path."" 1>&2; exit 1; }
else
    MOZ_USER_DIR="$val"
fi
fi


cat >> confdefs.h <<EOF
#define MOZ_USER_DIR "$MOZ_USER_DIR"
EOF


MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
# Check whether --with-doc-input-dirs or --without-doc-input-dirs was given.
if test "${with_doc_input_dirs+set}" = set; then
  withval="$with_doc_input_dirs"
   MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"`  
fi



MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
# Check whether --with-doc-include-dirs or --without-doc-include-dirs was given.
if test "${with_doc_include_dirs+set}" = set; then
  withval="$with_doc_include_dirs"
   MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"`  
fi



MOZ_DOC_OUTPUT_DIR='./dist/docs'
# Check whether --with-doc-output-dir or --without-doc-output-dir was given.
if test "${with_doc_output_dir+set}" = set; then
  withval="$with_doc_output_dir"
   MOZ_DOC_OUTPUT_DIR=$withval  
fi



if test -z "$SKIP_COMPILER_CHECKS"; then
# Compiler Options

echo $ac_n "checking for -pipe support""... $ac_c" 1>&6
echo "configure:23270: checking for -pipe support" >&5
if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
        CFLAGS="$CFLAGS -pipe"
    CXXFLAGS="$CXXFLAGS -pipe"
    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi


_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"

echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6
echo "configure:23284: checking whether C compiler supports -fprofile-generate" >&5
cat > conftest.$ac_ext <<EOF
#line 23286 "configure"
#include "confdefs.h"

int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:23293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
   PROFILE_GEN_CFLAGS="-fprofile-generate"
                 result="yes" 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  result="no"
fi
rm -f conftest*
echo "$ac_t""$result" 1>&6

if test $result = "yes"; then
  PROFILE_GEN_LDFLAGS="-fprofile-generate"
  PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
  PROFILE_USE_LDFLAGS="-fprofile-use"
fi

CFLAGS="$_SAVE_CFLAGS"

if test -n "$INTEL_CC"; then
  PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
  PROFILE_GEN_LDFLAGS=
  PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
  PROFILE_USE_LDFLAGS=
fi

if test "$SOLARIS_SUNPRO_CC"; then
  PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
  PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
  PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
  PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
fi






ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross


# Check whether --enable-pedantic or --disable-pedantic was given.
if test "${enable_pedantic+set}" = set; then
  enableval="$enable_pedantic"
  if test "$enableval" = "no"; then
    _PEDANTIC= 
  elif test "$enableval" = "yes"; then
    :
  else
    { echo "configure: error: Option, pedantic, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$_PEDANTIC"; then
    _SAVE_CXXFLAGS=$CXXFLAGS
    CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
    echo $ac_n "checking whether C++ compiler has -pedantic long long bug""... $ac_c" 1>&6
echo "configure:23357: checking whether C++ compiler has -pedantic long long bug" >&5
    cat > conftest.$ac_ext <<EOF
#line 23359 "configure"
#include "confdefs.h"
$configure_static_assert_macros
int main() {
CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)
; return 0; }
EOF
if { (eval echo configure:23366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  result="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  result="yes" 
fi
rm -f conftest*
    echo "$ac_t""$result" 1>&6
    CXXFLAGS="$_SAVE_CXXFLAGS"

    case "$result" in
    no)
        _WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long"
        _WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
        ;;
    yes)
        { echo "configure: error: Your compiler appears to have a known bug where long long is miscompiled when using -pedantic.  Reconfigure using --disable-pedantic. " 1>&2; exit 1; }
        ;;
    esac
fi

_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
echo $ac_n "checking for correct overload resolution with const and templates""... $ac_c" 1>&6
echo "configure:23393: checking for correct overload resolution with const and templates" >&5
if eval "test \"`echo '$''{'ac_nscap_nonconst_opeq_bug'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 23398 "configure"
#include "confdefs.h"

                      template <class T>
                      class Pointer
                        {
                        public:
                          T* myPtr;
                        };

                      template <class T, class U>
                      int operator==(const Pointer<T>& rhs, U* lhs)
                        {
                          return rhs.myPtr == lhs;
                        }

                      template <class T, class U>
                      int operator==(const Pointer<T>& rhs, const U* lhs)
                        {
                          return rhs.myPtr == lhs;
                        }
                    
int main() {

                      Pointer<int> foo;
                      const int* bar;
                      return foo == bar;
                    
; return 0; }
EOF
if { (eval echo configure:23428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_nscap_nonconst_opeq_bug="no"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_nscap_nonconst_opeq_bug="yes"
fi
rm -f conftest*
fi

echo "$ac_t""$ac_nscap_nonconst_opeq_bug" 1>&6
CXXFLAGS="$_SAVE_CXXFLAGS"

if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define NSCAP_DONT_PROVIDE_NONCONST_OPEQ 1
EOF

fi
fi # ! SKIP_COMPILER_CHECKS

cat >> confdefs.h <<\EOF
#define CPP_THROW_NEW throw()
EOF

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


if test "$COMPILE_ENVIRONMENT"; then


echo $ac_n "checking what kind of list files are supported by the linker""... $ac_c" 1>&6
echo "configure:23467: checking what kind of list files are supported by the linker" >&5
if eval "test \"`echo '$''{'EXPAND_LIBS_LIST_STYLE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo "int main() {return 0;}" > conftest.${ac_ext}
     if { ac_try='${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5'; { (eval echo configure:23472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.${OBJ_SUFFIX}; then
         echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
         if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&5'; { (eval echo configure:23474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest${ac_exeext}; then
             EXPAND_LIBS_LIST_STYLE=linkerscript
         else
             echo "conftest.${OBJ_SUFFIX}" > conftest.list
             if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5'; { (eval echo configure:23478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest${ac_exeext}; then
                 EXPAND_LIBS_LIST_STYLE=list
             else
                 EXPAND_LIBS_LIST_STYLE=none
             fi
         fi
     else
                  { echo "configure: error: couldn't compile a simple C file" 1>&2; exit 1; }
     fi
     rm -rf conftest*
fi

echo "$ac_t""$EXPAND_LIBS_LIST_STYLE" 1>&6

LIBS_DESC_SUFFIX=desc



if test "$GCC_USE_GNU_LD"; then
    echo $ac_n "checking what kind of ordering can be done with the linker""... $ac_c" 1>&6
echo "configure:23498: checking what kind of ordering can be done with the linker" >&5
if eval "test \"`echo '$''{'EXPAND_LIBS_ORDER_STYLE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  > conftest.order
         _SAVE_LDFLAGS="$LDFLAGS"
         LDFLAGS="${LDFLAGS} -Wl,--section-ordering-file,conftest.order"
         cat > conftest.$ac_ext <<EOF
#line 23506 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:23513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  EXPAND_LIBS_ORDER_STYLE=section-ordering-file
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  EXPAND_LIBS_ORDER_STYLE=
fi
rm -f conftest*
         LDFLAGS="$_SAVE_LDFLAGS"
         if test -z "$EXPAND_LIBS_ORDER_STYLE"; then
             if { ac_try='${CC-cc} ${DSO_LDOPTS} ${LDFLAGS} -o ${DLL_PREFIX}conftest${DLL_SUFFIX} -Wl'; { (eval echo configure:23525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
                 EXPAND_LIBS_ORDER_STYLE=linkerscript
             else
                 EXPAND_LIBS_ORDER_STYLE=none
             fi
             rm -f ${DLL_PREFIX}conftest${DLL_SUFFIX}
         fi
fi

echo "$ac_t""$EXPAND_LIBS_ORDER_STYLE" 1>&6
fi



fi # COMPILE_ENVIRONMENT

# Build dependencies

MOZ_AUTO_DEPS=1
# Check whether --enable-auto-deps or --disable-auto-deps was given.
if test "${enable_auto_deps+set}" = set; then
  enableval="$enable_auto_deps"
  if test "$enableval" = "no"; then
    MOZ_AUTO_DEPS=
  elif test "$enableval" = "yes"; then
    MOZ_AUTO_DEPS=1
  else
    { echo "configure: error: Option, auto-deps, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$MOZ_AUTO_DEPS"; then
_cpp_md_flag=
# Check whether --enable-md or --disable-md was given.
if test "${enable_md+set}" = set; then
  enableval="$enable_md"
  if test "$enableval" = "no"; then
    _cpp_md_flag=
  elif test "$enableval" = "yes"; then
    _cpp_md_flag=1
  else
    { echo "configure: error: Option, md, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
else
     if test "$GNU_CC" -a "$GNU_CXX"; then
     _cpp_md_flag=1
   fi
     if test "$SOLARIS_SUNPRO_CC"; then
     _cpp_md_flag=1
   fi
fi

if test "$_cpp_md_flag"; then
  COMPILER_DEPEND=1
  _DEPEND_CFLAGS='$(filter-out %/.pp,-MD -MF $(MDDEPDIR)/$(basename $(@F)).pp)'
    if test "$SOLARIS_SUNPRO_CC"; then
    _DEPEND_CFLAGS=
  fi
else
  COMPILER_DEPEND=
    if test -z "$_WIN32_MSVC"; then
    _USE_CPP_INCLUDE_FLAG=
    _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
    _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
  else
    echo '#include <stdio.h>' > dummy-hello.c
    
    CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
    
    if test -z "$CL_INCLUDES_PREFIX"; then
        { echo "configure: error: Cannot find cl -showIncludes prefix." 1>&2; exit 1; }
    fi
    
    rm -f dummy-hello.c
        CC_WRAPPER='$(PYTHON) -O $(topsrcdir)/build/cl.py'
    CXX_WRAPPER='$(PYTHON) -O $(topsrcdir)/build/cl.py'
    COMPILER_DEPEND=1
  fi
fi
fi # MOZ_AUTO_DEPS
MDDEPDIR='.deps'







# Static build options

# split JS out by default to avoid VS2005 PGO crash (bug 591836).
if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
  ENABLE_SHARED_JS=1
fi

# Check whether --enable-shared-js or --disable-shared-js was given.
if test "${enable_shared_js+set}" = set; then
  enableval="$enable_shared_js"
  if test "$enableval" = "yes"; then
    ENABLE_SHARED_JS=1
  elif test "$enableval" = "no"; then
    ENABLE_SHARED_JS=
  else
    { echo "configure: error: Option, shared-js, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test -n "$ENABLE_SHARED_JS"; then
  JS_SHARED_LIBRARY=1
  MOZ_JS_LIBS="$MOZ_JS_SHARED_LIBS"
else
  MOZ_JS_LIBS="$MOZ_JS_STATIC_LIBS"
  cat >> confdefs.h <<\EOF
#define MOZ_STATIC_JS 1
EOF

fi



XPCOM_LIBS="$LIBXUL_LIBS"

# Standalone module options (Not for building Mozilla)


if test -z "$SKIP_PATH_CHECKS"; then
if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
    if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:23661: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for glib-2.0 >= 1.3.7 gobject-2.0""... $ac_c" 1>&6
echo "configure:23705: checking for glib-2.0 >= 1.3.7 gobject-2.0" >&5

        if $PKG_CONFIG --exists "glib-2.0 >= 1.3.7 gobject-2.0" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking GLIB_CFLAGS""... $ac_c" 1>&6
echo "configure:23712: checking GLIB_CFLAGS" >&5
            GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 1.3.7 gobject-2.0"`
            echo "$ac_t""$GLIB_CFLAGS" 1>&6

            echo $ac_n "checking GLIB_LIBS""... $ac_c" 1>&6
echo "configure:23717: checking GLIB_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            GLIB_LIBS="`$PKG_CONFIG --libs \"glib-2.0 >= 1.3.7 gobject-2.0\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$GLIB_LIBS" 1>&6
        else
            GLIB_CFLAGS=""
            GLIB_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0 >= 1.3.7 gobject-2.0"`
            echo $GLIB_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (glib-2.0 >= 1.3.7 gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    fi
fi
fi

if test -z "${GLIB_GMODULE_LIBS}" \
   -a -n "${GLIB_CONFIG}"\
    -a "${GLIB_CONFIG}" != no\
; then
    GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
fi






if test "${OS_ARCH}" = "Darwin" -o "${MOZ_WIDGET_TOOLKIT}" = "android" -o "${MOZ_WIDGET_TOOLKIT}" = "gtk2"; then
MOZ_ENABLE_SKIA=1
else
MOZ_ENABLE_SKIA=
fi

# Check whether --enable-skia or --disable-skia was given.
if test "${enable_skia+set}" = set; then
  enableval="$enable_skia"
  if test "$enableval" = "yes"; then
    MOZ_ENABLE_SKIA=1
  elif test "$enableval" = "no"; then
    MOZ_ENABLE_SKIA=
  else
    { echo "configure: error: Option, skia, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi



MOZ_TREE_CAIRO=1
# Check whether --enable-system-cairo or --disable-system-cairo was given.
if test "${enable_system_cairo+set}" = set; then
  enableval="$enable_system_cairo"
  if test "$enableval" = "yes"; then
    MOZ_TREE_CAIRO=
  elif test "$enableval" = "no"; then
    MOZ_TREE_CAIRO=1 
  else
    { echo "configure: error: Option, system-cairo, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


MOZ_TREE_PIXMAN=1
# Check whether --enable-system-pixman or --disable-system-pixman was given.
if test "${enable_system_pixman+set}" = set; then
  enableval="$enable_system_pixman"
  if test "$enableval" = "yes"; then
    MOZ_TREE_PIXMAN=
  elif test "$enableval" = "no"; then
    MOZ_TREE_PIXMAN=force
  else
    { echo "configure: error: Option, system-pixman, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
else
  MOZ_TREE_PIXMAN=1 
fi


# System cairo depends on system pixman
if test "$MOZ_TREE_PIXMAN" = "force"; then
    if test -z "$MOZ_TREE_CAIRO"; then
        { echo "configure: error: --disable-system-pixman is incompatible with --enable-system-cairo." 1>&2; exit 1; }
    else
        MOZ_TREE_PIXMAN=1
    fi
elif test -z "$MOZ_TREE_CAIRO"; then
    MOZ_TREE_PIXMAN=
fi

if test "$MOZ_TREE_PIXMAN"; then
    cat >> confdefs.h <<\EOF
#define MOZ_TREE_PIXMAN 1
EOF

    MOZ_PIXMAN_CFLAGS=""
    MOZ_PIXMAN_LIBS='$(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
else
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:23837: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for pixman-1 >= 0.19.2""... $ac_c" 1>&6
echo "configure:23881: checking for pixman-1 >= 0.19.2" >&5

        if $PKG_CONFIG --exists "pixman-1 >= 0.19.2" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking PIXMAN_CFLAGS""... $ac_c" 1>&6
echo "configure:23888: checking PIXMAN_CFLAGS" >&5
            PIXMAN_CFLAGS=`$PKG_CONFIG --cflags "pixman-1 >= 0.19.2"`
            echo "$ac_t""$PIXMAN_CFLAGS" 1>&6

            echo $ac_n "checking PIXMAN_LIBS""... $ac_c" 1>&6
echo "configure:23893: checking PIXMAN_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            PIXMAN_LIBS="`$PKG_CONFIG --libs \"pixman-1 >= 0.19.2\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$PIXMAN_LIBS" 1>&6
        else
            PIXMAN_CFLAGS=""
            PIXMAN_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            PIXMAN_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pixman-1 >= 0.19.2"`
            echo $PIXMAN_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (pixman-1 >= 0.19.2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    MOZ_PIXMAN_CFLAGS="$PIXMAN_CFLAGS"
    MOZ_PIXMAN_LIBS="$PIXMAN_LIBS"
fi



# Check for headers defining standard int types.
 for ac_hdr in stdint.h inttypes.h sys/int_types.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:23933: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 23938 "configure"
#include "confdefs.h"

#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:23946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    
  fi

  done


if test "$MOZ_TREE_CAIRO"; then
    MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
    cat >> confdefs.h <<\EOF
#define MOZ_TREE_CAIRO 1
EOF


    # For now we assume that we will have a uint64_t available through
    # one of the above headers or mozstdint.h.
    cat >> confdefs.h <<\EOF
#define HAVE_UINT64_T 1
EOF


    # Define macros for cairo-features.h
    TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1"
    if test "$MOZ_X11"; then
        XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
        XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
        PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
        FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
        MOZ_ENABLE_CAIRO_FT=1
        CAIRO_FT_CFLAGS="$FT2_CFLAGS"
    fi
    case "$MOZ_WIDGET_TOOLKIT" in
      qt)
        QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
        ;;
      cocoa | uikit)
        QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
        QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
        QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
        ;;
      windows)
        WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
        WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
        if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
            WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
            WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
            MOZ_ENABLE_D2D_SURFACE=1
            MOZ_ENABLE_DWRITE_FONT=1
        else
            WIN32_DWRITE_FONT_FEATURE=
            WIN32_D2D_SURFACE_FEATURE=
        fi

           ac_safe=`echo "d3d9.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for d3d9.h""... $ac_c" 1>&6
echo "configure:24021: checking for d3d9.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 24026 "configure"
#include "confdefs.h"

#include <d3d9.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:24034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    MOZ_ENABLE_D3D9_LAYER=1
  else
    echo "$ac_t""no" 1>&6
    
  fi


                if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
             ac_safe=`echo "d3d10.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for d3d10.h""... $ac_c" 1>&6
echo "configure:24058: checking for d3d10.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 24063 "configure"
#include "confdefs.h"

#include <d3d10.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:24071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    MOZ_ENABLE_D3D10_LAYER=1
  else
    echo "$ac_t""no" 1>&6
    
  fi

        fi
        ;;
      os2)
        OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
        FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
        MOZ_ENABLE_CAIRO_FT=1
        CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
        CAIRO_FT_OSLIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
        CAIRO_FT_LIBS=""
        ;;
    esac
    if test "$USE_FC_FREETYPE"; then
        FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
    fi
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
    MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'

    if test "$MOZ_X11"; then
        MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
    fi

    CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
    mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null

else
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:24149: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for cairo >= $CAIRO_VERSION""... $ac_c" 1>&6
echo "configure:24193: checking for cairo >= $CAIRO_VERSION" >&5

        if $PKG_CONFIG --exists "cairo >= $CAIRO_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking CAIRO_CFLAGS""... $ac_c" 1>&6
echo "configure:24200: checking CAIRO_CFLAGS" >&5
            CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= $CAIRO_VERSION"`
            echo "$ac_t""$CAIRO_CFLAGS" 1>&6

            echo $ac_n "checking CAIRO_LIBS""... $ac_c" 1>&6
echo "configure:24205: checking CAIRO_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            CAIRO_LIBS="`$PKG_CONFIG --libs \"cairo >= $CAIRO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$CAIRO_LIBS" 1>&6
        else
            CAIRO_CFLAGS=""
            CAIRO_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            CAIRO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "cairo >= $CAIRO_VERSION"`
            echo $CAIRO_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (cairo >= $CAIRO_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS"
    MOZ_CAIRO_LIBS="$CAIRO_LIBS"
    succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:24242: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for cairo-tee >= $CAIRO_VERSION""... $ac_c" 1>&6
echo "configure:24286: checking for cairo-tee >= $CAIRO_VERSION" >&5

        if $PKG_CONFIG --exists "cairo-tee >= $CAIRO_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking CAIRO_TEE_CFLAGS""... $ac_c" 1>&6
echo "configure:24293: checking CAIRO_TEE_CFLAGS" >&5
            CAIRO_TEE_CFLAGS=`$PKG_CONFIG --cflags "cairo-tee >= $CAIRO_VERSION"`
            echo "$ac_t""$CAIRO_TEE_CFLAGS" 1>&6

            echo $ac_n "checking CAIRO_TEE_LIBS""... $ac_c" 1>&6
echo "configure:24298: checking CAIRO_TEE_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            CAIRO_TEE_LIBS="`$PKG_CONFIG --libs \"cairo-tee >= $CAIRO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$CAIRO_TEE_LIBS" 1>&6
        else
            CAIRO_TEE_CFLAGS=""
            CAIRO_TEE_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            CAIRO_TEE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "cairo-tee >= $CAIRO_VERSION"`
            echo $CAIRO_TEE_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (cairo-tee >= $CAIRO_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

    if test "$MOZ_X11"; then
        succeeded=no

  if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:24334: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PKG_CONFIG" in
  /*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
if test -n "$PKG_CONFIG"; then
  echo "$ac_t""$PKG_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  fi

  if test "$PKG_CONFIG" = "no" ; then
     echo "*** The pkg-config script could not be found. Make sure it is"
     echo "*** in your path, or set the PKG_CONFIG environment variable"
     echo "*** to the full path to pkg-config."
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  else
     PKG_CONFIG_MIN_VERSION=0.9.0
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
        echo $ac_n "checking for cairo-xlib-xrender >= $CAIRO_VERSION""... $ac_c" 1>&6
echo "configure:24378: checking for cairo-xlib-xrender >= $CAIRO_VERSION" >&5

        if $PKG_CONFIG --exists "cairo-xlib-xrender >= $CAIRO_VERSION" ; then
            echo "$ac_t""yes" 1>&6
            succeeded=yes

            echo $ac_n "checking CAIRO_XRENDER_CFLAGS""... $ac_c" 1>&6
echo "configure:24385: checking CAIRO_XRENDER_CFLAGS" >&5
            CAIRO_XRENDER_CFLAGS=`$PKG_CONFIG --cflags "cairo-xlib-xrender >= $CAIRO_VERSION"`
            echo "$ac_t""$CAIRO_XRENDER_CFLAGS" 1>&6

            echo $ac_n "checking CAIRO_XRENDER_LIBS""... $ac_c" 1>&6
echo "configure:24390: checking CAIRO_XRENDER_LIBS" >&5
            ## Remove evil flags like -Wl,--export-dynamic
            CAIRO_XRENDER_LIBS="`$PKG_CONFIG --libs \"cairo-xlib-xrender >= $CAIRO_VERSION\" |sed s/-Wl,--export-dynamic//g`"
            echo "$ac_t""$CAIRO_XRENDER_LIBS" 1>&6
        else
            CAIRO_XRENDER_CFLAGS=""
            CAIRO_XRENDER_LIBS=""
            ## If we have a custom action on failure, don't print errors, but 
            ## do set a variable so people can do so.
            CAIRO_XRENDER_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "cairo-xlib-xrender >= $CAIRO_VERSION"`
            echo $CAIRO_XRENDER_PKG_ERRORS
        fi

        
        
     else
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
     fi
  fi

  if test $succeeded = yes; then
     :
  else
     if test "$COMPILE_ENVIRONMENT"; then 
       { echo "configure: error: Library requirements (cairo-xlib-xrender >= $CAIRO_VERSION) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
     fi
  fi

        MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
        MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_LIBS"
        MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
    fi
fi








QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'


MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'


if test "$MOZ_GRAPHITE"; then
  MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
  cat >> confdefs.h <<\EOF
#define MOZ_GRAPHITE 1
EOF

else
  MOZ_GRAPHITE_LIBS=
fi



MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'


if test "$MOZ_ENABLE_SKIA"; then
  MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
  cat >> confdefs.h <<\EOF
#define MOZ_ENABLE_SKIA 1
EOF

else
  MOZ_SKIA_LIBS=
fi



# Check whether --enable-xul or --disable-xul was given.
if test "${enable_xul+set}" = set; then
  enableval="$enable_xul"
  if test "$enableval" = "no"; then
    MOZ_XUL= 
  elif test "$enableval" = "yes"; then
    :
  else
    { echo "configure: error: Option, xul, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$MOZ_XUL"; then
  cat >> confdefs.h <<\EOF
#define MOZ_XUL 1
EOF

else
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
fi



# Check whether --enable-profilelocking or --disable-profilelocking was given.
if test "${enable_profilelocking+set}" = set; then
  enableval="$enable_profilelocking"
  if test "$enableval" = "no"; then
    MOZ_PROFILELOCKING=
  elif test "$enableval" = "yes"; then
    MOZ_PROFILELOCKING=1 
  else
    { echo "configure: error: Option, profilelocking, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi

if test "$MOZ_PROFILELOCKING"; then
  cat >> confdefs.h <<\EOF
#define MOZ_PROFILELOCKING 1
EOF

fi


# Check whether --enable-necko-protocols or --disable-necko-protocols was given.
if test "${enable_necko_protocols+set}" = set; then
  enableval="$enable_necko_protocols"
   for option in `echo $enableval | sed 's/,/ /g'`; do
    if test "$option" = "yes" -o "$option" = "all"; then
        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
    elif test "$option" = "no" -o "$option" = "none"; then
        NECKO_PROTOCOLS=""
    elif test "$option" = "default"; then
        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
    elif test `echo "$option" | grep -c \^-` != 0; then
        option=`echo $option | sed 's/^-//'`
        NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
    else
        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
    fi
done
else
  NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT"
fi

NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`

for p in $NECKO_PROTOCOLS; do
    cat >> confdefs.h <<EOF
#define NECKO_PROTOCOL_$p 1
EOF

done

# Check whether --enable-necko-wifi or --disable-necko-wifi was given.
if test "${enable_necko_wifi+set}" = set; then
  enableval="$enable_necko_wifi"
  if test "$enableval" = "no"; then
    NECKO_WIFI=
  elif test "$enableval" = "yes"; then
    NECKO_WIFI=1
  else
    { echo "configure: error: Option, necko-wifi, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$OS_ARCH" = "OS2"; then
    NECKO_WIFI=
fi
if test "$NECKO_WIFI" -a \
        "$OS_ARCH" != "Linux" -a \
        "$OS_ARCH" != "Darwin" -a \
        "$OS_ARCH" != "SunOS" -a \
        "$OS_ARCH" != "WINNT"; then
  { echo "configure: error: Necko WiFi scanning not supported on your platform, use --disable-necko-wifi" 1>&2; exit 1; }
fi

if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
then
     ac_safe=`echo "iwlib.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for iwlib.h""... $ac_c" 1>&6
echo "configure:24566: checking for iwlib.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 24571 "configure"
#include "confdefs.h"

#include <iwlib.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:24579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    :
  else
    echo "$ac_t""no" 1>&6
    
  fi

  if test "$ac_cv_header_iwlib_h" != "yes"; then
    { echo "configure: error: Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora) or libiw-devel (openSUSE)); use --disable-necko-wifi to disable" 1>&2; exit 1; }
  fi
fi

if test "$NECKO_WIFI"; then
  cat >> confdefs.h <<\EOF
#define NECKO_WIFI 1
EOF

fi


# Check whether --enable-cookies or --disable-cookies was given.
if test "${enable_cookies+set}" = set; then
  enableval="$enable_cookies"
  if test "$enableval" = "no"; then
    NECKO_COOKIES=
  elif test "$enableval" = "yes"; then
    NECKO_COOKIES=1
  else
    { echo "configure: error: Option, cookies, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$NECKO_COOKIES"; then
    cat >> confdefs.h <<\EOF
#define NECKO_COOKIES 1
EOF

fi

# Check whether --enable-ctypes or --disable-ctypes was given.
if test "${enable_ctypes+set}" = set; then
  enableval="$enable_ctypes"
  if test "$enableval" = "no"; then
    BUILD_CTYPES=
  elif test "$enableval" = "yes"; then
    BUILD_CTYPES=1
  else
    { echo "configure: error: Option, ctypes, does not take an argument ($enableval)." 1>&2; exit 1; }
  fi
fi


if test "$BUILD_CTYPES"; then
    cat >> confdefs.h <<\EOF
#define BUILD_CTYPES 1
EOF

fi

_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"

if test "$MOZ_PLACES"; then
  cat >> confdefs.h <<\EOF
#define MOZ_PLACES 1
EOF

fi


if test -n "$MOZ_SERVICES_SYNC"; then
  cat >> confdefs.h <<\EOF
#define MOZ_SERVICES_SYNC 1
EOF

fi

if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
    MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
fi

if test "$MOZ_APP_COMPONENT_INCLUDE"; then
  cat >> confdefs.h <<EOF
#define MOZ_APP_COMPONENT_INCLUDE "$MOZ_APP_COMPONENT_INCLUDE"
EOF

fi

if test "$MOZ_APP_COMPONENT_MODULES"; then
  cat >> confdefs.h <<EOF
#define MOZ_APP_COMPONENT_MODULES $MOZ_APP_COMPONENT_MODULES
EOF

fi
















































































































# Check whether --with-macbundlename-prefix or --without-macbundlename-prefix was given.
if test "${with_macbundlename_prefix+set}" = set; then
  withval="$with_macbundlename_prefix"
   MOZ_MACBUNDLE_NAME_PREFIX="$withval"
fi


MOZ_MACBUNDLE_NAME=`echo $MOZ_APP_DISPLAYNAME | tr -d ' '`
if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
  MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
fi

if test "$MOZ_DEBUG"; then
  MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}Debug.app
else
  MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
fi


MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z'`
MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
if test "$MOZ_DEBUG"; then
  MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
fi

cat >> confdefs.h <<EOF
#define MOZ_MACBUNDLE_ID $MOZ_MACBUNDLE_ID
EOF



# The following variables are available to branding and application
# configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
# - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
# impacts profile location and user-visible fields.
# - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
# versions of a given application (e.g. Aurora and Firefox both use
# "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
# for application.ini's "Name" field, which controls profile location in
# the absence of a "Profile" field (see below), and various system
# integration hooks (Unix remoting, Windows MessageWindow name, etc.)
# - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
# Mac Bundle name, Updater, Installer), it is typically used for nightly
# builds (e.g. Aurora for Firefox).
# - MOZ_APP_VERSION: Defines the application version number.
# - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
# defaults to a lowercase form of MOZ_APP_BASENAME.
# - MOZ_APP_PROFILE: When set, used for application.ini's
# "Profile" field, which controls profile location.
# - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
# crash reporter server url.
# - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
# - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.

if test -z "$MOZ_APP_NAME"; then
   MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
fi

# For extensions and langpacks, we require a max version that is compatible
# across security releases. MOZ_APP_MAXVERSION is our method for doing that.
# 10.0a1 and 10.0a2 aren't affected
# 10.0 becomes 10.0.*
# 10.0.1 becomes 10.0.*
IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
if test -z "$IS_ALPHA"; then
  
  MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*.[0-9]*\).*|\1|"`.*
  
else
  MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
fi











cat >> confdefs.h <<EOF
#define MOZ_APP_UA_NAME "$MOZ_APP_UA_NAME"
EOF


cat >> confdefs.h <<EOF
#define MOZ_APP_UA_VERSION "$MOZ_APP_VERSION"
EOF



cat >> confdefs.h <<EOF
#define MOZ_UA_FIREFOX_VERSION "$FIREFOX_VERSION"
EOF

cat >> confdefs.h <<EOF
#define FIREFOX_VERSION $FIREFOX_VERSION
EOF


cat >> confdefs.h <<EOF
#define MOZ_UA_BUILDID "$MOZ_UA_BUILDID"
EOF



# We can't use the static application.ini data when building against
# a libxul SDK.
if test -n "$LIBXUL_SDK"; then
    MOZ_APP_STATIC_INI=
fi






if test "$MOZ_TELEMETRY_REPORTING"; then
    cat >> confdefs.h <<\EOF
#define MOZ_TELEMETRY_REPORTING 1
EOF

fi







CFLAGS=`echo \
	$_WARNINGS_CFLAGS \
	$CFLAGS`

CXXFLAGS=`echo \
	$_MOZ_RTTI_FLAGS \
	$_WARNINGS_CXXFLAGS \
	$CXXFLAGS`

COMPILE_CFLAGS=`echo \
    $_DEFINES_CFLAGS \
	$_DEPEND_CFLAGS \
    $COMPILE_CFLAGS`

COMPILE_CXXFLAGS=`echo \
    $_DEFINES_CXXFLAGS \
	$_DEPEND_CFLAGS \
    $COMPILE_CXXFLAGS`
























































































cat >> confdefs.h <<EOF
#define MOZ_DLL_SUFFIX "$DLL_SUFFIX"
EOF
















































echo $ac_n "checking for posix_fallocate""... $ac_c" 1>&6
echo "configure:25088: checking for posix_fallocate" >&5
cat > conftest.$ac_ext <<EOF
#line 25090 "configure"
#include "confdefs.h"
#define _XOPEN_SOURCE 600
  #include <fcntl.h>
int main() {
posix_fallocate(0, 0, 0);
; return 0; }
EOF
if { (eval echo configure:25098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv___posix_fallocate=true
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv___posix_fallocate=false
fi
rm -f conftest*

if test "$ac_cv___posix_fallocate" = true ; then
  cat >> confdefs.h <<\EOF
#define HAVE_POSIX_FALLOCATE 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "$COMPILE_ENVIRONMENT"; then
if test "$MOZ_X11"; then
    if test "$WITHOUT_X11"; then
        { echo "configure: error: --without-x specified and MOZ_X11 still defined" 1>&2; exit 1; }
    fi
                _SAVE_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS $XCFLAGS"
    cat > conftest.$ac_ext <<EOF
#line 25127 "configure"
#include "confdefs.h"

        #include <stdio.h>
        #include <stdlib.h>
        #include <X11/Xlib.h>
        #include <X11/Intrinsic.h>
        #include <X11/extensions/XShm.h>
    
int main() {

        Display *dpy = 0;
        if ((dpy = XOpenDisplay(NULL)) == NULL) {
            fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
            exit(1);
        }
    
; return 0; }
EOF
if { (eval echo configure:25146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   { echo "configure: error: Could not compile basic X program." 1>&2; exit 1; } 
fi
rm -f conftest*
    CFLAGS="$_SAVE_CFLAGS"

    if test -n "$MISSING_X"; then
        { echo "configure: error:  Could not find the following X libraries: $MISSING_X " 1>&2; exit 1; };
    fi

fi # MOZ_X11

if test "$MOZ_GL_DEFAULT_PROVIDER" = "GLX"; then
       ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
echo "configure:25166: checking for GL/glx.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 25171 "configure"
#include "confdefs.h"

#include <GL/glx.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:25179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    :
  else
    echo "$ac_t""no" 1>&6
    
  fi

    if test "$ac_cv_header_GL_glx_h" != "yes"; then
        { echo "configure: error: Can't find header GL/glx.h for WebGL (install mesa-common-dev (Ubuntu), mesa-libGL-devel (Fedora), or Mesa-devel (openSUSE))" 1>&2; exit 1; }
    fi
fi # MOZ_GL_DEFAULT_PROVIDER=GLX
fi # COMPILE_ENVIRONMENT

if test "$USE_FC_FREETYPE"; then
    if test "$COMPILE_ENVIRONMENT"; then
    	_SAVE_CPPFLAGS="$CPPFLAGS"
    	CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
         for ac_hdr in fontconfig/fcfreetype.h
  do
       ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:25213: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
   cat > conftest.$ac_ext <<EOF
#line 25218 "configure"
#include "confdefs.h"
#include <fontconfig/fontconfig.h>
#include <$ac_hdr>
int main() {

; return 0; }
EOF
if { (eval echo configure:25226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest* 
fi

  if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                       cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
  else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: Can't find header fontconfig/fcfreetype.h." 1>&2; exit 1; }
  fi

  done

    	CPPFLAGS="$_SAVE_CPPFLAGS"
    else
        cat >> confdefs.h <<\EOF
#define HAVE_FONTCONFIG_FCFREETYPE_H 1
EOF

    fi
fi


if test "$OS_ARCH" = "Darwin"; then
  cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF

  cat >> confdefs.h <<\EOF
#define UNIX_ASYNC_DNS 1
EOF

elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
  cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF

  cat >> confdefs.h <<\EOF
#define UNIX_ASYNC_DNS 1
EOF

fi

if test "$MOZ_DEBUG"; then
    cat >> confdefs.h <<\EOF
#define MOZ_REFLOW_PERF 1
EOF

    cat >> confdefs.h <<\EOF
#define MOZ_REFLOW_PERF_DSP 1
EOF

fi

if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
    cat >> confdefs.h <<\EOF
#define MOZ_ACCESSIBILITY_ATK 1
EOF

    ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
    ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
    ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
    ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
    cat >> confdefs.h <<EOF
#define ATK_MAJOR_VERSION $ATK_MAJOR_VERSION
EOF

    cat >> confdefs.h <<EOF
#define ATK_MINOR_VERSION $ATK_MINOR_VERSION
EOF

    cat >> confdefs.h <<EOF
#define ATK_REV_VERSION $ATK_REV_VERSION
EOF

fi

case "$host_os" in
mingw*)
    WIN_TOP_SRC=`cd $srcdir; pwd -W`
    ;;
esac








_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
CPP_THROW_NEW
HAVE_CPP_2BYTE_WCHAR_T
HAVE_CPP_AMBIGUITY_RESOLVING_USING
HAVE_CPP_CHAR16_T
HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
HAVE_CPP_PARTIAL_SPECIALIZATION
HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
HAVE_STATVFS
NEED_CPP_UNUSED_IMPLEMENTATIONS
NEW_H
HAVE_GETPAGESIZE
HAVE_ICONV
HAVE_ICONV_WITH_CONST_INPUT
HAVE_MBRTOWC
HAVE_SYS_MOUNT_H
HAVE_SYS_VFS_H
HAVE_WCRTOMB
"



# Hack around an Apple bug that effects the egrep that comes with OS X 10.7.
# "arch -arch i386 egrep" always uses the 32-bit Intel part of the egrep fat
# binary, even on 64-bit systems. We (apparently) only need this hack when
# egrep's "pattern" is particularly long (as in the following code).
# See bug 655339.
case "$host" in
*-apple-darwin11*)
    FIXED_EGREP="arch -arch i386 egrep"
    ;;
*)
    FIXED_EGREP="egrep"
    ;;
esac

# Save the defines header file before autoconf removes it.
# (Do not add AC_DEFINE calls after this line.)
  _CONFIG_TMP=confdefs-tmp.h
  _CONFIG_DEFS_H=mozilla-config.h

  cat > $_CONFIG_TMP <<\EOF
/* List of defines generated by configure. Included with preprocessor flag,
 * -include, to avoid long list of -D defines on the compile command-line.
 * Do not edit.
 */

#ifndef _MOZILLA_CONFIG_H_
#define _MOZILLA_CONFIG_H_
EOF

_EGREP_PATTERN='^#define ('
if test -n "$_NON_GLOBAL_ACDEFINES"; then
    for f in $_NON_GLOBAL_ACDEFINES; do
        _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
    done
fi
_EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"

  sort confdefs.h | $FIXED_EGREP -v "$_EGREP_PATTERN" >> $_CONFIG_TMP

  if test "$?" != 0; then
    { echo "configure: error: Error outputting config definitions" 1>&2; exit 1; }
  fi

  cat >> $_CONFIG_TMP <<\EOF

/* The c99 defining the limit macros (UINT32_MAX for example), says:
 * C++ implementations should define these macros only when __STDC_LIMIT_MACROS
 * is defined before <stdint.h> is included. */
#define __STDC_LIMIT_MACROS

/* Force-include hunspell_alloc_hooks.h for hunspell, so that we don't need to
 * modify it directly.
 *
 * HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/Makefile.in,
 * unless --enable-system-hunspell is defined.
 */
#if defined(HUNSPELL_STATIC)
#include "hunspell_alloc_hooks.h"
#endif

#endif /* _MOZILLA_CONFIG_H_ */

EOF

  # Only write mozilla-config.h when something changes (or it doesn't exist)
  if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
    rm $_CONFIG_TMP
  else
    echo "$ac_t"""creating $_CONFIG_DEFS_H"" 1>&6
    mv -f $_CONFIG_TMP $_CONFIG_DEFS_H

    echo ==== $_CONFIG_DEFS_H =================================
    cat $_CONFIG_DEFS_H
  fi

rm -f confdefs.h.save
mv confdefs.h confdefs.h.save
$FIXED_EGREP -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
if test "$?" != 0; then
  { echo "configure: error: Error outputting confdefs.h" 1>&2; exit 1; }
fi
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
# take arguments), then we branch to the quote section.  Otherwise,
# look for a macro that doesn't take arguments.
cat >confdef2opt.sed <<\_ACEOF
t clear
: clear
s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*([^)]*)\)[ 	]*\(.*\),-D\1=\2,g
t quote
s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\),-D\1=\2,g
t quote
d
: quote
s,[ 	`~#$^&*(){}\\|;'"<>?],\\&,g
s,\[,\\&,g
s,\],\\&,g
s,\$,$$,g
p
_ACEOF
# We use echo to avoid assuming a particular line-breaking character.
# The extra dot is to prevent the shell from consuming trailing
# line-breaks from the sub-command output.  A line-break within
# single-quotes doesn't work because, if this script is created in a
# platform that uses two characters for line-breaks (e.g., DOS), tr
# would break.
ac_LF_and_DOT=`echo; echo .`
DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
rm -f confdef2opt.sed

MOZ_DEFINES=$DEFS

rm -f confdefs.h
mv confdefs.h.save confdefs.h

echo "$ac_t""Creating Python virtualenv" 1>&6
rm -rf _virtualenv
mkdir -p _virtualenv
MACOSX_DEPLOYMENT_TARGET= PYTHONDONTWRITEBYTECODE= $PYTHON $_topsrcdir/other-licenses/virtualenv/virtualenv.py --system-site-packages ./_virtualenv
case "$host_os" in
mingw*)
    PYTHON=`pwd`/_virtualenv/Scripts/python.exe
    ;;
*)
    PYTHON=`pwd`/_virtualenv/bin/python
    ;;
esac



. ${srcdir}/allmakefiles.sh
echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
. ./conftest.sh
rm conftest.sh

echo $MAKEFILES > unallmakefiles

mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null

trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  *ac_space=\ *)
    # `set' does not quote correctly, so add quotes (double-quote substitution
    # turns \\\\ into \\, and sed turns \\ into \).
    sed -n \
      -e "s/'/'\\\\''/g" \
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    ;;
  *)
    # `set' quotes correctly as required by POSIX, so do not add quotes.
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    ;;
  esac >> confcache
if cmp -s $cache_file confcache; then
  :
else
  if test -w $cache_file; then
    echo "updating cache $cache_file"
    cat confcache > $cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "$MAKEFILES netwerk/necko-config.h
xpcom/xpcom-config.h
xpcom/xpcom-private.h
" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF



# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@target@%$target%g
s%@target_alias@%$target_alias%g
s%@target_cpu@%$target_cpu%g
s%@target_vendor@%$target_vendor%g
s%@target_os@%$target_os%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@MOZ_DEB_TIMESTAMP@%$MOZ_DEB_TIMESTAMP%g
s%@AWK@%$AWK%g
s%@CC@%$CC%g
s%@CXX@%$CXX%g
s%@COMPILE_ENVIRONMENT@%$COMPILE_ENVIRONMENT%g
s%@L10NBASEDIR@%$L10NBASEDIR%g
s%@PERL@%$PERL%g
s%@ANDROID_VERSION@%$ANDROID_VERSION%g
s%@OBJCOPY@%$OBJCOPY%g
s%@ANDROID_NDK@%$ANDROID_NDK%g
s%@ANDROID_TOOLCHAIN@%$ANDROID_TOOLCHAIN%g
s%@ANDROID_SOURCE@%$ANDROID_SOURCE%g
s%@ANDROID_PLATFORM@%$ANDROID_PLATFORM%g
s%@ANDROID_SDK@%$ANDROID_SDK%g
s%@ANDROID_PLATFORM_TOOLS@%$ANDROID_PLATFORM_TOOLS%g
s%@ANDROID_PACKAGE_NAME@%$ANDROID_PACKAGE_NAME%g
s%@HOST_CC@%$HOST_CC%g
s%@HOST_CXX@%$HOST_CXX%g
s%@HOST_RANLIB@%$HOST_RANLIB%g
s%@HOST_AR@%$HOST_AR%g
s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
s%@AS@%$AS%g
s%@LD@%$LD%g
s%@STRIP@%$STRIP%g
s%@WINDRES@%$WINDRES%g
s%@CRTDLLVERSION@%$CRTDLLVERSION%g
s%@CRTEXPDLLVERSION@%$CRTEXPDLLVERSION%g
s%@MIDL@%$MIDL%g
s%@MAKEPRI@%$MAKEPRI%g
s%@CPP@%$CPP%g
s%@CXXCPP@%$CXXCPP%g
s%@MIDL_FLAGS@%$MIDL_FLAGS%g
s%@_MSC_VER@%$_MSC_VER%g
s%@GNU_AS@%$GNU_AS%g
s%@GNU_LD@%$GNU_LD%g
s%@GNU_CC@%$GNU_CC%g
s%@GNU_CXX@%$GNU_CXX%g
s%@INTEL_CC@%$INTEL_CC%g
s%@INTEL_CXX@%$INTEL_CXX%g
s%@CLANG_CC@%$CLANG_CC%g
s%@CLANG_CXX@%$CLANG_CXX%g
s%@STL_FLAGS@%$STL_FLAGS%g
s%@WRAP_STL_INCLUDES@%$WRAP_STL_INCLUDES%g
s%@MOZ_MSVC_STL_WRAP__Throw@%$MOZ_MSVC_STL_WRAP__Throw%g
s%@MOZ_MSVC_STL_WRAP__RAISE@%$MOZ_MSVC_STL_WRAP__RAISE%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LN_S@%$LN_S%g
s%@PYTHON@%$PYTHON%g
s%@MOZ_SYSTEM_PLY@%$MOZ_SYSTEM_PLY%g
s%@NSINSTALL_BIN@%$NSINSTALL_BIN%g
s%@DOXYGEN@%$DOXYGEN%g
s%@AUTOCONF@%$AUTOCONF%g
s%@UNZIP@%$UNZIP%g
s%@ZIP@%$ZIP%g
s%@SYSTEM_MAKEDEPEND@%$SYSTEM_MAKEDEPEND%g
s%@XARGS@%$XARGS%g
s%@RPMBUILD@%$RPMBUILD%g
s%@PBBUILD@%$PBBUILD%g
s%@SDP@%$SDP%g
s%@GCC_VERSION@%$GCC_VERSION%g
s%@UNIVERSAL_BINARY@%$UNIVERSAL_BINARY%g
s%@MOZ_CAN_RUN_PROGRAMS@%$MOZ_CAN_RUN_PROGRAMS%g
s%@MACOSX_DEPLOYMENT_TARGET@%$MACOSX_DEPLOYMENT_TARGET%g
s%@MACOS_SDK_DIR@%$MACOS_SDK_DIR%g
s%@NEXT_ROOT@%$NEXT_ROOT%g
s%@MOZ_NO_THEORA_ASM@%$MOZ_NO_THEORA_ASM%g
s%@GMAKE@%$GMAKE%g
s%@X_CFLAGS@%$X_CFLAGS%g
s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_LIBS@%$X_LIBS%g
s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
s%@SOLARIS_SUNPRO_CC@%$SOLARIS_SUNPRO_CC%g
s%@SOLARIS_SUNPRO_CXX@%$SOLARIS_SUNPRO_CXX%g
s%@MOZ_THUMB2@%$MOZ_THUMB2%g
s%@HAVE_ARM_SIMD@%$HAVE_ARM_SIMD%g
s%@HAVE_ARM_NEON@%$HAVE_ARM_NEON%g
s%@STLPORT_SOURCES@%$STLPORT_SOURCES%g
s%@MOZ_ASAN@%$MOZ_ASAN%g
s%@MOZ_NO_WLZDEFS@%$MOZ_NO_WLZDEFS%g
s%@MOZ_CFLAGS_NSS@%$MOZ_CFLAGS_NSS%g
s%@HAVE_COMPILER_FLAG_MSSSE3@%$HAVE_COMPILER_FLAG_MSSSE3%g
s%@HAVE_64BIT_OS@%$HAVE_64BIT_OS%g
s%@MOZ_OS2_HIGH_MEMORY@%$MOZ_OS2_HIGH_MEMORY%g
s%@MOZ_VALGRIND@%$MOZ_VALGRIND%g
s%@MOZ_DMD@%$MOZ_DMD%g
s%@MOZ_CUSTOM_STDINT_H@%$MOZ_CUSTOM_STDINT_H%g
s%@AIX_OBJMODEL@%$AIX_OBJMODEL%g
s%@MOZ_LINKER@%$MOZ_LINKER%g
s%@MOZ_ENABLE_SZIP@%$MOZ_ENABLE_SZIP%g
s%@NO_LD_ARCHIVE_FLAGS@%$NO_LD_ARCHIVE_FLAGS%g
s%@_MOZ_RTTI_FLAGS_ON@%$_MOZ_RTTI_FLAGS_ON%g
s%@WRAP_SYSTEM_INCLUDES@%$WRAP_SYSTEM_INCLUDES%g
s%@VISIBILITY_FLAGS@%$VISIBILITY_FLAGS%g
s%@LD_PRINT_ICF_SECTIONS@%$LD_PRINT_ICF_SECTIONS%g
s%@HAVE_GCC_ALIGN_ARG_POINTER@%$HAVE_GCC_ALIGN_ARG_POINTER%g
s%@HAVE_DTRACE@%$HAVE_DTRACE%g
s%@PKG_CONFIG@%$PKG_CONFIG%g
s%@FT2_CFLAGS@%$FT2_CFLAGS%g
s%@FT2_LIBS@%$FT2_LIBS%g
s%@XCFLAGS@%$XCFLAGS%g
s%@XLDFLAGS@%$XLDFLAGS%g
s%@XLIBS@%$XLIBS%g
s%@XEXT_LIBS@%$XEXT_LIBS%g
s%@XT_LIBS@%$XT_LIBS%g
s%@XSS_LIBS@%$XSS_LIBS%g
s%@LIBOBJS@%$LIBOBJS%g
s%@HAVE_CLOCK_MONOTONIC@%$HAVE_CLOCK_MONOTONIC%g
s%@REALTIME_LIBS@%$REALTIME_LIBS%g
s%@LIBXUL_SDK@%$LIBXUL_SDK%g
s%@LIBXUL_DIST@%$LIBXUL_DIST%g
s%@NSPR_CONFIG@%$NSPR_CONFIG%g
s%@NSPR_CFLAGS@%$NSPR_CFLAGS%g
s%@NSPR_LIBS@%$NSPR_LIBS%g
s%@MOZ_NATIVE_LIBEVENT@%$MOZ_NATIVE_LIBEVENT%g
s%@MOZ_LIBEVENT_INCLUDES@%$MOZ_LIBEVENT_INCLUDES%g
s%@MOZ_LIBEVENT_LIBS@%$MOZ_LIBEVENT_LIBS%g
s%@NSS_CONFIG@%$NSS_CONFIG%g
s%@NSS_CFLAGS@%$NSS_CFLAGS%g
s%@NSS_LIBS@%$NSS_LIBS%g
s%@YASM@%$YASM%g
s%@MOZ_HUNSPELL_CFLAGS@%$MOZ_HUNSPELL_CFLAGS%g
s%@MOZ_HUNSPELL_LIBS@%$MOZ_HUNSPELL_LIBS%g
s%@SYSTEM_HUNSPELL@%$SYSTEM_HUNSPELL%g
s%@MOZ_FFI_CFLAGS@%$MOZ_FFI_CFLAGS%g
s%@MOZ_FFI_LIBS@%$MOZ_FFI_LIBS%g
s%@XULRUNNER_STUB_NAME@%$XULRUNNER_STUB_NAME%g
s%@MOZ_BUILD_APP@%$MOZ_BUILD_APP%g
s%@MOZ_PHOENIX@%$MOZ_PHOENIX%g
s%@MOZ_XULRUNNER@%$MOZ_XULRUNNER%g
s%@MOZ_OLD_LINKER@%$MOZ_OLD_LINKER%g
s%@MOZ_PDF_PRINTING@%$MOZ_PDF_PRINTING%g
s%@MOZ_GTK2_CFLAGS@%$MOZ_GTK2_CFLAGS%g
s%@MOZ_GTK2_LIBS@%$MOZ_GTK2_LIBS%g
s%@MOZ_FS_LAYOUT@%$MOZ_FS_LAYOUT%g
s%@MOZ_STARTUP_NOTIFICATION_CFLAGS@%$MOZ_STARTUP_NOTIFICATION_CFLAGS%g
s%@MOZ_STARTUP_NOTIFICATION_LIBS@%$MOZ_STARTUP_NOTIFICATION_LIBS%g
s%@MOZ_ENABLE_STARTUP_NOTIFICATION@%$MOZ_ENABLE_STARTUP_NOTIFICATION%g
s%@MOZ_QT_CFLAGS@%$MOZ_QT_CFLAGS%g
s%@MOZ_QT_LIBS@%$MOZ_QT_LIBS%g
s%@MOZ_QT5_CFLAGS@%$MOZ_QT5_CFLAGS%g
s%@MOZ_QT5_LIBS@%$MOZ_QT5_LIBS%g
s%@HOST_MOC@%$HOST_MOC%g
s%@HOST_RCC@%$HOST_RCC%g
s%@_QMSYSTEM2_CFLAGS@%$_QMSYSTEM2_CFLAGS%g
s%@_QMSYSTEM2_LIBS@%$_QMSYSTEM2_LIBS%g
s%@_QTNETWORK_CFLAGS@%$_QTNETWORK_CFLAGS%g
s%@_QTNETWORK_LIBS@%$_QTNETWORK_LIBS%g
s%@_QTMOBILITY_CFLAGS@%$_QTMOBILITY_CFLAGS%g
s%@_QTMOBILITY_LIBS@%$_QTMOBILITY_LIBS%g
s%@GTK_CONFIG@%$GTK_CONFIG%g
s%@TK_CFLAGS@%$TK_CFLAGS%g
s%@TK_LIBS@%$TK_LIBS%g
s%@MOZ_ENABLE_GTK2@%$MOZ_ENABLE_GTK2%g
s%@MOZ_ENABLE_QT@%$MOZ_ENABLE_QT%g
s%@MOZ_ENABLE_QTNETWORK@%$MOZ_ENABLE_QTNETWORK%g
s%@MOZ_ENABLE_QMSYSTEM2@%$MOZ_ENABLE_QMSYSTEM2%g
s%@MOZ_ENABLE_QTMOBILITY@%$MOZ_ENABLE_QTMOBILITY%g
s%@MOZ_ENABLE_XREMOTE@%$MOZ_ENABLE_XREMOTE%g
s%@MOC@%$MOC%g
s%@RCC@%$RCC%g
s%@MOZ_X11@%$MOZ_X11%g
s%@MOZ_UI_LOCALE@%$MOZ_UI_LOCALE%g
s%@MOZ_OFFICIAL_BRANDING@%$MOZ_OFFICIAL_BRANDING%g
s%@MOZ_BRANDING_DIRECTORY@%$MOZ_BRANDING_DIRECTORY%g
s%@MOZ_DISTRIBUTION_ID@%$MOZ_DISTRIBUTION_ID%g
s%@MOZ_PANGO@%$MOZ_PANGO%g
s%@_PANGOCHK_CFLAGS@%$_PANGOCHK_CFLAGS%g
s%@_PANGOCHK_LIBS@%$_PANGOCHK_LIBS%g
s%@MOZ_PANGO_CFLAGS@%$MOZ_PANGO_CFLAGS%g
s%@MOZ_PANGO_LIBS@%$MOZ_PANGO_LIBS%g
s%@MOZ_GNOMEVFS_CFLAGS@%$MOZ_GNOMEVFS_CFLAGS%g
s%@MOZ_GNOMEVFS_LIBS@%$MOZ_GNOMEVFS_LIBS%g
s%@MOZ_ENABLE_GNOMEVFS@%$MOZ_ENABLE_GNOMEVFS%g
s%@_GTKCHECK_CFLAGS@%$_GTKCHECK_CFLAGS%g
s%@_GTKCHECK_LIBS@%$_GTKCHECK_LIBS%g
s%@MOZ_GIO_CFLAGS@%$MOZ_GIO_CFLAGS%g
s%@MOZ_GIO_LIBS@%$MOZ_GIO_LIBS%g
s%@MOZ_ENABLE_GIO@%$MOZ_ENABLE_GIO%g
s%@MOZ_GCONF_CFLAGS@%$MOZ_GCONF_CFLAGS%g
s%@MOZ_GCONF_LIBS@%$MOZ_GCONF_LIBS%g
s%@MOZ_ENABLE_GCONF@%$MOZ_ENABLE_GCONF%g
s%@MOZ_LIBPROXY_CFLAGS@%$MOZ_LIBPROXY_CFLAGS%g
s%@MOZ_LIBPROXY_LIBS@%$MOZ_LIBPROXY_LIBS%g
s%@MOZ_ENABLE_LIBPROXY@%$MOZ_ENABLE_LIBPROXY%g
s%@MOZ_LIBNOTIFY_CFLAGS@%$MOZ_LIBNOTIFY_CFLAGS%g
s%@MOZ_LIBNOTIFY_LIBS@%$MOZ_LIBNOTIFY_LIBS%g
s%@MOZ_ENABLE_LIBNOTIFY@%$MOZ_ENABLE_LIBNOTIFY%g
s%@MOZ_ENABLE_GNOME_COMPONENT@%$MOZ_ENABLE_GNOME_COMPONENT%g
s%@MOZ_GNOMEUI_CFLAGS@%$MOZ_GNOMEUI_CFLAGS%g
s%@MOZ_GNOMEUI_LIBS@%$MOZ_GNOMEUI_LIBS%g
s%@MOZ_ENABLE_GNOMEUI@%$MOZ_ENABLE_GNOMEUI%g
s%@MOZ_DBUS_CFLAGS@%$MOZ_DBUS_CFLAGS%g
s%@MOZ_DBUS_LIBS@%$MOZ_DBUS_LIBS%g
s%@MOZ_DBUS_GLIB_CFLAGS@%$MOZ_DBUS_GLIB_CFLAGS%g
s%@MOZ_DBUS_GLIB_LIBS@%$MOZ_DBUS_GLIB_LIBS%g
s%@MOZ_ENABLE_DBUS@%$MOZ_ENABLE_DBUS%g
s%@MOZ_IPDL_TESTS@%$MOZ_IPDL_TESTS%g
s%@MOZ_RAW@%$MOZ_RAW%g
s%@LIBVPX_CFLAGS@%$LIBVPX_CFLAGS%g
s%@LIBVPX_LIBS@%$LIBVPX_LIBS%g
s%@MOZ_NATIVE_LIBVPX@%$MOZ_NATIVE_LIBVPX%g
s%@MOZ_LIBVPX_INCLUDES@%$MOZ_LIBVPX_INCLUDES%g
s%@MOZ_LIBVPX_LIBS@%$MOZ_LIBVPX_LIBS%g
s%@MOZ_ALSA_CFLAGS@%$MOZ_ALSA_CFLAGS%g
s%@MOZ_ALSA_LIBS@%$MOZ_ALSA_LIBS%g
s%@GSTREAMER_CFLAGS@%$GSTREAMER_CFLAGS%g
s%@GSTREAMER_LIBS@%$GSTREAMER_LIBS%g
s%@MOZ_GSTREAMER@%$MOZ_GSTREAMER%g
s%@JAVA@%$JAVA%g
s%@JAVAC@%$JAVAC%g
s%@JAR@%$JAR%g
s%@MOZ_GTHREAD_CFLAGS@%$MOZ_GTHREAD_CFLAGS%g
s%@MOZ_GTHREAD_LIBS@%$MOZ_GTHREAD_LIBS%g
s%@LIBJPEG_TURBO_AS@%$LIBJPEG_TURBO_AS%g
s%@MOZ_TREE_FREETYPE@%$MOZ_TREE_FREETYPE%g
s%@CAIRO_FT_CFLAGS@%$CAIRO_FT_CFLAGS%g
s%@MAKENSISU@%$MAKENSISU%g
s%@MOZ_WEBAPP_RUNTIME@%$MOZ_WEBAPP_RUNTIME%g
s%@TAR@%$TAR%g
s%@WGET@%$WGET%g
s%@MOZ_UPDATE_CHANNEL@%$MOZ_UPDATE_CHANNEL%g
s%@MOZ_UPDATE_PACKAGING@%$MOZ_UPDATE_PACKAGING%g
s%@MOZ_DISABLE_PARENTAL_CONTROLS@%$MOZ_DISABLE_PARENTAL_CONTROLS%g
s%@SQLITE_CFLAGS@%$SQLITE_CFLAGS%g
s%@SQLITE_LIBS@%$SQLITE_LIBS%g
s%@MOZ_NATIVE_SQLITE@%$MOZ_NATIVE_SQLITE%g
s%@MOZ_SAFE_BROWSING@%$MOZ_SAFE_BROWSING%g
s%@MOZ_URL_CLASSIFIER@%$MOZ_URL_CLASSIFIER%g
s%@MOZ_ZIPWRITER@%$MOZ_ZIPWRITER%g
s%@LIBCONIC_CFLAGS@%$LIBCONIC_CFLAGS%g
s%@LIBCONIC_LIBS@%$LIBCONIC_LIBS%g
s%@MOZ_ENABLE_LIBCONIC@%$MOZ_ENABLE_LIBCONIC%g
s%@XCOMPOSITE_LIBS@%$XCOMPOSITE_LIBS%g
s%@LIBHILDONMIME_CFLAGS@%$LIBHILDONMIME_CFLAGS%g
s%@LIBHILDONMIME_LIBS@%$LIBHILDONMIME_LIBS%g
s%@LIBOSSO_CFLAGS@%$LIBOSSO_CFLAGS%g
s%@LIBOSSO_LIBS@%$LIBOSSO_LIBS%g
s%@LIBHILDONFM_CFLAGS@%$LIBHILDONFM_CFLAGS%g
s%@LIBHILDONFM_LIBS@%$LIBHILDONFM_LIBS%g
s%@LIBCONTENTMANAGER_CFLAGS@%$LIBCONTENTMANAGER_CFLAGS%g
s%@LIBCONTENTMANAGER_LIBS@%$LIBCONTENTMANAGER_LIBS%g
s%@MOZ_ENABLE_CONTENTMANAGER@%$MOZ_ENABLE_CONTENTMANAGER%g
s%@LIBCONTENTACTION_CFLAGS@%$LIBCONTENTACTION_CFLAGS%g
s%@LIBCONTENTACTION_LIBS@%$LIBCONTENTACTION_LIBS%g
s%@MOZ_ENABLE_CONTENTACTION@%$MOZ_ENABLE_CONTENTACTION%g
s%@MOZ_MEEGOTOUCH_CFLAGS@%$MOZ_MEEGOTOUCH_CFLAGS%g
s%@MOZ_MEEGOTOUCH_LIBS@%$MOZ_MEEGOTOUCH_LIBS%g
s%@LIBLOCATION_CFLAGS@%$LIBLOCATION_CFLAGS%g
s%@LIBLOCATION_LIBS@%$LIBLOCATION_LIBS%g
s%@MOZ_MAEMO_LIBLOCATION@%$MOZ_MAEMO_LIBLOCATION%g
s%@LIBMEEGOTOUCHSHARE_CFLAGS@%$LIBMEEGOTOUCHSHARE_CFLAGS%g
s%@LIBMEEGOTOUCHSHARE_LIBS@%$LIBMEEGOTOUCHSHARE_LIBS%g
s%@MOZ_ENABLE_MEEGOTOUCHSHARE@%$MOZ_ENABLE_MEEGOTOUCHSHARE%g
s%@MOZ_PLATFORM_MAEMO_LIBS@%$MOZ_PLATFORM_MAEMO_LIBS%g
s%@MOZ_PLATFORM_MAEMO_CFLAGS@%$MOZ_PLATFORM_MAEMO_CFLAGS%g
s%@MOZ_EGL_XRENDER_COMPOSITE@%$MOZ_EGL_XRENDER_COMPOSITE%g
s%@MOZ_GL_PROVIDER@%$MOZ_GL_PROVIDER%g
s%@MOZ_GL_DEFAULT_PROVIDER@%$MOZ_GL_DEFAULT_PROVIDER%g
s%@MOZ_THEME_FASTSTRIPE@%$MOZ_THEME_FASTSTRIPE%g
s%@MOZ_GFX_OPTIMIZE_MOBILE@%$MOZ_GFX_OPTIMIZE_MOBILE%g
s%@MOZ_OPTIMIZE@%$MOZ_OPTIMIZE%g
s%@MOZ_FRAMEPTR_FLAGS@%$MOZ_FRAMEPTR_FLAGS%g
s%@MOZ_OPTIMIZE_FLAGS@%$MOZ_OPTIMIZE_FLAGS%g
s%@MOZ_OPTIMIZE_LDFLAGS@%$MOZ_OPTIMIZE_LDFLAGS%g
s%@MOZ_ALLOW_HEAP_EXECUTE_FLAGS@%$MOZ_ALLOW_HEAP_EXECUTE_FLAGS%g
s%@MOZ_OPTIMIZE_SIZE_TWEAK@%$MOZ_OPTIMIZE_SIZE_TWEAK%g
s%@MOZ_PGO_OPTIMIZE_FLAGS@%$MOZ_PGO_OPTIMIZE_FLAGS%g
s%@NS_TRACE_MALLOC@%$NS_TRACE_MALLOC%g
s%@MOZ_MEMORY@%$MOZ_MEMORY%g
s%@MOZ_GLUE_LDFLAGS@%$MOZ_GLUE_LDFLAGS%g
s%@MOZ_GLUE_PROGRAM_LDFLAGS@%$MOZ_GLUE_PROGRAM_LDFLAGS%g
s%@WIN32_CRT_LIBS@%$WIN32_CRT_LIBS%g
s%@DLLFLAGS@%$DLLFLAGS%g
s%@CCACHE@%$CCACHE%g
s%@DEHYDRA_PATH@%$DEHYDRA_PATH%g
s%@STDCXX_COMPAT@%$STDCXX_COMPAT%g
s%@MOZ_LIBSTDCXX_TARGET_VERSION@%$MOZ_LIBSTDCXX_TARGET_VERSION%g
s%@MOZ_LIBSTDCXX_HOST_VERSION@%$MOZ_LIBSTDCXX_HOST_VERSION%g
s%@MOZ_B2G_RIL@%$MOZ_B2G_RIL%g
s%@MOZ_B2G_BT@%$MOZ_B2G_BT%g
s%@MOZ_DEMANGLE_SYMBOLS@%$MOZ_DEMANGLE_SYMBOLS%g
s%@OMNIJAR_NAME@%$OMNIJAR_NAME%g
s%@MOZ_OMNIJAR@%$MOZ_OMNIJAR%g
s%@MOZ_DOC_INPUT_DIRS@%$MOZ_DOC_INPUT_DIRS%g
s%@MOZ_DOC_INCLUDE_DIRS@%$MOZ_DOC_INCLUDE_DIRS%g
s%@MOZ_DOC_OUTPUT_DIR@%$MOZ_DOC_OUTPUT_DIR%g
s%@PROFILE_GEN_CFLAGS@%$PROFILE_GEN_CFLAGS%g
s%@PROFILE_GEN_LDFLAGS@%$PROFILE_GEN_LDFLAGS%g
s%@PROFILE_USE_CFLAGS@%$PROFILE_USE_CFLAGS%g
s%@PROFILE_USE_LDFLAGS@%$PROFILE_USE_LDFLAGS%g
s%@LIBS_DESC_SUFFIX@%$LIBS_DESC_SUFFIX%g
s%@EXPAND_LIBS_LIST_STYLE@%$EXPAND_LIBS_LIST_STYLE%g
s%@EXPAND_LIBS_ORDER_STYLE@%$EXPAND_LIBS_ORDER_STYLE%g
s%@CL_INCLUDES_PREFIX@%$CL_INCLUDES_PREFIX%g
s%@MOZ_AUTO_DEPS@%$MOZ_AUTO_DEPS%g
s%@COMPILER_DEPEND@%$COMPILER_DEPEND%g
s%@MDDEPDIR@%$MDDEPDIR%g
s%@CC_WRAPPER@%$CC_WRAPPER%g
s%@CXX_WRAPPER@%$CXX_WRAPPER%g
s%@JS_SHARED_LIBRARY@%$JS_SHARED_LIBRARY%g
s%@LIBXUL_LIBS@%$LIBXUL_LIBS%g
s%@GLIB_CFLAGS@%$GLIB_CFLAGS%g
s%@GLIB_LIBS@%$GLIB_LIBS%g
s%@GLIB_GMODULE_LIBS@%$GLIB_GMODULE_LIBS%g
s%@PIXMAN_CFLAGS@%$PIXMAN_CFLAGS%g
s%@PIXMAN_LIBS@%$PIXMAN_LIBS%g
s%@MOZ_PIXMAN_CFLAGS@%$MOZ_PIXMAN_CFLAGS%g
s%@MOZ_PIXMAN_LIBS@%$MOZ_PIXMAN_LIBS%g
s%@MOZ_ENABLE_CAIRO_FT@%$MOZ_ENABLE_CAIRO_FT%g
s%@MOZ_ENABLE_DWRITE_FONT@%$MOZ_ENABLE_DWRITE_FONT%g
s%@MOZ_ENABLE_D2D_SURFACE@%$MOZ_ENABLE_D2D_SURFACE%g
s%@MOZ_ENABLE_D3D9_LAYER@%$MOZ_ENABLE_D3D9_LAYER%g
s%@MOZ_ENABLE_D3D10_LAYER@%$MOZ_ENABLE_D3D10_LAYER%g
s%@PS_SURFACE_FEATURE@%$PS_SURFACE_FEATURE%g
s%@PDF_SURFACE_FEATURE@%$PDF_SURFACE_FEATURE%g
s%@SVG_SURFACE_FEATURE@%$SVG_SURFACE_FEATURE%g
s%@XLIB_SURFACE_FEATURE@%$XLIB_SURFACE_FEATURE%g
s%@XLIB_XRENDER_SURFACE_FEATURE@%$XLIB_XRENDER_SURFACE_FEATURE%g
s%@QUARTZ_SURFACE_FEATURE@%$QUARTZ_SURFACE_FEATURE%g
s%@QUARTZ_IMAGE_SURFACE_FEATURE@%$QUARTZ_IMAGE_SURFACE_FEATURE%g
s%@WIN32_SURFACE_FEATURE@%$WIN32_SURFACE_FEATURE%g
s%@OS2_SURFACE_FEATURE@%$OS2_SURFACE_FEATURE%g
s%@DIRECTFB_SURFACE_FEATURE@%$DIRECTFB_SURFACE_FEATURE%g
s%@FT_FONT_FEATURE@%$FT_FONT_FEATURE%g
s%@FC_FONT_FEATURE@%$FC_FONT_FEATURE%g
s%@WIN32_FONT_FEATURE@%$WIN32_FONT_FEATURE%g
s%@WIN32_DWRITE_FONT_FEATURE@%$WIN32_DWRITE_FONT_FEATURE%g
s%@WIN32_D2D_SURFACE_FEATURE@%$WIN32_D2D_SURFACE_FEATURE%g
s%@QUARTZ_FONT_FEATURE@%$QUARTZ_FONT_FEATURE%g
s%@PNG_FUNCTIONS_FEATURE@%$PNG_FUNCTIONS_FEATURE%g
s%@QT_SURFACE_FEATURE@%$QT_SURFACE_FEATURE%g
s%@TEE_SURFACE_FEATURE@%$TEE_SURFACE_FEATURE%g
s%@CAIRO_CFLAGS@%$CAIRO_CFLAGS%g
s%@CAIRO_LIBS@%$CAIRO_LIBS%g
s%@CAIRO_TEE_CFLAGS@%$CAIRO_TEE_CFLAGS%g
s%@CAIRO_TEE_LIBS@%$CAIRO_TEE_LIBS%g
s%@CAIRO_XRENDER_CFLAGS@%$CAIRO_XRENDER_CFLAGS%g
s%@CAIRO_XRENDER_LIBS@%$CAIRO_XRENDER_LIBS%g
s%@MOZ_TREE_CAIRO@%$MOZ_TREE_CAIRO%g
s%@MOZ_CAIRO_CFLAGS@%$MOZ_CAIRO_CFLAGS%g
s%@MOZ_CAIRO_LIBS@%$MOZ_CAIRO_LIBS%g
s%@MOZ_CAIRO_OSLIBS@%$MOZ_CAIRO_OSLIBS%g
s%@MOZ_TREE_PIXMAN@%$MOZ_TREE_PIXMAN%g
s%@QCMS_LIBS@%$QCMS_LIBS%g
s%@MOZ_HARFBUZZ_LIBS@%$MOZ_HARFBUZZ_LIBS%g
s%@MOZ_GRAPHITE@%$MOZ_GRAPHITE%g
s%@MOZ_GRAPHITE_LIBS@%$MOZ_GRAPHITE_LIBS%g
s%@MOZ_OTS_LIBS@%$MOZ_OTS_LIBS%g
s%@MOZ_ENABLE_SKIA@%$MOZ_ENABLE_SKIA%g
s%@MOZ_SKIA_LIBS@%$MOZ_SKIA_LIBS%g
s%@MOZ_XUL@%$MOZ_XUL%g
s%@NECKO_PROTOCOLS@%$NECKO_PROTOCOLS%g
s%@NECKO_WIFI@%$NECKO_WIFI%g
s%@NECKO_COOKIES@%$NECKO_COOKIES%g
s%@BUILD_CTYPES@%$BUILD_CTYPES%g
s%@MOZ_SERVICES_SYNC@%$MOZ_SERVICES_SYNC%g
s%@AR_FLAGS@%$AR_FLAGS%g
s%@AR_LIST@%$AR_LIST%g
s%@AR_EXTRACT@%$AR_EXTRACT%g
s%@AR_DELETE@%$AR_DELETE%g
s%@ASFLAGS@%$ASFLAGS%g
s%@AS_DASH_C_FLAG@%$AS_DASH_C_FLAG%g
s%@RC@%$RC%g
s%@RCFLAGS@%$RCFLAGS%g
s%@MC@%$MC%g
s%@IMPLIB@%$IMPLIB%g
s%@FILTER@%$FILTER%g
s%@BIN_FLAGS@%$BIN_FLAGS%g
s%@MOZ_WIDGET_TOOLKIT@%$MOZ_WIDGET_TOOLKIT%g
s%@MOZ_UPDATE_XTERM@%$MOZ_UPDATE_XTERM%g
s%@MOZ_PLATFORM_MAEMO@%$MOZ_PLATFORM_MAEMO%g
s%@MOZ_AUTH_EXTENSION@%$MOZ_AUTH_EXTENSION%g
s%@MOZ_PERMISSIONS@%$MOZ_PERMISSIONS%g
s%@MOZ_XTF@%$MOZ_XTF%g
s%@MOZ_PREF_EXTENSIONS@%$MOZ_PREF_EXTENSIONS%g
s%@MOZ_JS_LIBS@%$MOZ_JS_LIBS%g
s%@MOZ_PSM@%$MOZ_PSM%g
s%@MOZ_DEBUG@%$MOZ_DEBUG%g
s%@MOZ_DEBUG_SYMBOLS@%$MOZ_DEBUG_SYMBOLS%g
s%@MOZ_DEBUG_ENABLE_DEFS@%$MOZ_DEBUG_ENABLE_DEFS%g
s%@MOZ_DEBUG_DISABLE_DEFS@%$MOZ_DEBUG_DISABLE_DEFS%g
s%@MOZ_DEBUG_FLAGS@%$MOZ_DEBUG_FLAGS%g
s%@MOZ_DEBUG_LDFLAGS@%$MOZ_DEBUG_LDFLAGS%g
s%@WARNINGS_AS_ERRORS@%$WARNINGS_AS_ERRORS%g
s%@MOZ_EXTENSIONS@%$MOZ_EXTENSIONS%g
s%@MOZ_JSDEBUGGER@%$MOZ_JSDEBUGGER%g
s%@MOZ_LOG_REFCNT@%$MOZ_LOG_REFCNT%g
s%@MOZ_ENABLE_PROFILER_SPS@%$MOZ_ENABLE_PROFILER_SPS%g
s%@MOZ_JPROF@%$MOZ_JPROF%g
s%@MOZ_SHARK@%$MOZ_SHARK%g
s%@MOZ_CALLGRIND@%$MOZ_CALLGRIND%g
s%@MOZ_VTUNE@%$MOZ_VTUNE%g
s%@MOZ_ETW@%$MOZ_ETW%g
s%@MOZ_PROFILING@%$MOZ_PROFILING%g
s%@MOZ_QUANTIFY@%$MOZ_QUANTIFY%g
s%@LIBICONV@%$LIBICONV%g
s%@MOZ_PLACES@%$MOZ_PLACES%g
s%@MOZ_TOOLKIT_SEARCH@%$MOZ_TOOLKIT_SEARCH%g
s%@MOZ_FEEDS@%$MOZ_FEEDS%g
s%@NS_PRINTING@%$NS_PRINTING%g
s%@MOZ_WEBGL@%$MOZ_WEBGL%g
s%@MOZ_HELP_VIEWER@%$MOZ_HELP_VIEWER%g
s%@MOZ_PROFILELOCKING@%$MOZ_PROFILELOCKING%g
s%@ENABLE_TESTS@%$ENABLE_TESTS%g
s%@ENABLE_MARIONETTE@%$ENABLE_MARIONETTE%g
s%@IBMBIDI@%$IBMBIDI%g
s%@MOZ_UNIVERSALCHARDET@%$MOZ_UNIVERSALCHARDET%g
s%@ACCESSIBILITY@%$ACCESSIBILITY%g
s%@MOZ_SPELLCHECK@%$MOZ_SPELLCHECK%g
s%@MOZ_JAVA_COMPOSITOR@%$MOZ_JAVA_COMPOSITOR%g
s%@MOZ_ONLY_TOUCH_EVENTS@%$MOZ_ONLY_TOUCH_EVENTS%g
s%@MOZ_USER_DIR@%$MOZ_USER_DIR%g
s%@MOZ_CRASHREPORTER@%$MOZ_CRASHREPORTER%g
s%@MOZ_CRASHREPORTER_INJECTOR@%$MOZ_CRASHREPORTER_INJECTOR%g
s%@MOZ_MAINTENANCE_SERVICE@%$MOZ_MAINTENANCE_SERVICE%g
s%@MOZ_VERIFY_MAR_SIGNATURE@%$MOZ_VERIFY_MAR_SIGNATURE%g
s%@MOZ_ENABLE_SIGNMAR@%$MOZ_ENABLE_SIGNMAR%g
s%@MOZ_UPDATER@%$MOZ_UPDATER%g
s%@MOZ_ANGLE@%$MOZ_ANGLE%g
s%@MOZ_DIRECTX_SDK_PATH@%$MOZ_DIRECTX_SDK_PATH%g
s%@MOZ_DIRECTX_SDK_CPU_SUFFIX@%$MOZ_DIRECTX_SDK_CPU_SUFFIX%g
s%@MOZ_D3DX9_VERSION@%$MOZ_D3DX9_VERSION%g
s%@MOZ_D3DX9_CAB@%$MOZ_D3DX9_CAB%g
s%@MOZ_D3DCOMPILER_CAB@%$MOZ_D3DCOMPILER_CAB%g
s%@MOZ_D3DX9_DLL@%$MOZ_D3DX9_DLL%g
s%@MOZ_D3DCOMPILER_DLL@%$MOZ_D3DCOMPILER_DLL%g
s%@MOZ_METRO@%$MOZ_METRO%g
s%@MOZ_ANDROID_HISTORY@%$MOZ_ANDROID_HISTORY%g
s%@MOZ_WEBSMS_BACKEND@%$MOZ_WEBSMS_BACKEND%g
s%@ENABLE_STRIP@%$ENABLE_STRIP%g
s%@PKG_SKIP_STRIP@%$PKG_SKIP_STRIP%g
s%@STRIP_FLAGS@%$STRIP_FLAGS%g
s%@USE_ELF_DYNSTR_GC@%$USE_ELF_DYNSTR_GC%g
s%@USE_ELF_HACK@%$USE_ELF_HACK%g
s%@INCREMENTAL_LINKER@%$INCREMENTAL_LINKER%g
s%@MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@%$MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS%g
s%@MOZ_COMPONENT_NSPR_LIBS@%$MOZ_COMPONENT_NSPR_LIBS%g
s%@MOZ_FIX_LINK_PATHS@%$MOZ_FIX_LINK_PATHS%g
s%@XPCOM_LIBS@%$XPCOM_LIBS%g
s%@XPCOM_FROZEN_LDOPTS@%$XPCOM_FROZEN_LDOPTS%g
s%@XPCOM_GLUE_LDOPTS@%$XPCOM_GLUE_LDOPTS%g
s%@XPCOM_STANDALONE_GLUE_LDOPTS@%$XPCOM_STANDALONE_GLUE_LDOPTS%g
s%@XPCOM_STATICRUNTIME_GLUE_LDOPTS@%$XPCOM_STATICRUNTIME_GLUE_LDOPTS%g
s%@XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS@%$XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS%g
s%@USE_DEPENDENT_LIBS@%$USE_DEPENDENT_LIBS%g
s%@MOZ_BUILD_ROOT@%$MOZ_BUILD_ROOT%g
s%@MOZ_OS2_TOOLS@%$MOZ_OS2_TOOLS%g
s%@MOZ_POST_DSO_LIB_COMMAND@%$MOZ_POST_DSO_LIB_COMMAND%g
s%@MOZ_POST_PROGRAM_COMMAND@%$MOZ_POST_PROGRAM_COMMAND%g
s%@MOZ_LINKER_EXTRACT@%$MOZ_LINKER_EXTRACT%g
s%@MOZ_MACBUNDLE_NAME@%$MOZ_MACBUNDLE_NAME%g
s%@MOZ_MACBUNDLE_ID@%$MOZ_MACBUNDLE_ID%g
s%@MOZ_APP_NAME@%$MOZ_APP_NAME%g
s%@MOZ_APP_DISPLAYNAME@%$MOZ_APP_DISPLAYNAME%g
s%@MOZ_APP_BASENAME@%$MOZ_APP_BASENAME%g
s%@MOZ_APP_VENDOR@%$MOZ_APP_VENDOR%g
s%@MOZ_APP_PROFILE@%$MOZ_APP_PROFILE%g
s%@MOZ_APP_ID@%$MOZ_APP_ID%g
s%@MAR_CHANNEL_ID@%$MAR_CHANNEL_ID%g
s%@ACCEPTED_MAR_CHANNEL_IDS@%$ACCEPTED_MAR_CHANNEL_IDS%g
s%@MOZ_PROFILE_MIGRATOR@%$MOZ_PROFILE_MIGRATOR%g
s%@MOZ_EXTENSION_MANAGER@%$MOZ_EXTENSION_MANAGER%g
s%@MOZ_APP_UA_NAME@%$MOZ_APP_UA_NAME%g
s%@MOZ_APP_VERSION@%$MOZ_APP_VERSION%g
s%@MOZ_APP_MAXVERSION@%$MOZ_APP_MAXVERSION%g
s%@FIREFOX_VERSION@%$FIREFOX_VERSION%g
s%@MOZ_UA_BUILDID@%$MOZ_UA_BUILDID%g
s%@MOZ_APP_STATIC_INI@%$MOZ_APP_STATIC_INI%g
s%@MOZ_PKG_SPECIAL@%$MOZ_PKG_SPECIAL%g
s%@MOZILLA_OFFICIAL@%$MOZILLA_OFFICIAL%g
s%@MOZ_MAPINFO@%$MOZ_MAPINFO%g
s%@MOZ_BROWSE_INFO@%$MOZ_BROWSE_INFO%g
s%@MOZ_TOOLS_DIR@%$MOZ_TOOLS_DIR%g
s%@WIN32_REDIST_DIR@%$WIN32_REDIST_DIR%g
s%@SYSTEM_LIBXUL@%$SYSTEM_LIBXUL%g
s%@SYSTEM_JPEG@%$SYSTEM_JPEG%g
s%@SYSTEM_PNG@%$SYSTEM_PNG%g
s%@SYSTEM_ZLIB@%$SYSTEM_ZLIB%g
s%@SYSTEM_BZ2@%$SYSTEM_BZ2%g
s%@JPEG_CFLAGS@%$JPEG_CFLAGS%g
s%@JPEG_LIBS@%$JPEG_LIBS%g
s%@ZLIB_CFLAGS@%$ZLIB_CFLAGS%g
s%@ZLIB_LIBS@%$ZLIB_LIBS%g
s%@BZ2_CFLAGS@%$BZ2_CFLAGS%g
s%@BZ2_LIBS@%$BZ2_LIBS%g
s%@PNG_CFLAGS@%$PNG_CFLAGS%g
s%@PNG_LIBS@%$PNG_LIBS%g
s%@MOZ_FLEXBOX@%$MOZ_FLEXBOX%g
s%@MOZ_JPEG_CFLAGS@%$MOZ_JPEG_CFLAGS%g
s%@MOZ_JPEG_LIBS@%$MOZ_JPEG_LIBS%g
s%@MOZ_ZLIB_CFLAGS@%$MOZ_ZLIB_CFLAGS%g
s%@MOZ_ZLIB_LIBS@%$MOZ_ZLIB_LIBS%g
s%@MOZ_BZ2_CFLAGS@%$MOZ_BZ2_CFLAGS%g
s%@MOZ_BZ2_LIBS@%$MOZ_BZ2_LIBS%g
s%@MOZ_PNG_CFLAGS@%$MOZ_PNG_CFLAGS%g
s%@MOZ_PNG_LIBS@%$MOZ_PNG_LIBS%g
s%@MOZ_NATIVE_NSPR@%$MOZ_NATIVE_NSPR%g
s%@NSS_DEP_LIBS@%$NSS_DEP_LIBS%g
s%@MOZ_NATIVE_NSS@%$MOZ_NATIVE_NSS%g
s%@NSS_DISABLE_DBM@%$NSS_DISABLE_DBM%g
s%@COMPILE_CFLAGS@%$COMPILE_CFLAGS%g
s%@COMPILE_CXXFLAGS@%$COMPILE_CXXFLAGS%g
s%@CROSS_COMPILE@%$CROSS_COMPILE%g
s%@WCHAR_CFLAGS@%$WCHAR_CFLAGS%g
s%@HOST_CFLAGS@%$HOST_CFLAGS%g
s%@HOST_CXXFLAGS@%$HOST_CXXFLAGS%g
s%@HOST_LDFLAGS@%$HOST_LDFLAGS%g
s%@HOST_OPTIMIZE_FLAGS@%$HOST_OPTIMIZE_FLAGS%g
s%@HOST_AR_FLAGS@%$HOST_AR_FLAGS%g
s%@HOST_LD@%$HOST_LD%g
s%@HOST_NSPR_MDCPUCFG@%$HOST_NSPR_MDCPUCFG%g
s%@HOST_BIN_SUFFIX@%$HOST_BIN_SUFFIX%g
s%@HOST_OS_ARCH@%$HOST_OS_ARCH%g
s%@TARGET_CPU@%$TARGET_CPU%g
s%@TARGET_VENDOR@%$TARGET_VENDOR%g
s%@TARGET_OS@%$TARGET_OS%g
s%@TARGET_NSPR_MDCPUCFG@%$TARGET_NSPR_MDCPUCFG%g
s%@TARGET_MD_ARCH@%$TARGET_MD_ARCH%g
s%@TARGET_XPCOM_ABI@%$TARGET_XPCOM_ABI%g
s%@OS_TARGET@%$OS_TARGET%g
s%@OS_ARCH@%$OS_ARCH%g
s%@OS_RELEASE@%$OS_RELEASE%g
s%@OS_TEST@%$OS_TEST%g
s%@CPU_ARCH@%$CPU_ARCH%g
s%@INTEL_ARCHITECTURE@%$INTEL_ARCHITECTURE%g
s%@MOZ_DISABLE_JAR_PACKAGING@%$MOZ_DISABLE_JAR_PACKAGING%g
s%@MOZ_CHROME_FILE_FORMAT@%$MOZ_CHROME_FILE_FORMAT%g
s%@WRAP_LDFLAGS@%$WRAP_LDFLAGS%g
s%@MKSHLIB@%$MKSHLIB%g
s%@MKCSHLIB@%$MKCSHLIB%g
s%@MKSHLIB_FORCE_ALL@%$MKSHLIB_FORCE_ALL%g
s%@MKSHLIB_UNFORCE_ALL@%$MKSHLIB_UNFORCE_ALL%g
s%@DSO_CFLAGS@%$DSO_CFLAGS%g
s%@DSO_PIC_CFLAGS@%$DSO_PIC_CFLAGS%g
s%@DSO_LDOPTS@%$DSO_LDOPTS%g
s%@LIB_PREFIX@%$LIB_PREFIX%g
s%@DLL_PREFIX@%$DLL_PREFIX%g
s%@DLL_SUFFIX@%$DLL_SUFFIX%g
s%@LIB_SUFFIX@%$LIB_SUFFIX%g
s%@OBJ_SUFFIX@%$OBJ_SUFFIX%g
s%@BIN_SUFFIX@%$BIN_SUFFIX%g
s%@ASM_SUFFIX@%$ASM_SUFFIX%g
s%@IMPORT_LIB_SUFFIX@%$IMPORT_LIB_SUFFIX%g
s%@USE_N32@%$USE_N32%g
s%@CC_VERSION@%$CC_VERSION%g
s%@CXX_VERSION@%$CXX_VERSION%g
s%@MSMANIFEST_TOOL@%$MSMANIFEST_TOOL%g
s%@NS_ENABLE_TSF@%$NS_ENABLE_TSF%g
s%@MOZ_NSS_PATCH@%$MOZ_NSS_PATCH%g
s%@MOZ_APP_COMPONENT_LIBS@%$MOZ_APP_COMPONENT_LIBS%g
s%@MOZ_APP_EXTRA_LIBS@%$MOZ_APP_EXTRA_LIBS%g
s%@MOZ_MEDIA@%$MOZ_MEDIA%g
s%@MOZ_SYDNEYAUDIO@%$MOZ_SYDNEYAUDIO%g
s%@MOZ_SPEEX_RESAMPLER@%$MOZ_SPEEX_RESAMPLER%g
s%@MOZ_CUBEB@%$MOZ_CUBEB%g
s%@MOZ_WAVE@%$MOZ_WAVE%g
s%@MOZ_VORBIS@%$MOZ_VORBIS%g
s%@MOZ_TREMOR@%$MOZ_TREMOR%g
s%@MOZ_OPUS@%$MOZ_OPUS%g
s%@MOZ_WEBM@%$MOZ_WEBM%g
s%@MOZ_MEDIA_PLUGINS@%$MOZ_MEDIA_PLUGINS%g
s%@MOZ_OMX_PLUGIN@%$MOZ_OMX_PLUGIN%g
s%@MOZ_VP8_ERROR_CONCEALMENT@%$MOZ_VP8_ERROR_CONCEALMENT%g
s%@MOZ_VP8_ENCODER@%$MOZ_VP8_ENCODER%g
s%@MOZ_OGG@%$MOZ_OGG%g
s%@VPX_AS@%$VPX_AS%g
s%@VPX_ASFLAGS@%$VPX_ASFLAGS%g
s%@VPX_DASH_C_FLAG@%$VPX_DASH_C_FLAG%g
s%@VPX_AS_CONVERSION@%$VPX_AS_CONVERSION%g
s%@VPX_ASM_SUFFIX@%$VPX_ASM_SUFFIX%g
s%@VPX_X86_ASM@%$VPX_X86_ASM%g
s%@VPX_ARM_ASM@%$VPX_ARM_ASM%g
s%@VPX_NEED_OBJ_INT_EXTRACT@%$VPX_NEED_OBJ_INT_EXTRACT%g
s%@MOZ_INSTRUMENT_EVENT_LOOP@%$MOZ_INSTRUMENT_EVENT_LOOP%g
s%@LIBJPEG_TURBO_ASFLAGS@%$LIBJPEG_TURBO_ASFLAGS%g
s%@LIBJPEG_TURBO_X86_ASM@%$LIBJPEG_TURBO_X86_ASM%g
s%@LIBJPEG_TURBO_X64_ASM@%$LIBJPEG_TURBO_X64_ASM%g
s%@LIBJPEG_TURBO_ARM_ASM@%$LIBJPEG_TURBO_ARM_ASM%g
s%@MOZ_PACKAGE_JSSHELL@%$MOZ_PACKAGE_JSSHELL%g
s%@WIN_TOP_SRC@%$WIN_TOP_SRC%g
s%@MOZILLA_VERSION@%$MOZILLA_VERSION%g
s%@ac_configure_args@%$ac_configure_args%g
s%@MOZ_DEFINES@%$MOZ_DEFINES%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"$MAKEFILES"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /* | ?:/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" `
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*




# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="netwerk/necko-config.h
xpcom/xpcom-config.h
xpcom/xpcom-private.h
"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" `
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done


EOF
cat >> $CONFIG_STATUS <<EOF

EOF
cat >> $CONFIG_STATUS <<\EOF

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1


# Populate the virtualenv
echo "$ac_t""Populating Python virtualenv" 1>&6
$MAKE -C build/virtualenv MACOSX_DEPLOYMENT_TARGET=  || exit 1

# Generate a JSON config file for unittest harnesses etc to read
# build configuration details from in a standardized way.
OS_TARGET=${OS_TARGET} TARGET_CPU=${TARGET_CPU} MOZ_DEBUG=${MOZ_DEBUG} \
MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
  $PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp
if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then
  rm ./mozinfo.json.tmp
else
  mv -f ./mozinfo.json.tmp ./mozinfo.json
fi

if test "$CAIRO_FEATURES_H"; then
  if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
    echo "$CAIRO_FEATURES_H is unchanged"
    mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
  else
    rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
  fi
fi

if test "$OS_TARGET" = "Android" -a "$MOZ_PROFILING"; then
  old_ac_configure_arg="$ac_configure_args"
  ac_configure_args="--build=${build} --host=${target_alias} --disable-shared --enable-block-signals=no"
  if test "$MOZ_DEBUG"; then
    ac_configure_args="$ac_configure_args --enable-debug"
  fi
  if test "$DSO_PIC_CFLAGS"; then
    ac_configure_args="$ac_configure_args --with-pic"
  fi
  ac_configure_args="$ac_configure_args \
      CC=\"$CC\" \
      CXX=\"$CXX\" \
      CPP=\"$CPP\" \
      CFLAGS=\"$CFLAGS\" \
      CXXFLAGS=\"$CXXFLAGS\" \
      CPPFLAGS=\"$CPPFLAGS\" \
      LD=\"$LD\" \
      LDFLAGS=\"$LDFLAGS\" \
      AR=\"$AR\" \
      RANLIB=\"$RANLIB\" \
      STRIP=\"$STRIP\" \
      LIBS=\"$LIBS\""

  # Use a separate cache file for libunwind, since it does not use caching.
  mkdir -p $_objdir/tools/profiler/libunwind/src
  old_cache_file=$cache_file
  cache_file=$_objdir/tools/profiler/libunwind/src/config.cache
  old_config_files=$CONFIG_FILES
  unset CONFIG_FILES
  

if test "$no_recursion" != yes; then

  # Remove --cache-file and --srcdir arguments so they do not pile up.
  ac_sub_configure_args=
  ac_prev=
  for ac_arg in $ac_configure_args; do
    if test -n "$ac_prev"; then
      ac_prev=
      continue
    fi
    case "$ac_arg" in
    -cache-file | --cache-file | --cache-fil | --cache-fi \
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
      ac_prev=cache_file ;;
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
      ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
      ac_prev=srcdir ;;
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
      ;;
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
    esac
  done

  for ac_config_dir in tools/profiler/libunwind/src; do

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    if test ! -d $srcdir/$ac_config_dir; then
      continue
    fi

    echo configuring in $ac_config_dir

    case "$srcdir" in
    .) ;;
    *)
      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
      else
        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
      fi
      ;;
    esac

    ac_popdir=`pwd`
    cd $ac_config_dir

      # A "../" for each directory in /$ac_config_dir.
      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`

    case "$srcdir" in
    .) # No --srcdir option.  We are building in place.
      ac_sub_srcdir=$srcdir ;;
    /* | ?:/*) # Absolute path.
      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
    *) # Relative path.
      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
    esac

    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f $ac_sub_srcdir/configure; then
      ac_sub_configure=$ac_sub_srcdir/configure
    elif test -f $ac_sub_srcdir/configure.in; then
      ac_sub_configure=$ac_configure
    else
      echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
      ac_sub_configure=
    fi

    # The recursion is here.
    if test -n "$ac_sub_configure"; then

      # Make the cache file name correct relative to the subdirectory.
      case "$cache_file" in
      /* | ?:/*) ac_sub_cache_file=$cache_file ;;
      *) # Relative path.
        ac_sub_cache_file="$ac_dots$cache_file" ;;
      esac
  case "$ac_given_INSTALL" in
        [/$]*) INSTALL="$ac_given_INSTALL" ;;
        *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
        esac

      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
      # The eval makes quoting arguments work.
      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
      then :
      else
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi


  cache_file=$old_cache_file
  ac_configure_args="$old_ac_configure_args"
  CONFIG_FILES=$old_config_files
fi

# Run freetype configure script

if test "$MOZ_TREE_FREETYPE"; then
   export CFLAGS="$CFLAGS -std=c99"
   export CPPFLAGS="$CPPFLAGS"
   export CXXFLAGS="$CXXFLAGS"
   export LDFLAGS="$LDFLAGS"
   export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
   ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes"
   

if test "$no_recursion" != yes; then

  # Remove --cache-file and --srcdir arguments so they do not pile up.
  ac_sub_configure_args=
  ac_prev=
  for ac_arg in $ac_configure_args; do
    if test -n "$ac_prev"; then
      ac_prev=
      continue
    fi
    case "$ac_arg" in
    -cache-file | --cache-file | --cache-fil | --cache-fi \
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
      ac_prev=cache_file ;;
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
      ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
      ac_prev=srcdir ;;
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
      ;;
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
    esac
  done

  for ac_config_dir in modules/freetype2; do

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    if test ! -d $srcdir/$ac_config_dir; then
      continue
    fi

    echo configuring in $ac_config_dir

    case "$srcdir" in
    .) ;;
    *)
      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
      else
        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
      fi
      ;;
    esac

    ac_popdir=`pwd`
    cd $ac_config_dir

      # A "../" for each directory in /$ac_config_dir.
      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`

    case "$srcdir" in
    .) # No --srcdir option.  We are building in place.
      ac_sub_srcdir=$srcdir ;;
    /* | ?:/*) # Absolute path.
      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
    *) # Relative path.
      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
    esac

    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f $ac_sub_srcdir/configure; then
      ac_sub_configure=$ac_sub_srcdir/configure
    elif test -f $ac_sub_srcdir/configure.in; then
      ac_sub_configure=$ac_configure
    else
      echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
      ac_sub_configure=
    fi

    # The recursion is here.
    if test -n "$ac_sub_configure"; then

      # Make the cache file name correct relative to the subdirectory.
      case "$cache_file" in
      /* | ?:/*) ac_sub_cache_file=$cache_file ;;
      *) # Relative path.
        ac_sub_cache_file="$ac_dots$cache_file" ;;
      esac
  case "$ac_given_INSTALL" in
        [/$]*) INSTALL="$ac_given_INSTALL" ;;
        *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
        esac

      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
      # The eval makes quoting arguments work.
      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
      then :
      else
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi


fi

if test -z "$direct_nspr_config"; then
                    CC="$_SUBDIR_CC"
    CXX="$_SUBDIR_CXX"
    CFLAGS="$_SUBDIR_CFLAGS"
    CPPFLAGS="$_SUBDIR_CPPFLAGS"
    CXXFLAGS="$_SUBDIR_CXXFLAGS"
    LDFLAGS="$_SUBDIR_LDFLAGS"
    HOST_CC="$_SUBDIR_HOST_CC"
    HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
    HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
    RC=
fi

unset MAKEFILES
unset CONFIG_FILES

# No need to run subconfigures when building with LIBXUL_SDK_DIR
if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then

export WRAP_LDFLAGS

if test -n "$_WRAP_MALLOC"; then
    # Avoid doubling wrap malloc arguments
    _SUBDIR_CONFIG_ARGS="`echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'`"
fi

if test -z "$MOZ_NATIVE_NSPR"; then
    ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
    if test -z "$MOZ_DEBUG"; then
        ac_configure_args="$ac_configure_args --disable-debug"
    else
        ac_configure_args="$ac_configure_args --enable-debug"
    fi
    if test "$MOZ_OPTIMIZE" = "1"; then
        ac_configure_args="$ac_configure_args --enable-optimize"
    elif test -z "$MOZ_OPTIMIZE"; then
        ac_configure_args="$ac_configure_args --disable-optimize"
    fi
    if test -n "$HAVE_64BIT_OS"; then
        ac_configure_args="$ac_configure_args --enable-64bit"
    fi
    if test -n "$USE_ARM_KUSER"; then
        ac_configure_args="$ac_configure_args --with-arm-kuser"
    fi
    ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_ARGS"
    if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no ; then
      # dladdr is supported by the new linker, even when the system linker doesn't
      # support it. Trick nspr into using dladdr when it's not supported.
      _SAVE_CPPFLAGS="$CPPFLAGS"
      export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
    fi
    _SAVE_LDFLAGS="$LDFLAGS"
    export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS"
    

if test "$no_recursion" != yes; then

  # Remove --cache-file and --srcdir arguments so they do not pile up.
  ac_sub_configure_args=
  ac_prev=
  for ac_arg in $ac_configure_args; do
    if test -n "$ac_prev"; then
      ac_prev=
      continue
    fi
    case "$ac_arg" in
    -cache-file | --cache-file | --cache-fil | --cache-fi \
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
      ac_prev=cache_file ;;
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
      ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
      ac_prev=srcdir ;;
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
      ;;
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
    esac
  done

  for ac_config_dir in nsprpub; do

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    if test ! -d $srcdir/$ac_config_dir; then
      continue
    fi

    echo configuring in $ac_config_dir

    case "$srcdir" in
    .) ;;
    *)
      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
      else
        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
      fi
      ;;
    esac

    ac_popdir=`pwd`
    cd $ac_config_dir

      # A "../" for each directory in /$ac_config_dir.
      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`

    case "$srcdir" in
    .) # No --srcdir option.  We are building in place.
      ac_sub_srcdir=$srcdir ;;
    /* | ?:/*) # Absolute path.
      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
    *) # Relative path.
      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
    esac

    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f $ac_sub_srcdir/configure; then
      ac_sub_configure=$ac_sub_srcdir/configure
    elif test -f $ac_sub_srcdir/configure.in; then
      ac_sub_configure=$ac_configure
    else
      echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
      ac_sub_configure=
    fi

    # The recursion is here.
    if test -n "$ac_sub_configure"; then

      # Make the cache file name correct relative to the subdirectory.
      case "$cache_file" in
      /* | ?:/*) ac_sub_cache_file=$cache_file ;;
      *) # Relative path.
        ac_sub_cache_file="$ac_dots$cache_file" ;;
      esac
  case "$ac_given_INSTALL" in
        [/$]*) INSTALL="$ac_given_INSTALL" ;;
        *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
        esac

      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
      # The eval makes quoting arguments work.
      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
      then :
      else
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi


    LDFLAGS="$_SAVE_LDFLAGS"
    if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no; then
      unset CPPFLAGS
      CPPFLAGS="$_SAVE_CFLAGS"
    fi
    ac_configure_args="$_SUBDIR_CONFIG_ARGS"
fi

if test -z "$MOZ_NATIVE_NSPR"; then
    # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
    echo "configure: warning: Recreating autoconf.mk with updated nspr-config output" 1>&2
    if test "$OS_ARCH" != "WINNT"; then
       NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
       $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
       NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
       $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
    fi
    rm -f config/autoconf.mk.bak
fi

CC="$_SUBDIR_CC"
CXX="$_SUBDIR_CXX"
CFLAGS="$_SUBDIR_CFLAGS"
CPPFLAGS="$_SUBDIR_CPPFLAGS"
CXXFLAGS="$_SUBDIR_CXXFLAGS"
LDFLAGS="$_SUBDIR_LDFLAGS"
HOST_CC="$_SUBDIR_HOST_CC"
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
RC=

# Run the SpiderMonkey 'configure' script.
dist=$MOZ_BUILD_ROOT/dist
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
ac_configure_args="$ac_configure_args --enable-threadsafe"
if test "$BUILD_CTYPES"; then
    # Build js-ctypes on the platforms we can.
    ac_configure_args="$ac_configure_args --enable-ctypes"
fi
if test -z "$JS_SHARED_LIBRARY" ; then
    ac_configure_args="$ac_configure_args --disable-shared-js"
fi
if test -z "$MOZ_NATIVE_NSPR"; then
    ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
    ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
fi
ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
ac_configure_args="$ac_configure_args --prefix=$dist"
ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
if test "$MOZ_MEMORY"; then
   ac_configure_args="$ac_configure_args --enable-jemalloc"
fi
if test -n "$MOZ_GLUE_LDFLAGS"; then
   export MOZ_GLUE_LDFLAGS
fi
if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then
   export MOZ_GLUE_PROGRAM_LDFLAGS
fi
export MOZ_APP_NAME
export STLPORT_CPPFLAGS
export STLPORT_LDFLAGS
export STLPORT_LIBS


if test "$no_recursion" != yes; then

  # Remove --cache-file and --srcdir arguments so they do not pile up.
  ac_sub_configure_args=
  ac_prev=
  for ac_arg in $ac_configure_args; do
    if test -n "$ac_prev"; then
      ac_prev=
      continue
    fi
    case "$ac_arg" in
    -cache-file | --cache-file | --cache-fil | --cache-fi \
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
      ac_prev=cache_file ;;
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
      ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
      ac_prev=srcdir ;;
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
      ;;
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
    esac
  done

  for ac_config_dir in js/src; do

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    if test ! -d $srcdir/$ac_config_dir; then
      continue
    fi

    echo configuring in $ac_config_dir

    case "$srcdir" in
    .) ;;
    *)
      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
      else
        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
      fi
      ;;
    esac

    ac_popdir=`pwd`
    cd $ac_config_dir

      # A "../" for each directory in /$ac_config_dir.
      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`

    case "$srcdir" in
    .) # No --srcdir option.  We are building in place.
      ac_sub_srcdir=$srcdir ;;
    /* | ?:/*) # Absolute path.
      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
    *) # Relative path.
      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
    esac

    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f $ac_sub_srcdir/configure; then
      ac_sub_configure=$ac_sub_srcdir/configure
    elif test -f $ac_sub_srcdir/configure.in; then
      ac_sub_configure=$ac_configure
    else
      echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
      ac_sub_configure=
    fi

    # The recursion is here.
    if test -n "$ac_sub_configure"; then

      # Make the cache file name correct relative to the subdirectory.
      case "$cache_file" in
      /* | ?:/*) ac_sub_cache_file=$cache_file ;;
      *) # Relative path.
        ac_sub_cache_file="$ac_dots$cache_file" ;;
      esac
  case "$ac_given_INSTALL" in
        [/$]*) INSTALL="$ac_given_INSTALL" ;;
        *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
        esac

      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
      # The eval makes quoting arguments work.
      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
      then :
      else
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi


ac_configure_args="$_SUBDIR_CONFIG_ARGS"

fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR

if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
  echo "config/autoconf.mk is unchanged"
  mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
else
  rm -f config/autoconf.mk.orig 2> /dev/null
fi

