Index: /trunk/dports/aqua/qt4-mac/Portfile
===================================================================
--- /trunk/dports/aqua/qt4-mac/Portfile	(revision 97949)
+++ /trunk/dports/aqua/qt4-mac/Portfile	(revision 97950)
@@ -12,6 +12,5 @@
 name                qt4-mac
 conflicts           qt3 qt3-mac qt4-mac-devel
-version             4.8.2
-revision            3
+version             4.8.3
 categories          aqua
 platforms           macosx
@@ -28,6 +27,6 @@
 distname            qt-everywhere-opensource-src-${version}
 
-checksums           sha1    e1e2edef1d63ed677d6534d32800c2e1f7ad0e73 \
-                    rmd160  6a15077aee1e84076380787127b80c7bb97ebe86
+checksums           sha1    bc352a283610e0cd2fe0dbedbc45613844090fcb \
+                    rmd160  fe56e5da874503a79d6f84a1e15460eba5a6feae
 
 minimum_xcodeversions   {8 2.5}
@@ -206,12 +205,11 @@
     patch-src_3rdparty_webkit_Source_WebCore_WebCore.pro.diff
 
-# Temporary patch to get ML working; some of this is already upstream 
-# https://codereview.qt-project.org/#change,31759
-# See also https://trac.macports.org/ticket/35430
+# (23) Under 10.8 only: Patch to fix corelib linking
+
 platform darwin 12 {
-    patchfiles-append patch-EXPERIMENTAL-ML-fixes.diff
-}
-
-# (23) fix Framework directory in MacDeployQt tool
+    patchfiles-append patch-src_corelib_corelib.pro.diff
+}
+
+# (24) fix Framework directory in MacDeployQt tool
 
 patchfiles-append   \
@@ -390,6 +388,10 @@
 # -openssl-linked ensures that the MacPorts openssl is used.
 #
-# -no-framework ensures that this port is installed as separate
-#     libraries and headers, with guaranteed locations and names.
+# -framework ensures that this port is installed as frameworks
+#     (collections of {library, headers, resources}); in
+#     post-destroot, link headers and libraries from the frameworks
+#     into non-framework locations as if "-no-framework" were
+#     specified.  Some dependent projects will not work properly if Qt
+#     is installed as libraries by default, thus make it so #1.
 #
 # -no-phonon ensures that Qt does not install the 3rd-parth Phonon
@@ -419,5 +421,5 @@
     -fast                                                 \
     -optimized-qmake                                      \
-    -no-framework                                         \
+    -framework                                            \
     -no-phonon                                            \
     -no-phonon-backend
@@ -572,67 +574,80 @@
     }
 
-    if {![variant_isset framework]} {
-
-        # if not doing framework install: install qt_menu.nib, used by
-        # any applications making use of Qt's application class
-
-        xinstall -m 755 -d ${destroot_qt}/lib/Resources
-        copy ${worksrcpath}/src/gui/mac/qt_menu.nib \
-            ${destroot_qt}/lib/Resources
-
-    } else {
-
-        # remove -L entries from .prl, and .la files; this is a
-        # framework install, not a library install
-
-        foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
-            reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile}
-        }
-        foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
-            reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile}
-        }
-
-        # remove redundant -F${prefix}/Library/Frameworks entries
-
-        foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
-            reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \
-                ${fixfile}
-            reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*||g" ${fixfile}
-            reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
-                ${fixfile}
-        }
-        foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
-            reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \
-                ${fixfile}
-            reinplace "/dependency_libs/s|-F\[^ \]*||g" ${fixfile}
-            reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
-                ${fixfile}
-        }
-
-        # move .pc files from ${qt_frameworks_dir}/pkgconfig to
-        # ${qt_pkg_config_dir}
-
-        file delete -force ${destroot}${qt_pkg_config_dir}
-        xinstall -m 755 -d ${destroot}${qt_libs_dir}
-        move ${destroot}${qt_frameworks_dir}/pkgconfig \
-            ${destroot}${qt_libs_dir}
+    # remove -L entries from .prl, and .la files; this is a
+    # framework install, not a library install
+
+    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
+        reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile}
+    }
+    foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
+        reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile}
+    }
+
+    # remove redundant -F${prefix}/Library/Frameworks entries
+
+    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
+        reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \
+            ${fixfile}
+        reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*||g" ${fixfile}
+        reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
+            ${fixfile}
+    }
+    foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
+        reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \
+            ${fixfile}
+        reinplace "/dependency_libs/s|-F\[^ \]*||g" ${fixfile}
+        reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
+            ${fixfile}
+    }
+
+    # move .pc files from ${qt_frameworks_dir}/pkgconfig to
+    # ${qt_pkg_config_dir}
+
+    file delete -force ${destroot}${qt_pkg_config_dir}
+    xinstall -m 755 -d ${destroot}${qt_libs_dir}
+    move ${destroot}${qt_frameworks_dir}/pkgconfig \
+        ${destroot}${qt_libs_dir}
+
+    # get Qt's version numbers
+
+    set qt_vers [split ${version} "."]
+    set qt_major [lindex ${qt_vers} 0]
+    set qt_minor [lindex ${qt_vers} 1]
+    set qt_patch [lindex ${qt_vers} 2]
+
+    # link includes and libraries for each actual installed framework
+
+    foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
+                         -name "*.framework" | \
+                         sed -e "s@${destroot}@@g"] {
+
+        set tf_full [strsed ${fixfile} {s@\\.framework@@}]
+        set tf [strsed ${tf_full} {g@.*\/@@}]
 
         # link headers into ${qt_includes_dir}, removing directories
         # if they are already there first
 
-        foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
-                             -name "*.framework" | \
-                             sed -e "s@${destroot}@@g"] {
-            set tf_full [strsed ${fixfile} {s@\\.framework@@}]
-            set tf [strsed ${tf_full} {g@.*\/@@}]
-            set inc_file ${destroot}${qt_includes_dir}/${tf}
-            if {[file exists ${inc_file}]} {
-                file delete -force ${inc_file}
-            }
-            ln -s ${tf_full}.framework/Headers ${inc_file}
+        set inc_file ${destroot}${qt_includes_dir}/${tf}
+        if {[file exists ${inc_file}]} {
+            file delete -force ${inc_file}
         }
+        ln -s ${tf_full}.framework/Headers ${inc_file}
+
+        # link libraries into ${qt_libs_dir}, all 4 number variants as
+        # well as the .prl and .la files
+
+        set libs_dir ${destroot}${qt_libs_dir}
+
+        ln -s ${tf_full}.framework/${tf}.prl ${libs_dir}/lib${tf}.prl
+        ln -s ${tf_full}.la ${libs_dir}/lib${tf}.la
+        ln -s ${tf_full}.framework/${tf} ${libs_dir}/lib${tf}.dylib
+        ln -s ${tf_full}.framework/${tf} ${libs_dir}/lib${tf}.${qt_major}.dylib
+        ln -s ${tf_full}.framework/${tf} ${libs_dir}/lib${tf}.${qt_major}.${qt_minor}.dylib
+        ln -s ${tf_full}.framework/${tf} ${libs_dir}/lib${tf}.${qt_major}.${qt_minor}.${qt_patch}.dylib
+
     }
 
     # Install documentation.
+
     xinstall -m 755 -d ${worksrcpath}/${qt_docs_dir}
     xinstall -m 644 -W ${worksrcpath} \
@@ -641,5 +656,16 @@
         ${destroot}${qt_docs_dir}
 
+    # Install private headers needed by QtCreator 
+
+    foreach {src_dir include_dir} \
+    {corelib QtCore gui QtGui script QtScript declarative QtDeclarative} {
+        set dest_dir ${destroot}${qt_frameworks_dir}/${include_dir}.framework/Headers/private
+        xinstall -m 755 -d ${dest_dir}
+        set files [exec find ${worksrcpath}/src/${src_dir} -type f -name "*_p.h"]
+        eval xinstall -m 644 [split ${files}] ${dest_dir}
+    }
+
     # Move .apps into the applications_dir
+
     xinstall -m 755 -d ${destroot}${qt_apps_dir}
     foreach app [glob ${destroot}/${qt_bins_dir}/*.app] {
@@ -663,7 +689,7 @@
 }
 
-variant framework description {Build as Frameworks} {
-    configure.args-delete -no-framework
-    configure.args-append -framework
+variant framework description {Framework Legacy Compatibility Variant} {
+    ui_error "${name} variant +framework has been disabled because ${name} now installs as both libraries and frameworks.  Please install ${name} without +framework."
+    return -code error "Variant disabled"
 }
 
Index: unk/dports/aqua/qt4-mac/files/patch-EXPERIMENTAL-ML-fixes.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-EXPERIMENTAL-ML-fixes.diff	(revision 97949)
+++ 	(revision )
@@ -1,37 +1,0 @@
---- ./src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro.orig	2012-08-02 23:32:52.000000000 -0500
-+++ ./src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro	2012-08-02 23:35:52.000000000 -0500
-@@ -253,6 +253,8 @@
-             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
-         } else: equals(DARWIN_MAJOR_VERSION, "11") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.7.sdk") {
-             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
-+        } else: equals(DARWIN_MAJOR_VERSION, "12") | contains(QMAKE_MAC_SDK, "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk") {
-+            LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
-         }
-     }
- }
---- ./src/corelib/corelib.pro.orig	2012-08-02 23:29:31.000000000 -0500
-+++ ./src/corelib/corelib.pro	2012-08-02 23:31:24.000000000 -0500
-@@ -27,6 +27,9 @@
- } else:mac|darwin {
-         LIBS_PRIVATE += -framework CoreFoundation -framework Security
- }
-+
-+LIBS_PRIVATE += -framework Foundation
-+
- mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
- win32:DEFINES-=QT_NO_CAST_TO_ASCII
- 
---- src/corelib/global/qglobal.h.orig	2012-08-07 16:13:40.000000000 -0400
-+++ src/corelib/global/qglobal.h	2012-08-07 16:14:01.000000000 -0400
-@@ -324,7 +324,10 @@
- #  if !defined(MAC_OS_X_VERSION_10_7)
- #       define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1
- #  endif
--#  if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_7)
-+#  if !defined(MAC_OS_X_VERSION_10_8)
-+#       define MAC_OS_X_VERSION_10_8 MAC_OS_X_VERSION_10_7 + 1
-+#  endif
-+#  if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_8)
- #    warning "This version of Mac OS X is unsupported"
- #  endif
- #endif
Index: /trunk/dports/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff	(revision 97949)
+++ /trunk/dports/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff	(revision 97950)
@@ -14,7 +14,7 @@
      ;;
  
--*g++*|c++)
+-*g++*|c++|*qcc*)
 -    case `"$COMPILER" -dumpversion 2>/dev/null` in
-+*g++*|c++|*gcc*|cc)
++*g++*|c++|*qcc*|*gcc*|cc)
 +    case `$COMPILER -dumpversion 2>/dev/null` in
      3.*)
Index: /trunk/dports/aqua/qt4-mac/files/patch-configure.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-configure.diff	(revision 97949)
+++ /trunk/dports/aqua/qt4-mac/files/patch-configure.diff	(revision 97950)
@@ -1,5 +1,5 @@
---- configure.orig	2012-08-08 16:12:36.000000000 -0400
-+++ configure	2012-08-08 16:39:19.000000000 -0400
-@@ -901,6 +901,7 @@
+--- configure.orig	2012-09-17 11:00:59.000000000 -0400
++++ configure	2012-09-17 11:01:07.000000000 -0400
+@@ -920,6 +920,7 @@
  QT_INSTALL_DOCS=
  QT_INSTALL_HEADERS=
@@ -9,5 +9,5 @@
  QT_INSTALL_PLUGINS=
  QT_INSTALL_IMPORTS=
-@@ -1358,6 +1359,9 @@
+@@ -1380,6 +1381,9 @@
      libdir)
          QT_INSTALL_LIBS="$VAL"
@@ -19,5 +19,5 @@
          QT_NAMESPACE="$VAL"
          ;;
-@@ -3649,6 +3653,19 @@
+@@ -3697,6 +3701,19 @@
      fi
      QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
@@ -39,5 +39,5 @@
      if [ -z "$QT_INSTALL_BINS" ]; then #default
          if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-@@ -4700,6 +4717,7 @@
+@@ -4752,6 +4769,7 @@
  DOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_INSTALL_DOCS"`
  HEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_INSTALL_HEADERS"`
@@ -47,5 +47,5 @@
  PLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_INSTALL_PLUGINS"`
  IMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_INSTALL_IMPORTS"`
-@@ -4725,6 +4743,7 @@
+@@ -4777,6 +4795,7 @@
      HOSTDOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_HOST_PREFIX/doc"`
      HOSTHEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_HOST_PREFIX/include"`
@@ -55,5 +55,5 @@
      HOSTPLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_HOST_PREFIX/plugins"`
      HOSTIMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_HOST_PREFIX/IMPORTS"`
-@@ -4742,6 +4761,7 @@
+@@ -4794,6 +4813,7 @@
  static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR";
  static const char qt_configure_headers_path_str      [256 + 12] = "$HOSTHEADERS_PATH_STR";
@@ -63,5 +63,5 @@
  static const char qt_configure_plugins_path_str      [256 + 12] = "$HOSTPLUGINS_PATH_STR";
  static const char qt_configure_imports_path_str      [256 + 12] = "$HOSTIMPORTS_PATH_STR";
-@@ -4760,6 +4780,7 @@
+@@ -4812,6 +4832,7 @@
  static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR";
  static const char qt_configure_headers_path_str      [256 + 12] = "$HEADERS_PATH_STR";
@@ -71,5 +71,5 @@
  static const char qt_configure_plugins_path_str      [256 + 12] = "$PLUGINS_PATH_STR";
  static const char qt_configure_imports_path_str      [256 + 12] = "$IMPORTS_PATH_STR";
-@@ -4785,6 +4806,7 @@
+@@ -4837,6 +4858,7 @@
  #define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;
  #define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;
@@ -79,5 +79,5 @@
  #define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;
  #define QT_CONFIGURE_IMPORTS_PATH qt_configure_imports_path_str + 12;
-@@ -4944,20 +4966,11 @@
+@@ -4996,20 +5018,11 @@
              EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
              EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
@@ -105,5 +105,5 @@
  		echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile"
  		echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile"
-@@ -5389,9 +5402,9 @@
+@@ -5441,9 +5454,9 @@
          psql)
              if [ "$CFG_SQL_psql" != "no" ]; then
@@ -118,5 +118,5 @@
                  [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL"
                  [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL"
-@@ -7042,16 +7055,8 @@
+@@ -7097,16 +7110,8 @@
  
  # set the global Mac deployment target. This is overridden on an arch-by-arch basis
@@ -137,5 +137,5 @@
  # disable Qt 3 support on VxWorks, Symbian and INTEGRITY
  case "$XPLATFORM" in
-@@ -7782,28 +7787,28 @@
+@@ -7844,28 +7849,28 @@
  # env. variable. 
  if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] ; then
@@ -182,5 +182,5 @@
  fi
  
-@@ -8550,6 +8555,7 @@
+@@ -8618,6 +8623,7 @@
  QMAKE_RCC        = \$\$QT_BUILD_TREE/bin/rcc
  QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
Index: /trunk/dports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff	(revision 97949)
+++ /trunk/dports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff	(revision 97950)
@@ -1,5 +1,5 @@
---- mkspecs/features/qt_functions.prf.orig	2012-05-11 10:33:49.000000000 -0400
-+++ mkspecs/features/qt_functions.prf	2012-05-25 13:15:09.000000000 -0400
-@@ -16,24 +16,54 @@
+--- mkspecs/features/qt_functions.prf.orig	2012-09-20 10:57:59.000000000 -0400
++++ mkspecs/features/qt_functions.prf	2012-09-20 15:31:19.000000000 -0400
+@@ -16,24 +16,75 @@
  }
  
@@ -63,14 +63,37 @@
 -       	      exists($${frmwrk_dir}/$${LIB_NAME}.framework) {
 -                QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
++
++    # see if the framework, and exists in the current known paths
++
++    # add LIBS entries QMAKE_FRAMEWORKPATH, as appropriate
++
++    all_frmwrks = $$find(LIBS, -F.*) $$find(QMAKE_LFLAGS, -F.*)
++#    message(qtAddLibrary: all frameworks is $$all_frmwrks)
++
++    for(frmwrk_dir, all_frmwrks) {
++
++#      message(qtAddLibrary: this frmwrk_dir is $$frmwrk_dir)
++      tfp = $$frmwrk_dir
++      tfp ~= s,-F,,
++      QMAKE_FRAMEWORKPATH *= $$tfp
++#      message(qtAddLibrary: this frmwrk_path is $$tfp)
++
++    }
++
 +    mac:!qt_no_framework {
-+       for(frmwrk_dir, $$list($$QMAKE_FRAMEWORKDIR_QT $$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH))) {
++       for(frmwrk_dir, $$list($$QMAKE_FRAMEWORKPATH $$QMAKE_FRAMEWORKDIR_QT $$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH))) {
++
++#           message(qtAddLibrary: looking for framework $$LIB_NAME in directory $$frmwrk_dir)
 +           exists($${frmwrk_dir}/$${LIB_NAME}.framework) {
-+               QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
++
++                message(qtAddLibrary: found framework $$LIB_NAME in directory $$frmwrk_dir)
      	        FRAMEWORK_INCLUDE = $$frmwrk_dir/$${LIB_NAME}.framework/Headers
      	        !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
      	          INCLUDEPATH -= $$FRAMEWORK_INCLUDE
-@@ -42,8 +72,7 @@
+@@ -41,10 +92,13 @@
+                 }
      	        LINKAGE = -framework $${LIB_NAME}
         	        break()
++
                }
 -           }
@@ -78,8 +101,52 @@
 +         }
      }
++
++    # special for symbian
++
      symbian {
          isEqual(LIB_NAME, QtCore) {
-@@ -73,7 +102,16 @@
+             #workaround for dependency from f32file.h on e32svr.h which has moved location in symbian3
+@@ -70,10 +124,56 @@
+         export(TARGET.EPOCHEAPSIZE)
+         export(TARGET.CAPABILITY)
+     }
++
++    isEmpty(LINKAGE) {
++
++      # not a framework or symbian
++      # see if the library exists in the current known paths
++
++      # add LIBS entries QMAKE_LIBPATH, as appropriate
++
++      all_libs = $$find(LIBS, -L.*) $$find(QMAKE_LFLAGS, -L.*)
++#      message(qtAddLibrary: all library paths is $$all_libs)
++
++      for(lib_dir, all_libs) {
++
++#        message(qtAddLibrary: this lib_dir is $$lib_dir)
++        tlp = $$lib_dir
++        tlp ~= s,-L,,
++        QMAKE_LIBPATH *= $$tlp
++#        message(qtAddLibrary: this lib_path is $$tlp)
++
++      }
++
++      for(lib_dir, $$list($$QMAKE_LIBPATH $$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR)) {
++
++#           message(qtAddLibrary: looking for library $${LIB_NAME}$${QT_LIBINFIX} in directory $$lib_dir)
++           exists($${lib_dir}/lib$${LIB_NAME}$${QT_LIBINFIX}.*) {
++
++                message(qtAddLibrary: found library $${LIB_NAME}$${QT_LIBINFIX} in directory $$lib_dir)
++    	        LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
++       	        break()
++
++              }
++         }
++    }
++
      isEmpty(LINKAGE) {
++
++       message(WARNING: Could not find library or framework $$LIB_NAME in the current known search directories; assuming a default library.)
++
         if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
             win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
@@ -98,5 +165,5 @@
         isEmpty(LINKAGE):LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
      }
-@@ -83,6 +121,9 @@
+@@ -83,9 +183,13 @@
          QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX}
      }
@@ -108,5 +175,9 @@
      export(INCLUDEPATH)
      export(QMAKE_FRAMEWORKPATH)
-@@ -119,4 +160,3 @@
++    export(QMAKE_LIBPATH)
+     export(QMAKE_LFLAGS)
+     return(true)
+ }
+@@ -119,4 +223,3 @@
  
      return(true)
Index: /trunk/dports/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff	(revision 97949)
+++ /trunk/dports/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff	(revision 97950)
@@ -1,5 +1,5 @@
 --- qmake/qmake.pri.orig	2012-04-23 14:49:04.000000000 -0400
 +++ qmake/qmake.pri	2012-04-17 14:38:16.000000000 -0400
-@@ -138,7 +138,7 @@
+@@ -136,7 +136,7 @@
          mac {
            SOURCES += qfilesystemengine_mac.cpp
Index: /trunk/dports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebKit_qt_QtWebKit.pro.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebKit_qt_QtWebKit.pro.diff	(revision 97949)
+++ /trunk/dports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebKit_qt_QtWebKit.pro.diff	(revision 97950)
@@ -10,5 +10,5 @@
          }
  
-@@ -295,7 +295,7 @@
+@@ -297,7 +297,7 @@
  
  !symbian-abld:!symbian-sbsv2 {
@@ -19,5 +19,5 @@
      INSTALLS += modfile
  } else {
-@@ -303,7 +303,7 @@
+@@ -305,7 +305,7 @@
  
      inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
Index: /trunk/dports/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff	(revision 97950)
+++ /trunk/dports/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff	(revision 97950)
@@ -0,0 +1,11 @@
+--- src/corelib/corelib.pro.orig	2012-09-17 15:22:14.000000000 -0400
++++ src/corelib/corelib.pro	2012-09-17 15:22:22.000000000 -0400
+@@ -25,7 +25,7 @@
+         LIBS_PRIVATE += -framework CoreServices -framework Security
+     }
+ } else:mac|darwin {
+-        LIBS_PRIVATE += -framework CoreFoundation -framework Security
++        LIBS_PRIVATE += -framework CoreFoundation -framework Security -framework Foundation
+ }
+ mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
+ win32:DEFINES-=QT_NO_CAST_TO_ASCII
Index: /trunk/dports/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff
===================================================================
--- /trunk/dports/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff	(revision 97949)
+++ /trunk/dports/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff	(revision 97950)
@@ -1,5 +1,5 @@
 --- src/tools/bootstrap/bootstrap.pro.orig	2012-04-23 14:49:04.000000000 -0400
 +++ src/tools/bootstrap/bootstrap.pro	2012-04-17 14:38:16.000000000 -0400
-@@ -104,7 +104,7 @@
+@@ -103,7 +103,7 @@
  else:win32:SOURCES += ../../corelib/tools/qlocale_win.cpp
  
