-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
executable file
·322 lines (291 loc) · 9.77 KB
/
configure.ac
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# ======================================================================
# This is the CLHEP configuration input file
# Process this file with autoconf to produce a configure script.
# ======================================================================
# ----------------------------------------------------------------------
# Identify the package and initialize the autotools:
# ----------------------------------------------------------------------
AC_PREREQ(2.59)
AC_INIT(CLHEP, 2.1.4.2, http://savannah.cern.ch/projects/clhep/ )
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([Vector/src/AxisAngle.cc])
AM_INIT_AUTOMAKE(1.9 foreign)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
# ----------------------------------------------------------------------
# subpackages
# ----------------------------------------------------------------------
AC_CONFIG_SUBDIRS(Units Utility Vector Evaluator GenericFunctions Geometry Random Matrix RandomObjects RefCount Cast Exceptions)
# ----------------------------------------------------------------------
# --enable-exceptions or --disable-exceptions
# --disable-exceptions is the default
# ----------------------------------------------------------------------
AC_ARG_ENABLE(exceptions,
AC_HELP_STRING([--enable-exceptions],[use CLHEP/Exceptions (off by default)]),
[case "${enableval}" in
yes) AC_SUBST(use_exceptions,["#define ENABLE_ZOOM_EXCEPTIONS"]) ;;
no) AC_SUBST(use_exceptions,["#undef ENABLE_ZOOM_EXCEPTIONS"]) ;;
*) AC_SUBST(use_exceptions,["#define ENABLE_ZOOM_EXCEPTIONS"]) ;;
esac],
[AC_SUBST(use_exceptions,["#undef ENABLE_ZOOM_EXCEPTIONS"])])
AC_ARG_ENABLE(shared,
AC_HELP_STRING([--disable-shared],[do not build shared libraries]),
[case "${enableval}" in
yes) build_shared="yes";;
no) build_shared="no";;
*) build_shared="yes";;
esac],
[build_shared="yes"])
AC_ARG_ENABLE(static,
AC_HELP_STRING([--disable-static],[do not build static libraries]),
[case "${enableval}" in
yes) build_static="yes";;
no) build_static="no";;
*) build_static="yes";;
esac],
[build_static="yes"])
AC_ARG_ENABLE(visual,
AC_HELP_STRING([--enable-visual],[on by default when using Visual C++]),
[case "${enableval}" in
yes) build_visual="yes";;
no) build_visual="no";;
*) build_visual="no";;
esac],
[build_visual="no"])
AC_ARG_ENABLE(gmake,
AC_HELP_STRING([--enable-gmake],[use gmake (default is make)]),
[case "${enableval}" in
yes) use_gmake="yes";;
no) use_gmake="no";;
*) use_gmake="no";;
esac],
[use_gmake="no"])
# ----------------------------------------------------------------------
# Identify the files that 'configure' is to produce:
# ----------------------------------------------------------------------
# Makefiles:
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([getObjectList], [chmod +x getObjectList])
# tarball scripts
AC_CONFIG_FILES([makeSourceDist], [chmod +x makeSourceDist])
AC_CONFIG_FILES([makeBinaryTar], [chmod +x makeBinaryTar])
# build clheplib
AC_CONFIG_FILES([build-clheplib], [chmod +x build-clheplib])
# build ClhepVersion.h
AC_CONFIG_FILES([build-header], [chmod +x build-header])
# Configuration inquiry program/script:
AC_CONFIG_FILES([clhep-config], [chmod +x clhep-config])
# ----------------------------------------------------------------------
# Capture post-install information:
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Check for needed programs:
# ----------------------------------------------------------------------
# Locate a C++ compiler:
AC_PROG_CXX(cl g++ g++4 c++ icc aCC CC cxx cc++ FCC RCC xlC_r xlC gpp)
# Use it hereinafter:
AC_LANG(C++)
# Ensure we've found a preprocessor:
AC_REQUIRE_CPP
# copy and diff
case "$target" in
*-*-win32*)
COPY_P="copy -p";DIFF_Q="diff -q -b"
;;
*-*-cygwin*)
COPY_P="cp -p";DIFF_Q="diff -q -b"
;;
*-*-solaris*)
COPY_P="cp -p";DIFF_Q="diff -b"
use_gmake="yes"
;;
*-*-linux*)
COPY_P="cp -p";DIFF_Q="diff -q -b"
;;
*)
COPY_P="cp -p";DIFF_Q="diff -q -b"
esac
AM_CONDITIONAL(USE_GMAKE, test x$use_gmake = xyes)
AC_SUBST(COPY_P)
AC_SUBST(DIFF_Q)
# worry about compiler flags
case "$CXX" in
g++)
case "$target" in
*-*-linux*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE"
MY_SHFLAGS="-fPIC -DPIC"
MY_SHLINK="-shared -Wl,--no-undefined"
MY_SHNAME="-Wl,-soname,"
MY_LD="-Wl,--rpath -Wl,"
SHEXT=so
AR="ar"; ARFLAGS="cru"
;;
*-*-darwin*)
AM_CXXFLAGS="-O -pedantic -Wall"
MY_SHFLAGS=""; MY_SHLINK="-dynamiclib -single_module -undefined dynamic_lookup"; SHEXT=dylib
MY_SHNAME="-Wl,-install_name,"; MY_LD="-bind_at_load -Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
;;
*-*-cygwin*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall"
MY_SHFLAGS="-DPIC"; SHEXT=dll
MY_SHLINK="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive"
MY_SHLINKEXTRA="-Wl,--no-whole-archive"
MY_SHNAME="-Wl,-out-implib="; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
build_static="yes"
build_shared="no"
;;
*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall"
MY_SHFLAGS="-fPIC -DPIC"
MY_SHLINK="-shared -Wl,--no-undefined"
MY_SHNAME="-Wl,-soname,"
MY_LD="-Wl,--rpath -Wl,"
SHEXT=so
AR="ar"; ARFLAGS="cru"
esac;;
g++4)
case "$target" in
*-*-linux*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE"
MY_SHFLAGS="-fPIC -DPIC"
MY_SHLINK="-shared -Wl,--no-undefined"
MY_SHNAME="-Wl,-soname,"
MY_LD="-Wl,--rpath -Wl,"
SHEXT=so
AR="ar"; ARFLAGS="cru"
;;
*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall"
MY_SHFLAGS="-fPIC -DPIC"
MY_SHLINK="-shared -Wl,--no-undefined"
MY_SHNAME="-Wl,-soname,"
MY_LD="-Wl,--rpath -Wl,"
SHEXT=so
AR="ar"; ARFLAGS="cru"
esac;;
c++)
case "$target" in
*-*-linux*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE"
MY_SHFLAGS="-fPIC -DPIC"
MY_SHLINK="-shared -Wl,--no-undefined"
MY_SHNAME="-Wl,-soname,"
MY_LD="-Wl,--rpath -Wl,"
SHEXT=so
AR="ar"; ARFLAGS="cru"
;;
*-*-darwin*)
AM_CXXFLAGS="-O -pedantic -Wall"
MY_SHFLAGS=""; MY_SHLINK="-dynamiclib -single_module -undefined dynamic_lookup"; SHEXT=dylib
MY_SHNAME="-Wl,-install_name,"; MY_LD="-bind_at_load -Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
;;
*-*-cygwin*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall"
MY_SHFLAGS="-DPIC"; SHEXT=dll
MY_SHLINK="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive"
MY_SHLINKEXTRA="-Wl,--no-whole-archive"
MY_SHNAME="-Wl,-out-implib="; MY_LD="-Wl,--rpath -Wl,"
AR="ar"; ARFLAGS="cru"
build_static="yes"
build_shared="no"
;;
*)
AM_CXXFLAGS="-O -ansi -pedantic -Wall"
MY_SHFLAGS="-fPIC -DPIC"
MY_SHLINK="-shared -Wl,--no-undefined"
MY_SHNAME="-Wl,-soname,"
MY_LD="-Wl,--rpath -Wl,"
SHEXT=so
AR="ar"; ARFLAGS="cru"
esac;;
icc)
case "$target" in
*-*-linux*)
AM_CXXFLAGS="-O -ansi -fp-model precise -no-gcc -w1"
AM_LDFLAGS="-lstdc++"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-shared"; SHEXT=so
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="xiar"; ARFLAGS="cru"
;;
*)
AM_CXXFLAGS="-O -ansi -fp-model precise -no-gcc -w1"
AM_LDFLAGS="-lstdc++"
MY_SHFLAGS="-fPIC -DPIC"; MY_SHLINK="-shared"; SHEXT=so
MY_SHNAME="-Wl,-soname,"; MY_LD="-Wl,--rpath -Wl,"
AR="xiar"; ARFLAGS="cru"
esac;;
cl)
AM_CXXFLAGS="-EHsc -nologo -GR -MD"
AR="ar"; ARFLAGS="cru"
MY_SHFLAGS=" "; MY_SHLINK="lib /NOLOGO"; SHEXT=lib
MY_SHNAME="/OUT:"; MY_LD=" "
build_static="no"
build_shared="yes"
build_visual="yes"
CXXFLAGS=" "
AC_SUBST(CXXFLAGS)
;;
CC)
case "$target" in
*-*-solaris*)
AM_CXXFLAGS="-O"
MY_SHFLAGS="-KPIC -DPIC"; MY_SHLINK="-G"; SHEXT=so
MY_SHNAME="-h"; MY_LD="-R"
AM_LDFLAGS="-lsunmath"
AR="CC"; ARFLAGS="-xar -o"
build_shared="no"
;;
*-*-hpux*) AM_CXXFLAGS="+O3 +DAportable +a1 -z -pta +Onolimit"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
*-*-irix*) AM_CXXFLAGS="-O -OPT:Olimit=0 -pta"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
*) echo UNEXPECTED CHOICE OF OPERATING SYSTEM FOR $CXX: $target
esac;;
aCC)
AM_CXXFLAGS="-O -Aa +DAportable +Onolimit"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
cxx)
AM_CXXFLAGS="-O -std strict_ansi -timplicit_local"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
xlC)
AM_CXXFLAGS="-O3 -qtwolink -+"
AR="ar"; ARFLAGS="cru"
build_shared="no"
;;
*) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX
esac
AM_CONDITIONAL(BUILD_SHARED, test x$build_shared = xyes)
AM_CONDITIONAL(BUILD_STATIC, test x$build_static = xyes)
AM_CONDITIONAL(BUILD_VISUAL, test x$build_visual = xyes)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_SUBST(MY_SHFLAGS)
AC_SUBST(MY_SHLINK)
AC_SUBST(MY_SHNAME)
AC_SUBST(MY_LD)
AC_SUBST(SHEXT)
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
# ----------------------------------------------------------------------
# Check for supported link flags
# ----------------------------------------------------------------------
AC_CHECK_LIB([c -Wl,--as-needed],open,[MY_SHEXTRA="-Wl,--as-needed"])
AC_SUBST(MY_SHEXTRA)
# ----------------------------------------------------------------------
# Finish up:
# ----------------------------------------------------------------------
AC_OUTPUT
# ======================================================================