QtConcurrent: Remove QMutex kept for BC reasons.
[profile/ivi/qtbase.git] / configure
index 26b12a5..7f9ea8a 100755 (executable)
--- a/configure
+++ b/configure
@@ -155,7 +155,7 @@ BEGIN {
         ovalue = ovalue substr(value, 1, RSTART - 1)
         var = substr(value, RSTART + 2, RLENGTH - 2)
         value = substr(value, RSTART + RLENGTH)
-        if (var ~ /^{/) {
+        if (var ~ /^\{/) {
             var = substr(var, 2, length(var) - 2)
         }
         ovalue = ovalue values[var]
@@ -242,6 +242,23 @@ DeviceVar()
     echo "$2" "$eq" "$3" >> "$DEVICE_VARS_FILE"
 }
 
+resolveDeviceMkspec()
+{
+    result=$(find "$relpath/mkspecs/devices/" -type d -name "*$VAL*" | sed "s,^$relpath/mkspecs/,,")
+    match_count=$(echo "$result" | wc -w)
+    if [ "$match_count" -gt 1 ]; then
+        echo >&2 "Error: Multiple matches for device '$VAL'. Candidates are:"
+        tabbed_result=$(echo "$result" | sed "s,^,    ,")
+        echo >&2 "$tabbed_result"
+        echo "undefined"
+    elif [ "$match_count" -eq 0 ]; then
+        echo >&2 "Error: No device matching '$VAL'"
+        echo "undefined"
+    else
+        echo "$result"
+    fi
+}
+
 #-------------------------------------------------------------------------------
 # operating system detection
 #-------------------------------------------------------------------------------
@@ -501,7 +518,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then
            ;;
     esac
     ### EMBEDDED_QPA logic missing ###
-    case "$PlatformCode,$PLATFORM_MAC,$PLATFORM_QWS" in
+    case "$PlatformCode,$PLATFORM_MAC" in
         X9,* | XC,* | XU,* | XW,* | XM,*)
             # Qt All-OS
             LICENSE_EXTENSION="-ALLOS"
@@ -510,11 +527,11 @@ elif [ $COMMERCIAL_USER = "yes" ]; then
             # Qt for Embedded Linux
             LICENSE_EXTENSION="-EMBEDDED"
             ;;
-        6M,*,no | N7,*,no | N9,*,no | NX,*,no)
+        6M,* | N7,* | N9,* | NX,*)
             # Embedded no-deploy
             LICENSE_EXTENSION="-EMBEDDED"
             ;;
-        FM,*,no | LM,yes,* | ZM,no,no)
+        FM,* | LM,yes | ZM,no)
             # Desktop
             LICENSE_EXTENSION="-DESKTOP"
             ;;
@@ -645,7 +662,6 @@ MIN_DBUS_1_VERSION=0.93
 # initalize internal variables
 CFG_CONFIGURE_EXIT_ON_ERROR=yes
 CFG_PROFILE=no
-CFG_EXCEPTIONS=unspecified
 CFG_GUI=auto # (yes|no|auto)
 CFG_WIDGETS=yes
 CFG_QCONFIG=full
@@ -686,8 +702,9 @@ CFG_NOBUILD_PARTS=""
 CFG_RELEASE_QMAKE=no
 CFG_AUDIO_BACKEND=auto
 CFG_V8SNAPSHOT=auto
-CFG_DECLARATIVE_DEBUG=yes
+CFG_QML_DEBUG=yes
 CFG_JAVASCRIPTCORE_JIT=auto
+CFG_PKGCONFIG=auto
 
 # Target architecture
 CFG_ARCH=
@@ -704,6 +721,7 @@ CFG_XKB=auto
 CFG_XCB=auto
 CFG_XCB_LIMITED=yes
 CFG_EGLFS=auto
+CFG_DIRECTFB=auto
 CFG_LIBUDEV=auto
 CFG_OBSOLETE_WAYLAND=no
 CFG_EVDEV=auto
@@ -716,20 +734,17 @@ CFG_GSTREAMER=auto
 CFG_QGTKSTYLE=auto
 CFG_LARGEFILE=auto
 CFG_OPENSSL=auto
-CFG_STL=auto
 CFG_PRECOMPILE=auto
 CFG_SEPARATE_DEBUG_INFO=no
 CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
 CFG_REDUCE_EXPORTS=auto
-CFG_MMX=auto
-CFG_3DNOW=auto
-CFG_SSE=auto
 CFG_SSE2=auto
 CFG_SSE3=auto
 CFG_SSSE3=auto
 CFG_SSE4_1=auto
 CFG_SSE4_2=auto
 CFG_AVX=auto
+CFG_AVX2=auto
 CFG_REDUCE_RELOCATIONS=auto
 CFG_ACCESSIBILITY=auto
 CFG_IWMMXT=no
@@ -746,7 +761,6 @@ CFG_INOTIFY=auto
 CFG_RPATH=yes
 CFG_FRAMEWORK=auto
 MAC_CONFIG_TEST_COMMANDLINE=  # used to make the configure tests run with the correct arch's and SDK settings
-CFG_MAC_DWARF2=auto
 CFG_MAC_HARFBUZZ=no
 CFG_SXE=no
 CFG_PREFIX_INSTALL=yes
@@ -819,6 +833,9 @@ QT_LIBS_GLIB=
 QT_CFLAGS_GSTREAMER=
 QT_LIBS_GSTREAMER=
 
+# default qpa platform
+QT_QPA_DEFAULT_PLATFORM=
+
 #-------------------------------------------------------------------------------
 # check SQL drivers available in this package
 #-------------------------------------------------------------------------------
@@ -890,7 +907,7 @@ while [ "$#" -gt 0 ]; do
         VAL=no
         ;;
     #Qt style yes options
-    -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-declarative-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon)
+    -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-directfb|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon)
         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
         VAL=yes
         ;;
@@ -901,7 +918,7 @@ while [ "$#" -gt 0 ]; do
         shift
         VAL=$1
         ;;
-    -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir)
+    -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa)
         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
         shift
         VAL="$1"
@@ -1007,9 +1024,14 @@ while [ "$#" -gt 0 ]; do
             VAL=`echo $1 | sed 's,-R,,'`
         fi
         ;;
-    -l?*)
+    -l?*|-l)
         VAR="add_link"
-        VAL=`echo $1 | sed 's,-l,,'`
+        if [ "$1" = "-l" ]; then
+            shift
+            VAL="$1"
+        else
+            VAL=`echo $1 | sed 's,-l,,'`
+        fi
         ;;
     -F?*|-F)
         VAR="add_fpath"
@@ -1080,8 +1102,15 @@ while [ "$#" -gt 0 ]; do
     hostbindir)
         QT_HOST_BINS="$VAL"
         ;;
+    pkg-config)
+        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+            CFG_PKGCONFIG="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
     force-pkg-config)
-        QT_FORCE_PKGCONFIG=yes
+        CFG_PKGCONFIG="force"
         ;;
     docdir)
         QT_INSTALL_DOCS="$VAL"
@@ -1167,13 +1196,6 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
        ;;
-     dwarf2)
-        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
-            CFG_MAC_DWARF2="$VAL"
-        else
-            UNKNOWN_OPT=yes
-        fi
-       ;;
     arch|host-arch)
         OPT_OBSOLETE_HOST_ARG=yes
         ;;
@@ -1208,15 +1230,6 @@ while [ "$#" -gt 0 ]; do
             QTCONFIG_CONFIG="$QTCONFIG_CONFIG testcocoon"
         fi
         ;;
-    exceptions|g++-exceptions)
-        if [ "$VAL" = "no" ]; then
-            CFG_EXCEPTIONS=no
-        elif [ "$VAL" = "yes" ]; then
-            CFG_EXCEPTIONS=yes
-        else
-            UNKNOWN_OPT=yes
-        fi
-        ;;
     platform)
         PLATFORM="$VAL"
         # keep compatibility with old platform names
@@ -1279,13 +1292,17 @@ while [ "$#" -gt 0 ]; do
         case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
         ;;
     device)
-        XPLATFORM="devices/$VAL"
+        XPLATFORM=`resolveDeviceMkspec $VAL`
+        [ "$XPLATFORM" = "undefined" ] && exit 101
         ;;
     device-option)
         DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"`
         DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"`
         DeviceVar set $DEV_VAR $DEV_VAL
         ;;
+    qpa)
+        QT_QPA_DEFAULT_PLATFORM="$VAL"
+        ;;
     debug-and-release)
         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
             CFG_DEBUG_RELEASE="$VAL"
@@ -1419,13 +1436,6 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
         ;;
-    stl)
-        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
-            CFG_STL="$VAL"
-        else
-            UNKNOWN_OPT=yes
-        fi
-        ;;
     pch)
         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
             CFG_PRECOMPILE="$VAL"
@@ -1450,27 +1460,6 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
         ;;
-    mmx)
-        if [ "$VAL" = "no" ]; then
-            CFG_MMX="$VAL"
-        else
-            UNKNOWN_OPT=yes
-        fi
-        ;;
-    3dnow)
-        if [ "$VAL" = "no" ]; then
-            CFG_3DNOW="$VAL"
-        else
-            UNKNOWN_OPT=yes
-        fi
-        ;;
-    sse)
-        if [ "$VAL" = "no" ]; then
-            CFG_SSE="$VAL"
-        else
-            UNKNOWN_OPT=yes
-        fi
-        ;;
     sse2)
         if [ "$VAL" = "no" ]; then
             CFG_SSE2="$VAL"
@@ -1513,6 +1502,13 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
         ;;
+    avx2)
+        if [ "$VAL" = "no" ]; then
+            CFG_AVX2="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
     iwmmxt)
        CFG_IWMMXT="yes"
        ;;
@@ -1643,6 +1639,13 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
         ;;
+    directfb)
+        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+            CFG_DIRECTFB="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
     libudev)
         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
             CFG_LIBUDEV="$VAL"
@@ -1763,12 +1766,12 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
         ;;
-    declarative-debug)
+    qml-debug)
         if [ "$VAL" = "yes" ]; then
-            CFG_DECLARATIVE_DEBUG="yes"
+            CFG_QML_DEBUG="yes"
         else
             if [ "$VAL" = "no" ]; then
-                CFG_DECLARATIVE_DEBUG="no"
+                CFG_QML_DEBUG="no"
             else
                 UNKNOWN_OPT=yes
             fi
@@ -2097,6 +2100,10 @@ if [ "$OPT_SHADOW" = "yes" ]; then
         fi
     done
 
+    # save a pre-existing mkspecs/modules dir
+    test -d "$outpath/mkspecs/modules" && \
+        mv "$outpath/mkspecs/modules" "$outpath/mkspecs-modules"
+
     # symlink the mkspecs directory
     mkdir -p "$outpath/mkspecs"
     rm -rf "$outpath"/mkspecs/*
@@ -2116,7 +2123,12 @@ if [ "$OPT_SHADOW" = "yes" ]; then
     ShadowMkspecs features
 
     # The modules dir is special, too.
-    ShadowMkspecs modules
+    if test -d "$outpath/mkspecs-modules"; then
+        rm -rf "$outpath/mkspecs/modules"
+        mv "$outpath/mkspecs-modules" "$outpath/mkspecs/modules"
+    else
+        ShadowMkspecs modules
+    fi
 
     # symlink the doc directory
     rm -rf "$outpath/doc"
@@ -2168,19 +2180,19 @@ if [ -z "$PLATFORM" ]; then
     case "$UNAME_SYSTEM:$UNAME_RELEASE" in
      Darwin:*)
          OSX_VERSION=`uname -r | cut -d. -f1`
-         if [ "$OSX_VERSION" -ge 11 ]; then
-             # We're on Lion or above. Check if we have a supported Clang version
+         # Select compiler. Use g++ unless we find a usable Clang version
+         PLATFORM=macx-g++
+         if [ "$OSX_VERSION" -ge 12 ]; then
+            # We're on Mountain Lion or above. Use Clang. Don't advertise gcc.
+            PLATFORM=macx-clang
+         elif [ "$OSX_VERSION" -eq 11 ]; then
+             # We're on Lion. Check if we have a supported Clang version
              case "$(clang -v 2>&1 | grep -Po '(?<=version )\d[\d.]+')" in
                  3.*)
                      PLATFORM=macx-clang
                      PLATFORM_NOTES="\n    - Also available for Mac OS X: macx-g++\n"
                      ;;
-                 *)
-                     PLATFORM=macx-g++
-                     ;;
              esac
-         else
-             PLATFORM=macx-g++
          fi
          ;;
      AIX:*)
@@ -2343,6 +2355,7 @@ PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mksp
 
 case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
 case "$XPLATFORM" in linux-g++-maemo) XPLATFORM_MAEMO=yes;; esac
+case "$XPLATFORM" in qnx-*) XPLATFORM_QNX=yes;; esac
 
 if [ -d "$PLATFORM" ]; then
   QMAKESPEC="$PLATFORM"
@@ -2427,15 +2440,6 @@ if [ "$CFG_RTOS_ENABLED" = "no" ]; then
 fi
 
 #-------------------------------------------------------------------------------
-# write out device config before we run the test.
-#-------------------------------------------------------------------------------
-if cmp -s "$DEVICE_VARS_FILE" "$outpath/mkspecs/qdevice.pri"; then
-    rm -f "$DEVICE_VARS_FILE"
-else
-    mv -f $DEVICE_VARS_FILE "$outpath/mkspecs/qdevice.pri"
-fi
-
-#-------------------------------------------------------------------------------
 # tests that don't need qmake (must be run before displaying help)
 #-------------------------------------------------------------------------------
 
@@ -2456,50 +2460,6 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
     QT_CONFIG="$QT_CONFIG build_all"
 fi
 
-if [ -z "$PKG_CONFIG" ]; then
-    # See if PKG_CONFIG is set in the mkspec:
-    PKG_CONFIG=`getXQMakeConf PKG_CONFIG`
-fi
-if [ -z "$PKG_CONFIG" ]; then
-    PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
-fi
-
-# Work out if we can use pkg-config
-if [ "$QT_CROSS_COMPILE" = "yes" ]; then
-    if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
-        echo >&2 ""
-        echo >&2 "You have asked to use pkg-config and are cross-compiling."
-        echo >&2 "Please make sure you have a correctly set-up pkg-config"
-        echo >&2 "environment!"
-        echo >&2 ""
-        if [ -z "$PKG_CONFIG_LIBDIR" ]; then
-            echo >&2 ""
-            echo >&2 "Warning: PKG_CONFIG_LIBDIR has not been set.  This could mean"
-            echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)."
-            echo >&2 "This is probably not what you want."
-            echo >&2 ""
-        elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
-            echo >&2 ""
-            echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
-            echo >&2 "been set. This means your toolchain's .pc files must contain"
-            echo >&2 "the paths to the toolchain's libraries & headers. If configure"
-            echo >&2 "tests are failing, please check these files."
-            echo >&2 ""
-        fi
-    else
-        echo >&2 ""
-        echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling."
-        echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for"
-        echo >&2 "dependencies"
-        echo >&2 ""
-        PKG_CONFIG=""
-    fi
-fi
-
-if [ ! -n "$PKG_CONFIG" ]; then
-    QT_CONFIG="$QT_CONFIG no-pkg-config"
-fi
-
 # pass on $CFG_SDK to the configure tests.
 if [ '!' -z "$CFG_SDK" ]; then
     MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK"
@@ -2529,15 +2489,10 @@ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
     fi
 fi
 
-SYSROOT_FLAG=
 if [ -n "$CFG_SYSROOT" ]; then
-    if compilerSupportsFlag --sysroot="$CFG_SYSROOT"; then
-       [ "$OPT_VERBOSE" = "yes" ] && echo "Setting sysroot to: $CFG_SYSROOT"
-       SYSROOT_FLAG="--sysroot=$CFG_SYSROOT"
-    else
-       echo >&2 "The compiler doesn't support the --sysroot flag, I can't set the sysroot"
-       exit 1
-    fi
+    SYSROOT_FLAG="--sysroot=$CFG_SYSROOT"
+else
+    SYSROOT_FLAG=
 fi
 export SYSROOT_FLAG    # used by config.tests/unix/compile.test
 
@@ -2550,21 +2505,6 @@ if [ "$CFG_PRECOMPILE" = "auto" ]; then
     fi
 fi
 
-#auto-detect DWARF2 on the mac
-if [ "$BUILD_ON_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then
-    if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
-        CFG_MAC_DWARF2=no
-    else
-        CFG_MAC_DWARF2=yes
-    fi
-fi
-
-# don't autodetect support for separate debug info on objcopy when
-# cross-compiling as lots of toolchains seems to have problems with this
-if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
-    CFG_SEPARATE_DEBUG_INFO="no"
-fi
-
 # auto-detect support for separate debug info in objcopy
 if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
     TEST_COMPILER_CFLAGS=`getXQMakeConf QMAKE_CFLAGS`
@@ -2846,13 +2786,6 @@ if [ "$OPT_HELP" = "yes" ]; then
         LFSY="*"
         LFSN=" "
     fi
-    if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then
-        SHY="*"
-        SHN=" "
-    else
-        SHY=" "
-        SHN="*"
-    fi
     if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
         PHY=" "
         PHN="*"
@@ -2877,6 +2810,13 @@ if [ "$OPT_HELP" = "yes" ]; then
         EGLFSN=" "
     fi
 
+    if [ "$CFG_DIRECTFB" = "no" ]; then
+        DFBY=" "
+        DFBN="*"
+    else
+        DFBY="*"
+        DFBN=" "
+    fi
     if [ "$CFG_XINPUT2" = "no" ]; then
         X2Y=" "
         X2N="*"
@@ -2893,20 +2833,12 @@ if [ "$OPT_HELP" = "yes" ]; then
         DBN=" "
     fi
 
-    if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
-        if [ "$QT_CROSS_COMPILE" = "yes" ]; then
-            SBY=""
-            SBN="*"
-        else
-            SBY="*"
-            SBN=" "
-        fi
-    elif [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
-        SBY="*"
-        SBN=" "
-    else
+    if [ "$CFG_SEPARATE_DEBUG_INFO" = "no" ]; then
         SBY=" "
         SBN="*"
+    else
+        SBY="*"
+        SBN=" "
     fi
 
     if [ "$CFG_GLIB" = "no" ]; then
@@ -2923,8 +2855,7 @@ Usage:  $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir
         [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>] [-testsdir <dir>]
         [-release] [-debug] [-debug-and-release]
         [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
-        [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
-        [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
+        [-largefile] [-no-accessibility] [-accessibility] [-no-sql-<driver>] [-sql-<driver>]
         [-plugin-sql-<driver>] [-system-sqlite]
         [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
         [-qt-zlib] [-system-zlib] [-no-gif] [-no-libpng] [-qt-libpng] [-system-libpng]
@@ -2932,12 +2863,12 @@ Usage:  $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir
         [-nomake <part>] [-R <string>]  [-l <string>] [-no-rpath]  [-rpath] [-continue]
         [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
         [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui]
-        [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
+        [-no-separate-debug-info] [-no-sse2]
         [-no-sse3] [-no-ssse3] [-no-sse4.1] [-no-sse4.2] [-no-avx] [-no-neon]
         [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info]
         [-no-phonon-backend] [-phonon-backend] [-no-media-backend] [-media-backend]
         [-no-audio-backend] [-audio-backend]
-        [-no-javascript-jit] [-javascript-jit] [-no-declarative-debug] [-declarative-debug]
+        [-no-javascript-jit] [-javascript-jit] [-no-qml-debug] [-qml-debug]
         [-no-optimized-qmake] [-optimized-qmake]
         [-no-openssl] [-openssl] [-openssl-linked]
         [-no-gtkstyle] [-gtkstyle]
@@ -3025,15 +2956,9 @@ Configure options:
     -no-largefile ...... Disables large file support.
  +  -largefile ......... Enables Qt to access files larger than 4 GB.
 
-    -no-exceptions ..... Disable exceptions on compilers that support it.
- *  -exceptions ........ Enable exceptions on compilers that support it.
-
     -no-accessibility .. Do not compile Accessibility support.
  *  -accessibility ..... Compile Accessibility support.
 
- $SHN  -no-stl ............ Do not compile STL support.
- $SHY  -stl ............... Compile STL support.
-
     -no-sql-<driver> ... Disable SQL <driver> entirely.
     -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
                          none are turned on.
@@ -3051,8 +2976,8 @@ Configure options:
     -no-javascript-jit . Do not build the JavaScriptCore JIT compiler.
  +  -javascript-jit .... Build the JavaScriptCore JIT compiler.
 
-    -no-declarative-debug ..... Do not build the declarative debugging support.
- +  -declarative-debug ....... Build the declarative debugging support.
+    -no-qml-debug ...... Do not build the in-process QML debugging support.
+ +  -qml-debug ......... Build the QML debugging support.
 
     -platform target ... The operating system and compiler you are building
                          on ($PLATFORM).
@@ -3060,15 +2985,13 @@ Configure options:
                          See the README file for a list of supported
                          operating systems and compilers.
 
-    -no-mmx ............ Do not compile with use of MMX instructions.
-    -no-3dnow .......... Do not compile with use of 3DNOW instructions.
-    -no-sse ............ Do not compile with use of SSE instructions.
     -no-sse2 ........... Do not compile with use of SSE2 instructions.
     -no-sse3 ........... Do not compile with use of SSE3 instructions.
     -no-ssse3 .......... Do not compile with use of SSSE3 instructions.
     -no-sse4.1.......... Do not compile with use of SSE4.1 instructions.
     -no-sse4.2.......... Do not compile with use of SSE4.2 instructions.
     -no-avx ............ Do not compile with use of AVX instructions.
+    -no-avx2 ........... Do not compile with use of AVX2 instructions.
     -no-neon ........... Do not compile with use of NEON instructions.
     -no-mips_dsp ....... Do not compile with use of MIPS DSP instructions.
     -no-mips_dspr2 ..... Do not compile with use of MIPS DSP rev2 instructions.
@@ -3082,6 +3005,13 @@ Configure options:
     -I <string> ........ Add an explicit include path.
     -L <string> ........ Add an explicit library path.
 
+ +  -pkg-config ........ Use pkg-config to detect include and library paths. By default,
+                         configure determines whether to use pkg-config or not with
+                         some heuristics such as checking the environment variables.
+    -no-pkg-config ..... Disable use of pkg-config.
+    -force-pkg-config .. Force usage of pkg-config (skips pkg-config usability
+                         detection heuristic).
+
     -help, -h .......... Display this information.
 
 Third Party Libraries:
@@ -3172,10 +3102,17 @@ Additional options:
  $XCBY  -xcb ............... Compile Xcb support.
 
  $EGLFSN  -no-eglfs .......... Do not compile EGLFS (EGL Full Screen/Single Surface) support.
- $EGLFSY  -eglfs ............. Compile EGLFS support.
+ $EGLFSY  -eglfs ............. Compile EGLFS support (Requires OpenGL ES 2 support).
+
+ $DFBN  -no-directfb ....... Do not compile DirectFB support.
+ $DFBY  -directfb .......... Compile DirectFB support.
+
+    -qpa <name> ......... Sets the default QPA platform (e.g xcb, cocoa, windows).
 
     -xplatform target ... The target platform when cross-compiling.
 
+    -sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot.
+
     -no-feature-<feature> Do not compile in <feature>.
     -feature-<feature> .. Compile in <feature>. The available features
                           are described in src/corelib/global/qfeatures.txt
@@ -3220,9 +3157,6 @@ Qt/Mac only:
                          link tools against those frameworks.
     -no-framework ...... Do not build Qt as a series of frameworks.
 
- *  -dwarf2 ............ Enable dwarf2 debugging symbols.
-    -no-dwarf2 ......... Disable dwarf2 debugging symbols.
-
     -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4.
                          To use a different SDK with gcc 3.3, set the SDKROOT environment variable.
 
@@ -3652,6 +3586,79 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
 fi # Build qmake
 
 #-------------------------------------------------------------------------------
+# Detect pkg-config
+#-------------------------------------------------------------------------------
+if [ -z "$PKG_CONFIG" ]; then
+    # See if PKG_CONFIG is set in the mkspec:
+    PKG_CONFIG=`getXQMakeConf PKG_CONFIG`
+fi
+if [ -z "$PKG_CONFIG" ]; then
+    PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
+fi
+
+if [ "$CFG_PKGCONFIG" = "no" ]; then
+    PKG_CONFIG=
+elif [ "$CFG_PKGCONFIG" = "force" ]; then
+    echo >&2 ""
+    echo >&2 "You have asked to use pkg-config. Please make sure you have"
+    echo >&2 "a correctly setup pkg-config environment!"
+    echo >&2 ""
+elif [ -n "$PKG_CONFIG" ]; then
+    # found a pkg-config
+    if [ "$QT_CROSS_COMPILE" = "yes" ]; then
+        # when xcompiling, check environment to see if it's actually usable
+        if [ -z "$PKG_CONFIG_LIBDIR" ]; then
+            if [ -n "$CFG_SYSROOT" ] && [ -d "$CFG_SYSROOT/usr/lib/pkgconfig" ]; then
+                PKG_CONFIG_LIBDIR=$CFG_SYSROOT/usr/lib/pkgconfig:$CFG_SYSROOT/usr/share/pkgconfig
+                export PKG_CONFIG_LIBDIR
+                echo >&2 "Note: PKG_CONFIG_LIBDIR automatically set to $PKG_CONFIG_LIBDIR"
+            elif [ "$CFG_PKGCONFIG" = "yes" ]; then
+                echo >&2 "Error: PKG_CONFIG_LIBDIR has not been set. This could mean"
+                echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)."
+                echo >&2 "Set this variable to the directory that contains target .pc files"
+                echo >&2 "for pkg-config to function correctly when cross-compiling or"
+                echo >&2 "use -force-pkg-config to override this test."
+                exit 101
+            else
+                PKG_CONFIG=
+                echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set."
+            fi
+        fi
+        if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
+            if [ -n "$CFG_SYSROOT" ]; then
+                PKG_CONFIG_SYSROOT_DIR=$CFG_SYSROOT
+                export PKG_CONFIG_SYSROOT_DIR
+                echo >&2 "Note: PKG_CONFIG_SYSROOT_DIR automatically set to $PKG_CONFIG_SYSROOT_DIR"
+            elif [ "$CFG_PKGCONFIG" = "yes" ]; then
+                echo >&2 "Error: PKG_CONFIG_SYSROOT_DIR has not been set. Set this variable"
+                echo >&2 "to your sysroot for pkg-config to function correctly when cross-compiling"
+                echo >&2 "or use -force-pkg-config to override this test."
+                exit 101
+            else
+                PKG_CONFIG=
+                echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set."
+            fi
+        fi
+    fi
+elif [ "$CFG_PKGCONFIG" = "yes" ]; then
+    echo >&2 "Could not detect pkg-config from mkspec or PATH."
+    exit 101
+fi
+
+if [ -z "$PKG_CONFIG" ]; then
+    QT_CONFIG="$QT_CONFIG no-pkg-config"
+fi
+
+#-------------------------------------------------------------------------------
+# write out device config before we run the test.
+#-------------------------------------------------------------------------------
+if cmp -s "$DEVICE_VARS_FILE" "$outpath/mkspecs/qdevice.pri"; then
+    rm -f "$DEVICE_VARS_FILE"
+else
+    mv -f $DEVICE_VARS_FILE "$outpath/mkspecs/qdevice.pri"
+fi
+
+#-------------------------------------------------------------------------------
 # tests that need qmake
 #-------------------------------------------------------------------------------
 
@@ -3688,33 +3695,6 @@ else
     CFG_USE_FLOATMATH=no
 fi
 
-# detect mmx support
-if [ "${CFG_MMX}" = "auto" ]; then
-    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mmx "mmx" $L_FLAGS $I_FLAGS $l_FLAGS "-mmmx"; then
-       CFG_MMX=yes
-    else
-       CFG_MMX=no
-    fi
-fi
-
-# detect 3dnow support
-if [ "${CFG_3DNOW}" = "auto" ]; then
-    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/3dnow "3dnow" $L_FLAGS $I_FLAGS $l_FLAGS "-m3dnow"; then
-       CFG_3DNOW=yes
-    else
-       CFG_3DNOW=no
-    fi
-fi
-
-# detect sse support
-if [ "${CFG_SSE}" = "auto" ]; then
-    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse "sse" $L_FLAGS $I_FLAGS $l_FLAGS "-msse"; then
-       CFG_SSE=yes
-    else
-       CFG_SSE=no
-    fi
-fi
-
 # detect sse2 support
 if [ "${CFG_SSE2}" = "auto" ]; then
     if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse2 "sse2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse2"; then
@@ -3763,12 +3743,42 @@ fi
 # detect avx support
 if [ "${CFG_AVX}" = "auto" ]; then
     if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/avx "avx" $L_FLAGS $I_FLAGS $l_FLAGS "-mavx"; then
-       CFG_AVX=yes
+       case "$XQMAKESPEC" in
+           *g++*|*-clang*)
+               # Some clang versions produce internal compiler errors compiling Qt AVX code
+               case `$TEST_COMPILER --version` in
+                   Apple\ clang\ version\ 2*|Apple\ clang\ version\ 3.0*)
+                       CFG_AVX=no
+                       if [ "$OPT_VERBOSE" = "yes" ]; then
+                           echo 'AVX support disabled for blacklisted clang compiler'
+                       fi
+                       ;;
+                   *)
+                       CFG_AVX=yes
+                       ;;
+               esac
+               ;;
+           *)
+               CFG_AVX=yes
+               ;;
+       esac
     else
        CFG_AVX=no
     fi
 fi
 
+# detect avx2 support
+if [ "${CFG_AVX}" = "no" ]; then
+    CFG_AVX2=no
+fi
+if [ "${CFG_AVX2}" = "auto" ]; then
+    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/avx2 "avx2" $L_FLAGS $I_FLAGS $l_FLAGS "-march=core-avx2"; then
+       CFG_AVX2=yes
+    else
+       CFG_AVX2=no
+    fi
+fi
+
 # check iWMMXt support
 if [ "$CFG_IWMMXT" = "yes" ]; then
     "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt"
@@ -3882,6 +3892,11 @@ if [ "$CFG_EGLFS" = "yes" ]; then
         echo "The EGLFS plugin requires EGL support and cannot be built"
         exit 101
     fi
+    if [ "$CFG_OPENGL" != "es2" ]; then
+        echo "The EGLFS plugin requires OpenGL ES 2 support and cannot be built"
+        exit 101
+    fi
+    CFG_OPENGL="es2"
     CFG_EGL=yes
 fi
 
@@ -4240,6 +4255,32 @@ if [ "$CFG_GLIB" != "no" ]; then
     fi
 fi
 
+# auto-detect GTK style support
+if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
+    if [ -n "$PKG_CONFIG" ]; then
+        QT_CFLAGS_QGTKSTYLE=`$PKG_CONFIG --cflags gtk+-2.0 ">=" 2.10 atk 2>/dev/null`
+        QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
+    fi
+    if [ -n "$QT_CFLAGS_QGTKSTYLE" ] ; then
+        CFG_QGTKSTYLE=yes
+        QT_CONFIG="$QT_CONFIG gtkstyle"
+        QMakeVar set QT_CFLAGS_QGTKSTYLE "$QT_CFLAGS_QGTKSTYLE"
+        QMakeVar set QT_LIBS_QGTKSTYLE "$QT_LIBS_QGTKSTYLE"
+    else
+        if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+            echo "Gtk theme support cannot be enabled due to functionality tests!"
+            echo " Turn on verbose messaging (-v) to $0 to see the fin  al report."
+            echo " If you believe this message is in error you may use the continue"
+            echo " switch (-continue) to $0 to continue."
+            exit 101
+        else
+            CFG_QGTKSTYLE=no
+        fi
+    fi
+elif [ "$CFG_GLIB" = "no" ]; then
+    CFG_QGTKSTYLE=no
+fi
+
 # ### Vestige
 if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then
     if [ -n "$PKG_CONFIG" ]; then
@@ -4466,6 +4507,7 @@ fi
 # Save these for a check later
 ORIG_CFG_XCB="$CFG_XCB"
 ORIG_CFG_EGLFS="$CFG_EGLFS"
+ORIG_CFG_DIRECTFB="$CFG_DIRECTFB"
 
 if [ "$CFG_LIBUDEV" != "no" ]; then
     if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then
@@ -4573,6 +4615,26 @@ if [ "$CFG_XCB" != "no" ]; then
     fi
 fi
 
+if [ "$CFG_DIRECTFB" != "no" ]; then
+    if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists directfb 2>/dev/null; then
+        QMAKE_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
+        QMAKE_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
+        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/directfb" "DirectFB" $L_FLAGS $I_FLAGS $l_FLAGS $QMAKE_CFLAGS_DIRECTFB $QMAKE_LIBS_DIRECTFB; then
+            CFG_DIRECTFB=yes
+        elif [ "$CFG_DIRECTFB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+            echo " DirectFB support cannot be enabled due to functionality tests!"
+            echo " Turn on verbose messaging (-v) to $0 to see the final report."
+            echo " If you believe this message is in error you may use the continue"
+            echo " switch (-continue) to $0 to continue."
+            exit 101
+        else
+            CFG_DIRECTFB=no
+        fi
+    else
+        CFG_DIRECTFB=no
+    fi
+fi
+
 # Detect libxkbcommon
 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xkbcommon 2>/dev/null; then
     QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
@@ -4584,7 +4646,7 @@ else
 fi
 
 # EGL Support
-if [ "$CFG_EGL" != "no" ]; then
+if [ "$CFG_EGL" != "no" ] && [ "$CFG_OPENGL" != "desktop" ]; then
     if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists egl 2>/dev/null; then
         QMAKE_INCDIR_EGL=`$PKG_CONFIG --cflags-only-I egl 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
         QMAKE_LIBS_EGL=`$PKG_CONFIG --libs egl 2>/dev/null`
@@ -4602,10 +4664,36 @@ if [ "$CFG_EGL" != "no" ]; then
     else
         CFG_EGL=no
     fi
+elif [ "$CFG_OPENGL" = "desktop" ]; then
+    if [ "$CFG_EGL" = "yes" ]; then
+        echo "EGL support was requested but Qt is being configured for desktop OpenGL."
+        echo "Either disable EGL support or enable OpenGL ES support."
+        exit 101
+    fi
+    CFG_EGL=no
 fi
 
 if [ "$CFG_EGLFS" != "no" ]; then
-    CFG_EGLFS="$CFG_EGL"
+    if [ "$CFG_OPENGL" = "es2" ]; then
+        CFG_EGLFS="$CFG_EGL"
+    else
+        CFG_EGLFS="no"
+    fi
+fi
+
+# Determine the default QPA platform
+if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
+    # check the mkspec
+    QT_QPA_DEFAULT_PLATFORM=`getXQMakeConf QT_QPA_DEFAULT_PLATFORM`
+    if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
+        if [ "$BUILD_ON_MAC" = "yes" ]; then
+            QT_QPA_DEFAULT_PLATFORM="cocoa"
+        elif [ "$UNAME_SYSTEM" = "QNX" ]; then
+            QT_QPA_DEFAULT_PLATFORM="qnx"
+        else
+            QT_QPA_DEFAULT_PLATFORM="xcb"
+        fi
+    fi
 fi
 
 if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then
@@ -4613,6 +4701,11 @@ if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then
     QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB"
     QMakeVar set QMAKE_DEFINES_XCB "$QMAKE_DEFINES_XCB"
 fi
+if [ "$CFG_DIRECTFB" = "yes" ]; then
+    QT_CONFIG="$QT_CONFIG directfb"
+    QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB"
+    QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB"
+fi
 
 if [ "$BUILD_ON_MAC" = "yes" ]; then
     if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
@@ -4622,14 +4715,14 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then
     fi
 fi
 
-if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ]; then
-    if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ]; then
+if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ]; then
+    if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ]; then
         if [ "$QPA_PLATFORM_GUARD" = "yes" ] &&
-            ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] ); then
+            ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] ); then
         echo "No QPA platform plugin enabled!"
         echo " If you really want to build without a QPA platform plugin you must pass"
-        echo " -no-xcb and -no-eglfs to configure. Doing this will"
-        echo " produce a Qt that cannot run GUI applications."
+        echo " -no-qpa-platform-guard to configure. Doing this will"
+        echo " produce a Qt that can not run GUI applications."
         echo " The dependencies needed for xcb to build are listed in"
         echo " src/plugins/platforms/xcb/README"
         exit 1
@@ -4649,26 +4742,13 @@ if [ "$CFG_LIBFREETYPE" = "auto" ]; then
     fi
 fi
 
-HAVE_STL=no
-if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
-    HAVE_STL=yes
+if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS &&
+    [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+    echo "STL functionality check failed! Cannot build Qt with this STL library."
+    echo " Turn on verbose messaging (-v) to $0 to see the final report."
+    exit 101
 fi
 
-if [ "$CFG_STL" != "no" ]; then
-    if [ "$HAVE_STL" = "yes" ]; then
-        CFG_STL=yes
-    else
-        if [ "$CFG_STL" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
-            echo "STL support cannot be enabled due to functionality tests!"
-            echo " Turn on verbose messaging (-v) to $0 to see the final report."
-            echo " If you believe this message is in error you may use the continue"
-            echo " switch (-continue) to $0 to continue."
-            exit 101
-        else
-            CFG_STL=no
-        fi
-    fi
-fi
 
 # detect POSIX clock_gettime()
 if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then
@@ -4883,35 +4963,6 @@ fi
 # ask for all that hasn't been auto-detected or specified in the arguments
 #-------------------------------------------------------------------------------
 
-# enable dwarf2 support on Mac
-if [ "$CFG_MAC_DWARF2" = "yes" ]; then
-    QT_CONFIG="$QT_CONFIG dwarf2"
-fi
-
-# Detect the default arch (x86 or x86_64) on Mac OS X
-if [ "$BUILD_ON_MAC" = "yes" ] && [ "$QT_CROSS_COMPILE" = "no" ]; then
-    DEFAULT_ARCH=
-    case `file "${outpath}/bin/qmake"` in
-    *i?86)
-        DEFAULT_ARCH=x86
-        ;;
-    *x86_64)
-        DEFAULT_ARCH=x86_64
-        ;;
-    *ppc|*ppc64|*)
-        # unsupported/unknown
-        ;;
-    esac
-
-    if [ -n "$DEFAULT_ARCH" ]; then
-        [ "$OPT_VERBOSE" = "yes" ] && echo "Setting default Mac OS X architechture to $DEFAULT_ARCH."
-        QT_CONFIG="$QT_CONFIG $DEFAULT_ARCH"
-        QMAKE_CONFIG="$QMAKE_CONFIG $DEFAULT_ARCH"
-        # Make the application arch follow the Qt arch
-        QTCONFIG_CONFIG="$QTCONFIG_CONFIG $DEFAULT_ARCH"
-    fi
-fi
-
 # ### Vestige
 if [ "$CFG_PHONON_BACKEND" = "yes" ]; then
     QT_CONFIG="$QT_CONFIG phonon-backend"
@@ -5010,11 +5061,6 @@ QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
 if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
     QMAKE_CONFIG="$QMAKE_CONFIG largefile"
 fi
-if [ "$CFG_STL" = "no" ]; then
-    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STL"
-else
-    QMAKE_CONFIG="$QMAKE_CONFIG stl"
-fi
 if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
     QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
 fi
@@ -5029,15 +5075,13 @@ fi
 if [ "$CFG_SEPARATE_DEBUG_INFO_NOCOPY" = "yes" ] ; then
     QT_CONFIG="$QT_CONFIG separate_debug_info_nocopy"
 fi
-[ "$CFG_MMX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mmx"
-[ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow"
-[ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse"
 [ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
 [ "$CFG_SSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse3"
 [ "$CFG_SSSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG ssse3"
 [ "$CFG_SSE4_1" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_1"
 [ "$CFG_SSE4_2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_2"
 [ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx"
+[ "$CFG_AVX2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx2"
 [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
 [ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
 if [ "$CFG_ARCH" = "mips" ]; then
@@ -5182,17 +5226,6 @@ if [ '!' -z "$W_FLAGS" ]; then
     QMakeVar add QMAKE_OBJECTIVE_CFLAGS_WARN_ON "$W_FLAGS"
 fi
 
-# turn off exceptions for the compilers that support it
-if [ "$XPLATFORM" != "$PLATFORM" ]; then
-    COMPILER=`echo $XPLATFORM | cut -f 2- -d-`
-else
-    COMPILER=`echo $PLATFORM | cut -f 2- -d-`
-fi
-
-if [ "$CFG_EXCEPTIONS" != "no" ]; then
-    QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
-fi
-
 if [ "$XPLATFORM_MINGW" = "yes" ]; then
     # mkspecs/features/win32/default_pre.prf sets "no-rtti".
     # Follow default behavior of configure.exe by overriding with "rtti".
@@ -5394,34 +5427,12 @@ if [ "$CFG_V8SNAPSHOT" = "yes" ]; then
 fi
 
 # ### Vestige
-if [ "$CFG_DECLARATIVE_DEBUG" = "no" ]; then
-    QCONFIG_FLAGS="$QCONFIG_FLAGS QDECLARATIVE_NO_DEBUG_PROTOCOL"
-fi
-
-if [ "$CFG_EXCEPTIONS" = "no" ]; then
-    case "$COMPILER" in
-    g++*)
-       QMakeVar add QMAKE_CFLAGS -fno-exceptions
-       QMakeVar add QMAKE_CXXFLAGS -fno-exceptions
-       QMakeVar add QMAKE_LFLAGS -fno-exceptions
-        ;;
-    cc*)
-        case "$PLATFORM" in
-        irix-cc*)
-           QMakeVar add QMAKE_CFLAGS -LANG:exceptions=off
-           QMakeVar add QMAKE_CXXFLAGS -LANG:exceptions=off
-           QMakeVar add QMAKE_LFLAGS -LANG:exceptions=off
-            ;;
-        *) ;;
-        esac
-        ;;
-    *) ;;
-    esac
-    QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off"
+if [ "$CFG_QML_DEBUG" = "no" ]; then
+    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QML_NO_DEBUGGER"
 fi
 
-case "$COMPILER" in
-g++*)
+case "$QMAKE_CONF_COMPILER" in
+*g++*)
     # GNU C++
     COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
 
@@ -5539,7 +5550,6 @@ QMakeVar set sql-plugins "$SQL_PLUGINS"
 [ "$CFG_PNG" != "yes" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
 [ "$CFG_JPEG" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
 [ "$CFG_ZLIB" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
-[ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
 [ "$CFG_SXE" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
 [ "$CFG_DBUS" = "no" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
 
@@ -5643,6 +5653,8 @@ cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
 EOF
 fi
 
+echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$outpath/src/corelib/global/qconfig.h.new"
+
 # avoid unecessary rebuilds by copying only if qconfig.h has changed
 if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
     rm -f "$outpath/src/corelib/global/qconfig.h.new"
@@ -5674,9 +5686,6 @@ elif [ "$CFG_DEBUG" = "no" ]; then
     fi
     QT_CONFIG="$QT_CONFIG release"
 fi
-if [ "$CFG_STL" = "yes" ]; then
-    QTCONFIG_CONFIG="$QTCONFIG_CONFIG stl"
-fi
 if [ "$CFG_FRAMEWORK" = "no" ]; then
     QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_no_framework"
 else
@@ -5706,6 +5715,14 @@ QT_LIBINFIX = $QT_LIBINFIX
 QT_NAMESPACE = $QT_NAMESPACE
 
 EOF
+
+if [ -n "$PKG_CONFIG_SYSROOT_DIR" ] || [ -n "$PKG_CONFIG_LIBDIR" ]; then
+    echo "# pkgconfig" >> "$QTCONFIG.tmp"
+    echo "PKG_CONFIG_SYSROOT_DIR = $PKG_CONFIG_SYSROOT_DIR" >> "$QTCONFIG.tmp"
+    echo "PKG_CONFIG_LIBDIR = $PKG_CONFIG_LIBDIR" >> "$QTCONFIG.tmp"
+    echo >> $"$QTCONFIG.tmp"
+fi
+
 if [ -n "$CFG_SYSROOT" ]; then
     echo "# sysroot" >>"$QTCONFIG.tmp"
     echo `basename "$XQMAKESPEC"` \{ >>"$QTCONFIG.tmp"
@@ -5837,46 +5854,7 @@ fi
 #-------------------------------------------------------------------------------
 # give feedback on configuration
 #-------------------------------------------------------------------------------
-
-case "$COMPILER" in
-g++*)
-    if [ "$CFG_EXCEPTIONS" != "no" ]; then
-        cat <<EOF
-
-        This target is using the GNU C++ compiler ($PLATFORM).
-
-        Recent versions of this compiler automatically include code for
-        exceptions, which increase both the size of the Qt libraries and
-        the amount of memory taken by your applications.
-
-        You may choose to re-run `basename $0` with the -no-exceptions
-        option to compile Qt without exceptions. This is completely binary
-        compatible, and existing applications will continue to work.
-
-EOF
-    fi
-    ;;
-cc*)
-    case "$PLATFORM" in
-    irix-cc*)
-        if [ "$CFG_EXCEPTIONS" != "no" ]; then
-            cat <<EOF
-
-        This target is using the MIPSpro C++ compiler ($PLATFORM).
-
-        You may choose to re-run `basename $0` with the -no-exceptions
-        option to compile Qt without exceptions. This will make the
-        size of the Qt library smaller and reduce the amount of memory
-        taken by your applications.
-
-EOF
-        fi
-        ;;
-    *) ;;
-    esac
-    ;;
-*) ;;
-esac
+exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary
 
 echo
 if [ "$XPLATFORM" = "$PLATFORM" ]; then
@@ -5914,6 +5892,11 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
 else
    echo "Debug .................. $CFG_DEBUG"
 fi
+if [ -n "$PKG_CONFIG" ]; then
+    echo "pkg-config ............. yes"
+else
+    echo "pkg-config ............. no"
+fi
 [ "$CFG_DBUS" = "no" ]     && echo "QtDBus module .......... no"
 [ "$CFG_DBUS" = "yes" ]    && echo "QtDBus module .......... yes (run-time)"
 [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module .......... yes (linked)"
@@ -5925,13 +5908,12 @@ if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
 else
     echo "JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
 fi
-echo "Declarative debugging ...$CFG_DECLARATIVE_DEBUG"
-echo "STL support ............ $CFG_STL"
+echo "QML debugging .......... $CFG_QML_DEBUG"
 echo "PCH support ............ $CFG_PRECOMPILE"
 if [ "$CFG_ARCH" = "i386" -o "$CFG_ARCH" = "x86_64" ]; then
-    echo "MMX/3DNOW/SSE/SSE2/SSE3. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}/${CFG_SSE3}"
-    echo "SSSE3/SSE4.1/SSE4.2..... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}"
-    echo "AVX..................... ${CFG_AVX}"
+    echo "SSE2/SSE3/SSSE3......... ${CFG_SSE2}/${CFG_SSE3}/${CFG_SSSE3}"
+    echo "SSE4.1/SSE4.2........... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}"
+    echo "AVX/AVX2................ ${CFG_AVX}/${CFG_AVX2}"
 elif [ "$CFG_ARCH" = "arm" ]; then
     echo "iWMMXt support ......... ${CFG_IWMMXT}"
     echo "NEON support ........... ${CFG_NEON}"
@@ -6028,6 +6010,7 @@ if [ "$XPLATFORM_MAEMO" = "yes" ] && [ "$CFG_XCB" = "yes" ]; then
     echo "XInput2 support ........ $CFG_XINPUT2"
 fi
 echo "EGLFS support .......... $CFG_EGLFS"
+echo "DirectFB support ....... $CFG_DIRECTFB"
 echo
 
 # complain about not being able to use dynamic plugins if we are using a static build
@@ -6046,6 +6029,10 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
     echo "    OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
     echo
 fi
+
+exec 1>&3 3>&- # restore stdout
+cat $outpath/config.summary # display config feedback to user
+
 if [ "$BUILD_ON_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then
     echo
     echo "Error: debug-only framework builds are not supported. Configure with -no-framework"
@@ -6230,7 +6217,7 @@ for file in .projects .projects.3; do
             fi
             SPEC=$XQMAKESPEC ;;
         */qmake/qmake.pro) continue ;;
-        *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*tools/qdoc*) SPEC=$QMAKESPEC ;;
+        *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*tools/qdoc*|*tools/qdbusxml2cpp*|*tools/qdbuscpp2xml*) SPEC=$QMAKESPEC ;;
         *) if [ "$CFG_NOPROCESS" = "yes" ]; then
               continue
            else