--- configure.orig
+++ configure
@@ -7828,7 +7828,7 @@ else
 	char b[false == 0 ? 1 : -1];
 	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
 	char d[(bool) 0.5 == true ? 1 : -1];
-	bool e = &s;
+	/* See body of main program for 'e'.  */
 	char f[(_Bool) 0.0 == false ? 1 : -1];
 	char g[true];
 	char h[sizeof (_Bool)];
@@ -7839,25 +7839,6 @@ else
 	_Bool n[m];
 	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
 	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-#	if defined __xlc__ || defined __GNUC__
-	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-	    reported by James Lemley on 2005-10-05; see
-	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-	    This test is not quite right, since xlc is allowed to
-	    reject this program, as the initializer for xlcbug is
-	    not one of the forms that C requires support for.
-	    However, doing the test right would require a runtime
-	    test, and that would make cross-compilation harder.
-	    Let us hope that IBM fixes the xlc bug, and also adds
-	    support for this kind of constant expression.  In the
-	    meantime, this test will reject xlc, which is OK, since
-	    our stdbool.h substitute should suffice.  We also test
-	    this with GCC, where it should work, to detect more
-	    quickly whether someone messes up the test in the
-	    future.  */
-	 char digs[] = "0123456789";
-	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-#	endif
 	/* Catch a bug in an HP-UX C compiler.  See
 	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
 	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
@@ -7869,6 +7850,7 @@ int
 main ()
 {
 
+	bool e = &s;
 	*pq |= q;
 	*pq |= ! q;
 	/* Refer to every declared value, to avoid compiler optimizations.  */
@@ -13010,7 +12992,7 @@ fi
   CXXFLAGS="$CXXFLAGS $QT_CXXFLAGS"
 
     if test "$is_apple" = yes; then
-    CXXFLAGS="$CXXFLAGS -ObjC"
+    LIBS="$LIBS -framework Carbon"
   fi
 
   QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
--- configure.in.orig
+++ configure.in
@@ -1146,7 +1146,7 @@ if test "${enable_qt_ok}" = yes ; then
 
   dnl Compile Objective C Cocoa headers on Mac to hide the gnuplot icon from the dock
   if test "$is_apple" = yes; then
-    CXXFLAGS="$CXXFLAGS -ObjC"
+    LIBS="$LIBS -framework Carbon"
   fi
 
   QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
--- src/qtterminal/qt_term.cpp.orig
+++ src/qtterminal/qt_term.cpp
@@ -46,7 +46,7 @@
 #include <QtNetwork>
 
 #ifdef Q_WS_MAC
-	#include <Cocoa/Cocoa.h>
+	#include <Carbon/Carbon.h>
 #endif
 
 extern "C" {
@@ -308,10 +308,15 @@ void qt_init()
 	QApplication* application = new QApplication(argc, (char**)( NULL));
 
 #ifdef Q_WS_MAC
-	// Don't display this application in the MAC OS X dock
-	ProcessSerialNumber psn;
-	if (GetCurrentProcess(&psn) == noErr)
-		TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
+	#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+		#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+			// Don't display this application in the MAC OS X dock
+			// kProcessTransformToBackgroundApplication only works on Mac OS X 10.7 and later
+			ProcessSerialNumber psn;
+			if (GetCurrentProcess(&psn) == noErr)
+				TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
+		#endif
+	#endif
 #endif
 
 	// The creation of a QApplication mangled our locale settings
