$OpenBSD: patch-src_qt_qtbase_configure,v 1.2 2017/07/14 22:15:31 sthen Exp $

Index: src/qt/qtbase/configure
--- src/qt/qtbase/configure.orig
+++ src/qt/qtbase/configure
@@ -719,8 +719,8 @@ CFG_ACCESSIBILITY_ATSPI_BRIDGE=no # will be enabled de
 CFG_NEON=auto
 CFG_MIPS_DSP=auto
 CFG_MIPS_DSPR2=auto
-CFG_CLOCK_GETTIME=auto
-CFG_CLOCK_MONOTONIC=auto
+CFG_CLOCK_GETTIME=yes
+CFG_CLOCK_MONOTONIC=yes
 CFG_POSIX_FALLOCATE=auto
 CFG_MREMAP=auto
 CFG_GETADDRINFO=auto
@@ -2798,7 +2798,11 @@ if [ -z "$PLATFORM" ]; then
         "
         ;;
      OpenBSD:*)
-        PLATFORM=openbsd-g++
+	if cc -v 2>&1|grep -q clang; then
+	    PLATFORM=openbsd-clang
+	else
+	    PLATFORM=openbsd-g++
+	fi
         ;;
      NetBSD:*)
         PLATFORM=netbsd-g++
@@ -3591,7 +3595,7 @@ if [ -z "$CFG_BUILD_PARTS" ]; then
     fi
 fi
 for nobuild in $CFG_NOBUILD_PARTS; do
-    CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
+    CFG_BUILD_PARTS=`echo " $CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
 done
 if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
 #    echo
@@ -3906,7 +3910,11 @@ fi
 # is where the resulting variable is written to
 setBootstrapVariable()
 {
-    getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
+    if [ -n "$2" -a -n "$(eval echo \"\$$2\")" ]; then
+        echo ${2-$1} = "$(eval echo \"\$$2\")"
+    else
+        getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
+    fi
 }
 
 # build qmake
@@ -4064,7 +4072,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
 
     if [ "$OPT_VERBOSE" = yes ]; then
         # Show the output of make
-        (cd "$outpath/qmake"; "$MAKE") || exit 2
+        (cd "$outpath/qmake"; "$MAKE" $MAKEFLAGS) || exit 2
     else
         # Hide the output of make
         # Use bash to print dots, if we have it, and stdout is a tty.
@@ -4072,9 +4080,9 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
             bash -c 'set -o pipefail
                 cd "$0/qmake"; "$1" | while read line; do
                     builtin echo -n .
-                done' "$outpath" "$MAKE" || exit 2
+                done' "$outpath" "$MAKE" $MAKEFLAGS || exit 2
         else
-            (cd "$outpath/qmake"; "$MAKE" -s) || exit 2
+            (cd "$outpath/qmake"; "$MAKE" $MAKEFLAGS -s) || exit 2
         fi
         echo "Done."
     fi
