SSO Logout

Subversion Repositories hepmc

Rev

Rev 533 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
285 garren 1
# ----------------------------------------------------------------------
2
# This is the HepMC configuration input file
3
# Process this file with autoconf to produce a configure script.
4
# ----------------------------------------------------------------------
5
 
6
AC_PREREQ(2.59)
534 garren 7
AC_INIT([HepMC],[2.06.09],[https://savannah.cern.ch/projects/hepmc/],[HepMC])
285 garren 8
AC_CANONICAL_TARGET
9
AM_INIT_AUTOMAKE(1.9 foreign)
390 garren 10
AC_CONFIG_SRCDIR([src/GenEvent.cc])
285 garren 11
AC_CONFIG_HEADER([HepMC/defs.h])
12
 
13
# ----------------------------------------------------------------------
350 garren 14
# shared library versioning
15
# for various reasons, this cannot match the HepMC version
16
# ----------------------------------------------------------------------
17
 
434 garren 18
LIBRARY_VERSION="-version-info 4:0:0"
350 garren 19
AC_SUBST(LIBRARY_VERSION)
20
 
21
# ----------------------------------------------------------------------
285 garren 22
# define --enable-visual
23
# ----------------------------------------------------------------------
24
AC_ARG_ENABLE(visual,
25
   AC_HELP_STRING([--enable-visual],[on by default when using Visual C++]),
26
        [case "${enableval}" in
27
          yes) build_visual="yes";;
28
          no)  build_visual="no";;
29
          *)   build_visual="no";;
30
        esac],
31
        [build_visual="no"])
32
 
33
# ----------------------------------------------------------------------
335 garren 34
# define the default momentum and length (position) units
35
# these MUST be declared
36
# ----------------------------------------------------------------------
37
 
337 garren 38
AC_ARG_WITH(momentum,
39
   AC_HELP_STRING([--with-momentum],
40
                  [--with-momentum=MEV or GEV, no other values allowed]),
335 garren 41
   [HEPMC_DEFAULT_MOM_UNIT=${withval}],
346 garren 42
   [AC_MSG_ERROR([You MUST configure --with-momentum=XX, where XX is MEV or GEV])])
335 garren 43
AC_SUBST(HEPMC_DEFAULT_MOM_UNIT)
44
 
337 garren 45
AC_ARG_WITH(length,
46
   AC_HELP_STRING([--with-length],
47
                  [--with-length=MM or CM, no other values allowed]),
335 garren 48
   [HEPMC_DEFAULT_LEN_UNIT=${withval}],
346 garren 49
   [AC_MSG_ERROR([You MUST configure --with-length=YY, where YY is MM or CM])])
335 garren 50
AC_SUBST(HEPMC_DEFAULT_LEN_UNIT)
51
 
52
# ----------------------------------------------------------------------
285 garren 53
# find CLHEP and/or GENSER:
54
# these are used ONLY in the examples
55
# ----------------------------------------------------------------------
56
 
57
AC_ARG_WITH(CLHEP,
58
   AC_HELP_STRING([--with-CLHEP],[--with-CLHEP=$CLHEP_DIR: CLHEP is used in the examples]),
59
   [CLHEPdir=${withval}],[CLHEPdir=" "])
60
AC_SUBST(CLHEPdir)
61
 
62
AC_ARG_WITH(GENSER,
63
   AC_HELP_STRING([--with-GENSER],[--with-GENSER=$GENSER_DIR: GENSER is used in the examples]),
64
   [GENSERdir=${withval}],[GENSERdir=" "])
65
AC_SUBST(GENSERdir)
66
 
67
# ----------------------------------------------------------------------
68
# Checks for programs.
69
# ----------------------------------------------------------------------
532 garren 70
case "$CXX" in
71
cl)
533 garren 72
  AC_MSG_ERROR([configure is not supported for Visual C++, use cmake instead])
532 garren 73
  ;;
74
*)
75
esac
76
 
285 garren 77
AC_PROG_CXX
78
AC_PROG_CC
79
AC_PROG_MAKE_SET
533 garren 80
AC_PROG_F77(gfortran g77 f77)
285 garren 81
 
318 garren 82
# special libtool rules for Windows - work with gcc and cygwin
83
AC_LIBTOOL_WIN32_DLL
285 garren 84
AC_PROG_LIBTOOL
85
 
86
# ----------------------------------------------------------------------
87
# Checks for libraries.
88
# ----------------------------------------------------------------------
89
 
90
# ----------------------------------------------------------------------
91
# Checks for header files.
92
# ----------------------------------------------------------------------
93
AC_CHECK_HEADERS([stdint.h])
94
 
95
# ----------------------------------------------------------------------
96
# Checks for typedefs, structures, and compiler characteristics.
97
# ----------------------------------------------------------------------
98
AC_HEADER_STDBOOL
99
AC_C_CONST
100
AC_C_INLINE
101
AC_CHECK_TYPES([ptrdiff_t])
102
 
103
# ----------------------------------------------------------------------
104
# Checks for library functions.
105
# ----------------------------------------------------------------------
106
AC_HEADER_STDC
107
 
108
# ----------------------------------------------------------------------
109
# OS dependent differences:
110
# ----------------------------------------------------------------------
111
 
112
# copy
113
case "$target" in
114
*-*-win32*)
115
  COPY_P="copy -p"
533 garren 116
  AC_MSG_WARN([we recommend using cmake instead of configure on Windows])
285 garren 117
  ;;
533 garren 118
*-*-darwin*)
119
  COPY_P="cp -p"
120
  AC_MSG_WARN([we recommend using cmake instead of configure on MacOSX])
121
  ;;
285 garren 122
*)
123
  COPY_P="cp -p"
124
esac
125
 
126
# diff
127
DIFF_Q="diff -q -b"
128
 
129
AC_SUBST(COPY_P)
130
AC_SUBST(DIFF_Q)
131
 
132
# ----------------------------------------------------------------------
133
# compiler dependent differences
134
# notice that the default is presumed to be some flavor of g++
135
# ----------------------------------------------------------------------
136
case "$CXX" in
137
cl)
138
  AM_CXXFLAGS="-EHsc -nologo -GR -MD"
320 garren 139
  AC_SUBST(AM_MAKEFLAGS)
140
  CXXFLAGS=" "
141
  AC_SUBST(CXXFLAGS)
285 garren 142
  build_visual="yes"
533 garren 143
  AC_MSG_ERROR([configure is not supported for Visual C++, use cmake instead])
285 garren 144
  ;;
145
*)
146
  AM_CXXFLAGS="-ansi -pedantic -Wall"
147
esac
148
 
149
AC_SUBST(AM_CXXFLAGS)
150
 
151
AM_CONDITIONAL(BUILD_VISUAL, test x$build_visual = xyes)
152
 
153
# ----------------------------------------------------------------------
154
# process Makefile.in and other *.in files
155
# ----------------------------------------------------------------------
156
AC_CONFIG_FILES([Makefile
157
		 HepMC/Makefile
158
                 doc/Makefile
159
                 examples/Makefile
482 garren 160
                 examples/fio/Makefile
511 garren 161
                 examples/pythia8/Makefile
285 garren 162
                 fio/Makefile
163
                 src/Makefile
335 garren 164
                 src/Units.cc
285 garren 165
                 test/Makefile
166
                 test/testHepMC.cc
167
                 test/testMass.cc
168
                 test/testHepMCIteration.cc
169
                 test/testMultipleCopies.cc
390 garren 170
                 test/testStreamIO.cc
482 garren 171
                 examples/GNUmakefile.example
509 garren 172
                 examples/fio/GNUmakefile.example
173
                 examples/pythia8/config.csh
174
                 examples/pythia8/config.sh
175
                 examples/pythia8/GNUmakefile.example])
285 garren 176
 
177
AC_CONFIG_FILES([test/testHepMC.sh], [chmod +x test/testHepMC.sh])
418 garren 178
AC_CONFIG_FILES([test/testFlow.sh], [chmod +x test/testFlow.sh])
285 garren 179
AC_CONFIG_FILES([test/testMass.sh], [chmod +x test/testMass.sh])
180
AC_CONFIG_FILES([test/testHepMCIteration.sh], [chmod +x test/testHepMCIteration.sh])
450 garren 181
AC_CONFIG_FILES([test/testPolarization.sh], [chmod +x test/testPolarization.sh])
285 garren 182
AC_CONFIG_FILES([test/testPrintBug.sh], [chmod +x test/testPrintBug.sh])
390 garren 183
AC_CONFIG_FILES([test/testStreamIO.sh], [chmod +x test/testStreamIO.sh])
285 garren 184
 
185
# ----------------------------------------------------------------------
186
# Finish up:
187
# ----------------------------------------------------------------------
188
AC_OUTPUT