Index: trunk/geant4/config/History
===================================================================
--- trunk/geant4/config/History	(revision 726)
+++ trunk/geant4/config/History	(revision 758)
@@ -1,3 +1,3 @@
-$Id: History,v 1.312 2008/01/15 11:14:58 lgarnier Exp $
+$Id: History,v 1.317 2008/03/19 10:24:00 lgarnier Exp $
 -------------------------------------------------------------------
 
@@ -17,7 +17,19 @@
      ----------------------------------------------------------
 
-15th January 2007, Laurent Garnier
- - common.gmk : Added a function to autogenerate the moc files for Qt driver
- - WIN32-VC : Added flags to build Qt driver on windows
+19th March 2008, Laurent Garnier
+ - common.gmk : Changes for moc generation. When compiling G4UI driver
+   AFTER compiling G4UI QT driver, it does not remove the moc generated files
+   and try to compile theme again and failed. Corrected.
+
+18th March 2008, Laurent Garnier
+ - common.gmk : Minor changes when compiling Qt
+
+21st February 2008  Gabriele Cosmo (config-V09-01-01)
+- Replaced g77 with gfortran for Linux-g++ and Linux-icc platforms.
+
+15th February 2008  Laurent Garnier
+- common.gmk: added ability to autogenerate moc files for Qt driver.
+- WIN32-VC: added flags to build Qt driver on Windows.
+- Darwin-g++, Linux-g++: improvements for autogeneration of MOC files for Qt.
 
 15th January 2008  Gabriele Cosmo (config-V09-01-00)
@@ -60,4 +72,15 @@
 - Added "incl" (Liege cascade) hadronic model module to binmake.gmk. 
  
+ 
+3th October 2007  Laurent Garnier 
+- Added setup for Qt in those files : 
+- config/G4UI_BUILD.gmk 
+- config/G4UI_USE.gmk 
+- config/G4VIS_BUILD.gmk 
+- config/G4VIS_USE.gmk 
+- config/interactivity.gmk 
+- config/sys/Darwin-g++.gmk 
+- config/sys/Linux-g++.gmk 
+
 16th August 2007  Gabriele Cosmo (config-V09-00-04)
 - Corrected definition of OUT internal variable to allow for proper
Index: trunk/geant4/config/common.gmk
===================================================================
--- trunk/geant4/config/common.gmk	(revision 726)
+++ trunk/geant4/config/common.gmk	(revision 758)
@@ -1,3 +1,3 @@
-# $Id: common.gmk,v 1.44 2008/01/15 11:14:58 lgarnier Exp $
+# $Id: common.gmk,v 1.50 2008/03/19 10:55:47 lgarnier Exp $
 # ----------------------------------------------------------------
 # Common part of GNUmakefile for libraries.  John Allison, 5/7/95.
@@ -5,5 +5,5 @@
 # Libraries are created according to G4SYSTEM. G.Cosmo, 11/6/96.
 # Introduced G4LIBDIR and G4TMPDIR. G.Cosmo, 23/6/98.
-# Introduced QT moc rule,L. Garnier 12/6/07.
+# Introduced Qt moc rule, L.Garnier 15/2/08.
 
 ifndef G4LIBDIR
@@ -14,6 +14,18 @@
 moc_inc = $(shell grep -l "Q_OBJECT" include/*.hh )
 moc_files := $(patsubst include/%.hh, src/%_moc.cc, $(moc_inc))
-sources := $(wildcard src/*.cc)
-sources += $(moc_files)
+
+
+ifeq ($(G4INTY_BUILD_QT),)
+  # not so beautiful. In therory we should only remove theses files from sources 
+  sources := $(shell rm -f $(moc_files))
+  sources := $(wildcard src/*.cc)
+endif
+
+ifneq ($(G4INTY_BUILD_QT),)
+  sources := $(wildcard src/*.cc)
+  sources += $(moc_files)
+endif
+
+
 objects := $(patsubst src/%.cc,$(G4TMPDIR)/%.o,$(sources))
 dependencies := $(patsubst src/%.cc,$(G4TMPDIR)/%.d,$(sources))
@@ -66,15 +78,16 @@
 ###############################################################################
 #
-# Actual moc files for qt files
+# Actual moc files for Qt files
 #
 # moc sources and headers: used for Qt signal/slot 
 # - all headers which use signals/slots have the macro "Q_OBJECT" present
-#  in the class definitions; these all need to be processed by the
-#  "meta object compiler (moc)" which generates extra source code to
-#  implement the signal/slots, i.e., if "foo.h" contains the token "Q_OBJECT"
-#  it will be used by moc to generate the file "foo_moc.cpp" (the _moc. is
+#   in the class definitions; these all need to be processed by the
+#   "meta object compiler (moc)" which generates extra source code to
+#   implement the signal/slots, i.e., if "foo.h" contains the token "Q_OBJECT"
+#   it will be used by moc to generate the file "foo_moc.cpp" (the _moc. is
 #   just an arbitrary extension to make it easier to identify sources
 #   generated by moc).
 
+ifneq ($(G4INTY_BUILD_QT),)
 src/%_moc.cc: include/%.hh
 	@echo Making moc file for $< ...
@@ -83,4 +96,6 @@
 	else $(QTMOC) $(MOC_MACRO) -o $@ $<; \
 	fi;
+endif
+
 
 ###############################################################################
Index: trunk/geant4/config/interactivity.gmk
===================================================================
--- trunk/geant4/config/interactivity.gmk	(revision 726)
+++ trunk/geant4/config/interactivity.gmk	(revision 758)
@@ -22,4 +22,13 @@
   LOAD_GL  = 1
   INTYLIBS += $(OIVLIBS)
+endif
+
+########################### Qt ###############################
+# Should be before X11.
+ifdef INC_QT
+  CPPFLAGS += $(QTFLAGS)
+endif
+ifdef LOAD_QT
+  INTYLIBS += $(QTLIBS)
 endif
 
@@ -56,4 +65,5 @@
 endif
 
+
 ifdef INC_X11
   CPPFLAGS += $(X11FLAGS)
@@ -63,12 +73,4 @@
 endif
 
-########################### Qt ###################
-
-ifdef INC_QT
-  CPPFLAGS += $(QTFLAGS)
-endif
-ifdef LOAD_QT
-  INTYLIBS += $(QTLIBS)
-endif
 
 ########################### and finally... #######################
Index: trunk/geant4/config/sys/Darwin-g++.gmk
===================================================================
--- trunk/geant4/config/sys/Darwin-g++.gmk	(revision 726)
+++ trunk/geant4/config/sys/Darwin-g++.gmk	(revision 758)
@@ -47,19 +47,4 @@
 #   XMLIBS    := -L/usr/X11R6/lib -lXm -lXpm   ##### some installations.
   endif
-  ifndef QTHOME
-    QTHOME  := /sw
-  endif
-  ifndef QTFLAGS
-    QTFLAGS   := -I$(QTHOME)/include/Qt -I$(QTHOME)/include
-  endif
-  ifndef QTMOC
-    QTMOC       := $(QTHOME)/bin/moc
-  endif
-  ifndef QTLIBS
-    QT3LIBS    := -L$(QTHOME)/lib -lqt -lqui
-    QT4LIBS    := -F$(QTHOME)/lib -framework QtCore -framework QtGui
-    QT4LIBS    += -framework QtOpenGL -framework QtSql -framework QtXml
-    QTLIBS     := $(shell test -f $(QTHOME)/lib/Qt3Support.framework/Qt3Support && echo $(QT4LIBS) || echo $(QT3LIBS))
-  endif
   ifndef XAWFLAGS
     XAWFLAGS   := -I/sw/include
@@ -83,4 +68,19 @@
 #                 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
   endif
+  ifndef QTHOME
+    QTHOME     := /sw
+  endif
+  ifndef QTFLAGS
+    QTFLAGS    := -I$(QTHOME)/include/Qt -I$(QTHOME)/include
+  endif
+  ifndef QTMOC
+    QTMOC      := $(QTHOME)/bin/moc
+  endif
+  ifndef QTLIBS
+    QT3LIBS    := -L$(QTHOME)/lib -lqt -lqui
+    QT4LIBS    := -F$(QTHOME)/lib -framework QtCore -framework QtGui
+    QT4LIBS    += -framework QtOpenGL -framework QtSql -framework QtXml
+    QTLIBS     := $(shell test -f $(QTHOME)/lib/Qt3Support.framework/Qt3Support && echo $(QT4LIBS) || echo $(QT3LIBS))
+  endif
 
   define build-granular-shared-lib
Index: trunk/geant4/config/sys/Linux-g++.gmk
===================================================================
--- trunk/geant4/config/sys/Linux-g++.gmk	(revision 726)
+++ trunk/geant4/config/sys/Linux-g++.gmk	(revision 758)
@@ -38,5 +38,5 @@
   G4RUNPATHOPTION := -Wl,-rpath 
   CC := gcc
-  FC := g77
+  FC := gfortran
   FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
   FCLIBS := -lg2c -lnsl
@@ -56,12 +56,12 @@
   endif
   ifndef QTHOME
-    QTHOME  := /usr/local/Qt
+    QTHOME     := /usr/local/Qt
   endif
   ifndef QTFLAGS
-    QTFLAGS   := -I$(QTHOME)/include/Qt
-    QTFLAGS   += -I$(QTHOME)/include
+    QTFLAGS    := -I$(QTHOME)/include/Qt
+    QTFLAGS    += -I$(QTHOME)/include
   endif
   ifndef QTMOC
-    QTMOC       := $(QTHOME)/bin/moc
+    QTMOC      := $(QTHOME)/bin/moc
   endif
   ifndef QTLIBS
Index: trunk/geant4/config/sys/Linux-icc.gmk
===================================================================
--- trunk/geant4/config/sys/Linux-icc.gmk	(revision 726)
+++ trunk/geant4/config/sys/Linux-icc.gmk	(revision 758)
@@ -28,5 +28,5 @@
   G4RUNPATHOPTION := -Wl,-rpath -Wl,
   CC := gcc
-  FC := g77
+  FC := gfortran
   FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
   FCLIBS := -lg2c -lnsl
Index: trunk/geant4/config/sys/WIN32-VC.gmk
===================================================================
--- trunk/geant4/config/sys/WIN32-VC.gmk	(revision 726)
+++ trunk/geant4/config/sys/WIN32-VC.gmk	(revision 758)
@@ -36,5 +36,5 @@
   endif
   ifndef QTHOME
-    QTHOME  := /usr
+    QTHOME    := /usr
   endif
   ifndef QTFLAGS
@@ -42,13 +42,11 @@
   endif
   ifndef QTMOC
-    QTMOC       := $(QTHOME)/bin/moc
+    QTMOC     := $(QTHOME)/bin/moc
   endif
   ifndef QTLIBS
-    QT3LIBS    := -L$(QTHOME)/lib -lqt-mt
-    QT4LIBS    := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib QtOpenGL4.lib QtSql4.lib QtXml4.lib
-    QT4LIBS    += -lG4baryons -lG4biasing -lG4bosons -lG4brep -lG4csg -lG4cuts -lG4decay -lG4detector -lG4detutils -lG4digits -lG4emhighenergy -lG4emlowenergy -lG4empolar -lG4emstandard -lG4emutils -lG4error_propagation -lG4event -lG4geombias -lG4geomBoolean -lG4geomdivision -lG4geometrymng -lG4gflash -lG4globman -lG4graphics_reps -lG4hadronic_ablation -lG4hadronic_abrasion -lG4hadronic_bert_cascade -lG4hadronic_binary -lG4hadronic_body_ci -lG4hadronic_coherent_elastic -lG4hadronic_deex_evaporation -lG4hadronic_deex_fermi_breakup -lG4hadronic_deex_fission -lG4hadronic_deex_gem_evaporation -lG4hadronic_deex_handler -lG4hadronic_deex_management -lG4hadronic_deex_multifragmentation -lG4hadronic_deex_photon_evaporation -lG4hadronic_deex_util -lG4hadronic_em_dissociation -lG4hadronic_HE -lG4hadronic_hetcpp_evaporation -lG4hadronic_hetcpp_utils -lG4hadronic_interface_ci -lG4hadronic_iso -lG4hadronic_LE -lG4hadronic_leading_particle -lG4hadronic_mgt -lG4hadronic_proc -lG4hadronic_qgstring -lG4hadronic_radioactivedecay -lG4hadronic_stop -lG4hadronic_util -lG4hadronic_xsect -lG4had_im_r_matrix -lG4had_lll_fis -lG4had_mod_man -lG4had_mod_util -lG4had_muon_nuclear -lG4had_neu_hp -lG4had_preequ_exciton -lG4had_string_diff -lG4had_string_frag -lG4had_string_man -lG4had_theo_max -lG4hepnumerics -lG4hits -lG4intercoms -lG4ions -lG4leptons -lG4magneticfield -lG4materials -lG4mesons -lG4modeling -lG4muons -lG4navigation -lG4OpenGL -lG4optical -lG4parameterisation -lG4partman -lG4partutils -lG4persistency -lG4phys_builders -lG4phys_lists -lG4procman -lG4RayTracer -lG4readout -lG4run -lG4scoring -lG4shortlived -lG4specsolids -lG4track -lG4tracking -lG4transportation -lG4Tree -lG4UIbasic -lG4UIcommon -lG4UIGAG -lG4visHepRep -lG4visXXX -lG4vis_management -lG4volumes -lG4VRML -lG4xrays
-    QTLIBS     := $(shell test -f $(QTHOME)/lib/Qt3Support4.lib && echo $(QT4LIBS) || echo $(QT3LIBS))
+    QT3LIBS   := -L$(QTHOME)/lib -lqt-mt
+    QT4LIBS   := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib QtOpenGL4.lib QtSql4.lib QtXml4.lib
+    QTLIBS    := $(shell test -f $(QTHOME)/lib/Qt3Support4.lib && echo $(QT4LIBS) || echo $(QT3LIBS))
   endif
-
 
 #
