=== modified file 'mixxx/src/SConscript'
--- mixxx/src/SConscript	2010-03-10 22:48:52 +0000
+++ mixxx/src/SConscript	2010-03-23 13:55:32 +0000
@@ -601,10 +601,10 @@
 	print "Did not find PortTime development header, exiting!"
 	Exit(1)
 
-if not platform == 'osx':   # OSX doesn't need PortTime for some reason
-	if not conf.CheckLib(['porttime', 'libporttime']):
-		print "Did not find PortTime or it\'s development headers, exiting!"
-		Exit(1)
+#if not platform == 'osx':   # OSX doesn't need PortTime for some reason
+#	if not conf.CheckLib(['porttime', 'libporttime']):
+#		print "Did not find PortTime or it\'s development headers, exiting!"
+#		Exit(1)
 
 #Check for PortMIDI & PortTime
 if not conf.CheckLib(['portmidi', 'libportmidi']):
@@ -676,14 +676,27 @@
 
 	#QT4
 	env.Append(LINKFLAGS = '-framework QtCore -framework QtOpenGL -framework Qt3Support -framework QtGui -framework QtSql -framework QtXml -framework QtXmlPatterns  -framework QtNetwork -framework QtSql -framework QtScript -framework QtWebKit')
-	env.Append(CPPPATH = ['/Library/Frameworks/QtCore.framework/Headers/',
-				'/Library/Frameworks/QtOpenGL.framework/Headers/',
-				'/Library/Frameworks/Qt3Support.framework/Headers/',
-				'/Library/Frameworks/QtGui.framework/Headers/',
-				'/Library/Frameworks/QtXml.framework/Headers/',
-				'/Library/Frameworks/QtSql.framework/Headers/',
-				'/Library/Frameworks/QtWebKit.framework/Headers/',
-				'/Library/Frameworks/QtScript.framework/Headers/'])
+	frameworkPrefix = "";
+ 	if env['QTDIR'].find("/opt/local/libexec/qt4-mac") == 0:
+		# MacPorts
+		print "Mac Ports detected, using Mac Ports frameworks, libs and includes..."
+		mpPrefix = "/opt/local"
+		env.Append(LIBPATH = [mpPrefix+'/lib'])
+		env.Append(CPPPATH = [mpPrefix+'/include'])
+		env.Prepend(LINKFLAGS = ['-F'+mpPrefix+'/Library/Frameworks/'])
+		frameworkPrefix = mpPrefix
+		env.Append(CPPDEFINES = '__MP4V2__') # TODO: move this define to the M4A section, activate if mp4v2/mp4v2.h exists...  here it is harmless because if you have macports you can only have mp4v2 1.9 or greater
+		frameworkPrefix = "/opt/local"
+
+	env.Append(CPPPATH = [frameworkPrefix + '/Library/Frameworks/QtCore.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtOpenGL.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/Qt3Support.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtGui.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtXml.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtSql.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtWebKit.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtScript.framework/Headers/'])
+
 
 	#Non-standard libpaths for fink and darwin ports
 	env.Append(LIBPATH = ['/sw/lib'])
@@ -1310,6 +1323,7 @@
 if int(flags_force32):
 	env.Append(CCFLAGS = '-m32')
 	env.Append(CXXFLAGS = '-m32')
+	env.Append(LINKFLAGS = '-m32')
 	print "Force 32-bit GCC compile... enabled"
 else:
 	print "Force 32-bit GCC compile... disabled"
@@ -1517,9 +1531,9 @@
 	DMG_ICON="#res/osx/VolumeIcon.icns"
 
 	#this is a BIG HACK to support Qt's plugins (since Qt *requires* that it's plugins be in specific subdirectories, which OS X doesn't really play nice with)
-	qt_plugins = ([("iconengines", e) for e in ["libqsvgicon.dylib"]] +
-                      [("imageformats", e) for e in ["libqgif.dylib", "libqjpeg.dylib", "libqsvg.dylib"]] +
-                      [("sqldrivers", e) for e in ["libqsqlite.dylib"]])
+	qt_plugins = ([("iconengines", e) for e in ["libqsvgicon.bundle"]] +
+                      [("imageformats", e) for e in ["libqgif.bundle", "libqjpeg.bundle", "libqsvg.bundle"]] +
+                      [("sqldrivers", e) for e in ["libqsqlite.bundle"]])
 	#Left out libqmng and libqtiff to save space.
 
 	bundle = env.App("Mixxx", [mixxx_bin, '#res/osx/application.icns',
@@ -1529,7 +1543,7 @@
 		Dir('#res/ladspa_presets'), Dir('#res/doc/'), Dir('#res/promo/')],
 		 PLUGINS=plugins, ##XXX test what happens if we don't pass any plugins
 			#Qt plugins ((Qt *NEEDS* its plugins in specific locations or it refuses to find them, however this is clearly awkward to write out like this.. maybe))
-		 QT_HACK = [(p_tgt_dir, os.path.join("/Developer/Applications/Qt/plugins/", p_tgt_dir, p)) for p_tgt_dir, p in qt_plugins] #sigh :(
+		 QT_HACK = [(p_tgt_dir, os.path.join("/opt/local/libexec/qt4-mac/plugins/", p_tgt_dir, p)) for p_tgt_dir, p in qt_plugins] #sigh :(
 		 ,
 		 STRIP=True,
 		 #STRIP=(type == 'RELEASE')

