Fixes for object target dependencies
[u/mrichter/AliRoot.git] / TEvtGen / Photos / configure.in
CommitLineData
f97ec6ec 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT( [Photos C++ Interface], [3.3], [tomasz.przedzinski@uj.edu.pl] )
6AC_LANG_CPLUSPLUS
7
8AC_PREFIX_DEFAULT([`pwd`])
9AC_CONFIG_SRCDIR([src/photosCInterfaces/Photos.cxx])
10
11##############################################################################
12# Process command line options
13
14if test "$AFS_PATHS" == "yes"; then
15 with_hepmc=$HEPMCLOCATION
16 with_tauola=$TAUOLALOCATION
17 with_mc_tester=$MCTESTERLOCATION
18 with_pythia8=$PYTHIALOCATION
19 pythia8data=$PYTHIA8DATA
20fi
21
22echo ""
23
24AC_MSG_CHECKING([if HepMC location defined])
25AC_ARG_WITH(
26 [hepmc],
27 [AS_HELP_STRING([--with-hepmc], [Path to HepMC 2.xx (use --without-hepmc to compile without HepMC)] )],
28 [AC_MSG_RESULT([$with_hepmc])],
29 [AC_MSG_RESULT([no])]
30)
31
32AC_MSG_CHECKING([if MC-TESTER location defined])
33AC_ARG_WITH(
34 [mc-tester],
35 [AS_HELP_STRING([--with-mc-tester], [Path to MC-TESTER 1.23 or later (used by examples only)] )],
36 [AC_MSG_RESULT([$with_mc_tester])],
37 [AC_MSG_RESULT([no])]
38)
39
40AC_MSG_CHECKING([if Pythia 8 location defined])
41AC_ARG_WITH(
42 [pythia8],
43 [AS_HELP_STRING([--with-pythia8], [Path to Pythia 8.1 or later (used by examples only)] )],
44 [AC_MSG_RESULT([$with_pythia8])],
45 [AC_MSG_RESULT([no])]
46)
47
48AC_MSG_CHECKING([if Tauola location defined])
49AC_ARG_WITH(
50 [tauola],
51 [AS_HELP_STRING([--with-tauola], [Path to Tauola C++ interface v1.0.5 or later (used by examples only)] )],
52 [AC_MSG_RESULT([$with_tauola])],
53 [AC_MSG_RESULT([no])]
54)
55
56# Check for debug flags
57AC_MSG_CHECKING([if debug flags are enabled])
58AC_ARG_ENABLE(
59 [debug],
60 [AS_HELP_STRING([--enable-debug],[Enable debug flags])],
61 [
62 AC_MSG_RESULT([$enable_debug]) ;
63 FFLAGS="-g3 -O0" ;
64 CXXFLAGS="-g3 -O0"
65 ],
66 [
67 AC_MSG_RESULT([no]) ;
68 FFLAGS="-O2" ;
69 CXXFLAGS="-O2"
70 ]
71)
72
73echo ""
74
75##############################################################################
76# Check for programs
77AC_PROG_MAKE_SET
78AC_PROG_LN_S
79AC_PROG_CC
80AC_PROG_CXX
81AC_PROG_RANLIB
82
83# here is a trick to preffer
84# gfortran for gcc4 and higher
85# and g77 for gcc3 and lower
86flist="gfortran g77 f77"
87if [[[ "$(gcc -dumpversion | cut -d . -f 1)" < "4" ]]] ; then
88 flist="g77 f77 gfortran"
89fi
90
91AC_PROG_F77([$flist])
92AC_PROG_CPP
93AC_CHECK_PROG(DIRECT_CPP,cpp,cpp,$CPP)
94
95# Checks for typedefs, structures, and compiler characteristics.
96AC_C_CONST
97AC_C_INLINE
98AC_CHECK_TYPES([ptrdiff_t])
99
100# Checks for library functions.
101AC_FUNC_MALLOC
102AC_FUNC_STRFTIME
103AC_CHECK_FUNCS([atexit getcwd pow sqrt], ,
104[ echo "" &&
105 echo "ERROR: Basic functions not found. Something's wrong with paths." &&
106 exit -1
107])
108
109##############################################################################
110# Check for HepMC header files
111
112# If user specified --without-hepmc, skip hepmc check
113if ! test "$with_hepmc" == "no"; then
114
115AC_SUBST(with_hepmc)
116CPPFLAGS="-I$with_hepmc/include $CPPFLAGS"
117
118AC_CHECK_HEADERS([HepMC/Version.h], ,
119[ echo "" &&
120 echo "ERROR: HepMC not found. To provide location use:" &&
121 echo " --with-hepmc=/path/to/HepMC" ;
122 echo " or use";
123 echo " --without-hepmc";
124 echo " (Consider using 'source platform/afs.paths.sh' (or .csh) )"
125 echo ""
126 exit -1
127])
128
129else
130 with_hepmc=""
131 AC_SUBST(with_hepmc)
132fi
133
134##############################################################################
135with_photos=`pwd`
136
137if test "$prefix" != "NONE"; then
138 with_photos=$prefix
139fi
140
141pythia8data=$PYTHIA8DATA
142
143if test -z "$pythia8data"; then
144 pythia8data=$with_pythia8/xmldoc
145fi
146
147ln -sf platform/make.inc make.inc
148
149AC_SUBST(with_photos)
150AC_SUBST(with_hepmc)
151AC_SUBST(pythia8data)
152AC_SUBST(with_tauola)
153AC_SUBST(with_pythia8)
154AC_SUBST(with_mc_tester)
155AC_CONFIG_FILES([platform/make.inc configure.paths.sh configure.paths.csh])
156AC_OUTPUT
157