Moved from AliTransbit to AliL3Transbit.
[u/mrichter/AliRoot.git] / conf / Geant4.gmk
1 # $Id$
2  
3 ################### Geant4 specific definitions ################################
4
5 # include $(G4INSTALL)/config/architecture.gmk
6
7 # Alice options flags
8 ifdef AG4_VISUALIZE
9   CPPFLAGS  += -DALICE_VISUALIZE
10 endif
11
12 #
13 # C++ compilation flags
14 #
15
16 ifeq ($(ALICE_TARGET),Linux)
17
18 # Redefinition of -Wall option 
19 # in order to exclude warnings from G4 
20 # excluded for Geant4: -Wswitch -Wunused
21
22   CXXOPTS := $(filter-out -Wall,$(CXXOPTS))
23   CXXOPTS += -Wimplicit-int -Wimplicit-function-declaration\
24              -Wimplicit -Wmain -Wreturn-type -Wcomment \
25              -Wtrigraphs -Wformat -Wchar-subscripts \
26              -Wparentheses              
27   CXXOPTS := $(patsubst -O%,-O% -Wuninitialized,$(CXXOPTS))
28
29 # Motif, Xt libraries
30   G4GLIBS := -L/usr/lib/Motif1.2_R6 -lXm -L/usr/lib -lXt
31 endif
32
33 ifeq ($(ALICE_TARGET),HP-UX.aCC)
34
35 # Adding options: 
36 # +Onolimit - excludes warnings from G4 
37 # +DAportable - necessary (if not set, run time error from object space)                         
38
39   CXXOPTS := $(patsubst -O%,-O% +Onolimit,$(CXXOPTS))
40   CXXOPTS := $(patsubst +O%,+O% +Onolimit,$(CXXOPTS))
41   CXXOPTS += +DAportable
42
43 # Motif, Xt libraries
44   G4GLIBS := -L/usr/lib/Motif1.2_R6 -lXm -L/usr/lib -lXt                   
45 endif  
46  
47 ifeq ($(ALICE_TARGET),OSF1)
48
49   CXXOPTS := $(filter-out -nostdnew,$(CXXOPTS))
50   CXXOPTS := $(filter-out -nortti,$(CXXOPTS))
51   CXXOPTS += -ieee -timplicit_local
52   ifndef G4NO_STD_NAMESPACE
53     G4USE_STD_NAMESPACE := yes
54     CXXOPTS += -std strict_ansi
55   endif
56
57 endif  
58
59 ifeq ($(ALICE_TARGET),SunOS)
60
61   # Excluded of +w option 
62   # in order to exclude warnings from G4 
63   CXXOPTS := $(filter-out +w,$(CXXOPTS))
64
65 endif  
66
67 #
68 # Geant4 include paths
69 #
70
71 include $(G4INSTALL)/config/G4UI_USE.gmk
72 include $(G4INSTALL)/config/G4VIS_USE.gmk
73 include $(G4INSTALL)/config/interactivity.gmk
74 ifndef INCFLAGS
75   INCFLAGS := \
76               -I$(G4BASE)/global/management/include \
77               -I$(G4BASE)/global/HEPRandom/include \
78               -I$(G4BASE)/global/HEPGeometry/include \
79               -I$(G4BASE)/global/HEPNumerics/include \
80               -I$(G4BASE)/run/include \
81               -I$(G4BASE)/materials/include \
82               -I$(G4BASE)/particles/management/include \
83               -I$(G4BASE)/particles/bosons/include \
84               -I$(G4BASE)/particles/leptons/include \
85               -I$(G4BASE)/particles/hadrons/barions/include \
86               -I$(G4BASE)/particles/hadrons/ions/include \
87               -I$(G4BASE)/particles/hadrons/mesons/include \
88               -I$(G4BASE)/particles/shortlived/include \
89               -I$(G4BASE)/processes/management/include \
90               -I$(G4BASE)/processes/general/include \
91               -I$(G4BASE)/processes/decay/include \
92               -I$(G4BASE)/processes/optical/include \
93               -I$(G4BASE)/processes/transportation/include \
94               -I$(G4BASE)/processes/parameterisation/include \
95               -I$(G4BASE)/processes/electromagnetic/standard/include \
96               -I$(G4BASE)/processes/electromagnetic/muons/include \
97               -I$(G4BASE)/processes/electromagnetic/utils/include \
98               -I$(G4BASE)/processes/electromagnetic/xrays/include \
99               -I$(G4BASE)/processes/electromagnetic/lowenergy/include \
100               -I$(G4BASE)/processes/hadronic/management/include \
101               -I$(G4BASE)/processes/hadronic/processes/include \
102               -I$(G4BASE)/processes/hadronic/util/include \
103               -I$(G4BASE)/processes/hadronic/cross_sections/include \
104               -I$(G4BASE)/processes/hadronic/models/generator/de_excitation/include \
105               -I$(G4BASE)/processes/hadronic/models/generator/diffractive_string/include \
106               -I$(G4BASE)/processes/hadronic/models/generator/high_energy/include \
107               -I$(G4BASE)/processes/hadronic/models/generator/kinetic_model/include \
108               -I$(G4BASE)/processes/hadronic/models/generator/management/include \
109               -I$(G4BASE)/processes/hadronic/models/generator/pre_equilibrium/include \
110               -I$(G4BASE)/processes/hadronic/models/generator/quark_gluon_string/include \
111               -I$(G4BASE)/processes/hadronic/models/generator/string_common/include \
112               -I$(G4BASE)/processes/hadronic/models/generator/string_fragmentation/include \
113               -I$(G4BASE)/processes/hadronic/models/generator/util/include \
114               -I$(G4BASE)/processes/hadronic/models/high_energy/include \
115               -I$(G4BASE)/processes/hadronic/models/low_energy/include \
116               -I$(G4BASE)/processes/hadronic/models/neutron_hp/include \
117               -I$(G4BASE)/processes/hadronic/models/isotope_production/include \
118               -I$(G4BASE)/processes/hadronic/stopping/include \
119               -I$(G4BASE)/geometry/management/include \
120               -I$(G4BASE)/geometry/solids/CSG/include \
121               -I$(G4BASE)/geometry/solids/specific/include \
122               -I$(G4BASE)/geometry/solids/BREPS/include \
123               -I$(G4BASE)/geometry/solids/Boolean/include \
124               -I$(G4BASE)/geometry/solids/STEP/include \
125               -I$(G4BASE)/geometry/solids/STEPinterface/include \
126               -I$(G4BASE)/geometry/volumes/include \
127               -I$(G4BASE)/geometry/magneticfield/include \
128               -I$(G4BASE)/track/include \
129               -I$(G4BASE)/tracking/include \
130               -I$(G4BASE)/digits+hits/detector/include \
131               -I$(G4BASE)/digits+hits/hits/include \
132               -I$(G4BASE)/digits+hits/digits/include \
133               -I$(G4BASE)/readout/include \
134               -I$(G4BASE)/event/include \
135               -I$(G4BASE)/graphics_reps/include \
136               -I$(G4BASE)/intercoms/include \
137               -I$(G4BASE)/g3tog4/include
138
139 endif
140 CPPFLAGS += $(INCFLAGS)
141
142 #
143 # Geant4 libraries
144 #
145
146 ifdef NEED_G4_LIBS
147
148 G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(G4TARGET)
149 G4LIBDIR := $(G4LIB)/$(G4SYSTEM)
150 LDFLAGS += -L$(G4LIBDIR) -L$(CLHEP_LIB_DIR)
151
152 ifdef LDLIBS
153   USER_DEFINED_LDLIBS := 1
154 endif
155
156 # Because of the script for granular libraries which replaces part of LDLIBS
157 # and because of the way user defined LDLIBS was augmented historically I
158 # have split LDLIBS into 4 parts...
159 #
160
161 ifndef USER_DEFINED_LDLIBS
162
163 # LDLIBS1 contains the very high level libraries...
164 #
165 ifdef G4EXLIB
166   LDLIBS1 := -l$(G4TARGET)
167 endif
168   LDLIBS1 += $(EXTRALIBS)
169   LDLIBS1 += $(VISLIBS) $(UILIBS)
170
171 # test if global libraries are present
172 GLOBALLIBS := $(shell test -f $(G4LIBDIR)/libG4global.$(SL) && echo yes)
173
174 ifdef GLOBALLIBS
175   LDLIBS2 := \
176         -lG4readout \
177         -lG4run \
178         -lG4event \
179         -lG4tracking \
180         -lG4processes \
181         -lG4particles \
182         -lG4digits+hits \
183         -lG4track \
184         -lG4materials \
185         -lG4geometry \
186         -lG4geometry \
187         -lG4graphics_reps \
188         -lG4intercoms \
189         -lG4global 
190 else
191   DUMMY := $(shell \
192         if [ ! \( -f $(G4INSTALL)/lib/$(G4SYSTEM)/list \) ]; then \
193         $(G4INSTALL)/lib/$(G4SYSTEM)/liblist  \
194         -d $(G4INSTALL)/tmp/$(G4SYSTEM) \
195         < $(G4INSTALL)/lib/$(G4SYSTEM)/libname.map \
196         > $(G4INSTALL)/lib/$(G4SYSTEM)/list; fi )
197 # Extra libraries to resolve remaining circular dependencies...    
198   LDLIBS2 := $(shell cat $(G4INSTALL)/lib/$(G4SYSTEM)/list)     
199 #  LDLIBS2 += -lG4xrays -lG4optical -lG4muons
200 endif   
201
202 # Warning: do not add to LDLIBS2 with += becuase this causes it to be
203 # expanded too soon.  Hence extra libraries must have a different name...
204 # Extra libraries to resolve remaining circular dependencies...
205 #  LDLIBS2EXTRA = 
206
207 # LDLIBS3 contains the first set of low level libraries...
208 #
209   LDLIBS3 += $(INTYLIBS) $(G4GLIBS)
210
211 endif # ifndef USER_DEFINED_LDLIBS
212
213 # LDLIBS4 contains the next set of low level libraries which historically
214 # (why?) the user is not supposed to be able to define...
215 #
216 ifdef G4USE_OSPACE
217   LDLIBS4 += $(OSPACELIBS)
218 endif
219
220   LDLIBS4 += $(LOADLIBS)
221
222 # Finally assemble libraries...
223 #
224 ifdef USER_DEFINED_LDLIBS
225   LDLIBS_PREFINAL := $(LDLIBS)
226 else
227   LDLIBS_PREFINAL = $(LDLIBS1) -lG3toG4 $(LDLIBS2) $(LDLIBS2EXTRA) $(LDLIBS3)
228 endif
229   LDLIBS_PREFINAL += $(LDLIBS4)
230
231 LDLIBS = $(LDLIBS_PREFINAL)
232
233 G4LDLIBS = $(LDLIBS)
234
235 endif #ifdef NEED_G4_LIBS
236