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