]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/Photos/examples/configure.in
TENDER becomes Tender, removing .so
[u/mrichter/AliRoot.git] / TEvtGen / Photos / examples / configure.in
CommitLineData
f97ec6ec 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3AC_PREREQ(2.59)
4AC_INIT( [Photos C++ Interface - examples], [1.0.0], [tomasz.przedzinski@uj.edu.pl] )
5AC_LANG_CPLUSPLUS
6
7##############################################################################
8# This must be done before we load paths from configure.paths.sh!
9env_mc_tester=$MCTESTERLOCATION
10env_pythia8data=$PYTHIA8DATA
11
12hepmclocation=$HEPMCLOCATION
13photoslocation=$PHOTOSLOCATION
14tauolalocation=$TAUOLALOCATION
15mctesterlocation=$MCTESTERLOCATION
16pythialocation=$PYTHIALOCATION
17##############################################################################
18# Find Photos source code location and load paths
19
20echo ""
21
22AC_MSG_CHECKING([if Photos location defined])
23AC_ARG_WITH(
24 [photos],
25 [AS_HELP_STRING([--with-photos], [Path to Photos installation (needed if examples are separated from Photos source code)] )],
26 [AC_MSG_RESULT($with_photos)],
27 [
28 with_photos=`(cd ..; pwd)`
29 AC_MSG_RESULT($with_photos (automatic))
30 ]
31)
32
33### Load configure.paths.sh
34
35if test -e "$with_photos/configure.paths.sh"; then
36 source $with_photos/configure.paths.sh
37elif test -e "$photoslocation/configure.paths.sh"; then
38 source $photoslocation/configure.paths.sh
39 with_photos=$photoslocation
40fi
41
42##############################################################################
43### Check if other locations are defined
44
45### Prefer configure.paths.sh than environment paths
46
47if test ! -z "$HEPMCLOCATION"; then
48 hepmclocation=$HEPMCLOCATION
49fi
50
51if test ! -z "$TAUOLALOCATION"; then
52 tauolalocation=$TAUOLALOCATION
53fi
54
55if test ! -z "$MCTESTERLOCATION"; then
56 mctesterlocation=$MCTESTERLOCATION
57fi
58
59if test ! -z "$PYTHIALOCATION"; then
60 pythialocation=$PYTHIALOCATION
61fi
62
63### Force all paths if AFS_PATHS was defined
64
65if test "$AFS_PATHS" == "yes"; then
66 with_hepmc=$HEPMCLOCATION
67 with_mc_tester=$MCTESTERLOCATION
68 with_pythia8=$PYTHIALOCATION
69fi
70
71##############################################################################
72# Process command line options
73
74echo ""
75
76AC_MSG_CHECKING([if Tauola location defined])
77AC_ARG_WITH(
78 [tauola],
79 [AS_HELP_STRING([--with-tauola], [Path to Tauola C++ v1.0.5 or later] )],,
80 [with_tauola=$tauolalocation]
81)
82AC_MSG_RESULT([$with_tauola])
83
84AC_MSG_CHECKING([if MC-TESTER location defined])
85AC_ARG_WITH(
86 [mc-tester],
87 [AS_HELP_STRING([--with-mc-tester], [Path to MC-TESTER 1.23 or later] )],,
88 [with_mc_tester=$mctesterlocation]
89)
90AC_MSG_RESULT([$with_mc_tester])
91
92AC_MSG_CHECKING([if Pythia 8 location defined])
93AC_ARG_WITH(
94 [pythia8],
95 [AS_HELP_STRING([--with-pythia8], [Path to Pythia 8.1 or later] )],,
96 [with_pythia8=$pythialocation]
97)
98AC_MSG_RESULT([$with_pythia8])
99
100
101AC_MSG_CHECKING([if HepMC location is defined])
102AC_ARG_WITH(
103 [hepmc],
104 [AS_HELP_STRING([--with-hepmc], [Path to HepMC 2.xx] )],,
105 [with_hepmc=$hepmclocation]
106)
107AC_MSG_RESULT([$with_hepmc])
108
109echo ""
110##############################################################################
111# Check for HepMC header files
112CPPFLAGS="-I$with_hepmc/include $CPPFLAGS"
113
114AC_CHECK_HEADERS([HepMC/Version.h],
115 HAS_HEPMC=1,
116[ HAS_HEPMC=0 &&
117 echo "" &&
118 echo "INFO: HepMC not found. To provide location use:" &&
119 echo " './configure --with-hepmc=<path_to_HepMC>' "
120 echo " (Consider using 'source platform/afs.paths.sh' (or .csh) )"
121 echo ""
122])
123
124##############################################################################
125# Check for Photos
126CPPFLAGS="-I$with_photos/include $CPPFLAGS"
127
128AC_CHECK_HEADER([Photos/Photos.h], ,
129[ echo "" &&
130 echo "ERROR: Photos not found. To provide location use:" &&
131 echo " './configure --with-photos=<path_to_Photos>' "
132 echo ""
133 exit 0
134])
135
136##############################################################################
137# Check for Tauola
138CPPFLAGS="-I$with_tauola/include $CPPFLAGS"
139
140AC_CHECK_HEADER([Tauola/Tauola.h],
141 HAS_TAUOLA=1,
142[ HAS_TAUOLA=0 &&
143 echo "" &&
144 echo "INFO: Tauola not found. To provide location use:" &&
145 echo " './configure --with-tauola=<path_to_Tauola>' "
146 echo ""
147])
148
149##############################################################################
150# Check for ROOT
151
152AC_CHECK_PROG(HAS_ROOT_CONFIG,root-config,[yes],[no])
153
154if test "$HAS_ROOT_CONFIG" == "no"; then
155 HAS_ROOT=0
156 echo ""
157 echo "INFO: root-config not found. ROOT is not installed or path"
158 echo " to ROOT bin folder not provied via \$PATH variable. Use:"
159 echo " export PATH=\$PATH:<path_to_root>/bin"
160 echo " export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\`root-config --libdir\`"
161 echo " (consider using 'source platform/afs.paths.sh' (or .csh) )"
162 echo ""
163else
164 AC_CHECK_PROG(HAS_ROOT_EXE,root,[yes],[no])
165 if test "$HAS_ROOT_EXE" == "no"; then
166 HAS_ROOT=0;
167 echo ""
168 echo "INFO: root-config exists but root not found."
169 else
170 ROOTLIB=`root-config --glibs`
171 ROOTINC=`root-config --cflags`
172 CPPFLAGS="$ROOTLIB $ROOTINC $CPPFLAGS"
173 AC_CHECK_HEADER([TROOT.h],
174 HAS_ROOT=1,
175 [ HAS_ROOT=0 &&
176 echo "" &&
177 echo "INFO: ROOT header file cannot be compiled."
178 ])
179 fi
180 if test $HAS_ROOT = 0; then
181 echo " This indicates faulty or unusual ROOT installation."
182 echo " Verify that location of both 'root' and 'root-config' "
183 echo " is provided via \$PATH."
184 echo " MC-Tester will not be used."
185 echo ""
186 fi
187fi
188
189##############################################################################
190# Check for MC-Tester
191CPPFLAGS="-I$with_mc_tester/include $CPPFLAGS"
192
193if test $HAS_ROOT = 1; then
194 AC_CHECK_HEADER([Generate.h],
195 HAS_MC_TESTER=1,
196 [ HAS_MC_TESTER=0 &&
197 echo "" &&
198 echo "INFO: MC-Tester not found. To provide location use:" &&
199 echo " './configure --with-mc-tester=<path_to_MC_Tester>' "
200 echo ""
201 ])
202 if test $HAS_MC_TESTER = 1; then
203 AC_CHECK_HEADER([HepMCParticle.H], ,
204 [ HAS_MC_TESTER=0 &&
205 echo "" &&
206 echo "INFO: MC-Tester has been compiled without the required" &&
207 echo " library 'libHepMCEvent'. MC-Tester will not be used." &&
208 echo ""
209 ])
210 fi
211 echo "checking for MCTESTERLOCATION: $env_mc_tester"
212 if test $HAS_MC_TESTER = 1 && test -z "$env_mc_tester"; then
213 echo ""
214 echo "WARNING: MC-Tester location is valid, however MCTESTERLOCATION"
215 echo " variable required by MC-Tester scripts is not set."
216 echo " Without it, examples will compile and execute correctly,"
217 echo " but scripts in examples/testing/* won't work. "
218 echo " Use 'source $with_photos/configure.paths.sh' (or .csh) to set this variable."
219 echo ""
220 fi
221else
222 HAS_MC_TESTER=0
223fi
224
225##############################################################################
226# Check for Pythia
227CPPFLAGS="-I$with_pythia8/include $CPPFLAGS"
228
229AC_CHECK_HEADER([Pythia.h],
230 HAS_PYTHIA=1,
231[ HAS_PYTHIA=0 &&
232 echo "" &&
233 echo "INFO: Pythia8 not found. To provide location use:" &&
234 echo " './configure --with-pythia8=<path_to_Pythia8>' "
235 echo ""
236])
237
238if test $HAS_PYTHIA = 1; then
239 AC_CHECK_HEADER([HepMCInterface.h], ,
240 [ HAS_PYTHIA=0 &&
241 echo "" &&
242 echo "WARNING: Pythia8 has been compiled without the required" &&
243 echo " library 'libhepmcinterface'. Pythia8 will not be used." &&
244 echo ""
245 ])
246 echo "checking for PYTHIA8DATA: $env_pythia8data"
247 if test $HAS_PYTHIA = 1 && test -z "$env_pythia8data"; then
248 pythia8data=$with_pythia8/xmldoc
249 echo ""
250 echo "WARNING: Pythia8 location is valid, however PYTHIA8DATA"
251 echo " variable required by Pythia is not set."
252 echo " Without it, examples will compile, but Pythia cannot"
253 echo " work properly. Refer to Pythia documentation."
254 echo " Use 'source $with_photos/configure.paths.sh' (or .csh) to set this variable."
255 echo ""
256 fi
257fi
258
259if test $HAS_HEPMC = 0; then unset with_hepmc; fi
260if test $HAS_TAUOLA = 0; then unset with_tauola; fi
261if test $HAS_PYTHIA = 0; then unset with_pythia8; fi
262if test $HAS_MC_TESTER = 0; then unset with_mc_tester; fi
263
264##############################################################################
265AC_SUBST(with_photos)
266AC_SUBST(with_hepmc)
267AC_SUBST(with_tauola)
268AC_SUBST(with_hepmc)
269AC_SUBST(pythia8data)
270AC_SUBST(with_pythia8)
271AC_SUBST(with_mc_tester)
272
273AC_CONFIG_FILES([make.inc])
274
275### Save paths (only if configure.paths.sh exists and is writable)
276if test -e "$with_photos/configure.paths.sh" && test -w "$with_photos/configure.paths.sh"; then
277 AC_CONFIG_FILES([$with_photos/configure.paths.sh $with_photos/configure.paths.csh])
278fi
279
280AC_OUTPUT
281
282##############################################################################
283echo "Finished!"
284echo "---------"
285echo ""
286
287if test -e "$with_photos/configure.paths.sh"; then
288 echo "Consider using 'source $with_photos/configure.paths.sh'"
289 echo "(or .csh) for setting up several paths used by examples."
290fi
291
292if test $HAS_TAUOLA = 0 || test $HAS_PYTHIA = 0 || test $HAS_MC_TESTER = 0; then
293 echo ""
294 echo "Not all examples will be available."
295fi
296
297if test $HAS_TAUOLA = 0; then
298 echo "Consider './configure --with-tauola=<path_to_Tauola>' "
299fi
300
301if test $HAS_PYTHIA = 0; then
302 echo "Consider './configure --with-pythia8=<path_to_Pythia8>' "
303fi
304
305if test $HAS_MC_TESTER = 0; then
306 unset with_mc_tester
307 echo "Consider './configure --with-mc-tester=<path_to_MC_Tester>' "
308fi
309
310echo ""