Binary files qt-everywhere-opensource-src-4.8.7-orig/.configure.swp and qt-everywhere-opensource-src-4.8.7/.configure.swp differ
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/.qmake.vars qt-everywhere-opensource-src-4.8.7/.qmake.vars
--- qt-everywhere-opensource-src-4.8.7-orig/.qmake.vars	1969-12-31 18:00:00.000000000 -0600
+++ qt-everywhere-opensource-src-4.8.7/.qmake.vars	2015-05-26 20:52:03.000000000 -0500
@@ -0,0 +1,4 @@
+styles += cde mac motif plastique cleanlooks windows
+decorations += default windows styled
+mouse-drivers += pc
+kbd-drivers += tty
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/config.tests/unix/compile.test qt-everywhere-opensource-src-4.8.7/config.tests/unix/compile.test
--- qt-everywhere-opensource-src-4.8.7-orig/config.tests/unix/compile.test	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/config.tests/unix/compile.test	2015-05-26 20:34:22.000000000 -0500
@@ -68,17 +68,17 @@
 
 cd "$OUTDIR/$TEST"
 
 test -r Makefile && $MAKE distclean >/dev/null 2>&1
 # Make sure output from possible previous tests is gone
 rm -f "$EXE" "${EXE}.exe"
 
 echo "QT_BUILD_TREE = $OUTDIR" > "$OUTDIR/$TEST/.qmake.cache"
-"$OUTDIR/bin/qmake" -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
+"$OUTDIR/bin/qmake" -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release app_bundle" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CFLAGS*=$CXXFLAGS" "QMAKE_CFLAGS+=$MAC_ARCH_CXXFLAGS" "QMAKE_OBJECTIVE_CFLAGS*=$CXXFLAGS" "QMAKE_OBJECTIVE_CFLAGS+=$MAC_ARCH_CXXFLAGS" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
 
 if [ "$VERBOSE" = "yes" ]; then
     $MAKE
 else
     $MAKE >/dev/null 2>&1
 fi
 
 ( [ -x "$EXE" ] || [ -x "${EXE}.exe" ] ) && SUCCESS=yes
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp qt-everywhere-opensource-src-4.8.7/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp
--- qt-everywhere-opensource-src-4.8.7-orig/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp	2015-05-26 20:34:22.000000000 -0500
@@ -43,17 +43,17 @@
 #error "iconv not supported on IRIX"
 #else
 #include <iconv.h>
 
 int main(int, char **)
 {
     iconv_t x = iconv_open("", "");
 
-    const char *inp;
+    char *inp;
     char *outp;
     size_t inbytes, outbytes;
     iconv(x, &inp, &inbytes, &outp, &outbytes);
 
     iconv_close(x);
 
     return 0;
 }
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/config.tests/unix/precomp.test qt-everywhere-opensource-src-4.8.7/config.tests/unix/precomp.test
--- qt-everywhere-opensource-src-4.8.7-orig/config.tests/unix/precomp.test	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/config.tests/unix/precomp.test	2015-05-26 20:34:22.000000000 -0500
@@ -22,17 +22,17 @@
     $COMPILER -pch-create header.pchi -include header.h -c header.cpp -o header.o >/dev/null 2>&1 \
         && $COMPILER -pch-use header.pchi -include header.h -c source.cpp -o source.o >/dev/null 2>&1 \
         && PRECOMP_SUPPORT=yes
 
     rm -f header.h header.cpp source.cpp
     rm -f header.pchi header.o source.o
     ;;
 
-*g++*|c++|*qcc*)
+*g++*|c++|*qcc*|*gcc*|cc)
     case `"$COMPILER" -dumpversion 2>/dev/null` in
     3.*)
         ;;
     *)
 
         >precomp_header.h
         if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then
            $COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/configure qt-everywhere-opensource-src-4.8.7/configure
--- qt-everywhere-opensource-src-4.8.7-orig/configure	2015-05-07 09:14:56.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/configure	2015-05-26 20:58:13.000000000 -0500
@@ -5009,41 +5009,34 @@
         fi
         if [ "$BUILD_ON_MAC" = "yes" ]; then
             case "$PLATFORM" in
             *macx-clang-libc++)
                 # Avoid overriding the default configuration settings when building with clang/libc++
                 ;;
             *)
                 # For all other configurations require a minimum of 10.5
-                echo "export MACOSX_DEPLOYMENT_TARGET = 10.5" >> "$mkfile"
+                echo "export MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@" >> "$mkfile"
                 ;;
             esac
 
             echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
             echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
             EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
             EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
             EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
             EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
             EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
 	    if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64
-		X86_CFLAGS="-arch i386"
-		X86_LFLAGS="-arch i386"
+		X86_CFLAGS="-arch @FINK_ARCH@"
+		X86_LFLAGS="-arch @FINK_ARCH@"
 		EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS"
 		EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS"
                 EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS"
             fi
-	    if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64
-		PPC_CFLAGS="-arch ppc"
-		PPC_LFLAGS="-arch ppc"
-		EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS"
-		EXTRA_CXXFLAGS="$PPC_CFLAGS $EXTRA_CXXFLAGS"
-                EXTRA_LFLAGS="$EXTRA_LFLAGS $PPC_LFLAGS"
-            fi
 	    if [ '!' -z "$CFG_SDK" ]; then
 		echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile"
 		echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile"
 		EXTRA_CFLAGS="$EXTRA_CFLAGS \$(SDK_CFLAGS)"
 		EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(SDK_CFLAGS)"
 		EXTRA_LFLAGS="$EXTRA_LFLAGS \$(SDK_LFLAGS)"
             fi
         fi
@@ -7225,17 +7218,17 @@
 # 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)
     # Avoid overriding the default configuration setting when building with clang/libc++
     ;;
 macx*,yes)
     # Cocoa
-    QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5
+    QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET @MACOSX_DEPLOYMENT_TARGET@
     ;;
 macx*,no)
     # gcc, Carbon
     QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.4
     ;;
 esac
 
 # disable Qt 3 support on VxWorks, Symbian and INTEGRITY
@@ -7993,20 +7986,20 @@
         fi
         if echo "$CFG_MAC_ARCHS" | grep '\<ppc\>' > /dev/null 2>&1; then
             QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
             QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
             QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
             QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.4"
         fi
         if echo "$CFG_MAC_ARCHS" | grep '\<x86_64\>' > /dev/null 2>&1; then
-            QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
-            QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
-            QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
-            QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5"
+            QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@"
+            QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@"
+            QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@"
+            QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@"
         fi
         if echo "$CFG_MAC_ARCHS" | grep '\<ppc64\>' > /dev/null 2>&1; then
             QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
             QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
             QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
             QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5"
         fi
         ;;
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/mkspecs/common/g++-macx.conf qt-everywhere-opensource-src-4.8.7/mkspecs/common/g++-macx.conf
--- qt-everywhere-opensource-src-4.8.7-orig/mkspecs/common/g++-macx.conf	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/mkspecs/common/g++-macx.conf	2015-05-26 20:34:22.000000000 -0500
@@ -10,19 +10,21 @@
 
 include(g++-base.conf)
 
 QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2
 QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2
 QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g $$QMAKE_CFLAGS_DWARF2
 
 QMAKE_LFLAGS_STATIC_LIB += -all_load
+QMAKE_LFLAGS_PLUGIN -= -dynamiclib
+QMAKE_LFLAGS_PLUGIN += -bundle
 
-QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.5
-QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.5
+QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@
+QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@
 
 QMAKE_CXXFLAGS_X86_64         = $$QMAKE_CFLAGS_X86_64
 QMAKE_CXXFLAGS_PPC_64         = $$QMAKE_CFLAGS_PPC_64
 QMAKE_OBJECTIVE_CFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64
 QMAKE_OBJECTIVE_CFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64
 QMAKE_LFLAGS_X86_64           = $$QMAKE_CFLAGS_X86_64
 QMAKE_LFLAGS_PPC_64           = $$QMAKE_CFLAGS_PPC_64
 
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/mkspecs/common/mac.conf qt-everywhere-opensource-src-4.8.7/mkspecs/common/mac.conf
--- qt-everywhere-opensource-src-4.8.7-orig/mkspecs/common/mac.conf	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/mkspecs/common/mac.conf	2015-05-26 20:34:22.000000000 -0500
@@ -1,15 +1,16 @@
 #
 # qmake configuration for common Mac OS X
 #
 
 QMAKE_RESOURCE		= /Developer/Tools/Rez
 
 QMAKE_EXTENSION_SHLIB	= dylib
+QMAKE_EXTENSION_PLUGIN = so
 
 QMAKE_LIBDIR		=
 QMAKE_INCDIR_QT		= $$[QT_INSTALL_HEADERS]
 QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
 QMAKE_INCDIR_OPENGL	= /System/Library/Frameworks/OpenGL.framework/Headers \
 	/System/Library/Frameworks/AGL.framework/Headers/
 
 QMAKE_FIX_RPATH         = install_name_tool -id 
@@ -33,12 +34,16 @@
 QMAKE_COPY		= cp -f
 QMAKE_COPY_FILE		= $$QMAKE_COPY
 QMAKE_COPY_DIR		= $$QMAKE_COPY -R
 QMAKE_MOVE		= mv -f
 QMAKE_DEL_FILE		= rm -f
 QMAKE_DEL_DIR		= rmdir
 QMAKE_CHK_DIR_EXISTS	= test -d
 QMAKE_MKDIR		= mkdir -p
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 # overridden to 10.5 for Cocoa on the compiler command line
+QMAKE_MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
 
+# allow CC and CXX to use CCACHE;
+# use "make CCACHE=ccache" when building
+QMAKE_CC = $(CCACHE) $$QMAKE_CC
+QMAKE_CXX = $(CCACHE) $$QMAKE_CXX
 
 include(unix.conf)
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/mkspecs/features/moc.prf qt-everywhere-opensource-src-4.8.7/mkspecs/features/moc.prf
--- qt-everywhere-opensource-src-4.8.7-orig/mkspecs/features/moc.prf	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/mkspecs/features/moc.prf	2015-05-26 20:34:22.000000000 -0500
@@ -78,18 +78,23 @@
 }
 silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands
 QMAKE_EXTRA_COMPILERS += moc_source
 INCREDIBUILD_XGE += moc_source
 
 #make sure we can include these files
 moc_dir_short = $$MOC_DIR
 contains(QMAKE_HOST.os,Windows):moc_dir_short ~= s,^.:,/,
-contains(moc_dir_short, ^[/\\\\].*):INCLUDEPATH += $$MOC_DIR
-else:INCLUDEPATH += $$OUT_PWD/$$MOC_DIR
+
+# order the local moc path -before- the others, since its headers
+# should -always be found locally so we want that path first.
+contains(moc_dir_short, ^[/\\\\].*):INCLUDEPATH = $$MOC_DIR $$INCLUDEPATH
+else:INCLUDEPATH = $$OUT_PWD/$$MOC_DIR $$INCLUDEPATH
+
+# message(MOC_DIR is $$MOC_DIR)
 
 # Backwards compatibility: Make shadow builds with default MOC_DIR work
 # if the user did not add the source dir explicitly.
 equals(MOC_DIR, .) {
     CONFIG -= include_source_dir
     CONFIG = include_source_dir $$CONFIG
 }
 
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/mkspecs/features/qt.prf qt-everywhere-opensource-src-4.8.7/mkspecs/features/qt.prf
--- qt-everywhere-opensource-src-4.8.7-orig/mkspecs/features/qt.prf	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/mkspecs/features/qt.prf	2015-05-26 20:34:22.000000000 -0500
@@ -140,17 +140,25 @@
 
             DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
         }
     }
 }
 #specific module settings
 !isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs
 QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT
+
 for(QTLIB, $$list($$lower($$unique(QT)))) {
+
+#   message(qt: 'LIBS' qt before $$QTLIB is '$${LIBS}')
+#   message(qt: 'INCLUDEPATH' qt before $$QTLIB is '$${INCLUDEPATH}')
+#   message(qt: 'QMAKE_LFLAGS' qt before $$QTLIB is '$${QMAKE_LFLAGS}')
+#   message(qt: 'QMAKE_CFLAGS' qt before $$QTLIB is '$${QMAKE_CFLAGS}')
+#   message(qt: 'QMAKE_CXXFLAGS' qt before $$QTLIB is '$${QMAKE_CXXFLAGS}')
+
    unset(qlib_style)
    !qt_debug:!qt_release {
       CONFIG(debug, debug|release):qlib_style = debug
       else:qlib_style = release
    } else:CONFIG(qt_debug, qt_debug|qt_release) {
       qlib_style = debug
    } else {
       qlib_style = release
@@ -201,18 +209,53 @@
 	 isEqual(QTLIB, openvg):CONFIG += openvg
 	 isEqual(QTLIB, qt3support):DEFINES *= QT3_SUPPORT
          isEqual(QTLIB, testlib):CONFIG += console
          isEqual(QTLIB, dbus):CONFIG += dbusadaptors dbusinterfaces
 
      qtAddLibrary($$qlib)
       }
    }
+#   message(qt: 'LIBS' qt after $$QTLIB is '$${LIBS}')
+#   message(qt: 'INCLUDEPATH' qt after $$QTLIB is '$${INCLUDEPATH}')
+#   message(qt: 'QMAKE_LFLAGS' qt after $$QTLIB is '$${QMAKE_LFLAGS}')
+#   message(qt: 'QMAKE_CFLAGS' qt after $$QTLIB is '$${QMAKE_CFLAGS}')
+#   message(qt: 'QMAKE_CXXFLAGS' qt after $$QTLIB is '$${QMAKE_CXXFLAGS}')
+}
+
+# remove Qt's libdir from various flags; it is already part of LIBS,
+# and should be used only to find Qt's libraries.  Qt puts LIBDIR
+# before all other paths, so it is critical that this variable not
+# contain anything questionable.
+QMAKE_LIBDIR -= $$QMAKE_LIBDIR_QT
+QMAKE_LFLAGS -= -L$$QMAKE_LIBDIR_QT
+!isEqual($$QMAKE_LIBDIR_QT, $$[QT_INSTALL_PREFIX]/lib) {
+  QMAKE_LFLAGS -= -L$$[QT_INSTALL_PREFIX]/lib
+}
+
+# remove Qt's incdir from various flags; it is already part of
+# INCLUDEPATH.  C*FLAGS come before the INCPATH build from
+# INCLUDEPATH, so they should never have this -I in it (or, reall, any
+# other -I but instead just remove the the obvious choices)
+QMAKE_CFLAGS -= -I$$QMAKE_INCDIR_QT
+QMAKE_CXXFLAGS -= -I$$QMAKE_INCDIR_QT
+QMAKE_OBJECTIVE_CFLAGS -= -I$$QMAKE_INCDIR_QT
+QMAKE_OBJECTIVE_CXXFLAGS -= -I$$QMAKE_INCDIR_QT
+!isEqual($$QMAKE_INCDIR_QT, $$[QT_INSTALL_PREFIX]/include) {
+  QMAKE_CFLAGS -= -I$$[QT_INSTALL_PREFIX]/include
+  QMAKE_CXXFLAGS -= -I$$[QT_INSTALL_PREFIX]/include
+  QMAKE_OBJECTIVE_CFLAGS -= -I$$[QT_INSTALL_PREFIX]/include
+  QMAKE_OBJECTIVE_CXXFLAGS -= -I$$[QT_INSTALL_PREFIX]/include
 }
 
+#message(qt: QMAKE_CFLAGS at end is $${QMAKE_CFLAGS})
+#message(qt: QMAKE_CXXFLAGS at end is $${QMAKE_CXXFLAGS})
+#message(qt: QMAKE_OBJECTIVE_CFLAGS at end is $${QMAKE_OBJECTIVE_CFLAGS})
+#message(qt: QMAKE_OBJECTIVE_CXXFLAGS at end is $${QMAKE_OBJECTIVE_CXXFLAGS})
+
 qt_compat {
    !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us
    INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt
    DEFINES *= QT_COMPAT
 }
 
 wince*:static:gui {
    QTLIB += qmenu_wce.res
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/mkspecs/macx-g++/qmake.conf qt-everywhere-opensource-src-4.8.7/mkspecs/macx-g++/qmake.conf
--- qt-everywhere-opensource-src-4.8.7-orig/mkspecs/macx-g++/qmake.conf	2015-05-07 09:14:41.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/mkspecs/macx-g++/qmake.conf	2015-05-26 20:34:22.000000000 -0500
@@ -4,16 +4,16 @@
 # qmake configuration for macx-g++
 #
 # Mac OS X + command-line compiler
 #
 
 MAKEFILE_GENERATOR	= UNIX
 TARGET_PLATFORM		= macx
 TEMPLATE		= app
-CONFIG			+= qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl
+CONFIG			+= qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl absolute_library_soname
 QT			+= core gui
 QMAKE_INCREMENTAL_STYLE = sublib
 
 include(../common/mac.conf)
 include(../common/gcc-base-macx.conf)
 include(../common/g++-macx.conf)
 load(qt_config)
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/qmake/project.cpp qt-everywhere-opensource-src-4.8.7/qmake/project.cpp
--- qt-everywhere-opensource-src-4.8.7-orig/qmake/project.cpp	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/qmake/project.cpp	2015-05-26 20:34:22.000000000 -0500
@@ -591,39 +591,44 @@
             if(QFile::exists(specdir.path() + QDir::separator() + "features")) {
                 for(QStringList::Iterator concat_it = concat.begin();
                     concat_it != concat.end(); ++concat_it)
                     feature_roots << (specdir.path() + (*concat_it));
                 break;
             }
         }
     }
-    for(QStringList::Iterator concat_it = concat.begin();
-        concat_it != concat.end(); ++concat_it)
+    QByteArray qmake_no_defaults = qgetenv("QMAKE_NO_DEFAULTS");
+    if (qmake_no_defaults.isNull()) {
+      for(QStringList::Iterator concat_it = concat.begin();
+	  concat_it != concat.end(); ++concat_it)
         feature_roots << (QLibraryInfo::location(QLibraryInfo::PrefixPath) +
                           mkspecs_concat + (*concat_it));
-    for(QStringList::Iterator concat_it = concat.begin();
-        concat_it != concat.end(); ++concat_it)
+      for(QStringList::Iterator concat_it = concat.begin();
+	  concat_it != concat.end(); ++concat_it)
         feature_roots << (QLibraryInfo::location(QLibraryInfo::DataPath) +
                           mkspecs_concat + (*concat_it));
+    }
     return feature_roots;
 }
 
 QStringList qmake_mkspec_paths()
 {
     QStringList ret;
     const QString concat = QDir::separator() + QString("mkspecs");
     QByteArray qmakepath = qgetenv("QMAKEPATH");
     if (!qmakepath.isEmpty()) {
         const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath));
         for(QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
             ret << ((*it) + concat);
     }
-    ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat;
-
+    QByteArray qmake_no_defaults = qgetenv("QMAKE_NO_DEFAULTS");
+    if (qmake_no_defaults.isNull()) {
+      ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat;
+    }
     return ret;
 }
 
 QMakeProject::~QMakeProject()
 {
     if(own_prop)
         delete prop;
     for(QMap<QString, FunctionBlock*>::iterator it = replaceFunctions.begin(); it != replaceFunctions.end(); ++it) {
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/qmake/qmake.pri qt-everywhere-opensource-src-4.8.7/qmake/qmake.pri
--- qt-everywhere-opensource-src-4.8.7-orig/qmake/qmake.pri	2015-05-07 09:14:42.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/qmake/qmake.pri	2015-05-26 20:34:22.000000000 -0500
@@ -130,17 +130,17 @@
         qvector.h \
         qxmlstream.h \
         qxmlutils.h
 
     unix {
         SOURCES += qfilesystemengine_unix.cpp qfilesystemiterator_unix.cpp qfsfileengine_unix.cpp
         mac {
           SOURCES += qcore_mac.cpp qsettings_mac.cpp
-          QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 #enables weak linking for 10.4 (exported)
+          QMAKE_MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
           LIBS += -framework ApplicationServices
         }
     } else:win32 {
         SOURCES += qfilesystemengine_win.cpp qfsfileengine_win.cpp qfilesystemiterator_win.cpp qsettings_win.cpp \
             qsystemlibrary.cpp
         win32-msvc*:LIBS += ole32.lib advapi32.lib
         win32-g++*:LIBS += -lole32 -luuid -ladvapi32 -lkernel32
     }
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/src/corelib/tools/qelapsedtimer_mac.cpp qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qelapsedtimer_mac.cpp
--- qt-everywhere-opensource-src-4.8.7-orig/src/corelib/tools/qelapsedtimer_mac.cpp	2015-05-07 09:14:48.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qelapsedtimer_mac.cpp	2015-05-26 20:34:22.000000000 -0500
@@ -57,17 +57,17 @@
     return true;
 }
 
 static mach_timebase_info_data_t info = {0,0};
 static qint64 absoluteToNSecs(qint64 cpuTime)
 {
     if (info.denom == 0)
         mach_timebase_info(&info);
-    qint64 nsecs = cpuTime * info.numer / info.denom;
+    qint64 nsecs = (qint64)(((double) cpuTime) * ((double) info.numer) / ((double) info.denom));
     return nsecs;
 }
 
 static qint64 absoluteToMSecs(qint64 cpuTime)
 {
     return absoluteToNSecs(cpuTime) / 1000000;
 }
 
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/src/gui/dialogs/qfontdialog_mac.mm qt-everywhere-opensource-src-4.8.7/src/gui/dialogs/qfontdialog_mac.mm
--- qt-everywhere-opensource-src-4.8.7-orig/src/gui/dialogs/qfontdialog_mac.mm	2015-05-07 09:14:43.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/src/gui/dialogs/qfontdialog_mac.mm	2015-05-26 20:34:22.000000000 -0500
@@ -506,17 +506,17 @@
 {
     QMacCocoaAutoReleasePool pool;
     QFontEngine *fe = font.d->engineForScript(QUnicodeTables::Common);
     NSFontManager *mgr = [NSFontManager sharedFontManager];
     const NSFont *nsFont = 0;
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
     if (qstrcmp(fe->name(), "CoreText") == 0) {
-        nsFont = reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont);
+        nsFont = const_cast<NSFont *>(reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont));
     } else
 #endif
     {
         int weight = 5;
         NSFontTraitMask mask = 0;
         if (font.style() == QFont::StyleItalic) {
             mask |= NSItalicFontMask;
         }
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/src/gui/kernel/qcocoamenuloader_mac.mm qt-everywhere-opensource-src-4.8.7/src/gui/kernel/qcocoamenuloader_mac.mm
--- qt-everywhere-opensource-src-4.8.7-orig/src/gui/kernel/qcocoamenuloader_mac.mm	2015-05-07 09:14:43.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/src/gui/kernel/qcocoamenuloader_mac.mm	2015-05-26 20:34:22.000000000 -0500
@@ -65,17 +65,17 @@
 
 - (void)awakeFromNib
 {
     servicesItem = [[appMenu itemWithTitle:@"Services"] retain];
     hideAllOthersItem = [[appMenu itemWithTitle:@"Hide Others"] retain];
     showAllItem = [[appMenu itemWithTitle:@"Show All"] retain];
 
     // Get the names in the nib to match the app name set by Qt.
-    const NSString *appName = reinterpret_cast<const NSString*>(QCFString::toCFStringRef(qAppName()));
+    const NSString *appName = const_cast<NSString *>(reinterpret_cast<const NSString*>(QCFString::toCFStringRef(qAppName())));
     [quitItem setTitle:[[quitItem title] stringByReplacingOccurrencesOfString:@"NewApplication"
                                                                    withString:const_cast<NSString *>(appName)]];
     [hideItem setTitle:[[hideItem title] stringByReplacingOccurrencesOfString:@"NewApplication"
                                                                    withString:const_cast<NSString *>(appName)]];
     [aboutItem setTitle:[[aboutItem title] stringByReplacingOccurrencesOfString:@"NewApplication"
                                                                    withString:const_cast<NSString *>(appName)]];
     [appName release];
     // Disable the items that don't do anything. If someone associates a QAction with them
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/src/plugins/qpluginbase.pri qt-everywhere-opensource-src-4.8.7/src/plugins/qpluginbase.pri
--- qt-everywhere-opensource-src-4.8.7-orig/src/plugins/qpluginbase.pri	2015-05-07 09:14:48.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/src/plugins/qpluginbase.pri	2015-05-26 20:34:22.000000000 -0500
@@ -1,15 +1,18 @@
 TEMPLATE = lib
 isEmpty(QT_MAJOR_VERSION) {
    VERSION=4.8.7
 } else {
    VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
 }
 CONFIG += qt plugin
+QMAKE_LFLAGS_PLUGIN -= -dynamiclib
+QMAKE_LFLAGS_PLUGIN += -bundle
+QMAKE_EXTENSION_PLUGIN = so
 
 win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
 TARGET = $$qtLibraryTarget($$TARGET)
 contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
 
 include(../qt_targets.pri)
 
 wince*:LIBS += $$QMAKE_LIBS_GUI
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/src/qbase.pri qt-everywhere-opensource-src-4.8.7/src/qbase.pri
--- qt-everywhere-opensource-src-4.8.7-orig/src/qbase.pri	2015-05-07 09:14:43.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/src/qbase.pri	2015-05-26 20:34:22.000000000 -0500
@@ -132,33 +132,33 @@
 
 !static:PRL_EXPORT_DEFINES += QT_SHARED
 
 #install directives
 include(qt_install.pri)
 
 unix|win32-g++*:!symbian {
    CONFIG += create_pc
-   QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS]
+   QMAKE_PKGCONFIG_LIBDIR = $$target.path
    QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET
    QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS]
    QMAKE_PKGCONFIG_DESTDIR = pkgconfig
    include_replace.match = $$QMAKE_INCDIR_QT
    include_replace.replace = $$[QT_INSTALL_HEADERS]
    lib_replace.match = $$QMAKE_LIBDIR_QT
-   lib_replace.replace = $$[QT_INSTALL_LIBS]
+   lib_replace.replace = $$target.path
    prefix_replace.match = $$QT_BUILD_TREE
    prefix_replace.replace = $$[QT_INSTALL_PREFIX]
    QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace
 }
 
 unix:!symbian {
    CONFIG += create_libtool explicitlib
-   QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS]
-   QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS]
+   QMAKE_LIBTOOL_LIBDIR = $$target.path
+   QMAKE_PRL_LIBDIR = $$target.path
    QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
    QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
 }
 
 contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE
 DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS
 contains(QT_CONFIG, qt3support):DEFINES *= QT3_SUPPORT
 DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/src/tools/bootstrap/bootstrap.pro qt-everywhere-opensource-src-4.8.7/src/tools/bootstrap/bootstrap.pro
--- qt-everywhere-opensource-src-4.8.7-orig/src/tools/bootstrap/bootstrap.pro	2015-05-07 09:14:44.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/src/tools/bootstrap/bootstrap.pro	2015-05-26 20:34:22.000000000 -0500
@@ -98,17 +98,17 @@
                  ../../corelib/plugin/qsystemlibrary.cpp \
 
 mac: OBJECTIVE_SOURCES += ../../corelib/tools/qlocale_mac.mm
 else:symbian:SOURCES += ../../corelib/tools/qlocale_symbian.cpp
 else:unix:SOURCES += ../../corelib/tools/qlocale_unix.cpp
 else:win32:SOURCES += ../../corelib/tools/qlocale_win.cpp
 
 macx: {
-   QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 #enables weak linking for 10.4 (exported)
+   QMAKE_MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
    SOURCES += ../../corelib/kernel/qcore_mac.cpp
    LIBS += -framework CoreServices -framework ApplicationServices
 }
 
 if(contains(QT_CONFIG, zlib)|cross_compile):include(../../3rdparty/zlib.pri)
 else:include(../../3rdparty/zlib_dependency.pri)
 
 lib.CONFIG = dummy_install
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/tools/assistant/lib/fulltextsearch/fulltextsearch.pro qt-everywhere-opensource-src-4.8.7/tools/assistant/lib/fulltextsearch/fulltextsearch.pro
--- qt-everywhere-opensource-src-4.8.7-orig/tools/assistant/lib/fulltextsearch/fulltextsearch.pro	2015-05-07 09:14:40.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/tools/assistant/lib/fulltextsearch/fulltextsearch.pro	2015-05-26 20:34:22.000000000 -0500
@@ -1,19 +1,19 @@
 
 QMAKE_TARGET_PRODUCT = QtCLucene
 QMAKE_TARGET_DESCRIPTION = QtCLucene full text search library wrapper.
 #if qt is built with frameworks in debug, we must build QtCLucene in debug and release 
 #that's a similar logic as in qbase.pri 
 mac:!static:contains(QT_CONFIG, qt_framework) { 
    CONFIG(debug, debug|release) { 
       !build_pass:CONFIG += build_all 
-   } 
+   }
 }
-QT_CONFIG -= qt_framework 
+# QT_CONFIG -= qt_framework 
 QT -= gui
 TEMPLATE = lib
 TARGET = QtCLucene
 DEFINES += QHELP_LIB
 include(../../../../src/qbase.pri)
 include(fulltextsearch.pri)
 
 CONFIG += qt warn_off
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/tools/assistant/lib/lib.pro qt-everywhere-opensource-src-4.8.7/tools/assistant/lib/lib.pro
--- qt-everywhere-opensource-src-4.8.7-orig/tools/assistant/lib/lib.pro	2015-05-07 09:14:40.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/tools/assistant/lib/lib.pro	2015-05-26 20:34:22.000000000 -0500
@@ -7,26 +7,25 @@
 CONFIG += qt \
     warn_on
 include(../../../src/qbase.pri)
 QMAKE_TARGET_PRODUCT = Help
 QMAKE_TARGET_DESCRIPTION = Help \
     application \
     framework.
 DEFINES -= QT_ASCII_CAST_WARNINGS
-qclucene = QtCLucene$${QT_LIBINFIX}
-if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { 
-    mac:qclucene = $${qclucene}_debug
-    win32:qclucene = $${qclucene}d
-}
-linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene
+
+qtAddLibrary(QtCLucene)
+
 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \
     QtSql \
-    QtXml
-LIBS_PRIVATE += -l$$qclucene
+    QtGui \
+    QtCore \
+    QtCLucene
+
 RESOURCES += helpsystem.qrc
 SOURCES += qhelpenginecore.cpp \
     qhelpengine.cpp \
     qhelpdbreader.cpp \
     qhelpcontentwidget.cpp \
     qhelpindexwidget.cpp \
     qhelpgenerator.cpp \
     qhelpdatainterface.cpp \
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/tools/designer/src/lib/lib.pro qt-everywhere-opensource-src-4.8.7/tools/designer/src/lib/lib.pro
--- qt-everywhere-opensource-src-4.8.7-orig/tools/designer/src/lib/lib.pro	2015-05-07 09:14:40.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/tools/designer/src/lib/lib.pro	2015-05-26 20:34:22.000000000 -0500
@@ -8,18 +8,16 @@
 !wince*:DLLDESTDIR = ../../../../bin
 
 isEmpty(QT_MAJOR_VERSION) {
    VERSION=4.3.0
 } else {
    VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
 }
 
-unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtXml
-
 include(../../../../src/qt_targets.pri)
 QMAKE_TARGET_PRODUCT = Designer
 QMAKE_TARGET_DESCRIPTION = Graphical user interface designer.
 
 !contains(CONFIG, static) {
     CONFIG += dll
 
     DEFINES += \
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/tools/designer/src/uitools/uitools.pro qt-everywhere-opensource-src-4.8.7/tools/designer/src/uitools/uitools.pro
--- qt-everywhere-opensource-src-4.8.7-orig/tools/designer/src/uitools/uitools.pro	2015-05-07 09:14:40.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/tools/designer/src/uitools/uitools.pro	2015-05-26 20:34:22.000000000 -0500
@@ -1,12 +1,12 @@
 TEMPLATE = lib
 TARGET = QtUiTools
 QT += xml
-CONFIG += qt staticlib
+CONFIG += qt qt_install_headers
 DESTDIR = ../../../../lib
 DLLDESTDIR = ../../../../bin
 
 symbian {
     TARGET.UID3 = 0x2001E628
     load(armcc_warnings)
 }
 
diff -ruN -U8 qt-everywhere-opensource-src-4.8.7-orig/tools/macdeployqt/macdeployqt/main.cpp qt-everywhere-opensource-src-4.8.7/tools/macdeployqt/macdeployqt/main.cpp
--- qt-everywhere-opensource-src-4.8.7-orig/tools/macdeployqt/macdeployqt/main.cpp	2015-05-07 09:14:40.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/tools/macdeployqt/macdeployqt/main.cpp	2015-05-26 20:34:22.000000000 -0500
@@ -122,17 +122,17 @@
             return 0;
         }
      }
 
     DeploymentInfo deploymentInfo  = deployQtFrameworks(appBundlePath, additionalExecutables, useDebugLibs);
 
     if (plugins) {
         if (deploymentInfo.qtPath.isEmpty())
-            deploymentInfo.pluginPath = "/Developer/Applications/Qt/plugins"; // Assume binary package.
+            deploymentInfo.pluginPath = "@QT_PLUGINS_DIR@"; // Assume binary package.
         else
             deploymentInfo.pluginPath = deploymentInfo.qtPath + "/plugins";
 
         LogNormal();
         deployPlugins(appBundlePath, deploymentInfo, useDebugLibs);
         createQtConf(appBundlePath);
     }
 
