-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
343 lines (279 loc) · 7.62 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
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
define([libint_mmm_version],[2.0.0])
define([libint_buildid],[stable])
define([libint_so_version],[2:0:0])
dnl --------- Begin ---------
dnl Process this file with autoconf to produce a configure script.
define([AC_CACHE_LOAD], )dnl for debugging configure.in
define([AC_CACHE_SAVE], )dnl for debugging configure.in
AC_PREREQ(2.57)
AC_INIT([Libint2],[libint_mmm_version],[[email protected]],[libint2])
AC_CONFIG_SRCDIR(include/libint2.h)
AC_CONFIG_AUX_DIR(bin)
dnl --- Compiling C++ only ---
AC_LANG(C++)
AC_CANONICAL_TARGET
AC_DEFINE_UNQUOTED(HOST_ARCH, "$host")
AC_DEFINE_UNQUOTED(TARGET_ARCH, "$target")
define([default_prefix_dash],ifelse(libint_buildid, ,[],[-]))
define([default_prefix],"/usr/local")
LIBINT_MMM_VERSION=libint_mmm_version
LIBINT_BUILDID=libint_buildid
AC_SUBST(LIBINT_MMM_VERSION)
AC_SUBST(LIBINT_BUILDID)
changequote(<<, >>)dnl
LIBINT_MAJOR_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/\([0-9]*\)\.[0-9]*\.[0-9]*/\1/'`
LIBINT_MINOR_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/'`
LIBINT_MICRO_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'`
changequote([, ])dnl
AC_DEFINE_UNQUOTED(LIBINT_MAJOR_VERSION,$LIBINT_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(LIBINT_MINOR_VERSION,$LIBINT_MINOR_VERSION)
AC_DEFINE_UNQUOTED(LIBINT_MICRO_VERSION,$LIBINT_MICRO_VERSION)
AC_SUBST(LIBINT_MAJOR_VERSION)
AC_SUBST(LIBINT_MINOR_VERSION)
AC_SUBST(LIBINT_MICRO_VERSION)
LIBINT_SO_VERSION=libint_so_version
AC_SUBST(LIBINT_SO_VERSION)
dnl --------- Features ---------
AC_ARG_ENABLE(debug,
[ --enable-debug Compile with debugging options],
[
case $enableval in
yes)
DEBUG=yes
;;
no)
DEBUG=no
;;
opt)
DEBUG=opt
;;
*)
AC_MSG_ERROR([Invalid value for --enable-debug ($enableval)])
;;
esac
],[
DEBUG=no
]
)
BUILDID="libint_buildid"
AC_ARG_WITH(build-id,
[ --with-build-id Gives an identifier for the build.],
BUILDID=$withval
)
AC_SUBST(BUILDID)
AC_DEFINE_UNQUOTED(LIBINT_BUILDID,"$BUILDID")
if test "$BUILDID"; then
LIBINT_VERSION="$LIBINT_MMM_VERSION-$BUILDID"
else
LIBINT_VERSION="$LIBINT_MMM_VERSION"
fi
AC_DEFINE_UNQUOTED(LIBINT_VERSION, "$LIBINT_VERSION")
AC_SUBST(LIBINT_VERSION)
ac_default_prefix="/usr/local/libint/$LIBINT_VERSION"
AC_ARG_WITH(cxx,
[ --with-cxx Gives the name of the C++ compiler to use.],
CXX=$withval
)
CXXOPTIONS_OPT=
AC_ARG_WITH(cxx-optflags,
[ --with-cxx-optflags Gives optimization flags for the C++ compiler.],
CXXOPTIONS_OPT=$withval
)
AC_ARG_WITH(ranlib,
[ --with-ranlib Gives the name of the ranlib program.],
RANLIB=$withval
)
AC_ARG_WITH(ar,
[ --with-ar Names the archive creator.],
AR=$withval
)
ARFLAGS=r
AC_ARG_WITH(ar-flags,
[ --with-ar-flags Flags for the the archive creator.],
ARFLAGS=$withval
)
AC_SUBST(ARFLAGS)
AC_ARG_WITH(ld,
[ --with-ld Names the object linker.],
LD=$withval
)
libintincludedir=$includedir
AC_ARG_WITH(libint-includedir,
[ --with-libint-includedir Specifies include file install subdir.],
libintincludedir=$withval
)
AC_SUBST(libintincludedir)
AC_ARG_WITH(incdirs,
[ --with-incdirs Specifies include directories (-Idir1 -Idir2).],
EXTRAINCDIRS=$withval
CPPFLAGS=$withval
echo Using extra include directories: $withval
)
AC_ARG_WITH(libs,
[ --with-libs Specifies libraries (-llib1 -llib2).],
LIBS=$withval
echo Using extra libraries: $withval
)
LDFLAGS=
LIBDIRS=
AC_ARG_WITH(libdirs,
[ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).],
LIBDIRS=$withval
LDFLAGS=$withval
echo Using extra library directories: $withval
)
dnl --------- Want absolute path for srcdir, not relative. ---------
if test X$ac_srcdir_defaulted = Xyes; then
case $srcdir in
../*)
srcdir=`(cd $srcdir; pwd)`
#srcdir=`(cd $srcdir; echo $PWD)`
;;
esac
fi
dnl --------- Checks for programs. ---------
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl ac_prog_cxx's order isn't what i need
AC_CHECK_PROGS(CXX, g++ c++ gcc CC cxx xlC_r, gcc)
dnl sees if CXX is a GNU compiler
AC_PROG_CXX
AC_PROG_CXXCPP
AC_CHECK_PROG(AR,ar,ar)
AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin)
AC_PATH_PROG(PDFLATEX,pdflatex,,$PATH:/usr/local/bin)
AC_PATH_PROG(PSLATEX,pslatex,,$PATH:/usr/local/bin)
AC_PATH_PROG(BIBTEX,bibtex,,$PATH:/usr/local/bin)
if test X$LD = X; then
LD=$CXX
AC_SUBST(LD)
fi
dnl -------- Checks for compiler/linker options. ----------
# options needed only for optimization
if test "X$CXXOPTIONS_OPT" = X; then
CXXOPTIONS_OPT=-O2
fi
# options needed only for debugging
CXXOPTIONS_DBG=-g
# options that are always needed
CXXOPTIONS_MISC=
OBJSUF=o
LIBSUF=a
dnl -- check how dependency information is built --
# The GNU compilers work with:
CXXDEPENDSUF=none
CXXDEPENDFLAGS=-M
/bin/rm -f depcheck.u depcheck.c depcheck.o
# Check for an IBM visual age C++ compiler
echo "#include <iostream>" > depcheck.cc
$CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1
if test -f depcheck.u; then
CXXDEPENDSUF=u
CXXDEPENDFLAGS="-M -E"
fi
/bin/rm -f depcheck.u depcheck.c depcheck.o
dnl -- special optimization options --
AC_MSG_CHECKING([for additional optimization options])
case $target in
rs6000-ibm-aix3.2.* | rs6000-ibm-aix4.* | powerpc-ibm-aix4.* | powerpc-ibm-aix5.*)
if test X$GXX != Xyes; then
CXXOPTIONS_OPT="$CXXOPTIONS_OPT -qnolm -qrtti"
fi
AC_MSG_RESULT([rs6000 or powerpc])
;;
*)
AC_MSG_RESULT([none])
;;
esac
dnl -- special architecture options --
if test "X$CXXOPTIONS_OPT" = X; then
AC_MSG_WARN([C++ optimization options are not given! For optimum performance use --with-cxx-optflags configure option])
fi
dnl ----------- check for GNU libc++-v3 prerelease bug ---------------
if test X$GXX = Xyes; then
AC_MSG_CHECKING([for GNU libc++-v3 prerelease bug])
AC_LINK_IFELSE([AC_LANG_SOURCE(
[[#include <stdio.h>
#include <$iostream>
]],[[
]])],[
AC_MSG_RESULT([no])
],
EXTRADEFINES="$EXTRADEFINES -D_ISOC99_SOURCE=1"
AC_MSG_RESULT([yes])
);
fi
dnl -- other options --
AC_MSG_CHECKING([GNU c++ library/template flags])
if test X$GXX = Xyes; then
AC_MSG_RESULT([GNU])
else
case $target in
*)
AC_MSG_RESULT([generic non GNU])
;;
esac
fi
if test $DEBUG = yes; then
CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_MISC"
LDFLAGS="$LDFLAGS -g"
elif test $DEBUG = opt; then
CXXFLAGS="$CXXOPTIONS_DBG $COPTIONS_OPT $CXXOPTIONS_MISC"
LDFLAGS="$LDFLAGS -g"
else
CXXFLAGS="$CXXOPTIONS_OPT $CXXOPTIONS_MISC"
fi
AC_SUBST(EXTRAINCLUDE)
AC_SUBST(CXXFLAGS)
AC_SUBST(LIBDIRS)
AC_SUBST(OBJSUF)
AC_SUBST(LIBSUF)
AC_SUBST(CXXDEPENDSUF)
AC_SUBST(CXXDEPENDFLAGS)
dnl -------- Checks for architecture specific features. --------
dnl (Doesn't work for cross compilation.)
dnl AC_CHECK_SIZEOF(void*)
AC_SUBST(EXTRADEFINES)
dnl ---------- Checks for header files. -----------
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h stdint.h)
dnl -- Checks for typedefs, structures, and compiler characteristics. --
AC_TYPE_SIZE_T
CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="-lm $LIBS $FLIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
dnl --------- Shared library configuration. ---------
enablelibtool=yes
AC_ARG_ENABLE(libtool,
[ --disable-libtool Do not use libtool.],
[
case $enableval in
yes)
;;
no)
enablelibtool=no
;;
*)
AC_MSG_ERROR([Invalid value for --(dis|en)able-libtool ($enableval)])
;;
esac
])
if test "$enablelibtool" = yes; then
dnl by default make only static libraries
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
OBJSUF=lo
LIBSUF=la
else
enable_shared=no
fi
if test "$enable_shared" = "no"; then
OBJSUF=o
LIBSUF=a
fi
ENABLESHARED=$enable_shared
AC_SUBST(ENABLESHARED)
AC_CONFIG_FILES(MakeVars MakeRules MakeSuffixRules)
dnl --------- Done! ---------
AC_OUTPUT