QtConcurrent: Remove QMutex kept for BC reasons.
[profile/ivi/qtbase.git] / configure
index dce0299..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
 #-------------------------------------------------------------------------------
@@ -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
@@ -745,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
@@ -818,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
 #-------------------------------------------------------------------------------
@@ -889,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|-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|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-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
         ;;
@@ -900,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"
@@ -1006,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"
@@ -1173,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
         ;;
@@ -1214,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
@@ -1285,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"
@@ -2344,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"
@@ -2428,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)
 #-------------------------------------------------------------------------------
 
@@ -2502,15 +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
-
 # 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`
@@ -2816,7 +2810,7 @@ if [ "$OPT_HELP" = "yes" ]; then
         EGLFSN=" "
     fi
 
-    if [ "$CFG_DIRECTFB" = "no"]; then
+    if [ "$CFG_DIRECTFB" = "no" ]; then
         DFBY=" "
         DFBN="*"
     else
@@ -2861,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-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]
@@ -2963,9 +2956,6 @@ 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.
 
@@ -3117,6 +3107,8 @@ Additional options:
  $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.
@@ -3165,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.
 
@@ -3661,6 +3650,15 @@ if [ -z "$PKG_CONFIG" ]; 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 need qmake
 #-------------------------------------------------------------------------------
 
@@ -3745,13 +3743,34 @@ 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
@@ -4236,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
@@ -4574,7 +4619,17 @@ 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`
-        QT_CONFIG="$QT_CONFIG directfb"
+        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
@@ -4626,12 +4681,28 @@ if [ "$CFG_EGLFS" != "no" ]; then
     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
     QMakeVar set QMAKE_CFLAGS_XCB "$QMAKE_CFLAGS_XCB"
     QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB"
     QMakeVar set QMAKE_DEFINES_XCB "$QMAKE_DEFINES_XCB"
 fi
-if [ -n "$QMAKE_CFLAGS_DIRECTFB" ] || [ -n "$QMAKE_LIBS_DIRECTFB" ]; then
+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
@@ -4644,7 +4715,7 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then
     fi
 fi
 
-if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "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" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] ); then
@@ -4892,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"
@@ -5184,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".
@@ -5400,30 +5431,8 @@ if [ "$CFG_QML_DEBUG" = "no" ]; then
     QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QML_NO_DEBUGGER"
 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"
-fi
-
-case "$COMPILER" in
-g++*)
+case "$QMAKE_CONF_COMPILER" in
+*g++*)
     # GNU C++
     COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
 
@@ -5541,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"
 
@@ -5645,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"
@@ -5705,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"
@@ -5838,46 +5856,6 @@ fi
 #-------------------------------------------------------------------------------
 exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary
 
-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
-
 echo
 if [ "$XPLATFORM" = "$PLATFORM" ]; then
     echo "Build type:    $PLATFORM"