$NetBSD: patch-aq,v 1.20 2020/03/24 20:38:03 joerg Exp $

--- configure.orig	2015-05-07 14:14:56.000000000 +0000
+++ configure
@@ -3227,13 +3227,13 @@ if [ -z "${CFG_HOST_ARCH}" ]; then
             CFG_HOST_ARCH=x86_64
         fi
         ;;
-    *:*:ppc)
+    *:*:ppc|*:*:powerpc)
         if [ "$OPT_VERBOSE" = "yes" ]; then
             echo "    32-bit PowerPC (powerpc)"
         fi
         CFG_HOST_ARCH=powerpc
         ;;
-    *:*:ppc64*)
+    *:*:ppc64|*:*:powerpc64)
         if [ "$OPT_VERBOSE" = "yes" ]; then
             echo "    64-bit PowerPC (powerpc)"
         fi
@@ -3263,6 +3263,19 @@ if [ -z "${CFG_HOST_ARCH}" ]; then
         fi
         CFG_HOST_ARCH=sparc
         ;;
+    NetBSD:*:sparc)
+        if [ "$OPT_VERBOSE" = "yes" ]; then
+            echo "    NetBSD on SPARC"
+        fi
+        CFG_HOST_ARCH=sparc
+        ;;
+    NetBSD:*:sparc64)
+        if [ "$OPT_VERBOSE" = "yes" ]; then
+            echo "    NetBSD on SPARC64"
+        fi
+        CFG_HOST_ARCH=sparc
+        CFG_HOST_BITSIZE=64
+        ;;
     QNX:*:*)
         case "$UNAME_MACHINE" in
         x86pc)
@@ -3571,7 +3584,7 @@ fi
 if [ "$PLATFORM_MAC" = "yes" ] && [ '!' -z "$CFG_SDK" ]; then
     # get the darwin version. 10.0.0 and up means snow leopard.
     VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
-    if [ "$VERSION" -gt 9 ] && [ `basename "$CFG_SDK"` == "MacOSX10.4u.sdk" ] && [ "$PLATFORM" == "macx-g++" ]; then
+    if [ "$VERSION" -gt 9 ] && [ `basename "$CFG_SDK"` = "MacOSX10.4u.sdk" ] && [ "$PLATFORM" = "macx-g++" ]; then
         echo
         echo "WARNING: The 10.4u SDK does not support gcc 4.2. Configure with -platform macx-g++40. "
         echo
@@ -5009,7 +5022,7 @@ if true; then ###[ '!' -f "$outpath/bin/
         fi
         if [ "$BUILD_ON_MAC" = "yes" ]; then
             case "$PLATFORM" in
-            *macx-clang-libc++)
+            *macx-llvm)
                 # Avoid overriding the default configuration settings when building with clang/libc++
                 ;;
             *)
@@ -5078,7 +5091,7 @@ if true; then ###[ '!' -f "$outpath/bin/
     done
 
     QMAKE_BUILD_ERROR=no
-    (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
+    (cd "$outpath/qmake"; "$MAKE" $MAKE_FLAGS) || QMAKE_BUILD_ERROR=yes
     [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
     [ '!' -z "$OLD_QCONFIG_H" ] && mv -f "${OLD_QCONFIG_H}.old" "$OLD_QCONFIG_H" #put back qconfig.h
     [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2
@@ -7203,7 +7216,7 @@ fi
 # select Carbon on 10.4 Tiger.
 if [ "$PLATFORM_MAC" = "yes" ]; then
     VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
-    if [ "$VERSION" == 8 ]; then
+    if [ "$VERSION" = 8 ]; then
         CFG_MAC_COCOA="no";
         CFG_MAC_CARBON="yes";
     fi
@@ -7225,7 +7238,7 @@ fi
 # set the global Mac deployment target. This is overridden on an arch-by-arch basis
 # in some cases, see code further down
 case "$PLATFORM,$CFG_MAC_COCOA" in
-*macx-clang-libc++,yes)
+*macx-llvm,yes)
     # Avoid overriding the default configuration setting when building with clang/libc++
     ;;
 macx*,yes)
@@ -7713,7 +7726,7 @@ case "$XPLATFORM" in
 
 	# Check gcc's version
 	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
-	    4*)
+	    6*|5*|4*)
 		;;
 	    3.4*)
 		canBuildQtXmlPatterns="no"
@@ -7731,20 +7744,6 @@ case "$XPLATFORM" in
 	canBuildWebKit="no"
 	canBuildQtXmlPatterns="no"
 	;;
-    *-g++*)
-	# Check gcc's version
-	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
-	    5*|4*|3.4*)
-		;;
-            3.3*)
-                canBuildWebKit="no"
-                ;;
-	    *)
-		canBuildWebKit="no"
-		canBuildQtXmlPatterns="no"
-		;;
-	esac
-	;;
     solaris-cc*)
         # Check the compiler version
         case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
@@ -7981,7 +7980,7 @@ fi
 # env. variable.
 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ]; then
     case "$PLATFORM" in
-    *macx-clang-libc++)
+    *macx-llvm)
         # Avoid overriding the default settings when building clang/libc++.
         ;;
     *)
@@ -8050,7 +8049,7 @@ g++*)
     3.*)
         COMPILER_VERSION="3.*"
         ;;
-    5*|4.*)
+    6*|5*|4.*)
         COMPILER_VERSION="4"
         ;;
     *)
@@ -8485,7 +8484,7 @@ QMakeVar set sql-plugins "$SQL_PLUGINS"
 [ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
 [ "$CFG_IPV6" = "no" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6"
 [ "$CFG_SXE" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
-[ "$CFG_DBUS" = "no" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
+#[ "$CFG_DBUS" = "no" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
 
 if [ "$PLATFORM_QWS" != "yes" -a "$PLATFORM_QPA" != "yes" ]; then
     [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER"
@@ -8701,6 +8700,7 @@ cat >>"$QTCONFIG.tmp" <<EOF
 #configuration
 CONFIG += $QTCONFIG_CONFIG
 QT_ARCH = $CFG_ARCH
+QT_HOST_BITSIZE = $CFG_HOST_BITSIZE
 QT_EDITION = $Edition
 QT_CONFIG += $QT_CONFIG
 
