diff -uNr qt-x11-free-3.2.2/include/qglobal.h qt-x11-free-3.2.2-new/include/qglobal.h
--- qt-x11-free-3.2.2/include/qglobal.h	Thu Oct  9 21:47:11 2003
+++ qt-x11-free-3.2.2-new/include/qglobal.h	Thu Oct 16 09:13:21 2003
@@ -79,6 +79,10 @@
      UNIX	- Any UNIX BSD/SYSV system
 */
 
+#ifndef __DARWIN_X11__
+#define __DARWIN_X11__
+#endif
+
 #if defined(__DARWIN_X11__)
 #  define Q_OS_DARWIN
 #elif defined(__APPLE__) && defined(__GNUC__)
@@ -527,6 +531,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"
diff -uNr qt-x11-free-3.2.2/mkspecs/darwin-g++/qmake.conf qt-x11-free-3.2.2-new/mkspecs/darwin-g++/qmake.conf
--- qt-x11-free-3.2.2/mkspecs/darwin-g++/qmake.conf	Thu Oct  9 21:48:53 2003
+++ qt-x11-free-3.2.2-new/mkspecs/darwin-g++/qmake.conf	Thu Oct 16 09:18:51 2003
@@ -8,23 +8,23 @@
 
 MAKEFILE_GENERATOR	= UNIX
 TEMPLATE		= app
-CONFIG			+= qt warn_on release
-CONFIG			+= qt warn_on release link_prl
-DEFINES                 += __DARWIN_X11__
+CONFIG			+= qt warn_on release link_prl lib_version_first
+DEFINES			+= __DARWIN_X11__
 
 QMAKE_CC		= cc
 QMAKE_LEX		= flex
 QMAKE_LEXFLAGS		= 
 QMAKE_YACC		= yacc
 QMAKE_YACCFLAGS		= -d
-QMAKE_CFLAGS		= -pipe
+QMAKE_CFLAGS		= -pipe -fno-common -fPIC
 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
+QMAKE_EXTENSION_PLUGIN  = so
 QMAKE_CFLAGS_YACC	= -Wno-unused -Wno-parentheses
 QMAKE_CFLAGS_THREAD	=
 
@@ -39,8 +39,8 @@
 QMAKE_CXXFLAGS_YACC	= $$QMAKE_CFLAGS_YACC
 QMAKE_CXXFLAGS_THREAD	=
 
-QMAKE_INCDIR		= /usr/local/include
-QMAKE_LIBDIR		=
+QMAKE_INCDIR		= @PREFIX@/include/qt
+QMAKE_LIBDIR		= @PREFIX@/lib
 QMAKE_INCDIR_X11	= /usr/X11R6/include
 QMAKE_LIBDIR_X11	= /usr/X11R6/lib
 QMAKE_INCDIR_QT		= $(QTDIR)/include
@@ -50,11 +50,12 @@
 
 QMAKE_LINK		= c++
 QMAKE_LINK_SHLIB	= c++
-QMAKE_LFLAGS		=
+QMAKE_LFLAGS		= -headerpad_max_install_names
+QMAKE_LFLAGS_SHAPP	= -prebind -mdynamic-no-pic
 QMAKE_LFLAGS_RELEASE	=
 QMAKE_LFLAGS_DEBUG	=
-QMAKE_LFLAGS_APP        = 
-QMAKE_LFLAGS_SHLIB	= -dynamiclib
+QMAKE_LFLAGS_APP	= -prebind -mdynamic-no-pic
+QMAKE_LFLAGS_SHLIB	= -dynamiclib -single_module -install_name $$QMAKE_LIBDIR/$(TARGET1)
 QMAKE_LFLAGS_PLUGIN	= -bundle
 QMAKE_LFLAGS_THREAD	= 
 
@@ -63,14 +64,14 @@
 
 QMAKE_RPATH		= 
 
-QMAKE_LIBS_DYNLOAD	=
+QMAKE_LIBS_DYNLOAD	= -ldl
 QMAKE_LIBS_X11		= -lXext -lX11 -lm
 QMAKE_LIBS_X11SM	= -lSM -lICE
 QMAKE_LIBS_QT		= -lqt
 QMAKE_LIBS_QT_THREAD	= -lqt-mt
 QMAKE_LIBS_OPENGL	= -lGLU -lGL -lXmu
 QMAKE_LIBS_OPENGL_QT	= -lGL -lXmu
-QMAKE_LIBS_THREAD	=
+QMAKE_LIBS_THREAD	= -lXt
 
 QMAKE_MOC		= $(QTDIR)/bin/moc
 QMAKE_UIC		= $(QTDIR)/bin/uic
diff -uNr qt-x11-free-3.2.2/qmake/Makefile.unix qt-x11-free-3.2.2-new/qmake/Makefile.unix
--- qt-x11-free-3.2.2/qmake/Makefile.unix	Tue May 13 12:17:58 2003
+++ qt-x11-free-3.2.2-new/qmake/Makefile.unix	Thu Oct 16 09:13:21 2003
@@ -37,7 +37,7 @@
 	-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@
+LFLAGS=@QMAKE_LFLAGS@ -mdynamic-no-pic
 
 qmake: $(OBJS) $(QOBJS)
 	$(CXX) -o $@ $(OBJS) $(QOBJS) $(LFLAGS)
diff -uNr qt-x11-free-3.2.2/qmake/generators/unix/unixmake2.cpp qt-x11-free-3.2.2-new/qmake/generators/unix/unixmake2.cpp
--- qt-x11-free-3.2.2/qmake/generators/unix/unixmake2.cpp	Thu Oct  9 21:48:07 2003
+++ qt-x11-free-3.2.2-new/qmake/generators/unix/unixmake2.cpp	Thu Oct 16 11:36:03 2003
@@ -1186,14 +1186,14 @@
 	} else if( project->isActiveConfig("plugin") ) {
 	    project->variables()["TARGET_x.y.z"].append("lib" +
 							project->first("TARGET") + "." + 
-							project->first("QMAKE_EXTENSION_SHLIB"));
+							(project->first("QMAKE_EXTENSION_PLUGIN").isEmpty()? project->first("QMAKE_EXTENSION_SHLIB") : project->first("QMAKE_EXTENSION_PLUGIN")));
 	    if(project->isActiveConfig("lib_version_first"))
 		project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." +
 							project->first("VER_MAJ") + "." +
-							project->first("QMAKE_EXTENSION_SHLIB"));
+							(project->first("QMAKE_EXTENSION_PLUGIN").isEmpty()? project->first("QMAKE_EXTENSION_SHLIB") : project->first("QMAKE_EXTENSION_PLUGIN")));
 	    else
 		project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." +
-							project->first("QMAKE_EXTENSION_SHLIB") +
+							(project->first("QMAKE_EXTENSION_PLUGIN").isEmpty()? project->first("QMAKE_EXTENSION_SHLIB") : project->first("QMAKE_EXTENSION_PLUGIN")) +
 							"." + project->first("VER_MAJ"));
 
 	    project->variables()["TARGET"] = project->variables()["TARGET_x.y.z"];
diff -uNr qt-x11-free-3.2.2/qmake/main.cpp qt-x11-free-3.2.2-new/qmake/main.cpp
--- qt-x11-free-3.2.2/qmake/main.cpp	Thu Oct  9 21:48:06 2003
+++ qt-x11-free-3.2.2-new/qmake/main.cpp	Thu Oct 16 09:13:22 2003
@@ -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
diff -uNr qt-x11-free-3.2.2/src/kernel/qprocess_unix.cpp qt-x11-free-3.2.2-new/src/kernel/qprocess_unix.cpp
--- qt-x11-free-3.2.2/src/kernel/qprocess_unix.cpp	Thu Oct  9 21:47:28 2003
+++ qt-x11-free-3.2.2-new/src/kernel/qprocess_unix.cpp	Thu Oct 16 09:13:22 2003
@@ -779,7 +779,7 @@
 
 	if ( env == 0 ) { // inherit environment and start process
 	    QString command = _arguments[0];
-#if defined(Q_OS_MACX) //look in a bundle
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) //look in a bundle
 	    const QString mac_bundle_suffix = ".app/Contents/MacOS/";
 	    if(!QFile::exists(command) && QFile::exists(command + mac_bundle_suffix)) {
 		QString exec = command;
@@ -799,7 +799,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");
@@ -831,7 +831,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
@@ -841,7 +841,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();
@@ -852,7 +852,7 @@
 		    }
 		}
 	    }
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN)
 	    if(!QFile::exists(arglist[0])) {
 		QString command = arglist[0];
 		const QString mac_bundle_suffix = ".app/Contents/MacOS/";
diff -uNr qt-x11-free-3.2.2/src/qtmain.pro qt-x11-free-3.2.2-new/src/qtmain.pro
--- qt-x11-free-3.2.2/src/qtmain.pro	Tue May 13 03:08:35 2003
+++ qt-x11-free-3.2.2-new/src/qtmain.pro	Thu Oct 16 09:13:22 2003
@@ -3,6 +3,7 @@
 TEMPLATE	= lib
 TARGET		= qtmain
 VERSION		= 3.1.0
+COMPATIBILITY_VERSION = 3.0.0
 DESTDIR		= $$QMAKE_LIBDIR_QT
 
 CONFIG		+= qt staticlib warn_on release
diff -uNr qt-x11-free-3.2.2/src/tools/qdir_unix.cpp qt-x11-free-3.2.2-new/src/tools/qdir_unix.cpp
--- qt-x11-free-3.2.2/src/tools/qdir_unix.cpp	Thu Oct  9 21:47:13 2003
+++ qt-x11-free-3.2.2-new/src/tools/qdir_unix.cpp	Thu Oct 16 09:13:22 2003
@@ -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 );
diff -uNr qt-x11-free-3.2.2/src/tools/qglobal.h qt-x11-free-3.2.2-new/src/tools/qglobal.h
--- qt-x11-free-3.2.2/src/tools/qglobal.h	Thu Oct  9 21:47:11 2003
+++ qt-x11-free-3.2.2-new/src/tools/qglobal.h	Thu Oct 16 09:13:22 2003
@@ -79,6 +79,10 @@
      UNIX	- Any UNIX BSD/SYSV system
 */
 
+#ifndef __DARWIN_X11__
+#define __DARWIN_X11__
+#endif
+
 #if defined(__DARWIN_X11__)
 #  define Q_OS_DARWIN
 #elif defined(__APPLE__) && defined(__GNUC__)
@@ -527,6 +531,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"
diff -uNr qt-x11-free-3.2.2/src/tools/qgpluginmanager.cpp qt-x11-free-3.2.2-new/src/tools/qgpluginmanager.cpp
--- qt-x11-free-3.2.2/src/tools/qgpluginmanager.cpp	Thu Oct  9 21:47:12 2003
+++ qt-x11-free-3.2.2-new/src/tools/qgpluginmanager.cpp	Thu Oct 16 09:22:15 2003
@@ -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";
diff -uNr qt-x11-free-3.2.2/src/tools/qgpluginmanager.cpp.rej qt-x11-free-3.2.2-new/src/tools/qgpluginmanager.cpp.rej
--- qt-x11-free-3.2.2/src/tools/qgpluginmanager.cpp.rej	Wed Dec 31 19:00:00 1969
+++ qt-x11-free-3.2.2-new/src/tools/qgpluginmanager.cpp.rej	Thu Oct 16 09:13:22 2003
@@ -0,0 +1,19 @@
+***************
+*** 316,323 ****
+  
+  #if defined(Q_OS_WIN32)
+      QString filter = "*.dll";
+- #elif defined(Q_OS_MACX)
+-     QString filter = "*.dylib; *.so";
+  #elif defined(Q_OS_HPUX)
+      QString filter = "*.sl";
+  #elif defined(Q_OS_UNIX)
+--- 316,323 ----
+  
+  #if defined(Q_OS_WIN32)
+      QString filter = "*.dll";
++ #elif defined(Q_OS_MACX) || defined(Q_OS_DARWIN)
++     QString filter = "*.dylib; *.so; *.bundle";
+  #elif defined(Q_OS_HPUX)
+      QString filter = "*.sl";
+  #elif defined(Q_OS_UNIX)
diff -uNr qt-x11-free-3.2.2/src/tools/qmutex_unix.cpp qt-x11-free-3.2.2-new/src/tools/qmutex_unix.cpp
--- qt-x11-free-3.2.2/src/tools/qmutex_unix.cpp	Thu Oct  9 21:47:11 2003
+++ qt-x11-free-3.2.2-new/src/tools/qmutex_unix.cpp	Thu Oct 16 09:13:22 2003
@@ -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)
diff -uNr qt-x11-free-3.2.2/src/tools/qstring.cpp qt-x11-free-3.2.2-new/src/tools/qstring.cpp
--- qt-x11-free-3.2.2/src/tools/qstring.cpp	Thu Oct  9 21:47:14 2003
+++ qt-x11-free-3.2.2-new/src/tools/qstring.cpp	Thu Oct 16 09:13:22 2003
@@ -1337,7 +1337,7 @@
 QStringData* QString::makeSharedNull()
 {
     QString::shared_null = new QStringData;
-#if defined( Q_OS_MAC )
+#if defined( Q_OS_MAC ) || defined ( Q_OS_DARWIN )
     QString *that = const_cast<QString *>(&QString::null);
     that->d = QString::shared_null;
 #endif
@@ -2538,7 +2538,7 @@
     if ( !sl )
 	return index;
 
-#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
@@ -2637,7 +2637,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();
@@ -2693,7 +2693,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
diff -uNr qt-x11-free-3.2.2/tools/designer/designer/designer.pro qt-x11-free-3.2.2-new/tools/designer/designer/designer.pro
--- qt-x11-free-3.2.2/tools/designer/designer/designer.pro	Mon Aug 18 05:43:30 2003
+++ qt-x11-free-3.2.2-new/tools/designer/designer/designer.pro	Thu Oct 16 09:13:22 2003
@@ -1,5 +1,5 @@
 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
diff -uNr qt-x11-free-3.2.2/tools/designer/editor/editor.pro qt-x11-free-3.2.2-new/tools/designer/editor/editor.pro
--- qt-x11-free-3.2.2/tools/designer/editor/editor.pro	Tue May 13 03:08:53 2003
+++ qt-x11-free-3.2.2-new/tools/designer/editor/editor.pro	Thu Oct 16 09:13:22 2003
@@ -1,5 +1,5 @@
 TEMPLATE	= lib
-CONFIG		+= qt warn_on staticlib
+CONFIG		+= qt warn_on
 CONFIG		-= dll
 HEADERS		= editor.h  \
 		  parenmatcher.h  \
