Index: trunk/config/History
===================================================================
--- trunk/config/History	(revision 867)
+++ trunk/config/History	(revision 868)
@@ -1,3 +1,3 @@
-$Id: History,v 1.325 2008/07/11 15:42:35 gcosmo Exp $
+$Id: History,v 1.330 2008/10/15 10:10:51 lgarnier Exp $
 -------------------------------------------------------------------
 
@@ -16,4 +16,16 @@
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
+
+15th October 2008  Laurent Garnier 
+- Darwin.gmk : 
+  - Try to improve Qt config for Darwin :
+   - No more QTHOME or QTLIBS flags to be set
+   - Qt3 multithread or not auto select libraries
+   - Suppress some unuseful link and compil options
+
+10th October 2008  Laurent Garnier 
+- Darwin.gmk : 
+ - Remove Xml and Sql library for Qt config
+ - Try to better find if GL conflicts on Darwin
 
 8th October 2008  Laurent Garnier 
Index: trunk/config/sys/Darwin-g++.gmk
===================================================================
--- trunk/config/sys/Darwin-g++.gmk	(revision 867)
+++ trunk/config/sys/Darwin-g++.gmk	(revision 868)
@@ -63,28 +63,30 @@
   ifndef OGLLIBS
     OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
-# It may be required to uncomment the following lines for building on MacOSX 10.5 "Leopard"
-#    OGLLIBS   += -dylib_file \
-#                 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:\
-#                 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
+    ifeq ($(G4SYSTEM),Darwin-g++)
+          # It may be required to uncomment the following lines for building on MacOSX 10.5 "Leopard"
+      OGLLIBS   := $(shell test -f /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib && echo " -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
+      endif
   endif
   ifndef QTHOME
-    QTHOME     := /sw
+    QTHOME   := $(shell test -f /Library/Frameworks/Qt3Support.framework/Qt3Support && echo  "/Library/Frameworks" || echo "/sw")
   endif
 
-  QT_VERSION   := $(shell test -f $(QTHOME)/Qt3Support.framework/Qt3Support && echo QT3 || echo QT4)
+  ifeq ($(QTHOME),/Library/Frameworks)
+    QT_VERSION := $(shell grep "QT_VERSION_STR" $(QTHOME)/QtCore.framework/Headers/qglobal.h | sed 's/.* \"\([0-9]\)\..*\"/\1/')
+  else
+    QT_VERSION := $(shell grep "QT_VERSION_STR" $(QTHOME)/include/qt/qglobal.h | sed 's/.* \"\([0-9]\)\..*\"/\1/')
+  endif
 
   ifndef QTFLAGS
-    ifeq ($(QT_VERSION),QT4)
-      QTFLAFG   := "-I ${QTHOME}/QtCore.framework/Headers "
-      QTFLAFG   += "-I ${QTHOME}/QtGui.framework/Headers "
-      QTFLAFG   += "-I ${QTHOME}/QtOpenGL.framework/Headers "
-      QTFLAFG   += "-I ${QTHOME}/QtSql.framework/Headers "
-      QTFLAFG   += "-I ${QTHOME}/QtXml.framework/Headers "
+    ifeq ($(QT_VERSION),4)
+      QTFLAGS   := -I $(QTHOME)/QtCore.framework/Headers 
+      QTFLAGS   += -I $(QTHOME)/QtGui.framework/Headers 
+      QTFLAGS   += -I $(QTHOME)/QtOpenGL.framework/Headers 
     else
-      QTFLAGS   := -I$(QTHOME)/include/Qt -I$(QTHOME)/include
+      QTFLAGS   := -I $(QTHOME)/include/Qt -I$(QTHOME)/include
     endif
   endif
   ifndef QTMOC
-    ifeq ($(QT_VERSION),QT4)
+    ifeq ($(QT_VERSION),4)
       QTMOC      := /usr/bin/moc
     else
@@ -92,19 +94,34 @@
     endif
   endif
+
+  ifndef QTLIBPATH
+    ifeq ($(QT_VERSION),3)
+      QTLIBPATH   := $(shell test -d $(QTHOME)/lib/qt3/lib && echo "/lib/qt3/lib" || echo "/lib" )
+    else
+      QTLIBPATH  := -F$(QTHOME)
+    endif
+  endif
   ifndef QTLIBS
-    ifeq ($(QT_VERSION),QT3)
-      QTLIBS    := -L$(QTHOME)/lib -lqt -lqui
+    ifeq ($(QT_VERSION),3)
+      QTLIBS   := -L$(QTHOME)$(QTLIBPATH)
+      QT3_MT  := $(shell ls  $(QTHOME)$(QTLIBPATH)/libqt-mt.* | wc -l )
+      ifneq ($(QT3_MT),0)
+        QTLIBS  += -lqt-mt
+      else
+        QTLIBS  += -lqt
+      endif
+      QTLIBS   += -lqui
     else
-      QTLIBS    := -F$(QTHOME) -framework QtCore -framework QtGui
-      QTLIBS    += -framework QtSql -framework QtXml
+      QTLIBS    :=  -framework QtCore -framework QtGui
     endif
   endif
 
   ifndef GLQTLIBS
-    ifeq ($(QT_VERSION),QT3)
-      GLQTLIBS    := -L$(QTHOME)/lib -lqt -lqui
+    ifeq ($(QT_VERSION),3)
+        # already done in QTLIBS
+        #      GLQTLIBS    := $(QTLIBS)
     else
       GLQTLIBS    := -F$(QTHOME) -framework QtCore -framework QtGui
-      GLQTLIBS    += -framework QtOpenGL -framework QtSql -framework QtXml
+      GLQTLIBS    += -framework QtOpenGL
     endif
   endif
Index: trunk/config/sys/Linux-g++.gmk
===================================================================
--- trunk/config/sys/Linux-g++.gmk	(revision 867)
+++ trunk/config/sys/Linux-g++.gmk	(revision 868)
@@ -63,7 +63,13 @@
     QTHOME     := /usr
   endif
+  QT_VERSION   := $(shell test -f $(QTHOME)/lib/libQt3Support.so && echo QT4 || echo QT3)
+
   ifndef QTFLAGS
-    QTFLAGS    := -I$(QTHOME)/include/qt4/Qt
-    QTFLAGS    += -I$(QTHOME)/include/qt4
+    ifeq ($(QT_VERSION),QT4)
+      QTFLAGS    := -I$(QTHOME)/include/qt4/Qt
+      QTFLAGS    += -I$(QTHOME)/include/qt4
+    else
+      QTFLAGS    := -I$(QTHOME)/include/qt
+    endif
   endif
   ifndef QTMOC
@@ -71,5 +77,4 @@
   endif
 
-  QT_VERSION   := $(shell test -f $(QTHOME)/lib/libQt3Support.so && echo QT4 || echo QT3)
 
   ifndef GLQTLIBS
@@ -77,5 +82,5 @@
       GLQTLIBS    := -L$(QTHOME)/lib -lqt-mt
     else
-      GLQTLIBS    := -L$(QTHOME)/lib/qt4 -lQtCore -lQtGui -lQtOpenGL -lQtSql -lQtXml
+      GLQTLIBS    := -L$(QTHOME)/lib/qt4 -lQtCore -lQtGui -lQtOpenGL
     endif
   endif
@@ -84,5 +89,5 @@
       QTLIBS    := -L$(QTHOME)/lib -lqt-mt
     else
-      QTLIBS    := -L$(QTHOME)/lib/qt4 -lQtCore -lQtGui -lQtSql -lQtXml
+      QTLIBS    := -L$(QTHOME)/lib/qt4 -lQtCore -lQtGui
     endif
   endif
Index: trunk/config/sys/WIN32-VC.gmk
===================================================================
--- trunk/config/sys/WIN32-VC.gmk	(revision 867)
+++ trunk/config/sys/WIN32-VC.gmk	(revision 868)
@@ -51,5 +51,5 @@
       QTLIBS   := -L$(QTHOME)/lib -lqt-mt
     else
-      QTLIBS   := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib QtSql4.lib QtXml4.lib
+      QTLIBS   := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib
     endif
   endif
@@ -58,5 +58,5 @@
       QTLIBS   := -L$(QTHOME)/lib -lqt-mt
     else
-      QTLIBS   := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib QtOpenGL4.lib QtSql4.lib QtXml4.lib
+      QTLIBS   := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib QtOpenGL4.lib
     endif
   endif
