]>
Commit | Line | Data |
---|---|---|
f97ec6ec | 1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | AC_PREREQ(2.59) | |
5 | AC_INIT( [Photos C++ Interface], [3.3], [tomasz.przedzinski@uj.edu.pl] ) | |
6 | AC_LANG_CPLUSPLUS | |
7 | ||
8 | AC_PREFIX_DEFAULT([`pwd`]) | |
9 | AC_CONFIG_SRCDIR([src/photosCInterfaces/Photos.cxx]) | |
10 | ||
11 | ############################################################################## | |
12 | # Process command line options | |
13 | ||
14 | if 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 | |
20 | fi | |
21 | ||
22 | echo "" | |
23 | ||
24 | AC_MSG_CHECKING([if HepMC location defined]) | |
25 | AC_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 | ||
32 | AC_MSG_CHECKING([if MC-TESTER location defined]) | |
33 | AC_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 | ||
40 | AC_MSG_CHECKING([if Pythia 8 location defined]) | |
41 | AC_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 | ||
48 | AC_MSG_CHECKING([if Tauola location defined]) | |
49 | AC_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 | |
57 | AC_MSG_CHECKING([if debug flags are enabled]) | |
58 | AC_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 | ||
73 | echo "" | |
74 | ||
75 | ############################################################################## | |
76 | # Check for programs | |
77 | AC_PROG_MAKE_SET | |
78 | AC_PROG_LN_S | |
79 | AC_PROG_CC | |
80 | AC_PROG_CXX | |
81 | AC_PROG_RANLIB | |
82 | ||
83 | # here is a trick to preffer | |
84 | # gfortran for gcc4 and higher | |
85 | # and g77 for gcc3 and lower | |
86 | flist="gfortran g77 f77" | |
87 | if [[[ "$(gcc -dumpversion | cut -d . -f 1)" < "4" ]]] ; then | |
88 | flist="g77 f77 gfortran" | |
89 | fi | |
90 | ||
91 | AC_PROG_F77([$flist]) | |
92 | AC_PROG_CPP | |
93 | AC_CHECK_PROG(DIRECT_CPP,cpp,cpp,$CPP) | |
94 | ||
95 | # Checks for typedefs, structures, and compiler characteristics. | |
96 | AC_C_CONST | |
97 | AC_C_INLINE | |
98 | AC_CHECK_TYPES([ptrdiff_t]) | |
99 | ||
100 | # Checks for library functions. | |
101 | AC_FUNC_MALLOC | |
102 | AC_FUNC_STRFTIME | |
103 | AC_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 | |
113 | if ! test "$with_hepmc" == "no"; then | |
114 | ||
115 | AC_SUBST(with_hepmc) | |
116 | CPPFLAGS="-I$with_hepmc/include $CPPFLAGS" | |
117 | ||
118 | AC_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 | ||
129 | else | |
130 | with_hepmc="" | |
131 | AC_SUBST(with_hepmc) | |
132 | fi | |
133 | ||
134 | ############################################################################## | |
135 | with_photos=`pwd` | |
136 | ||
137 | if test "$prefix" != "NONE"; then | |
138 | with_photos=$prefix | |
139 | fi | |
140 | ||
141 | pythia8data=$PYTHIA8DATA | |
142 | ||
143 | if test -z "$pythia8data"; then | |
144 | pythia8data=$with_pythia8/xmldoc | |
145 | fi | |
146 | ||
147 | ln -sf platform/make.inc make.inc | |
148 | ||
149 | AC_SUBST(with_photos) | |
150 | AC_SUBST(with_hepmc) | |
151 | AC_SUBST(pythia8data) | |
152 | AC_SUBST(with_tauola) | |
153 | AC_SUBST(with_pythia8) | |
154 | AC_SUBST(with_mc_tester) | |
155 | AC_CONFIG_FILES([platform/make.inc configure.paths.sh configure.paths.csh]) | |
156 | AC_OUTPUT | |
157 |