
--- qt-x11-free-3.3.8/Makefile	2005-01-03 11:08:00.000000000 -0500
+++ qt-x11-free-3.3.8-new/Makefile	2007-10-04 16:09:34.000000000 -0400
@@ -11,7 +11,7 @@
 install: FORCE
 	@$(MAKE) qt.install
 
-all: symlinks src-qmake src-moc sub-src sub-tools sub-tutorial sub-examples
+all: symlinks src-qmake src-moc sub-src sub-tools
 	@echo
 	@echo "The Qt library is now built in ./lib"
 	@echo "The Qt examples are built in the directories in ./examples"
--- qt-x11-free-3.3.8/config.tests/x11/xfreetype.test	2004-08-09 16:16:57.000000000 -0400
+++ qt-x11-free-3.3.8-new/config.tests/x11/xfreetype.test	2007-10-04 16:09:34.000000000 -0400
@@ -41,7 +41,7 @@
 LIBS="Xft2 Xft"
 for LIB in $LIBS; do
     for LIBDIR in $LIBDIRS; do
-	EXTENSIONS="a so sl"
+	EXTENSIONS="a so sl dylib"
 	for E in $EXTENSIONS; do
 	    if [ -f "$LIBDIR/lib$LIB.$E" ]; then
 		F="$LIB"
--- qt-x11-free-3.3.8/configure	2007-01-15 07:41:50.000000000 -0500
+++ qt-x11-free-3.3.8-new/configure	2007-10-04 16:09:34.000000000 -0400
@@ -36,7 +36,7 @@
 
 # need that throughout the script
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_RELEASE=`(uname -r | cut -d. -f1) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
@@ -554,9 +554,9 @@
 	    QMAKE_PROJECTS="$QMAKE_PROJECTS $relpath/$VAL"
 	else
 	    if [ -d $relpath/$VAL ]; then
-		QMAKE_PROJECTS="$QMAKE_PROJECTS `find $relpath/$VAL -name '*.pro' -print`"
+		QMAKE_PROJECTS="$QMAKE_PROJECTS `find $relpath/$VAL -name '*.pro' -print | grep -v /examples/ | grep -v /tutorial/`"
 	    else
-		QMAKE_PROJECTS="$QMAKE_PROJECTS `find $relpath/. -name '*.pro' -print`"
+		QMAKE_PROJECTS="$QMAKE_PROJECTS `find $relpath/. -name '*.pro' -print | grep -v /examples/ | grep -v /tutorial/`"
 	    fi
 	fi
 	;;
@@ -1051,8 +1051,8 @@
 [ -z "$QT_INSTALL_DATA" ]         && QT_INSTALL_DATA=$QT_INSTALL_PREFIX
 # default PREFIX/translations
 [ -z "$QT_INSTALL_TRANSLATIONS" ] && QT_INSTALL_TRANSLATIONS=$QT_INSTALL_PREFIX/translations
-# default PREFIX/etc/settings
-[ -z "$QT_INSTALL_SYSCONF" ]      && QT_INSTALL_SYSCONF=$QT_INSTALL_PREFIX/etc/settings
+# default PREFIX/etc/qt
+[ -z "$QT_INSTALL_SYSCONF" ]      && QT_INSTALL_SYSCONF=$QT_INSTALL_PREFIX/etc/qt
 
 # generate qconfig.cpp
 [ -d $outpath/src/tools ] || mkdir -p $outpath/src/tools
@@ -3087,7 +3087,7 @@
 	COMPILER_VERSION="3.*"
 	;;
     *4.*)
-	COMPILER_VERSION="4"
+	COMPILER_VERSION="4.*"
 	;;
     *)
 	;;
@@ -3525,7 +3525,7 @@
 
 echo "Finding project files. Please wait..."
 if [ -z "$QMAKE_PROJECTS" ]; then
-    QMAKE_PROJECTS=`find $relpath/. -name '*.pro' -print | sed 's-/\./-/-'`
+    QMAKE_PROJECTS=`find $relpath/. -name '*.pro' -print | grep -v /examples/ | grep -v /tutorial/ | sed 's-/\./-/-'`
 else
     QT_PROJECTS=
     for a in `echo $QMAKE_PROJECTS`; do
--- qt-x11-free-3.3.8/include/qglobal.h	2007-02-02 09:01:04.000000000 -0500
+++ qt-x11-free-3.3.8-new/include/qglobal.h	2007-10-04 16:09:34.000000000 -0400
@@ -44,6 +44,10 @@
  */
 #define QT_VERSION 0x030308
 
+#ifndef __DARWIN_X11__
+#define __DARWIN_X11__
+#endif
+
 /*
    The operating system, must be one of: (Q_OS_x)
 
@@ -562,6 +566,8 @@
 
 #if defined(Q_OS_MAC9)
 #  define Q_WS_MAC9
+#elif defined(__DARWIN_X11__)
+#  define Q_WS_X11
 #elif defined(Q_OS_MSDOS)
 #  define Q_WS_WIN16
 #  error "Qt requires Win32 and does not work with Windows 3.x"
@@ -882,6 +888,10 @@
 #    define Q_TEMPLATE_EXTERN
 #    undef  Q_DISABLE_COPY 	/* avoid unresolved externals */
 #  endif
+#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4
+#    define Q_EXPORT __attribute__((visibility("default")))
+#    undef QT_MAKEDLL		/* ignore these for other platforms */
+#    undef QT_DLL
 #else
 #  undef QT_MAKEDLL		/* ignore these for other platforms */
 #  undef QT_DLL
--- qt-x11-free-3.3.8/mkspecs/darwin-g++/qmake.conf	2007-02-02 09:01:44.000000000 -0500
+++ qt-x11-free-3.3.8-new/mkspecs/darwin-g++/qmake.conf	2007-10-04 16:09:55.000000000 -0400
@@ -9,10 +9,10 @@
 MAKEFILE_GENERATOR	= UNIX
 TEMPLATE		= app
 CONFIG			+= qt warn_on release native_precompiled_headers
-CONFIG			+= qt warn_on release link_prl
+CONFIG			+= qt warn_on release link_prl lib_version_first
 DEFINES                 += __DARWIN_X11__
 
-QMAKE_CC		= cc
+QMAKE_CC		= gcc-4.0
 QMAKE_LEX		= flex
 QMAKE_LEXFLAGS		= 
 QMAKE_YACC		= yacc
@@ -21,7 +21,7 @@
 QMAKE_CFLAGS_DEPS	= -M
 QMAKE_CFLAGS_WARN_ON	= -Wall -W
 QMAKE_CFLAGS_WARN_OFF	= -w
-QMAKE_CFLAGS_RELEASE	= -O2
+QMAKE_CFLAGS_RELEASE	= -Os
 QMAKE_CFLAGS_DEBUG	= -g
 QMAKE_CFLAGS_SHLIB	= -fPIC
 QMAKE_EXTENSION_SHLIB	= dylib
@@ -29,7 +29,7 @@
 QMAKE_CFLAGS_YACC	= -Wno-unused -Wno-parentheses
 QMAKE_CFLAGS_THREAD	=
 
-QMAKE_CXX		= c++
+QMAKE_CXX		= g++-4.0
 QMAKE_CXXFLAGS		= $$QMAKE_CFLAGS
 QMAKE_CXXFLAGS_DEPS	= $$QMAKE_CFLAGS_DEPS
 QMAKE_CXXFLAGS_WARN_ON	= $$QMAKE_CFLAGS_WARN_ON
@@ -40,8 +40,8 @@
 QMAKE_CXXFLAGS_YACC	= $$QMAKE_CFLAGS_YACC
 QMAKE_CXXFLAGS_THREAD	=
 
-QMAKE_INCDIR		= /usr/local/include
-QMAKE_LIBDIR		=
+QMAKE_INCDIR		= @PREFIX@/lib/qt3/include
+QMAKE_LIBDIR		= @PREFIX@/lib
 QMAKE_INCDIR_X11	= /usr/X11R6/include
 QMAKE_LIBDIR_X11	= /usr/X11R6/lib
 QMAKE_INCDIR_QT		= $(QTDIR)/include
@@ -49,13 +49,13 @@
 QMAKE_INCDIR_OPENGL	= /usr/X11R6/include
 QMAKE_LIBDIR_OPENGL	= /usr/X11R6/lib
 
-QMAKE_LINK		= c++
-QMAKE_LINK_SHLIB	= c++
-QMAKE_LFLAGS		=
+QMAKE_LINK		= g++-4.0
+QMAKE_LINK_SHLIB	= g++-4.0
+QMAKE_LFLAGS		= -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
 QMAKE_LFLAGS_RELEASE	=
 QMAKE_LFLAGS_DEBUG	=
 QMAKE_LFLAGS_APP        = -prebind
-QMAKE_LFLAGS_SHLIB	= -prebind -dynamiclib -single_module -headerpad_max_install_names
+QMAKE_LFLAGS_SHLIB	= -prebind -dynamiclib -single_module -headerpad_max_install_names -install_name @PREFIX@/lib/$(TARGET1)
 QMAKE_LFLAGS_PLUGIN	= -bundle
 QMAKE_LFLAGS_THREAD	= 
 
@@ -64,7 +64,7 @@
 
 QMAKE_RPATH		= 
 
-QMAKE_LIBS_DYNLOAD	=
+QMAKE_LIBS_DYNLOAD	= -ldl
 QMAKE_LIBS_X11		= -lXext -lX11 -lm
 QMAKE_LIBS_X11SM	= -lSM -lICE
 QMAKE_LIBS_QT		= -lqt
@@ -76,17 +76,17 @@
 QMAKE_MOC		= $(QTDIR)/bin/moc
 QMAKE_UIC		= $(QTDIR)/bin/uic
 
-QMAKE_AR		= ar cq
-QMAKE_RANLIB		= ranlib -s
+QMAKE_AR		= /usr/bin/ar cq
+QMAKE_RANLIB		= /usr/bin/ranlib -s
 
 QMAKE_TAR		= tar -cf
 QMAKE_GZIP		= gzip -9f
 
-QMAKE_COPY		= cp -f
+QMAKE_COPY		= /bin/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_MOVE		= /bin/mv -f
+QMAKE_DEL_FILE		= /bin/rm -f
+QMAKE_DEL_DIR		= /bin/rmdir
+QMAKE_CHK_DIR_EXISTS	= /bin/test -d
+QMAKE_MKDIR		= /bin/mkdir -p
--- qt-x11-free-3.3.8/mkspecs/darwin-g++/qplatformdefs.h	2003-05-27 11:19:20.000000000 -0400
+++ qt-x11-free-3.3.8-new/mkspecs/darwin-g++/qplatformdefs.h	2007-10-04 16:09:34.000000000 -0400
@@ -74,12 +74,13 @@
 #define QT_SIGNAL_ARGS		int
 #define QT_SIGNAL_IGNORE	SIG_IGN
 
-#define QT_SOCKLEN_T		int
+#define QT_SOCKLEN_T		socklen_t
 
 #define QT_SNPRINTF		::snprintf
 #define QT_VSNPRINTF		::vsnprintf
 
 #define QT_AOUT_UNDERSCORE
 
+#define QT_MITSHM
 
 #endif // QPLATFORMDEFS_H
--- qt-x11-free-3.3.8/qmake/Makefile.unix	2006-02-28 05:32:54.000000000 -0500
+++ qt-x11-free-3.3.8-new/qmake/Makefile.unix	2007-10-04 16:09:34.000000000 -0400
@@ -36,8 +36,8 @@
 	-I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac \
 	-I@BUILD_PATH@/include/qmake -I@BUILD_PATH@/include -I@SOURCE_PATH@/include \
 	-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \
-	-DQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP
-LFLAGS=@QMAKE_LFLAGS@
+	-DQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP -mdynamic-no-pic
+LFLAGS=@QMAKE_LFLAGS@ -mdynamic-no-pic
 
 qmake: $(OBJS) $(QOBJS)
 	$(CXX) -o $@ $(OBJS) $(QOBJS) $(LFLAGS)
--- qt-x11-free-3.3.8/qmake/main.cpp	2007-02-02 09:01:27.000000000 -0500
+++ qt-x11-free-3.3.8-new/qmake/main.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -49,7 +49,7 @@
 
 // for Borland, main is defined to qMain which breaks qmake
 #undef main
-#ifdef Q_OS_MAC
+#if defined(Q_OS_MAC) || defined(Q_OS_DARWIN)
 // for qurl
 bool qt_resolve_symlinks = FALSE;
 #endif
--- qt-x11-free-3.3.8/src/kernel/qprocess_unix.cpp	2007-02-02 09:01:11.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/kernel/qprocess_unix.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -761,7 +761,7 @@
 #endif
 	i++;
     }
-#ifdef Q_OS_MACX
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN)
     if(i) {
 	QCString arg_bundle = arglistQ[0];
 	QFileInfo fi(arg_bundle);
@@ -826,7 +826,7 @@
 	} else { // start process with environment settins as specified in env
 	    // construct the environment for exec
 	    int numEntries = env->count();
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN)
 	    QString ld_library_path("DYLD_LIBRARY_PATH");
 #else
 	    QString ld_library_path("LD_LIBRARY_PATH");
@@ -858,7 +858,7 @@
 		    QStringList pathList = QStringList::split( ':', getenv( "PATH" ) );
 		    for (QStringList::Iterator it = pathList.begin(); it != pathList.end(); ++it ) {
 			QString dir = *it;
-#if defined(Q_OS_MACX) //look in a bundle
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) //look in a bundle
 			if(!QFile::exists(dir + "/" + command) && QFile::exists(dir + "/" + command + ".app"))
 			    dir += "/" + command + ".app/Contents/MacOS";
 #endif
@@ -868,7 +868,7 @@
 			QFileInfo fileInfo( dir + "/" + command );
 #endif
 			if ( fileInfo.isExecutable() ) {
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN)
 			    arglistQ[0] = fileInfo.absFilePath().local8Bit();
 #else
 			    arglistQ[0] = fileInfo.filePath().local8Bit();
--- qt-x11-free-3.3.8/src/moc/moc.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/moc/moc.pro	2007-10-04 16:09:34.000000000 -0400
@@ -48,6 +48,8 @@
 unix:SOURCES	+= ../tools/qfile_unix.cpp ../tools/qdir_unix.cpp ../tools/qfileinfo_unix.cpp
 win32:SOURCES	+= ../tools/qfile_win.cpp ../tools/qdir_win.cpp ../tools/qfileinfo_win.cpp
 macx:LIBS	+= -framework Carbon
+CFLAGS += -mdynamic-no-pic
+CXXFLAGS += -mdynamic-no-pic
 
 target.path=$$bins.path
 INSTALLS += target
--- qt-x11-free-3.3.8/src/network/qdns.cpp	2007-02-02 09:01:09.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/network/qdns.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -76,7 +76,7 @@
 #include "qcleanuphandler.h"
 #include <limits.h>
 #ifdef Q_OS_MAC
-#include "../3rdparty/dlcompat/dlfcn.h"
+#include <dlfcn.h>
 #endif
 
 //#define QDNS_DEBUG
--- qt-x11-free-3.3.8/src/qt_professional.pri	2004-02-06 07:08:19.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/qt_professional.pri	2007-10-04 16:09:34.000000000 -0400
@@ -25,7 +25,6 @@
 	unix {
 		NETWORK_H	= $$NETWORK_CPP
 	}
-	mac:INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/dlcompat
 	INCLUDEPATH += $$QT_SOURCE_TREE/src/network
 	include( $$QT_SOURCE_TREE/src/network/qt_network.pri )
 	DEFINES     *= QT_MODULE_NETWORK
--- qt-x11-free-3.3.8/src/qtmain.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/qtmain.pro	2007-10-04 16:09:34.000000000 -0400
@@ -2,6 +2,7 @@
 TEMPLATE = lib
 TARGET	 = qtmain
 VERSION	 = 3.1.0
+COMPATIBILITY_VERSION = 3.0.0
 DESTDIR	 = $$QMAKE_LIBDIR_QT
 
 CONFIG	+= qt staticlib warn_on release
--- qt-x11-free-3.3.8/src/sql/qdatatable.cpp	2007-01-11 08:46:33.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/sql/qdatatable.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -1043,8 +1043,8 @@
 	return FALSE;
     if ( !sqlCursor()->canInsert() ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::insertCurrent: insert not allowed for " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::insertCurrent: insert not allowed for %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	endInsert();
 	return FALSE;
@@ -1117,16 +1117,16 @@
 	return FALSE;
     if ( sqlCursor()->primaryIndex().count() == 0 ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::updateCurrent: no primary index for " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::updateCurrent: no primary index for %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	endUpdate();
 	return FALSE;
     }
     if ( !sqlCursor()->canUpdate() ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::updateCurrent: updates not allowed for " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::updateCurrent: updates not allowed for %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	endUpdate();
 	return FALSE;
@@ -1191,8 +1191,8 @@
 	return FALSE;
     if ( sqlCursor()->primaryIndex().count() == 0 ) {
 #ifdef QT_CHECK_RANGE
-	qWarning("QDataTable::deleteCurrent: no primary index " +
-		 sqlCursor()->name() );
+	qWarning("QDataTable::deleteCurrent: no primary index %s",
+		 sqlCursor()->name().latin1() );
 #endif
 	return FALSE;
     }
--- qt-x11-free-3.3.8/src/sql/qsqldatabase.cpp	2007-01-11 10:03:02.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/sql/qsqldatabase.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -234,7 +234,8 @@
 	db->open();
 #ifdef QT_CHECK_RANGE
 	if ( !db->isOpen() )
-	    qWarning("QSqlDatabaseManager::database: unable to open database: " + db->lastError().databaseText() + ": " + db->lastError().driverText() );
+	    qWarning("QSqlDatabaseManager::database: unable to open database: %s: %s",
+                    db->lastError().databaseText().latin1(), db->lastError().driverText().latin1() );
 #endif
     }
     return db;
@@ -686,7 +687,7 @@
     if ( !d->driver ) {
 #ifdef QT_CHECK_RANGE
 	qWarning( "QSqlDatabase: %s driver not loaded", type.latin1() );
-	qWarning( "QSqlDatabase: available drivers: " + drivers().join(" ") );
+	qWarning( "QSqlDatabase: available drivers: %s", drivers().join(" ").latin1() );
 #endif
 	d->driver = new QNullDriver();
 	d->driver->setLastError( QSqlError( "Driver not loaded", "Driver not loaded" ) );
--- qt-x11-free-3.3.8/src/sql/qsqlindex.cpp	2007-01-11 08:46:35.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/sql/qsqlindex.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -273,7 +273,7 @@
 	if ( field )
 	    newSort.append( *field, desc );
 	else
-	    qWarning( "QSqlIndex::fromStringList: unknown field: '" + f + "'" );
+	    qWarning( "QSqlIndex::fromStringList: unknown field: '%s'", f.latin1());
     }
     return newSort;
 }
--- qt-x11-free-3.3.8/src/sql/qsqlrecord.cpp	2007-01-11 08:46:35.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/sql/qsqlrecord.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -298,7 +298,7 @@
 	    return i;
     }
 #ifdef QT_CHECK_RANGE
-    qWarning( "QSqlRecord::position: unable to find field " + name );
+    qWarning( "QSqlRecord::position: unable to find field %s", name.latin1() );
 #endif
     return -1;
 }
@@ -313,7 +313,7 @@
     checkDetach();
     if ( !sh->d->contains( i ) ) {
 #ifdef QT_CHECK_RANGE
-	qWarning( "QSqlRecord::field: index out of range: " + QString::number( i ) );
+	qWarning( "QSqlRecord::field: index out of range: %d", i );
 #endif
 	return 0;
     }
@@ -344,7 +344,7 @@
 {
     if ( !sh->d->contains( i ) ) {
 #ifdef QT_CHECK_RANGE
-	qWarning( "QSqlRecord::field: index out of range: " + QString::number( i ) );
+	qWarning( "QSqlRecord::field: index out of range: %d", i  );
 #endif // QT_CHECK_RANGE
 	return 0;
     }
--- qt-x11-free-3.3.8/src/tools/qdir_unix.cpp	2007-02-02 09:01:05.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qdir_unix.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -88,7 +88,7 @@
 
 bool QDir::mkdir( const QString &dirName, bool acceptAbsPath ) const
 {
-#if defined(Q_OS_MACX)  // Mac X doesn't support trailing /'s
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN)  // Mac X doesn't support trailing /'s
     QString name = dirName;
     if (dirName[dirName.length() - 1] == "/")
 	name = dirName.left( dirName.length() - 1 );
--- qt-x11-free-3.3.8/src/tools/qglobal.cpp	2007-02-02 09:01:06.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qglobal.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -161,7 +161,7 @@
     return TRUE;
 }
 
-#if !defined(QWS) && defined(Q_OS_MAC)
+#if !defined(QWS) && !defined(Q_WS_X11) && defined(Q_OS_MACX)
 
 #include "qt_mac.h"
 
@@ -680,7 +680,7 @@
     if ( code != -1 )
 	qWarning( "%s\n\tError code %d - %s", msg, code, strerror( code ) );
     else
-	qWarning( msg );
+	qWarning( "%s", msg );
 #endif
 #else
     Q_UNUSED( msg );
--- qt-x11-free-3.3.8/src/tools/qglobal.h	2007-02-02 09:01:04.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qglobal.h	2007-10-04 16:09:34.000000000 -0400
@@ -44,6 +44,10 @@
  */
 #define QT_VERSION 0x030308
 
+#ifndef __DARWIN_X11__
+#define __DARWIN_X11__
+#endif
+
 /*
    The operating system, must be one of: (Q_OS_x)
 
@@ -562,6 +566,8 @@
 
 #if defined(Q_OS_MAC9)
 #  define Q_WS_MAC9
+#elif defined(__DARWIN_X11__)
+#  define Q_WS_X11
 #elif defined(Q_OS_MSDOS)
 #  define Q_WS_WIN16
 #  error "Qt requires Win32 and does not work with Windows 3.x"
@@ -882,6 +888,10 @@
 #    define Q_TEMPLATE_EXTERN
 #    undef  Q_DISABLE_COPY 	/* avoid unresolved externals */
 #  endif
+#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4
+#    define Q_EXPORT __attribute__((visibility("default")))
+#    undef QT_MAKEDLL		/* ignore these for other platforms */
+#    undef QT_DLL
 #else
 #  undef QT_MAKEDLL		/* ignore these for other platforms */
 #  undef QT_DLL
--- qt-x11-free-3.3.8/src/tools/qgpluginmanager.cpp	2007-02-02 09:01:04.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qgpluginmanager.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -316,7 +316,7 @@
 
 #if defined(Q_OS_WIN32)
     QString filter = "*.dll";
-#elif defined(Q_OS_MACX)
+#elif defined(Q_OS_MACX) || defined(Q_OS_DARWIN)
     QString filter = "*.dylib; *.so; *.bundle";
 #elif defined(Q_OS_HPUX)
     QString filter = "*.sl";
--- qt-x11-free-3.3.8/src/tools/qlibrary.cpp	2007-02-02 09:01:04.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qlibrary.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -400,7 +400,7 @@
 	filename += ".dll";
 #else
     QStringList filters = "";
-#ifdef Q_OS_MACX
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN)
     filters << ".so";
     filters << ".bundle";
     filters << ".dylib"; //the last one is also the default one..
--- qt-x11-free-3.3.8/src/tools/qlibrary_unix.cpp	2007-02-02 09:01:06.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qlibrary_unix.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -114,7 +114,7 @@
 
     QString filename = library->library();
 
-    pHnd = DL_PREFIX(dlopen)( filename.latin1(), RTLD_LAZY );
+    pHnd = DL_PREFIX(dlopen)( filename.latin1(), RTLD_LAZY | RTLD_LOCAL );
 #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT)
     if ( !pHnd )
 	qWarning( "%s", DL_PREFIX(dlerror)() );
--- qt-x11-free-3.3.8/src/tools/qmutex_unix.cpp	2007-02-02 09:01:04.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qmutex_unix.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -44,7 +44,7 @@
 // POSIX threads mutex types
 #if ((defined(PTHREAD_MUTEX_RECURSIVE) && defined(PTHREAD_MUTEX_DEFAULT)) || \
      defined(Q_OS_FREEBSD)) && !defined(Q_OS_UNIXWARE) && !defined(Q_OS_SOLARIS) && \
-    !defined(Q_OS_MAC)
+    !defined(Q_OS_MAC) && !defined(Q_OS_DARWIN)
 // POSIX 1003.1c-1995 - We love this OS
 #  define Q_MUTEX_SET_TYPE(a, b) pthread_mutexattr_settype((a), (b))
 #  if defined(QT_CHECK_RANGE)
--- qt-x11-free-3.3.8/src/tools/qsettings.cpp	2007-02-02 09:01:03.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qsettings.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -981,7 +981,7 @@
 
 	if ( filename.isEmpty() ) {
 
-#ifdef QT_CHECK_STATE
+#if 0 // this error is damn annoying
 	    qWarning("QSettings::sync: filename is null/empty");
 #endif // QT_CHECK_STATE
 
--- qt-x11-free-3.3.8/src/tools/qstring.cpp	2007-02-02 09:01:05.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qstring.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -1362,7 +1362,7 @@
 QStringData* QString::makeSharedNull()
 {
     QString::shared_null = new QStringData;
-#if defined( Q_OS_MAC ) || defined(Q_OS_SOLARIS) || defined(Q_OS_HPUX) || defined(Q_OS_AIX)
+#if defined( Q_OS_MAC ) || defined(Q_OS_DARWIN) || defined(Q_OS_SOLARIS) || defined(Q_OS_HPUX) || defined(Q_OS_AIX)
     QString *that = const_cast<QString *>(&QString::null);
     that->d = QString::shared_null;
 #endif
@@ -2923,7 +2923,7 @@
     if (!l)
 	return -1;
 
-#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020
+#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) | defined(Q_OS_DARWIN))
     if ( sl == 1 )
 	return find( *str.unicode(), index, cs );
 #endif
@@ -3022,7 +3022,7 @@
 
 int QString::findRev( QChar c, int index, bool cs ) const
 {
-#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION < 0x1020
+#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) | defined(Q_OS_DARWIN))
     return findRev( QString( c ), index, cs );
 #else
     const uint l = length();
@@ -3078,7 +3078,7 @@
     if ( index > delta )
 	index = delta;
 
-#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020
+#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) | defined(Q_OS_DARWIN))
     if ( sl == 1 )
 	return findRev( *str.unicode(), index, cs );
 #endif
--- qt-x11-free-3.3.8/src/tools/qt_tools.pri	2004-04-01 05:20:06.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/tools/qt_tools.pri	2007-10-04 16:09:34.000000000 -0400
@@ -101,10 +101,6 @@
 		  $$TOOLS_CPP/qwaitcondition_unix.cpp
 
         mac:!x11:!embedded:SOURCES += $$TOOLS_CPP/qsettings_mac.cpp
-	mac {
-		SOURCES+=3rdparty/dlcompat/dlfcn.c
-		INCLUDEPATH+=3rdparty/dlcompat
-	    }
 	unix:SOURCES += $$TOOLS_CPP/qlibrary_unix.cpp
 
 	SOURCES += $$TOOLS_CPP/qbitarray.cpp \
--- qt-x11-free-3.3.8/src/widgets/qtextedit.cpp	2007-02-02 09:01:23.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/widgets/qtextedit.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -6349,7 +6349,7 @@
 		    cur = tag->prev;
 		    if ( !cur ) {
 #ifdef QT_CHECK_RANGE
-			qWarning( "QTextEdit::optimParseTags: no left-tag for '<" + tag->tag + ">' in line %d.", tag->line + 1 );
+			qWarning( "QTextEdit::optimParseTags: no left-tag for '<%s>' in line %d.", tag->tag.ascii(), tag->line + 1 );
 #endif
 			return; // something is wrong - give up
 		    }
@@ -6372,7 +6372,7 @@
 				    break;
 				} else if ( !cur->leftTag ) {
 #ifdef QT_CHECK_RANGE
-				    qWarning( "QTextEdit::optimParseTags: mismatching %s-tag for '<" + cur->tag + ">' in line %d.", cur->tag[0] == '/' ? "left" : "right", cur->line + 1 );
+				    qWarning( "QTextEdit::optimParseTags: mismatching %s-tag for '<%s>' in line %d.", cur->tag[0] == '/' ? "left" : "right", cur->tag.ascii(), cur->line + 1 );
 #endif
 				    return; // something is amiss - give up
 				}
--- qt-x11-free-3.3.8/src/xml/qsvgdevice.cpp	2007-02-02 09:01:03.000000000 -0500
+++ qt-x11-free-3.3.8-new/src/xml/qsvgdevice.cpp	2007-10-04 16:09:34.000000000 -0400
@@ -978,7 +978,7 @@
 		// ### catch references to embedded .svg files
 		QPixmap pix;
 		if ( !pix.load( href ) ) {
-		    qWarning( "QSvgDevice::play: Couldn't load image "+href );
+		    qWarning( "QSvgDevice::play: Couldn't load image %s", href.latin1() );
 		    break;
 		}
 		pt->drawPixmap( QRect( x1, y1, w, h ), pix );
@@ -1024,8 +1024,8 @@
                 break;
 	    }
 	case InvalidElement:
-	    qWarning( "QSvgDevice::play: unknown element type " +
-		      node.nodeName() );
+	    qWarning( "QSvgDevice::play: unknown element type %s",
+		      node.nodeName().latin1() );
 	    break;
 	};
 
@@ -1111,7 +1111,7 @@
 {
     QRegExp reg( QString::fromLatin1("([+-]?\\d*\\.*\\d*[Ee]?[+-]?\\d*)(em|ex|px|%|pt|pc|cm|mm|in|)$") );
     if ( reg.search( str ) == -1 ) {
-	qWarning( "QSvgDevice::parseLen: couldn't parse " + str );
+	qWarning( "QSvgDevice::parseLen: couldn't parse %s ", str.latin1() );
 	if ( ok )
 	    *ok = FALSE;
 	return 0.0;
@@ -1140,7 +1140,7 @@
 	else if ( u == "pc" )
 	    dbl *= m.logicalDpiX() / 6.0;
 	else
-	    qWarning( "QSvgDevice::parseLen: Unknown unit " + u );
+	    qWarning( "QSvgDevice::parseLen: Unknown unit %s",  u.latin1() );
     }
     if ( ok )
 	*ok = TRUE;
--- qt-x11-free-3.3.8/tools/assistant/assistant.pro	2003-11-17 07:40:25.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/assistant/assistant.pro	2007-10-04 16:09:34.000000000 -0400
@@ -32,6 +32,8 @@
 
 win32:RC_FILE = assistant.rc
 mac:RC_FILE = assistant.icns
+CFLAGS += -mdynamic-no-pic
+CXXFLAGS += -mdynamic-no-pic
 
 target.path = $$bins.path
 INSTALLS += target
--- qt-x11-free-3.3.8/tools/designer/app/app.pro	2004-01-16 19:51:08.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/designer/app/app.pro	2007-10-04 16:09:34.000000000 -0400
@@ -20,7 +20,8 @@
    QMAKE_INFO_PLIST = Info_mac.plist
    staticlib:CONFIG -= global_init_link_order #yuck
 }
-
+CFLAGS += -mdynamic-no-pic
+CXXFLAGS += -mdynamic-no-pic
 
 target.path=$$bins.path
 INSTALLS        += target
--- qt-x11-free-3.3.8/tools/designer/designer/designer.pro	2006-02-15 10:48:20.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/designer/designer/designer.pro	2007-10-04 16:09:34.000000000 -0400
@@ -1,6 +1,6 @@
 TEMPLATE	= lib
 
-CONFIG		+= qt warn_on staticlib qmake_cache
+CONFIG		+= qt warn_on qmake_cache
 CONFIG 		-= dll
 !force_static:!win32:contains(QT_PRODUCT,qt-internal) {
    CONFIG          -= staticlib
--- qt-x11-free-3.3.8/tools/designer/editor/editor.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/designer/editor/editor.pro	2007-10-04 16:09:34.000000000 -0400
@@ -1,5 +1,5 @@
 TEMPLATE	= lib
-CONFIG		+= qt warn_on staticlib
+CONFIG		+= qt warn_on
 CONFIG		-= dll
 HEADERS		= editor.h  \
 		  parenmatcher.h  \
--- qt-x11-free-3.3.8/tools/designer/uic/uic.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/designer/uic/uic.pro	2007-10-04 16:09:34.000000000 -0400
@@ -40,3 +40,6 @@
    LIBS += $$MWERKSDIR/Libraries/PluginLib4.shlb
    SOURCES += mwerks_mac.cpp
 }
+CFLAGS += -mdynamic-no-pic
+CXXFLAGS += -mdynamic-no-pic
+
--- qt-x11-free-3.3.8/tools/linguist/linguist/linguist.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/linguist/linguist/linguist.pro	2007-10-04 16:09:34.000000000 -0400
@@ -43,6 +43,8 @@
     staticlib:CONFIG -= global_init_link_order #yuck
     RC_FILE = linguist.icns
 }
+CFLAGS += -mdynamic-no-pic
+CXXFLAGS += -mdynamic-no-pic
 
 PROJECTNAME	= Qt Linguist
 
--- qt-x11-free-3.3.8/tools/linguist/linguist.pro	2004-06-08 04:06:56.000000000 -0400
+++ qt-x11-free-3.3.8-new/tools/linguist/linguist.pro	2007-10-04 16:09:34.000000000 -0400
@@ -1,8 +1,5 @@
 TEMPLATE	= subdirs
 SUBDIRS		= linguist \
-		  tutorial/tt1 \
-		  tutorial/tt2 \
-		  tutorial/tt3 \
 		  lrelease \
 		  lupdate \
 		  qm2ts
--- qt-x11-free-3.3.8/tools/linguist/lrelease/lrelease.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/linguist/lrelease/lrelease.pro	2007-10-04 16:09:34.000000000 -0400
@@ -15,3 +15,6 @@
 
 target.path=$$bins.path
 INSTALLS	+= target
+
+QMAKE_CFLAGS += -mdynamic-no-pic
+QMAKE_CXXFLAGS += -mdynamic-no-pic
--- qt-x11-free-3.3.8/tools/linguist/lupdate/lupdate.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/linguist/lupdate/lupdate.pro	2007-10-04 16:09:34.000000000 -0400
@@ -19,3 +19,7 @@
 
 target.path=$$bins.path
 INSTALLS	+= target
+
+macx:CFLAGS += -mdynamic-no-pic
+macx:CXXFLAGS += -mdynamic-no-pic
+
--- qt-x11-free-3.3.8/tools/linguist/qm2ts/qm2ts.pro	2003-10-31 09:36:28.000000000 -0500
+++ qt-x11-free-3.3.8-new/tools/linguist/qm2ts/qm2ts.pro	2007-10-04 16:09:34.000000000 -0400
@@ -13,3 +13,6 @@
 
 target.path=$$bins.path
 INSTALLS	+= target
+
+CFLAGS += -mdynamic-no-pic
+CXXFLAGS += -mdynamic-no-pic
--- qt-x11-free-3.3.8/tools/qtconfig/qtconfig.pro	2005-07-19 20:59:24.000000000 -0400
+++ qt-x11-free-3.3.8-new/tools/qtconfig/qtconfig.pro	2007-10-04 16:09:34.000000000 -0400
@@ -15,4 +15,7 @@
 INSTALLS	+= target
 INCLUDEPATH	+= .
 DBFILE		 = qtconfig.db
+
+CFLAGS += -mdynamic-no-pic
+CXXFLAGS += -mdynamic-no-pic
 REQUIRES=full-config nocrosscompiler !win32*
