1 | # -*- Autoconf -*-
|
---|
2 | # Process this file with autoconf to produce a configure script.
|
---|
3 |
|
---|
4 | AC_PREREQ(2.59)
|
---|
5 | AC_INIT(MPQC, 2.3.1, [foo@molecuilder.de], [molecuilder], [http://www.molecuilder.de/])
|
---|
6 | AC_CONFIG_AUX_DIR([build-aux])
|
---|
7 | AC_CONFIG_SRCDIR([src/bin/mpqc/mpqc.cc])
|
---|
8 | AC_CONFIG_HEADER([src/lib/scconfig.h])
|
---|
9 | AC_CONFIG_MACRO_DIR([m4])
|
---|
10 |
|
---|
11 | # parallel-tests: use parallel test druver
|
---|
12 | # color-tests: us coloring to indicate success/failure when available
|
---|
13 | # tar-pax: use newer tar implementation with longer filename (>99 chars)
|
---|
14 | AM_INIT_AUTOMAKE([dist-bzip2 1.5 tar-pax subdir-objects])
|
---|
15 |
|
---|
16 | # Checks for programs.
|
---|
17 | AC_PROG_CXX
|
---|
18 | AC_PROG_INSTALL
|
---|
19 |
|
---|
20 | # use doxygen
|
---|
21 | DX_HTML_FEATURE(ON)
|
---|
22 | DX_PS_FEATURE(OFF)
|
---|
23 | DX_PDF_FEATURE(OFF)
|
---|
24 | DX_INIT_DOXYGEN(MPQC, doxygen.cfg, ${docdir})
|
---|
25 |
|
---|
26 | # Define these substitions here to keep all version information in one place.
|
---|
27 | # For information on how to properly maintain the library version information,
|
---|
28 | # refer to the libtool manual, section "Updating library version information":
|
---|
29 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
---|
30 | AC_SUBST([MPQC_SO_VERSION], [8:0:1])
|
---|
31 | AC_SUBST([MPQC_API_VERSION], [2.3.1])
|
---|
32 |
|
---|
33 | define([sc_mmm_version],[2.3.1])
|
---|
34 | define([sc_buildid],[])
|
---|
35 | define([sc_so_version],[8:0:1])
|
---|
36 |
|
---|
37 | dnl Process this file with autoconf to produce a configure script.
|
---|
38 | define([AC_CACHE_LOAD], )dnl for debugging configure.in
|
---|
39 | define([AC_CACHE_SAVE], )dnl for debugging configure.in
|
---|
40 |
|
---|
41 | dnl AC_CANONICAL_SYSTEM
|
---|
42 |
|
---|
43 | AC_DEFINE_UNQUOTED(HOST_ARCH, "$host", ["host"])
|
---|
44 | AC_DEFINE_UNQUOTED(TARGET_ARCH, "$target", ["target"])
|
---|
45 |
|
---|
46 | dnl define([default_prefix_dash],ifelse(sc_buildid, ,[],[-]))
|
---|
47 | dnl define([default_prefix],builtin(format,"/usr/local/mpqc/%s%s%s",
|
---|
48 | dnl sc_mmm_version,default_prefix_dash,sc_buildid))
|
---|
49 |
|
---|
50 | SC_MMM_VERSION=sc_mmm_version
|
---|
51 |
|
---|
52 | SC_SO_VERSION=sc_so_version
|
---|
53 | AC_SUBST(SC_SO_VERSION)
|
---|
54 |
|
---|
55 | changequote(<<, >>)dnl
|
---|
56 | SC_MAJOR_VERSION=`echo $SC_MMM_VERSION|sed 's/\([0-9]*\)\.[0-9]*\.[0-9]*/\1/'`
|
---|
57 | SC_MINOR_VERSION=`echo $SC_MMM_VERSION|sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/'`
|
---|
58 | SC_MICRO_VERSION=`echo $SC_MMM_VERSION|sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'`
|
---|
59 | changequote([, ])dnl
|
---|
60 | AC_DEFINE_UNQUOTED(SC_MAJOR_VERSION,$SC_MAJOR_VERSION, ["major version number"])
|
---|
61 | AC_DEFINE_UNQUOTED(SC_MINOR_VERSION,$SC_MINOR_VERSION, ["minor version number"])
|
---|
62 | AC_DEFINE_UNQUOTED(SC_MICRO_VERSION,$SC_MICRO_VERSION, ["micro version number"])
|
---|
63 |
|
---|
64 | EXCLUDED_DIRS=
|
---|
65 |
|
---|
66 | dnl --------- Features ---------
|
---|
67 |
|
---|
68 | AC_ARG_ENABLE(debug,
|
---|
69 | [ --enable-debug Compile with debugging options],
|
---|
70 | [
|
---|
71 | case $enableval in
|
---|
72 | yes)
|
---|
73 | DEBUG=yes
|
---|
74 | ;;
|
---|
75 | no)
|
---|
76 | DEBUG=no
|
---|
77 | ;;
|
---|
78 | opt)
|
---|
79 | DEBUG=opt
|
---|
80 | ;;
|
---|
81 | *)
|
---|
82 | AC_MSG_ERROR([Invalid value for --enable-debug ($enableval)])
|
---|
83 | ;;
|
---|
84 | esac
|
---|
85 | ],[
|
---|
86 | DEBUG=no
|
---|
87 | ]
|
---|
88 | )
|
---|
89 |
|
---|
90 | AC_ARG_ENABLE(strict-arch,
|
---|
91 | [ --enable-strict-arch Code might only work on target cpu type],
|
---|
92 | [
|
---|
93 | case $enableval in
|
---|
94 | yes)
|
---|
95 | STRICT_ARCH=yes
|
---|
96 | ;;
|
---|
97 | no)
|
---|
98 | STRICT_ARCH=no
|
---|
99 | ;;
|
---|
100 | *)
|
---|
101 | AC_MSG_ERROR([Invalid value for --enable-strict-arch ($enableval)])
|
---|
102 | ;;
|
---|
103 | esac
|
---|
104 | ],[
|
---|
105 | STRICT_ARCH=no
|
---|
106 | ]
|
---|
107 | )
|
---|
108 |
|
---|
109 | enableproduction=no
|
---|
110 | AC_ARG_ENABLE(production,
|
---|
111 | [ --enable-production Prepare for a production install.],
|
---|
112 | [
|
---|
113 | case $enableval in
|
---|
114 | yes)
|
---|
115 | enableproduction=yes
|
---|
116 | ;;
|
---|
117 | no)
|
---|
118 | ;;
|
---|
119 | *)
|
---|
120 | AC_MSG_ERROR([Invalid value for --enable-production ($enableval)])
|
---|
121 | ;;
|
---|
122 | esac
|
---|
123 | ])
|
---|
124 |
|
---|
125 | AC_ARG_ENABLE(sysv-ipc,
|
---|
126 | [ --disable-sysv-ipc Disable use of SysV IPC.],
|
---|
127 | [
|
---|
128 | case $enableval in
|
---|
129 | yes)
|
---|
130 | SYSVIPC=yes
|
---|
131 | ;;
|
---|
132 | no)
|
---|
133 | SYSVIPC=no
|
---|
134 | ;;
|
---|
135 | *)
|
---|
136 | AC_MSG_ERROR([Invalid value for --enable-sysv-ipc ($enableval)])
|
---|
137 | ;;
|
---|
138 | esac
|
---|
139 | ],[
|
---|
140 | SYSVIPC=yes
|
---|
141 | ]
|
---|
142 | )
|
---|
143 |
|
---|
144 | AC_ARG_ENABLE(parallel,
|
---|
145 | [ --disable-parallel Compile for serial execution.],
|
---|
146 | [
|
---|
147 | case $enableval in
|
---|
148 | yes)
|
---|
149 | PARALLEL=yes
|
---|
150 | ;;
|
---|
151 | no)
|
---|
152 | PARALLEL=no
|
---|
153 | ;;
|
---|
154 | *)
|
---|
155 | AC_MSG_ERROR([Invalid value for --enable-parallel ($enableval)])
|
---|
156 | ;;
|
---|
157 | esac
|
---|
158 | ],[
|
---|
159 | PARALLEL=yes
|
---|
160 | ]
|
---|
161 | )
|
---|
162 |
|
---|
163 | AC_ARG_ENABLE(always-use-mpi,
|
---|
164 | [ --enable-always-use-mpi Causes MPI_Init to always be called from main],
|
---|
165 | [
|
---|
166 | case $enableval in
|
---|
167 | yes)
|
---|
168 | ALWAYS_USE_MPI=yes
|
---|
169 | ;;
|
---|
170 | no)
|
---|
171 | ALWAYS_USE_MPI=no
|
---|
172 | ;;
|
---|
173 | *)
|
---|
174 | AC_MSG_ERROR([Invalid value for --enable-always-use-mpi ($enableval)])
|
---|
175 | ;;
|
---|
176 | esac
|
---|
177 | ],[
|
---|
178 | ALWAYS_USE_MPI=no
|
---|
179 | ]
|
---|
180 | )
|
---|
181 |
|
---|
182 | DEFAULT_PARALLEL=none
|
---|
183 | AC_ARG_WITH(default-parallel,
|
---|
184 | [ --with-default-parallel Default parallism model: none, mpi, armcimpi or mtmpi],
|
---|
185 | DEFAULT_PARALLEL=$withval
|
---|
186 | )
|
---|
187 | if test $DEFAULT_PARALLEL = mpi; then
|
---|
188 | AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"])
|
---|
189 | elif test $DEFAULT_PARALLEL = mtmpi; then
|
---|
190 | AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"])
|
---|
191 | AC_DEFINE(DEFAULT_MTMPI, 1, ["use multi-threaded MPI as default"])
|
---|
192 | elif test $DEFAULT_PARALLEL = armcimpi; then
|
---|
193 | AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"])
|
---|
194 | AC_DEFINE(DEFAULT_ARMCI, 1, ["use ARMCI as default"])
|
---|
195 | fi
|
---|
196 |
|
---|
197 | SC_MPI_THREAD_LEVEL=MPI_THREAD_MULTIPLE
|
---|
198 | AC_ARG_WITH(mpi-thread,
|
---|
199 | [ --with-mpi-thread Thread level for MPI (multiple,serialized,funneled,single)],
|
---|
200 | [
|
---|
201 | case $withval in
|
---|
202 | multiple)
|
---|
203 | SC_MPI_THREAD_LEVEL=MPI_THREAD_MULTIPLE
|
---|
204 | ;;
|
---|
205 | serialized)
|
---|
206 | SC_MPI_THREAD_LEVEL=MPI_THREAD_SERIALIZED
|
---|
207 | ;;
|
---|
208 | funneled)
|
---|
209 | SC_MPI_THREAD_LEVEL=MPI_THREAD_FUNNELED
|
---|
210 | ;;
|
---|
211 | single)
|
---|
212 | SC_MPI_THREAD_LEVEL=MPI_THREAD_SINGLE
|
---|
213 | ;;
|
---|
214 | *)
|
---|
215 | AC_MSG_ERROR([Invalid value for --with-mpi-thread ($withval)])
|
---|
216 | ;;
|
---|
217 | esac
|
---|
218 | ]
|
---|
219 | )
|
---|
220 | AC_DEFINE_UNQUOTED(SC_MPI_THREAD_LEVEL,$SC_MPI_THREAD_LEVEL, ["thread level for MPI"])
|
---|
221 |
|
---|
222 | AC_ARG_ENABLE(long-long,
|
---|
223 | [ --disable-long-long Disable use of long long.],
|
---|
224 | [
|
---|
225 | case $enableval in
|
---|
226 | yes)
|
---|
227 | LONGLONG=yes
|
---|
228 | ;;
|
---|
229 | no)
|
---|
230 | LONGLONG=no
|
---|
231 | ;;
|
---|
232 | *)
|
---|
233 | AC_MSG_ERROR([Invalid value for --enable-long-long ($enableval)])
|
---|
234 | ;;
|
---|
235 | esac
|
---|
236 | ],[
|
---|
237 | LONGLONG=yes
|
---|
238 | ]
|
---|
239 | )
|
---|
240 |
|
---|
241 | AC_ARG_ENABLE(threads,
|
---|
242 | [ --enable-threads Compile allowing use of threads, if possible.],
|
---|
243 | [
|
---|
244 | case $enableval in
|
---|
245 | yes)
|
---|
246 | THREADS=yes
|
---|
247 | ;;
|
---|
248 | no)
|
---|
249 | THREADS=no
|
---|
250 | ;;
|
---|
251 | *)
|
---|
252 | AC_MSG_ERROR([Invalid value for --enable-threads ($enableval)])
|
---|
253 | ;;
|
---|
254 | esac
|
---|
255 | ],[
|
---|
256 | THREADS=yes
|
---|
257 | ]
|
---|
258 | )
|
---|
259 |
|
---|
260 | AC_ARG_ENABLE(ref-debug,
|
---|
261 | [ --enable-ref-debug Check for reference count overwrites/overflows/etc],
|
---|
262 | [
|
---|
263 | case $enableval in
|
---|
264 | yes)
|
---|
265 | ;;
|
---|
266 | no)
|
---|
267 | AC_DEFINE(REF_OPTIMIZE, 1, ["do not check for reference count overwrites"])
|
---|
268 | ;;
|
---|
269 | *)
|
---|
270 | AC_MSG_ERROR([Invalid value for --enable-ref-debug ($enableval)])
|
---|
271 | ;;
|
---|
272 | esac
|
---|
273 | ],[
|
---|
274 | if test $DEBUG = no -o $DEBUG = opt; then
|
---|
275 | AC_DEFINE(REF_OPTIMIZE, 1, ["do not check for reference count overwrites"])
|
---|
276 | fi
|
---|
277 | ]
|
---|
278 | )
|
---|
279 |
|
---|
280 | AC_ARG_ENABLE(cross-compile,
|
---|
281 | [ --enable-cross-compile Rather than checking, assume cross compilation.],
|
---|
282 | [
|
---|
283 | case $enableval in
|
---|
284 | yes)
|
---|
285 | cross_compiling=yes
|
---|
286 | ;;
|
---|
287 | no)
|
---|
288 | ;;
|
---|
289 | *)
|
---|
290 | AC_MSG_ERROR([Invalid value for --enable-cross-compile ($enableval)])
|
---|
291 | ;;
|
---|
292 | esac
|
---|
293 | ])
|
---|
294 |
|
---|
295 | DOXYGEN_MAN=YES
|
---|
296 | AC_ARG_ENABLE(doxygen-man,
|
---|
297 | [ --disable-doxygen-man Disable doxygen man pages.],
|
---|
298 | [
|
---|
299 | case $enableval in
|
---|
300 | yes)
|
---|
301 | ;;
|
---|
302 | no)
|
---|
303 | DOXYGEN_MAN=NO
|
---|
304 | ;;
|
---|
305 | *)
|
---|
306 | AC_MSG_ERROR([Invalid value for --(dis|en)able-doxygen-man ($enableval)])
|
---|
307 | ;;
|
---|
308 | esac
|
---|
309 | ]
|
---|
310 | )
|
---|
311 | AC_SUBST(DOXYGEN_MAN)
|
---|
312 |
|
---|
313 | AC_ARG_ENABLE(sourceforge,
|
---|
314 | [ --enable-sourceforge Enable SourceForge web page generation],
|
---|
315 | [
|
---|
316 | case $enableval in
|
---|
317 | yes)
|
---|
318 | FOOTER_HTML=sf_footer.html
|
---|
319 | ;;
|
---|
320 | no)
|
---|
321 | FOOTER_HTML=footer.html
|
---|
322 | ;;
|
---|
323 | *)
|
---|
324 | AC_MSG_ERROR([Invalid value for --enable-sourceforge ($enableval)])
|
---|
325 | ;;
|
---|
326 | esac
|
---|
327 | ],[
|
---|
328 | FOOTER_HTML=footer.html
|
---|
329 | ]
|
---|
330 | )
|
---|
331 | AC_SUBST(FOOTER_HTML)
|
---|
332 |
|
---|
333 | AC_ARG_ENABLE(components,
|
---|
334 | [ --enable-components Enable CCA components],
|
---|
335 | [
|
---|
336 | case $enableval in
|
---|
337 | yes)
|
---|
338 | components=yes
|
---|
339 | ;;
|
---|
340 | no)
|
---|
341 | components=no
|
---|
342 | ;;
|
---|
343 | *)
|
---|
344 | AC_MSG_ERROR([Invalid value for --enable-components ($enableval)])
|
---|
345 | ;;
|
---|
346 | esac
|
---|
347 | ],[
|
---|
348 | components=no
|
---|
349 | ]
|
---|
350 | )
|
---|
351 | ENABLECCA=$components
|
---|
352 | AC_SUBST(ENABLECCA)
|
---|
353 |
|
---|
354 | BUILDID="sc_buildid"
|
---|
355 | AC_ARG_WITH(build-id,
|
---|
356 | [ --with-build-id Gives an identifier for the build.],
|
---|
357 | BUILDID=$withval
|
---|
358 | )
|
---|
359 | AC_SUBST(BUILDID)
|
---|
360 | AC_DEFINE_UNQUOTED(SC_BUILDID,"$BUILDID", ["build identifier"])
|
---|
361 |
|
---|
362 | DEFAULT_SC_MEMORY=32000000
|
---|
363 | AC_ARG_WITH(default-memory,
|
---|
364 | [ --with-default-memory Gives the default memory allocation.],
|
---|
365 | DEFAULT_SC_MEMORY=$withval
|
---|
366 | )
|
---|
367 | AC_DEFINE_UNQUOTED(DEFAULT_SC_MEMORY,$DEFAULT_SC_MEMORY, ["default memory allocation"])
|
---|
368 |
|
---|
369 | if test "$BUILDID"; then
|
---|
370 | SC_VERSION="$SC_MMM_VERSION-$BUILDID"
|
---|
371 | else
|
---|
372 | SC_VERSION="$SC_MMM_VERSION"
|
---|
373 | fi
|
---|
374 |
|
---|
375 | AC_DEFINE_UNQUOTED(SC_VERSION, "$SC_VERSION", ["SC version"])
|
---|
376 | AC_SUBST(SC_VERSION)
|
---|
377 |
|
---|
378 | ac_default_prefix="/usr/local/mpqc/$SC_VERSION"
|
---|
379 |
|
---|
380 | AC_ARG_WITH(cc,
|
---|
381 | [ --with-cc Gives the name of the C compiler to use.],
|
---|
382 | CC=$withval
|
---|
383 | )
|
---|
384 |
|
---|
385 | AC_ARG_WITH(cxx,
|
---|
386 | [ --with-cxx Gives the name of the C++ compiler to use.],
|
---|
387 | CXX=$withval
|
---|
388 | )
|
---|
389 |
|
---|
390 | AC_ARG_WITH(f77,
|
---|
391 | [ --with-f77 Gives the name of the FORTRAN 77 compiler to use.],
|
---|
392 | F77=$withval
|
---|
393 | )
|
---|
394 |
|
---|
395 | AC_ARG_WITH(cxx-optflags,
|
---|
396 | [ --with-cxx-optflags Optimization flags to use with the C++ compiler.],
|
---|
397 | GIVEN_CXXOPTIONS_OPT=$withval
|
---|
398 | )
|
---|
399 |
|
---|
400 | AC_ARG_WITH(cc-optflags,
|
---|
401 | [ --with-cc-optflags Optimization flags to use with the C compiler.],
|
---|
402 | GIVEN_COPTIONS_OPT=$withval
|
---|
403 | )
|
---|
404 |
|
---|
405 | DOT=yes
|
---|
406 | AC_ARG_WITH(dot,
|
---|
407 | [ --with-dot Gives the path to the dot graph generator.],
|
---|
408 | DOT=$withval
|
---|
409 | )
|
---|
410 |
|
---|
411 | AC_ARG_WITH(ranlib,
|
---|
412 | [ --with-ranlib Gives the name of the ranlib program.],
|
---|
413 | RANLIB=$withval
|
---|
414 | )
|
---|
415 |
|
---|
416 | AC_ARG_WITH(ar,
|
---|
417 | [ --with-ar Names the archive creator.],
|
---|
418 | AR=$withval
|
---|
419 | )
|
---|
420 |
|
---|
421 | ARFLAGS=r
|
---|
422 | AC_ARG_WITH(ar-flags,
|
---|
423 | [ --with-ar-flags Flags for the the archive creator.],
|
---|
424 | ARFLAGS=$withval
|
---|
425 | )
|
---|
426 | AC_SUBST(ARFLAGS)
|
---|
427 |
|
---|
428 | AC_ARG_WITH(ld,
|
---|
429 | [ --with-ld Names the object linker.],
|
---|
430 | LD=$withval
|
---|
431 | )
|
---|
432 |
|
---|
433 | changequote(<<, >>)dnl
|
---|
434 | LAUNCH="%MPQC% [-o %OUTPUT%] %INPUT%"
|
---|
435 | changequote([, ])dnl
|
---|
436 | AC_ARG_WITH(launch,
|
---|
437 | [ --with-launch The mpqcrun script launch string.],
|
---|
438 | LAUNCH=$withval
|
---|
439 | )
|
---|
440 | AC_SUBST(LAUNCH)
|
---|
441 |
|
---|
442 | changequote(<<, >>)dnl
|
---|
443 | CCALAUNCH="%CCAFE% --ccafe-rc %INPUT% --ccafe-remap-stdio --ccafe-outputdir %OUTPUT%";
|
---|
444 | changequote([, ])dnl
|
---|
445 | AC_ARG_WITH(cca-launch,
|
---|
446 | [ --with-cca-launch The ccarun script launch string.],
|
---|
447 | CCALAUNCH=$withval
|
---|
448 | )
|
---|
449 | AC_SUBST(CCALAUNCH)
|
---|
450 |
|
---|
451 | if test $prefix = $ac_default_prefix -o $prefix = NONE; then
|
---|
452 | scdatadir=$datadir
|
---|
453 | else
|
---|
454 | scdatadir=$datadir/mpqc/$SC_VERSION
|
---|
455 | fi
|
---|
456 | AC_ARG_WITH(sc-datadir,
|
---|
457 | [ --with-sc-datadir Specifies arch-independent install subdir.],
|
---|
458 | scdatadir=$withval
|
---|
459 | )
|
---|
460 | AC_SUBST(scdatadir)
|
---|
461 |
|
---|
462 | AC_ARG_WITH(include,
|
---|
463 | [ --with-include Specifies include directories (-Idir1 -Idir2).],
|
---|
464 | EXTRAINCLUDE=$withval
|
---|
465 | CPPFLAGS=$withval
|
---|
466 | echo Using extra include directories: $withval
|
---|
467 | )
|
---|
468 |
|
---|
469 | template_instantiation=none
|
---|
470 | AC_ARG_WITH(template,
|
---|
471 | [ --with-template Specifies template instantation model.],
|
---|
472 | template_instantiation=$withval
|
---|
473 | echo Using extra include directories: $withval
|
---|
474 | )
|
---|
475 |
|
---|
476 | scincludedir=$includedir
|
---|
477 | AC_ARG_WITH(sc-includedir,
|
---|
478 | [ --with-sc-includedir Specifies include file install subdir.],
|
---|
479 | scincludedir=$withval
|
---|
480 | )
|
---|
481 | AC_SUBST(scincludedir)
|
---|
482 |
|
---|
483 | AC_ARG_WITH(libs,
|
---|
484 | [ --with-libs Specifies libraries (-llib1 -llib2).],
|
---|
485 | LIBS=$withval
|
---|
486 | echo Using extra libraries: $withval
|
---|
487 | )
|
---|
488 |
|
---|
489 | XTRA_FLIBS=
|
---|
490 | AC_ARG_WITH(extra-flibs,
|
---|
491 | [ --with-extra-flibs Specifies libs needing a F77 runtime (-llib1 -llib2).],
|
---|
492 | XTRA_FLIBS=$withval
|
---|
493 | echo Using extra FORTRAN libraries: $withval
|
---|
494 | )
|
---|
495 |
|
---|
496 | have_flibs=no
|
---|
497 | AC_ARG_WITH(flibs,
|
---|
498 | [ --with-flibs Specifies the F77 runtime (by default, will guess).],
|
---|
499 | FLIBS=$withval
|
---|
500 | have_flibs=yes
|
---|
501 | echo Using FORTRAN runtime libraries: $withval
|
---|
502 | )
|
---|
503 |
|
---|
504 | LDFLAGS=
|
---|
505 | LIBDIRS=
|
---|
506 | AC_ARG_WITH(libdirs,
|
---|
507 | [ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).],
|
---|
508 | LIBDIRS=$withval
|
---|
509 | LDFLAGS=$withval
|
---|
510 | echo Using extra library directories: $withval
|
---|
511 | )
|
---|
512 |
|
---|
513 | AC_ARG_WITH(cca-chem-config,
|
---|
514 | [ --with-cca-chem-config Specifies full pathname of cca-chem-config script.],
|
---|
515 | [
|
---|
516 | CCA_CHEM_CONFIG=$withval
|
---|
517 | echo Using cca-chem-config: $withval
|
---|
518 | ],[
|
---|
519 | if test "$components" == "yes"; then
|
---|
520 | AC_PATH_PROG(CCA_CHEM_CONFIG,cca-chem-config,"not-found")
|
---|
521 | fi
|
---|
522 | ]
|
---|
523 | )
|
---|
524 |
|
---|
525 | dnl --------- Want absolute path for srcdir, not relative. ---------
|
---|
526 |
|
---|
527 | if test X$ac_srcdir_defaulted = Xyes; then
|
---|
528 | case $srcdir in
|
---|
529 | .|..|./*|../*)
|
---|
530 | srcdir=`(cd $srcdir; pwd)`
|
---|
531 | #srcdir=`(cd $srcdir; echo $PWD)`
|
---|
532 | ;;
|
---|
533 | esac
|
---|
534 | fi
|
---|
535 |
|
---|
536 | dnl --------- Get the path to the compile dir. ---------
|
---|
537 |
|
---|
538 | compiledir=`pwd`
|
---|
539 | AC_SUBST(compiledir)
|
---|
540 |
|
---|
541 | dnl --------- Need actual paths for substitution outside of a makefile. ---------
|
---|
542 |
|
---|
543 | if test $exec_prefix = "NONE"; then
|
---|
544 | if test $prefix = "NONE"; then
|
---|
545 | scbindir=$ac_default_prefix/bin;
|
---|
546 | sclibdir=$ac_default_prefix/lib;
|
---|
547 | else
|
---|
548 | scbindir=$prefix/bin;
|
---|
549 | sclibdir=$prefix/lib;
|
---|
550 | fi
|
---|
551 | else
|
---|
552 | scbindir=$exec_prefix/bin
|
---|
553 | sclibdir=$exec_prefix/lib
|
---|
554 | fi
|
---|
555 | AC_SUBST(scbindir)
|
---|
556 | AC_SUBST(sclibdir)
|
---|
557 |
|
---|
558 | dnl --------- Checks for programs. ---------
|
---|
559 | AC_PROG_LN_S
|
---|
560 | AC_PROG_INSTALL
|
---|
561 | dnl obsolete because of LT_INIT
|
---|
562 | dnl AC_PROG_RANLIB
|
---|
563 | AC_PROG_CC
|
---|
564 | dnl ac_prog_cxx's order isn't what i need
|
---|
565 | AC_CHECK_PROGS(CXX, g++ c++ gcc CC cxx xlC_r, gcc)
|
---|
566 | dnl sees if CXX is a GNU compiler
|
---|
567 | AC_PROG_CXX
|
---|
568 | if test ! "$F77" = no ; then
|
---|
569 | AC_PROG_F77
|
---|
570 | if test "X$have_flibs" = Xno; then
|
---|
571 | AC_F77_LIBRARY_LDFLAGS
|
---|
572 | fi
|
---|
573 | fi
|
---|
574 | FLIBS="$XTRA_FLIBS $FLIBS"
|
---|
575 | AC_PROG_CPP
|
---|
576 | AC_PROG_CXXCPP
|
---|
577 | AC_CHECK_PROG(AR,ar,ar)
|
---|
578 | AC_CHECK_PROG(PERL,perl,perl)
|
---|
579 | AC_CHECK_PROG(WISH,wish,/usr/bin/wish)
|
---|
580 |
|
---|
581 | dnl --------- use libtool ---------------------
|
---|
582 |
|
---|
583 | LT_INIT([static])
|
---|
584 |
|
---|
585 | dnl The lack of certain tools is a show stopper
|
---|
586 |
|
---|
587 | changequote(<<, >>)dnl
|
---|
588 |
|
---|
589 | if [ X$PERL = X ]; then
|
---|
590 | echo "Could not find the program perl. It can be obtained at"
|
---|
591 | echo "ftp://prep.ai.mit.edu/pub/gnu"
|
---|
592 | exit 1
|
---|
593 | fi
|
---|
594 |
|
---|
595 | changequote([, ])dnl
|
---|
596 |
|
---|
597 | dnl --------- Check for the graph generator used by doxygen
|
---|
598 |
|
---|
599 | DOT_PATH=""
|
---|
600 | if test X$DOT = Xno; then
|
---|
601 | HAVE_DOT=NO
|
---|
602 | elif test X$DOT = Xyes; then
|
---|
603 | AC_CHECK_PROG(HAVE_DOT,dot,YES,NO)
|
---|
604 | else
|
---|
605 | HAVE_DOT=YES
|
---|
606 | DOT_PATH=$DOT
|
---|
607 | fi
|
---|
608 | AC_SUBST(DOT_PATH)
|
---|
609 | AC_SUBST(HAVE_DOT)
|
---|
610 |
|
---|
611 | dnl -------- Checks for cross compiling. ----------
|
---|
612 |
|
---|
613 | # obsolete starting at autoconf 2.12
|
---|
614 | #if test X$cross_compiling != Xyes; then
|
---|
615 | #AC_C_CROSS
|
---|
616 | #fi
|
---|
617 |
|
---|
618 | #if test X$cross_compiling = Xyes -a X$target = X$host; then
|
---|
619 | # AC_MSG_ERROR([Cross compiling, but target is host (use --host).])
|
---|
620 | #fi
|
---|
621 |
|
---|
622 | dnl -------- Checks for compiler/linker options. ----------
|
---|
623 |
|
---|
624 | # options needed only for optimization
|
---|
625 | COPTIONS_OPT=-O
|
---|
626 | # options needed only for debugging
|
---|
627 | COPTIONS_DBG=-g
|
---|
628 | # options that are always needed
|
---|
629 | COPTIONS_MISC=
|
---|
630 |
|
---|
631 | # options needed only for optimization
|
---|
632 | CXXOPTIONS_OPT=-O
|
---|
633 | # options needed only for debugging
|
---|
634 | CXXOPTIONS_DBG=-g
|
---|
635 | # options that are always needed
|
---|
636 | CXXOPTIONS_MISC=
|
---|
637 |
|
---|
638 | OBJSUF=o
|
---|
639 | LIBSUF=a
|
---|
640 |
|
---|
641 | dnl -- check how dependency information is built --
|
---|
642 |
|
---|
643 | # The GNU compilers work with:
|
---|
644 | CCDEPENDSUF=none
|
---|
645 | CXXDEPENDSUF=none
|
---|
646 | CCDEPENDFLAGS=-M
|
---|
647 | CXXDEPENDFLAGS=-M
|
---|
648 |
|
---|
649 | /bin/rm -f depcheck.u depcheck.c depcheck.o
|
---|
650 |
|
---|
651 | # Check for an IBM visual age C compiler
|
---|
652 | echo "#include <stdio.h>" > depcheck.c
|
---|
653 | $CC $CPPFLAGS $CFLAGS -M depcheck.c > /dev/null 2>&1
|
---|
654 | if test -f depcheck.u; then
|
---|
655 | CCDEPENDSUF=u
|
---|
656 | fi
|
---|
657 | /bin/rm -f depcheck.u depcheck.c depcheck.o
|
---|
658 |
|
---|
659 | # Check for an IBM visual age C++ compiler
|
---|
660 | echo "#include <iostream>" > depcheck.cc
|
---|
661 | $CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1
|
---|
662 | if test -f depcheck.u; then
|
---|
663 | CXXDEPENDSUF=u
|
---|
664 | CXXDEPENDFLAGS="-M -E"
|
---|
665 | fi
|
---|
666 | /bin/rm -f depcheck.u depcheck.c depcheck.o
|
---|
667 |
|
---|
668 | dnl -- special misc options --
|
---|
669 |
|
---|
670 | AC_MSG_CHECKING([for miscellaneous flags])
|
---|
671 | case $target in
|
---|
672 | *-cray-unicos*)
|
---|
673 | if test ! X$GXX = Xyes; then
|
---|
674 | CXXOPTIONS_MISC="$CXXOPTIONS_MISC -h new_for_init"
|
---|
675 | fi
|
---|
676 | AC_MSG_RESULT(cray)
|
---|
677 | ;;
|
---|
678 | *)
|
---|
679 | AC_MSG_RESULT(none)
|
---|
680 | ;;
|
---|
681 | esac
|
---|
682 |
|
---|
683 | dnl -- special optimization options --
|
---|
684 |
|
---|
685 | AC_MSG_CHECKING([for special optimization options])
|
---|
686 | case $target in
|
---|
687 | rs6000-ibm-aix3.2.* | rs6000-ibm-aix4.* | powerpc-ibm-aix4.* | powerpc-ibm-aix5.*)
|
---|
688 | if test X$GCC != Xyes; then
|
---|
689 | COPTIONS_OPT="-O -qnolm"
|
---|
690 | fi
|
---|
691 | if test X$GXX != Xyes; then
|
---|
692 | CXXOPTIONS_OPT="-O -qnolm -qrtti"
|
---|
693 | fi
|
---|
694 | AC_MSG_RESULT("rs6000 or powerpc")
|
---|
695 | ;;
|
---|
696 | alphaev6-*)
|
---|
697 | if test X$GCC = Xyes; then
|
---|
698 | COPTIONS_OPT="-O3 -mcpu=ev6"
|
---|
699 | else
|
---|
700 | COPTIONS_OPT="-O5 -arch ev6"
|
---|
701 | fi
|
---|
702 | if test X$GXX = Xyes; then
|
---|
703 | CXXOPTIONS_OPT="-O3 -mcpu=ev6"
|
---|
704 | else
|
---|
705 | CXXOPTIONS_OPT="-O5 -arch ev6"
|
---|
706 | fi
|
---|
707 | AC_MSG_RESULT("alphaev6")
|
---|
708 | ;;
|
---|
709 | alphaev56-*)
|
---|
710 | if test X$GCC = Xyes; then
|
---|
711 | COPTIONS_OPT="-O3 -mcpu=ev56"
|
---|
712 | else
|
---|
713 | COPTIONS_OPT="-O5 -arch ev56"
|
---|
714 | fi
|
---|
715 | if test X$GXX = Xyes; then
|
---|
716 | CXXOPTIONS_OPT="-O3 -mcpu=ev56"
|
---|
717 | else
|
---|
718 | CXXOPTIONS_OPT="-O5 -arch ev56"
|
---|
719 | fi
|
---|
720 | AC_MSG_RESULT("alphaev56")
|
---|
721 | ;;
|
---|
722 | mips*-sgi-irix5*)
|
---|
723 | if test X$GCC != Xyes; then
|
---|
724 | COPTIONS_OPT="-O -Olimit 2000"
|
---|
725 | fi
|
---|
726 | AC_MSG_RESULT("mips*-sgi-irix5")
|
---|
727 | ;;
|
---|
728 | changequote(<<, >>)dnl
|
---|
729 | mips*-sgi-irix6.[01]*)
|
---|
730 | changequote([, ])dnl
|
---|
731 | if test X$GCC != Xyes; then
|
---|
732 | COPTIONS_OPT="-O2 -TENV:use_fp \
|
---|
733 | -OPT:const_copy_limit=20000:fold_arith_limit=20000:global_limit=20000"
|
---|
734 | fi
|
---|
735 | if test X$GXX != Xyes; then
|
---|
736 | CXXOPTIONS_OPT="-O2 -TENV:use_fp \
|
---|
737 | -OPT:const_copy_limit=20000:fold_arith_limit=20000:global_limit=20000"
|
---|
738 | fi
|
---|
739 | AC_MSG_RESULT("mips*-sgi-irix6.0 or mips*-sgi-irix6.1")
|
---|
740 | ;;
|
---|
741 | mips*-sgi-irix*)
|
---|
742 | if test X$GCC != Xyes; then
|
---|
743 | COPTIONS_OPT="-O2 -OPT:Olimit=0"
|
---|
744 | fi
|
---|
745 | if test X$GXX != Xyes; then
|
---|
746 | CXXOPTIONS_OPT="-O2 -OPT:Olimit=0"
|
---|
747 | fi
|
---|
748 | AC_MSG_RESULT("mips*-sgi-irix")
|
---|
749 | ;;
|
---|
750 | changequote(<<, >>)dnl
|
---|
751 | i[56]86-*)
|
---|
752 | changequote([, ])dnl
|
---|
753 | if test X$GCC = Xyes; then
|
---|
754 | COPTIONS_OPT="-O2"
|
---|
755 | fi
|
---|
756 | if test X$GXX = Xyes; then
|
---|
757 | CXXOPTIONS_OPT="-O2"
|
---|
758 | fi
|
---|
759 | AC_MSG_RESULT("i586 or i686")
|
---|
760 | ;;
|
---|
761 | i860-intel-*)
|
---|
762 | if test X$GCC != Xyes; then
|
---|
763 | COPTIONS_OPT="-O3 -Knoieee"
|
---|
764 | fi
|
---|
765 | AC_MSG_RESULT("i860")
|
---|
766 | ;;
|
---|
767 | *)
|
---|
768 | AC_MSG_RESULT("none")
|
---|
769 | ;;
|
---|
770 | esac
|
---|
771 |
|
---|
772 | dnl -- special architecture options --
|
---|
773 |
|
---|
774 | case $target_cpu in
|
---|
775 | i786)
|
---|
776 | opt_target_cpu=pentium4
|
---|
777 | ;;
|
---|
778 | *)
|
---|
779 | opt_target_cpu=$target_cpu
|
---|
780 | ;;
|
---|
781 | esac
|
---|
782 |
|
---|
783 | if test X$GXX == Xyes; then
|
---|
784 | AC_MSG_CHECKING([for C++ cpu tuning flag])
|
---|
785 | AC_LANG_SAVE
|
---|
786 | AC_LANG_CPLUSPLUS
|
---|
787 | CXXFLAGS_SAV=$CXXFLAGS
|
---|
788 | CXXFLAGS="-mtune=$opt_target_cpu $CXXFLAGS_SAV"
|
---|
789 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int main(){}])],cxx_tuneflag="-mtune",cxx_tuneflag="-mcpu")
|
---|
790 | CXXFLAGS=$CXXFLAGS_SAV
|
---|
791 | AC_LANG_RESTORE
|
---|
792 | AC_MSG_RESULT($cxx_tuneflag)
|
---|
793 | fi
|
---|
794 |
|
---|
795 | if test X$GCC == Xyes; then
|
---|
796 | AC_MSG_CHECKING([for C cpu tuning flag])
|
---|
797 | CFLAGS_SAV=$CFLAGS
|
---|
798 | CFLAGS="-mtune=$opt_target_cpu $CFLAGS_SAV"
|
---|
799 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int main(){}])],cc_tuneflag="-mtune",cc_tuneflag="-mcpu")
|
---|
800 | CFLAGS=$CFLAGS_SAV
|
---|
801 | AC_MSG_RESULT($cc_tuneflag)
|
---|
802 | fi
|
---|
803 |
|
---|
804 | AC_MSG_CHECKING([for special architecture options])
|
---|
805 | case $target in
|
---|
806 | *-solaris2*)
|
---|
807 | if test X$GCC != Xyes; then
|
---|
808 | CCDEPENDFLAGS="-xM"
|
---|
809 | fi
|
---|
810 | if test X$GXX != Xyes; then
|
---|
811 | CXXDEPENDFLAGS="-xM"
|
---|
812 | fi
|
---|
813 | ;;
|
---|
814 | rs6000-ibm-aix* | powerpc-ibm-aix*)
|
---|
815 | if test X$GCC != Xyes; then
|
---|
816 | LDFLAGS="$LDFLAGS -bmaxdata:0x70000000"
|
---|
817 | fi
|
---|
818 | AC_MSG_RESULT(rs6000 or powerpc)
|
---|
819 | ;;
|
---|
820 | i686-intel-cougar*)
|
---|
821 | COPTIONS_MISC="$COPTIONS_MISC -mcougar"
|
---|
822 | CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mcougar"
|
---|
823 | EXTRADEFINES="-D_REENTRANT $EXTRADEFINES"
|
---|
824 | if test X$cross_compiling = Xyes; then
|
---|
825 | AR=tflop-ar
|
---|
826 | fi
|
---|
827 | AC_MSG_RESULT(teraflop cougar)
|
---|
828 | ;;
|
---|
829 | changequote(<<, >>)dnl
|
---|
830 | i[4567]86-* | pentium-* | pentium4-* | pentiumpro-* | k6-* | athlon-*)
|
---|
831 | changequote([, ])dnl
|
---|
832 |
|
---|
833 | if test X$STRICT_ARCH = Xyes; then
|
---|
834 | cxx_cpu_arch_option="-march=$opt_target_cpu"
|
---|
835 | cc_cpu_arch_option="-march=$opt_target_cpu"
|
---|
836 | else
|
---|
837 | cxx_cpu_arch_option="$cxx_tuneflag=$opt_target_cpu"
|
---|
838 | cc_cpu_arch_option="$cc_tuneflag=$opt_target_cpu"
|
---|
839 | fi
|
---|
840 | if test X$GCC = Xyes; then
|
---|
841 | COPTIONS_OPT="$COPTIONS_OPT $cc_cpu_arch_option"
|
---|
842 | fi
|
---|
843 | if test X$GXX = Xyes; then
|
---|
844 | CXXOPTIONS_OPT="$CXXOPTIONS_OPT $cxx_cpu_arch_option"
|
---|
845 | fi
|
---|
846 | AC_MSG_RESULT(IA-32: $cpu_arch_option)
|
---|
847 | ;;
|
---|
848 | i860-intel-puma*)
|
---|
849 | if test X$GCC = Xyes; then
|
---|
850 | COPTIONS_MISC="$COPTIONS_MISC -mpuma"
|
---|
851 | else
|
---|
852 | COPTIONS_MISC="$COPTIONS_MISC -D__PUMAGON__"
|
---|
853 | COPTIONS_MISC="$COPTIONS_MISC -L$PARAGON_XDEV/paragon/lib-coff/puma"
|
---|
854 | COPTIONS_MISC="$COPTIONS_MISC -YS,$PARAGON_XDEV/paragon/lib-coff/puma"
|
---|
855 | COPTIONS_MISC="$COPTIONS_MISC -lpuma -lm -lkmath"
|
---|
856 | COPTIONS_MISC="$COPTIONS_MISC $PARAGON_XDEV/paragon/lib-coff/puma/libstubs.o"
|
---|
857 | fi
|
---|
858 | if test X$GXX = Xyes; then
|
---|
859 | CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mpuma"
|
---|
860 | fi
|
---|
861 | if test X$cross_compiling = Xyes; then
|
---|
862 | AR=ar860
|
---|
863 | fi
|
---|
864 | AC_MSG_RESULT(paragon puma)
|
---|
865 | ;;
|
---|
866 | i860-intel-sunmos*)
|
---|
867 | if test X$GCC = Xyes; then
|
---|
868 | COPTIONS_MISC="$COPTIONS_MISC -msunmos"
|
---|
869 | else
|
---|
870 | COPTIONS_MISC="$COPTIONS_MISC -DSUNMOS -D__PUMAGON__"
|
---|
871 | COPTIONS_MISC="$COPTIONS_MISC -L$PARAGON_XDEV/paragon/lib-coff/sunmos"
|
---|
872 | COPTIONS_MISC="$COPTIONS_MISC -Wl,-d0x4000000,-k"
|
---|
873 | COPTIONS_MISC="$COPTIONS_MISC -YS,$PARAGON_XDEV/paragon/lib-coff/sunmos"
|
---|
874 | COPTIONS_MISC="$COPTIONS_MISC -lm -lsunmos -lm"
|
---|
875 | fi
|
---|
876 | if test X$GXX = Xyes; then
|
---|
877 | CXXOPTIONS_MISC="$CXXOPTIONS_MISC -msunmos"
|
---|
878 | fi
|
---|
879 | if test X$cross_compiling = Xyes; then
|
---|
880 | AR=ar860
|
---|
881 | fi
|
---|
882 | AC_MSG_RESULT(paragon sunmos)
|
---|
883 | ;;
|
---|
884 | i860-intel-osf*)
|
---|
885 | if test X$GCC = Xyes; then
|
---|
886 | COPTIONS_MISC="$COPTIONS_MISC -mnx"
|
---|
887 | fi
|
---|
888 | if test X$GXX = Xyes; then
|
---|
889 | CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mnx"
|
---|
890 | fi
|
---|
891 | if test X$cross_compiling = Xyes; then
|
---|
892 | AR=ar860
|
---|
893 | fi
|
---|
894 | AC_MSG_RESULT(paragon osf)
|
---|
895 | ;;
|
---|
896 | *)
|
---|
897 | AC_MSG_RESULT("none")
|
---|
898 | ;;
|
---|
899 | esac
|
---|
900 |
|
---|
901 | dnl -- check for overriden optimization options --
|
---|
902 |
|
---|
903 | if test -n "$GIVEN_COPTIONS_OPT"; then
|
---|
904 | COPTIONS_OPT=$GIVEN_COPTIONS_OPT
|
---|
905 | AC_MSG_NOTICE("overriding C optimization flags with $COPTIONS_OPT")
|
---|
906 | fi
|
---|
907 |
|
---|
908 | if test -n "$GIVEN_CXXOPTIONS_OPT"; then
|
---|
909 | CXXOPTIONS_OPT=$GIVEN_CXXOPTIONS_OPT
|
---|
910 | AC_MSG_NOTICE("overriding C++ optimization flags with $CXXOPTIONS_OPT")
|
---|
911 | fi
|
---|
912 |
|
---|
913 | dnl ----------- check for C++ typename ---------------
|
---|
914 | dnl This is done before template flags are set to avoid
|
---|
915 | dnl undefined symbol problems.
|
---|
916 |
|
---|
917 | AC_LANG_SAVE
|
---|
918 | AC_LANG_CPLUSPLUS
|
---|
919 | AC_MSG_CHECKING("for C++ typename keyword")
|
---|
920 | AC_TRY_LINK([
|
---|
921 | class X { public: typedef int t; X(){} };
|
---|
922 | template <class T> void f(T i) {typename T::t x;}
|
---|
923 | ],[
|
---|
924 | X g;
|
---|
925 | f(g);
|
---|
926 | ],[
|
---|
927 | AC_DEFINE(HAVE_TYPENAME, 1, ["use typename keyword"])
|
---|
928 | AC_MSG_RESULT("yes")
|
---|
929 | ],
|
---|
930 | AC_MSG_RESULT("no")
|
---|
931 | AC_DEFINE(typename, [], ["remove usage of absent typename keyword by empty define"])
|
---|
932 | );
|
---|
933 | AC_LANG_RESTORE
|
---|
934 |
|
---|
935 | dnl ----------- check for C++ restrict extension ---------------
|
---|
936 |
|
---|
937 | AC_LANG_SAVE
|
---|
938 | AC_LANG_CPLUSPLUS
|
---|
939 | AC_TRY_LINK(,[double *restrict x=0;],
|
---|
940 | AC_DEFINE(CXX_RESTRICT, 1, ["c++ restricted extensions"])
|
---|
941 | AC_DEFINE(restrictxx, [restrict], ["convert keyword for c++ restricted extensions"]),
|
---|
942 |
|
---|
943 | AC_DEFINE(restrictxx, [], ["convert keyword to none for c++ restricted extensions"]),
|
---|
944 | )
|
---|
945 | AC_LANG_RESTORE
|
---|
946 |
|
---|
947 | dnl ---------- Checks for C++ header files. -----------
|
---|
948 |
|
---|
949 | AC_LANG_SAVE
|
---|
950 | AC_LANG_CPLUSPLUS
|
---|
951 | AC_CHECK_HEADERS(iostream sstream)
|
---|
952 | AC_LANG_RESTORE
|
---|
953 |
|
---|
954 | AC_MSG_CHECKING(iostream name)
|
---|
955 | if test x$ac_cv_header_iostream = xyes; then
|
---|
956 | iostream=iostream
|
---|
957 | else
|
---|
958 | iostream=iostream.h
|
---|
959 | fi
|
---|
960 | AC_MSG_RESULT($iostream)
|
---|
961 |
|
---|
962 | dnl ----------- check for namespace std ---------------
|
---|
963 |
|
---|
964 | AC_LANG_SAVE
|
---|
965 | AC_LANG_CPLUSPLUS
|
---|
966 | AC_MSG_CHECKING("for namespace std")
|
---|
967 | AC_TRY_LINK([
|
---|
968 | #include <$iostream>
|
---|
969 | using namespace std;
|
---|
970 | ],[
|
---|
971 | ostream &o = cout;
|
---|
972 | o << endl;
|
---|
973 | ],[
|
---|
974 | AC_DEFINE(USING_NAMESPACE_STD, 1, ["using namespace std"])
|
---|
975 | NAMESPACE_STD=std::
|
---|
976 | AC_MSG_RESULT("yes")
|
---|
977 | ],
|
---|
978 | NAMESPACE_STD=
|
---|
979 | AC_MSG_RESULT("no")
|
---|
980 | );
|
---|
981 | AC_LANG_RESTORE
|
---|
982 |
|
---|
983 | dnl ----------- check for GNU libc++-v3 prerelease bug ---------------
|
---|
984 |
|
---|
985 | if test X$GXX = Xyes; then
|
---|
986 | AC_LANG_SAVE
|
---|
987 | AC_LANG_CPLUSPLUS
|
---|
988 | AC_MSG_CHECKING("for GNU libc++-v3 prerelease bug")
|
---|
989 | AC_TRY_LINK([
|
---|
990 | #include <stdio.h>
|
---|
991 | #include <$iostream>
|
---|
992 | ],[
|
---|
993 | ],[
|
---|
994 | AC_MSG_RESULT("no")
|
---|
995 | ],
|
---|
996 | EXTRADEFINES="$EXTRADEFINES -D_ISOC99_SOURCE=1"
|
---|
997 | AC_MSG_RESULT("yes")
|
---|
998 | );
|
---|
999 | AC_LANG_RESTORE
|
---|
1000 | fi
|
---|
1001 |
|
---|
1002 | dnl -- other options --
|
---|
1003 |
|
---|
1004 | if test $DEBUG = yes; then
|
---|
1005 | CFLAGS="$COPTIONS_DBG $COPTIONS_MISC"
|
---|
1006 | CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_MISC"
|
---|
1007 | LDFLAGS="$LDFLAGS -g"
|
---|
1008 | elif test $DEBUG = opt; then
|
---|
1009 | CFLAGS="$COPTIONS_DBG $COPTIONS_OPT $COPTIONS_MISC"
|
---|
1010 | CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_OPT $CXXOPTIONS_MISC"
|
---|
1011 | LDFLAGS="$LDFLAGS -g"
|
---|
1012 | else
|
---|
1013 | CFLAGS="$COPTIONS_OPT $COPTIONS_MISC"
|
---|
1014 | CXXFLAGS="$CXXOPTIONS_OPT $CXXOPTIONS_MISC"
|
---|
1015 | fi
|
---|
1016 |
|
---|
1017 | AC_SUBST(EXTRAINCLUDE)
|
---|
1018 |
|
---|
1019 | AC_SUBST(CFLAGS)
|
---|
1020 | AC_SUBST(CXXFLAGS)
|
---|
1021 |
|
---|
1022 | AC_SUBST(LDFLAGS)
|
---|
1023 | AC_SUBST(LIBDIRS)
|
---|
1024 |
|
---|
1025 | AC_SUBST(OBJSUF)
|
---|
1026 | AC_SUBST(LIBSUF)
|
---|
1027 | AC_SUBST(CCDEPENDSUF)
|
---|
1028 | AC_SUBST(CXXDEPENDSUF)
|
---|
1029 | AC_SUBST(CCDEPENDFLAGS)
|
---|
1030 | AC_SUBST(CXXDEPENDFLAGS)
|
---|
1031 |
|
---|
1032 | dnl -------- Checks for architecture specific features. --------
|
---|
1033 | dnl (Doesn't work for cross compilation.)
|
---|
1034 | dnl AC_CHECK_SIZEOF(void*)
|
---|
1035 |
|
---|
1036 | dnl This version works on more machines without the need to run
|
---|
1037 | dnl a test program.
|
---|
1038 | AC_DEFUN([SC_C_BIGENDIAN],
|
---|
1039 | [AC_CHECK_HEADERS(fp.h endian.h machine/endian.h sys/endian.h sys/machine.h)
|
---|
1040 | AC_CACHE_CHECK(whether byte ordering is bigendian, sc_cv_c_bigendian,
|
---|
1041 | [sc_cv_c_bigendian=unknown
|
---|
1042 | # See if sys/param.h defines the BYTE_ORDER macro.
|
---|
1043 | AC_TRY_COMPILE([#include "confdefs.h"
|
---|
1044 | #ifdef HAVE_FP_H
|
---|
1045 | #include <fp.h>
|
---|
1046 | #endif
|
---|
1047 | #ifdef HAVE_ENDIAN_H
|
---|
1048 | #include <endian.h>
|
---|
1049 | #endif
|
---|
1050 | #ifdef HAVE_MACHINE_ENDIAN_H
|
---|
1051 | #include <machine/endian.h>
|
---|
1052 | #endif
|
---|
1053 | #ifdef HAVE_SYS_ENDIAN_H
|
---|
1054 | #include <sys/endian.h>
|
---|
1055 | #endif
|
---|
1056 | #ifdef HAVE_SYS_MACHINE_H
|
---|
1057 | #include <sys/machine.h>
|
---|
1058 | #endif
|
---|
1059 | #include <sys/types.h>
|
---|
1060 | #include <sys/param.h>], [
|
---|
1061 | #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
|
---|
1062 | bogus endian macros
|
---|
1063 | #endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
|
---|
1064 | AC_TRY_COMPILE([#include "confdefs.h"
|
---|
1065 | #ifdef HAVE_FP_H
|
---|
1066 | #include <fp.h>
|
---|
1067 | #endif
|
---|
1068 | #ifdef HAVE_MP_H
|
---|
1069 | #include <mp.h>
|
---|
1070 | #endif
|
---|
1071 | #ifdef HAVE_ENDIAN_H
|
---|
1072 | #include <endian.h>
|
---|
1073 | #endif
|
---|
1074 | #ifdef HAVE_MACHINE_ENDIAN_H
|
---|
1075 | #include <machine/endian.h>
|
---|
1076 | #endif
|
---|
1077 | #ifdef HAVE_SYS_ENDIAN_H
|
---|
1078 | #include <sys/endian.h>
|
---|
1079 | #endif
|
---|
1080 | #ifdef HAVE_SYS_MACHINE_H
|
---|
1081 | #include <sys/machine.h>
|
---|
1082 | #endif
|
---|
1083 | #include <sys/types.h>
|
---|
1084 | #include <sys/param.h>], [
|
---|
1085 | #if BYTE_ORDER != BIG_ENDIAN
|
---|
1086 | not big endian
|
---|
1087 | #endif], sc_cv_c_bigendian=yes, sc_cv_c_bigendian=no)])
|
---|
1088 | if test $sc_cv_c_bigendian = unknown; then
|
---|
1089 | AC_TRY_RUN([main () {
|
---|
1090 | /* Are we little or big endian? From Harbison&Steele. */
|
---|
1091 | union
|
---|
1092 | {
|
---|
1093 | long l;
|
---|
1094 | char c[sizeof (long)];
|
---|
1095 | } u;
|
---|
1096 | u.l = 1;
|
---|
1097 | exit (u.c[sizeof (long) - 1] == 1);
|
---|
1098 | }], sc_cv_c_bigendian=no, sc_cv_c_bigendian=yes,
|
---|
1099 | AC_MSG_ERROR([Could not determine endianness and cross compiling])
|
---|
1100 | )
|
---|
1101 | fi])
|
---|
1102 | if test $sc_cv_c_bigendian = yes; then
|
---|
1103 | AC_DEFINE(WORDS_BIGENDIAN, 1, ["use big endian encoding"])
|
---|
1104 | fi
|
---|
1105 | ])
|
---|
1106 |
|
---|
1107 | SC_C_BIGENDIAN
|
---|
1108 |
|
---|
1109 | dnl --------- Checks for libraries. ---------
|
---|
1110 | dnl -- libpthread should be linked in last.
|
---|
1111 | dnl -- Check on pthread_join since pthread_create, but not pthread_join,
|
---|
1112 | dnl -- seems to be in libc on IRIX and we must generate a -lpthread in LIBS.
|
---|
1113 | if test "(" X$PARALLEL = Xyes -a X$THREADS != Xno ")" -o X$THREADS = Xyes; then
|
---|
1114 |
|
---|
1115 | AC_MSG_CHECKING([pthreads])
|
---|
1116 | dnl see if posix threads are automatically linked ...
|
---|
1117 | AC_LANG_SAVE
|
---|
1118 | AC_LANG_CPLUSPLUS
|
---|
1119 | LIBSSAV="$LIBS"
|
---|
1120 | AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
|
---|
1121 | HAVE_PTHREAD=yes],[
|
---|
1122 | HAVE_PTHREAD=no])
|
---|
1123 | AC_LANG_RESTORE
|
---|
1124 |
|
---|
1125 | dnl see if posix threads are in -lpthread
|
---|
1126 | if test $HAVE_PTHREAD = no; then
|
---|
1127 | AC_LANG_SAVE
|
---|
1128 | AC_LANG_CPLUSPLUS
|
---|
1129 | LIBSSAV="$LIBS"
|
---|
1130 | LIBS="$LIBS -lpthread"
|
---|
1131 | AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
|
---|
1132 | HAVE_PTHREAD=yes],[
|
---|
1133 | HAVE_PTHREAD=no
|
---|
1134 | LIBS="$LIBSSAV"])
|
---|
1135 | AC_LANG_RESTORE
|
---|
1136 | fi
|
---|
1137 |
|
---|
1138 | dnl see if posix threads are in -lpthreads
|
---|
1139 | if test $HAVE_PTHREAD = no; then
|
---|
1140 | AC_LANG_SAVE
|
---|
1141 | AC_LANG_CPLUSPLUS
|
---|
1142 | LIBSSAV="$LIBS"
|
---|
1143 | LIBS="$LIBS -lpthreads"
|
---|
1144 | AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
|
---|
1145 | HAVE_PTHREAD=yes],[
|
---|
1146 | HAVE_PTHREAD=no
|
---|
1147 | LIBS="$LIBSSAV"])
|
---|
1148 | AC_LANG_RESTORE
|
---|
1149 | fi
|
---|
1150 |
|
---|
1151 | AC_MSG_RESULT($HAVE_PTHREAD)
|
---|
1152 | fi
|
---|
1153 | if test X$HAVE_PTHREAD = Xyes; then
|
---|
1154 | AC_DEFINE(HAVE_PTHREAD, 1, ["use pthreads"])
|
---|
1155 | EXTRADEFINES="-D_REENTRANT $EXTRADEFINES"
|
---|
1156 | AC_CHECK_FUNC(pthread_attr_getstacksize)
|
---|
1157 | AC_CHECK_FUNC(pthread_attr_setstacksize)
|
---|
1158 | AC_CHECK_FUNC(pthread_attr_setscope)
|
---|
1159 | AC_CHECK_FUNC(pthread_attr_getscope)
|
---|
1160 | AC_CHECK_FUNC(pthread_attr_setinheritsched)
|
---|
1161 | AC_CHECK_FUNC(pthread_attr_getinheritsched)
|
---|
1162 | AC_CHECK_FUNC(pthread_attr_setschedpolicy)
|
---|
1163 | AC_CHECK_FUNC(pthread_attr_getschedpolicy)
|
---|
1164 | AC_CHECK_FUNC(pthread_attr_setschedparam)
|
---|
1165 | AC_CHECK_FUNC(pthread_attr_getschedparam)
|
---|
1166 | AC_CHECK_FUNC(sched_get_priority_max)
|
---|
1167 | AC_CHECK_FUNC(sched_get_priority_min)
|
---|
1168 | fi
|
---|
1169 |
|
---|
1170 | AC_CHECK_LIB(dl,main)
|
---|
1171 | dnl commented out for Cray X1 (-lsun falsely detected)
|
---|
1172 | dnl AC_CHECK_LIB(sun,main)
|
---|
1173 | AC_CHECK_LIB(m,main)
|
---|
1174 | AC_CHECK_LIB(fl,main)
|
---|
1175 | AC_CHECK_HEADER(perf.h,[
|
---|
1176 | AC_CHECK_LIB(perf,perf_set_config,[
|
---|
1177 | HAVE_PERF=yes
|
---|
1178 | LIBS="-lperf $LIBS"
|
---|
1179 | AC_DEFINE(HAVE_PERF, 1, ["use perf"])
|
---|
1180 | ])
|
---|
1181 | ]
|
---|
1182 | )
|
---|
1183 |
|
---|
1184 | AC_CHECK_HEADER(execinfo.h,HAVE_EXECINFO_H_INC=1)
|
---|
1185 | AC_CHECK_FUNC(backtrace, HAVE_BACKTRACE_FUNC=1)
|
---|
1186 | AC_CHECK_FUNC(backtrace_symbols_fd, HAVE_BACKTRACE_SYMBOLS_FD_FUNC=1)
|
---|
1187 | if test -n "$HAVE_EXECINFO_H_INC" -a -n "$HAVE_BACKTRACE_FUNC" -a -n "$HAVE_BACKTRACE_SYMBOLS_FD_FUNC"; then
|
---|
1188 | AC_DEFINE(HAVE_BACKTRACE, 1, ["use backtrace"])
|
---|
1189 | fi
|
---|
1190 |
|
---|
1191 | if test X$PARALLEL = Xyes; then
|
---|
1192 |
|
---|
1193 | dnl ----- check for the mpi library
|
---|
1194 | AC_LANG_SAVE
|
---|
1195 | AC_LANG_CPLUSPLUS
|
---|
1196 | dnl Must use try_link since check_header runs cpp which doesn't
|
---|
1197 | dnl always find mpi.h (if mpicc and no -I is used for example)
|
---|
1198 | AC_MSG_CHECKING(for mpi.h)
|
---|
1199 | AC_TRY_LINK([#include <mpi.h>],[],have_mpi_h=yes,have_mpi_h=no)
|
---|
1200 | AC_MSG_RESULT($have_mpi_h)
|
---|
1201 | if test "$have_mpi_h" = yes; then
|
---|
1202 | AC_CHECK_FUNC(MPI_Init,HAVE_MPI=yes,HAVE_MPI=no)
|
---|
1203 | if test "$HAVE_MPI" = no; then
|
---|
1204 | AC_CHECK_LIB(mpi,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpi $LIBS"])
|
---|
1205 | fi
|
---|
1206 | if test "$HAVE_MPI" = no; then
|
---|
1207 | AC_CHECK_LIB(mpich,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpich $LIBS"])
|
---|
1208 | fi
|
---|
1209 | fi
|
---|
1210 | if test X$HAVE_MPI = Xyes; then
|
---|
1211 | AC_DEFINE(HAVE_MPI, 1, ["have MPI"])
|
---|
1212 | AC_CHECK_FUNC(MPI_File_open,
|
---|
1213 | [HAVE_MPIIO=yes;AC_DEFINE(HAVE_MPIIO, 1, ["have MPI IO extensions"])])
|
---|
1214 | AC_CHECK_FUNC(MPI_Init_thread,
|
---|
1215 | [AC_DEFINE(HAVE_MPI_INIT_THREAD, 1, ["have MPI init thread"])])
|
---|
1216 | HAVE_MPIPP=no;
|
---|
1217 | AC_CHECK_LIB(mpi++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lmpi++ $LIBS"])
|
---|
1218 | if test X$HAVE_MPIPP = Xno; then
|
---|
1219 | AC_CHECK_LIB(pmpich++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lpmpich++ $LIBS"])
|
---|
1220 | fi
|
---|
1221 | AC_DEFINE(HAVE_MPIPP, 1, ["have MPI PP"])
|
---|
1222 | fi
|
---|
1223 | AC_LANG_RESTORE
|
---|
1224 | fi
|
---|
1225 |
|
---|
1226 | if test X$HAVE_MPI != Xyes -a $ALWAYS_USE_MPI = yes; then
|
---|
1227 | AC_MSG_ERROR([--enable-always-use-mpi is set but MPI is not available])
|
---|
1228 | elif test $ALWAYS_USE_MPI = yes; then
|
---|
1229 | AC_DEFINE(ALWAYS_USE_MPI, 1, ["always use MPI"])
|
---|
1230 | fi
|
---|
1231 |
|
---|
1232 | dnl ------ check for the armci library
|
---|
1233 | AC_LANG_SAVE
|
---|
1234 | AC_LANG_CPLUSPLUS
|
---|
1235 | AC_CHECK_HEADER(armci.h,[
|
---|
1236 | AC_CHECK_FUNC(ARMCI_Init,HAVE_ARMCI=yes,[
|
---|
1237 | AC_CHECK_LIB(armci,ARMCI_Init,[HAVE_ARMCI=yes;LIBS="-larmci $LIBS"])
|
---|
1238 | ])
|
---|
1239 | ])
|
---|
1240 | AC_LANG_RESTORE
|
---|
1241 |
|
---|
1242 | if test X$HAVE_ARMCI = Xyes; then
|
---|
1243 | AC_DEFINE(HAVE_ARMCI, 1, ["use ARMCI"])
|
---|
1244 | fi
|
---|
1245 |
|
---|
1246 | if test $DEFAULT_PARALLEL = mtmpi -a X$HAVE_MPI != Xyes; then
|
---|
1247 | AC_MSG_ERROR([--with-default-parallel=mtmpi but MPI not available])
|
---|
1248 | fi
|
---|
1249 | if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_MPI != Xyes; then
|
---|
1250 | AC_MSG_ERROR([--with-default-parallel=armcimpi but MPI not available])
|
---|
1251 | fi
|
---|
1252 | if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_ARMCI != Xyes; then
|
---|
1253 | AC_MSG_ERROR([--with-default-parallel=armcimpi but ARMCI not available])
|
---|
1254 | fi
|
---|
1255 |
|
---|
1256 | AC_SUBST(HAVE_PERF)
|
---|
1257 | AC_SUBST(HAVE_MPI)
|
---|
1258 | AC_SUBST(ALWAYS_USE_MPI)
|
---|
1259 | AC_SUBST(HAVE_ARMCI)
|
---|
1260 | AC_SUBST(HAVE_MPIIO)
|
---|
1261 | AC_SUBST(HAVE_PTHREAD)
|
---|
1262 | AC_SUBST(EXTRADEFINES)
|
---|
1263 |
|
---|
1264 | dnl ---------- Checks for header files. -----------
|
---|
1265 |
|
---|
1266 | AC_HEADER_STDC
|
---|
1267 | AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h pwd.h)
|
---|
1268 | AC_CHECK_HEADERS(sys/times.h sys/resource.h time.h machine/fpu.h asm/fpu.h)
|
---|
1269 | AC_CHECK_HEADERS(termios.h sys/stat.h sys/types.h dlfcn.h stdint.h)
|
---|
1270 |
|
---|
1271 | dnl -- Checks for typedefs, structures, and compiler characteristics. --
|
---|
1272 | AC_C_CONST
|
---|
1273 | AC_TYPE_SIZE_T
|
---|
1274 | AC_STRUCT_TM
|
---|
1275 |
|
---|
1276 | dnl --------- Checks for library functions. ---------
|
---|
1277 | AC_TYPE_SIGNAL
|
---|
1278 | AC_FUNC_VPRINTF
|
---|
1279 | AC_CHECK_FUNCS(strerror sigfillset signal system getpwuid geteuid)
|
---|
1280 | AC_CHECK_FUNCS(gethostname time ctime)
|
---|
1281 | AC_CHECK_FUNCS(setrlimit setenv)
|
---|
1282 |
|
---|
1283 | dnl --------- Check for an isnan and make sure it can be used
|
---|
1284 | dnl with iostream (it can't on OS X)
|
---|
1285 | AC_LANG_SAVE
|
---|
1286 | AC_LANG_CPLUSPLUS
|
---|
1287 | AC_MSG_CHECKING(isnan and iostream)
|
---|
1288 | AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
---|
1289 | #include <iostream>
|
---|
1290 | #include <math.h>
|
---|
1291 | int main(int,char**) { isnan(1.0); return 0; }
|
---|
1292 | ])],
|
---|
1293 | AC_DEFINE(HAVE_ISNAN,1, ["isnan available"])
|
---|
1294 | AC_MSG_RESULT(yes),
|
---|
1295 | AC_MSG_RESULT(no)
|
---|
1296 | )
|
---|
1297 | AC_LANG_RESTORE
|
---|
1298 |
|
---|
1299 | dnl --------- Check for the glibc extensions to C99 fenv.h. ---------
|
---|
1300 |
|
---|
1301 | AC_CHECK_HEADERS(fenv.h)
|
---|
1302 | AC_CHECK_FUNCS(feenableexcept fedisableexcept)
|
---|
1303 |
|
---|
1304 | dnl --------- Checks for a C++ linkable fchdir. ---------
|
---|
1305 | AC_LANG_SAVE
|
---|
1306 | AC_LANG_CPLUSPLUS
|
---|
1307 | AC_MSG_CHECKING([fchdir])
|
---|
1308 | AC_TRY_COMPILE([#include <unistd.h>],[
|
---|
1309 | fchdir(0);
|
---|
1310 | ],[HAVE_FCHDIR=yes
|
---|
1311 | AC_DEFINE(HAVE_FCHDIR, 1, ["have fchdir"])
|
---|
1312 | AC_MSG_RESULT(yes)],[
|
---|
1313 | AC_MSG_RESULT(no)
|
---|
1314 | HAVE_FCHDIR=no
|
---|
1315 | ])
|
---|
1316 | AC_LANG_RESTORE
|
---|
1317 | AC_SUBST(HAVE_FCHDIR)
|
---|
1318 |
|
---|
1319 | dnl --------- Check for ios::fmtflags. ---------
|
---|
1320 |
|
---|
1321 | AC_LANG_SAVE
|
---|
1322 | AC_LANG_CPLUSPLUS
|
---|
1323 | AC_MSG_CHECKING([ios::fmtflags])
|
---|
1324 | AC_TRY_COMPILE([#include <$iostream>],[
|
---|
1325 | $NAMESPACE_STD ios::fmtflags flags;
|
---|
1326 | ],[HAVE_IOS_FMTFLAGS=yes
|
---|
1327 | AC_DEFINE(HAVE_IOS_FMTFLAGS, 1, ["have iostream format flags"])
|
---|
1328 | AC_MSG_RESULT(yes)],[
|
---|
1329 | AC_MSG_RESULT(no)
|
---|
1330 | HAVE_IOS_FMTFLAGS=no
|
---|
1331 | ])
|
---|
1332 | AC_LANG_RESTORE
|
---|
1333 | AC_SUBST(HAVE_IOS_FMTFLAGS)
|
---|
1334 |
|
---|
1335 | dnl --------- check for long long ---------
|
---|
1336 |
|
---|
1337 | if test X"$LONGLONG" = Xyes; then
|
---|
1338 | AC_LANG_SAVE
|
---|
1339 | AC_LANG_CPLUSPLUS
|
---|
1340 | AC_MSG_CHECKING(long long)
|
---|
1341 | AC_TRY_COMPILE([],[
|
---|
1342 | long long i;
|
---|
1343 | ],[AC_DEFINE(HAVE_LONG_LONG, 1, ["have long long"])
|
---|
1344 | AC_MSG_RESULT(yes)],[
|
---|
1345 | AC_MSG_RESULT(no)
|
---|
1346 | ])
|
---|
1347 | AC_LANG_RESTORE
|
---|
1348 | fi
|
---|
1349 |
|
---|
1350 | dnl --------- Check for sgetn. ---------
|
---|
1351 |
|
---|
1352 | AC_LANG_SAVE
|
---|
1353 | AC_LANG_CPLUSPLUS
|
---|
1354 | AC_MSG_CHECKING([sgetn])
|
---|
1355 | AC_TRY_COMPILE([#include <$iostream>],[
|
---|
1356 | char *c=0;
|
---|
1357 | $NAMESPACE_STD streambuf *s=0; s->sgetn(c,0);
|
---|
1358 | ],[HAVE_SGETN=yes
|
---|
1359 | AC_DEFINE(HAVE_SGETN, 1, ["have sgetn"])
|
---|
1360 | AC_MSG_RESULT(yes)],[
|
---|
1361 | AC_MSG_RESULT(no)
|
---|
1362 | HAVE_SGETN=no
|
---|
1363 | ])
|
---|
1364 | AC_LANG_RESTORE
|
---|
1365 | AC_SUBST(HAVE_SGETN)
|
---|
1366 |
|
---|
1367 | dnl --------- Check for pubseekoff. ---------
|
---|
1368 |
|
---|
1369 | AC_LANG_SAVE
|
---|
1370 | AC_LANG_CPLUSPLUS
|
---|
1371 | AC_MSG_CHECKING([pubseekoff])
|
---|
1372 | AC_TRY_COMPILE([#include <$iostream>],[
|
---|
1373 | $NAMESPACE_STD cout.rdbuf()->pubseekoff(0,$NAMESPACE_STD ios::beg,
|
---|
1374 | $NAMESPACE_STD ios::out);
|
---|
1375 | ],[HAVE_PUBSEEKOFF=yes
|
---|
1376 | AC_DEFINE(HAVE_PUBSEEKOFF, 1, ["have pubseekoff"])
|
---|
1377 | AC_MSG_RESULT(yes)],[
|
---|
1378 | AC_MSG_RESULT(no)
|
---|
1379 | HAVE_PUBSEEKOFF=no
|
---|
1380 | ])
|
---|
1381 | AC_LANG_RESTORE
|
---|
1382 | AC_SUBST(HAVE_PUBSEEKOFF)
|
---|
1383 |
|
---|
1384 | dnl --------- Check for seekoff. ---------
|
---|
1385 |
|
---|
1386 | AC_LANG_SAVE
|
---|
1387 | AC_LANG_CPLUSPLUS
|
---|
1388 | AC_MSG_CHECKING([seekoff])
|
---|
1389 | AC_TRY_COMPILE([#include <$iostream>],[
|
---|
1390 | $NAMESPACE_STD cout.rdbuf()->seekoff(0,$NAMESPACE_STD ios::beg,
|
---|
1391 | $NAMESPACE_STD ios::out);
|
---|
1392 | ],[HAVE_SEEKOFF=yes
|
---|
1393 | AC_DEFINE(HAVE_SEEKOFF, 1, ["have seekoff"])
|
---|
1394 | AC_MSG_RESULT(yes)],[
|
---|
1395 | AC_MSG_RESULT(no)
|
---|
1396 | HAVE_SEEKOFF=no
|
---|
1397 | ])
|
---|
1398 | AC_LANG_RESTORE
|
---|
1399 | AC_SUBST(HAVE_SEEKOFF)
|
---|
1400 |
|
---|
1401 | dnl --------- Check for signal handler argument lists. ---------
|
---|
1402 |
|
---|
1403 | AC_LANG_SAVE
|
---|
1404 | AC_LANG_CPLUSPLUS
|
---|
1405 | AC_MSG_CHECKING([signal handler needs ellipsis])
|
---|
1406 | AC_TRY_LINK([
|
---|
1407 | #include <signal.h>
|
---|
1408 | extern "C" {
|
---|
1409 | typedef void (*signal_handler)(...);
|
---|
1410 | void handler(int);
|
---|
1411 | }
|
---|
1412 | void handler(int) {}
|
---|
1413 | ],[
|
---|
1414 | signal(SIGINT, (signal_handler)handler);
|
---|
1415 | ],
|
---|
1416 | AC_DEFINE(SIGHASELLIP, 1, ["signal handler needs ellipsis"]) AC_MSG_RESULT(yes),
|
---|
1417 | AC_MSG_RESULT(no))
|
---|
1418 | AC_LANG_RESTORE
|
---|
1419 |
|
---|
1420 | dnl --------- Checks for rand functions ---------
|
---|
1421 |
|
---|
1422 | AC_LANG_SAVE
|
---|
1423 | AC_LANG_CPLUSPLUS
|
---|
1424 | AC_CHECK_FUNCS(drand48)
|
---|
1425 | AC_LANG_RESTORE
|
---|
1426 |
|
---|
1427 | dnl --------- Checks for SYSV IPC. ---------
|
---|
1428 |
|
---|
1429 | if test "X$SYSVIPC" = Xyes; then
|
---|
1430 | AC_CHECK_FUNCS(shmget semget)
|
---|
1431 | AC_CHECK_HEADERS(sys/ipc.h sys/sem.h sys/shm.h)
|
---|
1432 | AC_MSG_CHECKING([for SYSV IPC])
|
---|
1433 | if test X$ac_cv_func_shmget = Xyes -a \
|
---|
1434 | X$ac_cv_func_semget = Xyes -a \
|
---|
1435 | X$ac_cv_header_sys_ipc_h = Xyes -a \
|
---|
1436 | X$ac_cv_header_sys_sem_h = Xyes -a \
|
---|
1437 | X$ac_cv_header_sys_shm_h = Xyes; then
|
---|
1438 | HAVE_SYSV_IPC=yes
|
---|
1439 | AC_DEFINE(HAVE_SYSV_IPC, 1, ["use SYSVIPC"])
|
---|
1440 | else
|
---|
1441 | HAVE_SYSV_IPC=no
|
---|
1442 | fi
|
---|
1443 | AC_MSG_RESULT($HAVE_SYSV_IPC)
|
---|
1444 | AC_SUBST(HAVE_SYSV_IPC)
|
---|
1445 | else
|
---|
1446 | HAVE_SYSV_IPC=no
|
---|
1447 | AC_SUBST(HAVE_SYSV_IPC)
|
---|
1448 | fi
|
---|
1449 |
|
---|
1450 | AC_LANG_SAVE
|
---|
1451 | AC_LANG_CPLUSPLUS
|
---|
1452 | AC_MSG_CHECKING([if semctl requires semun])
|
---|
1453 | AC_TRY_LINK([
|
---|
1454 | #include <sys/types.h>
|
---|
1455 | #include <sys/ipc.h>
|
---|
1456 | #include <sys/sem.h>
|
---|
1457 | ],[
|
---|
1458 | int val = 0;
|
---|
1459 | semctl(0,0,0,val);
|
---|
1460 | ],[
|
---|
1461 | case $target in
|
---|
1462 | *-sgi-irix*)
|
---|
1463 | AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(sgi-irix -- yes)
|
---|
1464 | ;;
|
---|
1465 | *)
|
---|
1466 | AC_MSG_RESULT(no)
|
---|
1467 | ;;
|
---|
1468 | esac
|
---|
1469 | ],
|
---|
1470 | AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(yes))
|
---|
1471 | AC_LANG_RESTORE
|
---|
1472 | AC_DEFINE(SHMTYPE, [char *], ["type to use in shared memory"])
|
---|
1473 |
|
---|
1474 | dnl ----------- See if Fortran works --------------
|
---|
1475 |
|
---|
1476 | AC_MSG_CHECKING(if fortran compiler works)
|
---|
1477 | if test -n "$F77" -a "$F77" != no ; then
|
---|
1478 | /bin/rm -f ffunc.f flink.c
|
---|
1479 | echo " program main" > ffunc.f
|
---|
1480 | echo " end" >> ffunc.f
|
---|
1481 | if $F77 -o ffunc ffunc.f 1>&5 2>&5; then
|
---|
1482 | AC_MSG_RESULT(yes)
|
---|
1483 | else
|
---|
1484 | AC_MSG_RESULT(no)
|
---|
1485 | AC_MSG_FAILURE(fortran compiler does not work)
|
---|
1486 | fi
|
---|
1487 | /bin/rm -f ffunc ffunc.f
|
---|
1488 | fi
|
---|
1489 |
|
---|
1490 | dnl ----------- Fortran symbol names --------------
|
---|
1491 |
|
---|
1492 | AC_MSG_CHECKING(fortran symbols)
|
---|
1493 | if test -n "$F77" -a "$F77" != no ; then
|
---|
1494 | /bin/rm -f ffunc.f flink.c
|
---|
1495 | echo " subroutine ffunc()" > ffunc.f
|
---|
1496 | echo " return" >> ffunc.f
|
---|
1497 | echo " end" >> ffunc.f
|
---|
1498 | $F77 -c ffunc.f 1>/dev/null 2>/dev/null
|
---|
1499 | echo "main(){ FF(); return 0; }" > flink.c
|
---|
1500 | if $CC -o flink -DFF=ffunc flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
|
---|
1501 | AC_MSG_RESULT(same as C)
|
---|
1502 | F77_SYMBOLS=symbol
|
---|
1503 | elif $CC -o flink -DFF=ffunc_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
|
---|
1504 | AC_MSG_RESULT(lowercase with underscore)
|
---|
1505 | F77_SYMBOLS=symbol_
|
---|
1506 | elif $CC -o flink -DFF=FFUNC flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
|
---|
1507 | AC_MSG_RESULT(uppercase)
|
---|
1508 | F77_SYMBOLS=SYMBOL
|
---|
1509 | elif $CC -o flink -DFF=FFUNC_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
|
---|
1510 | AC_MSG_RESULT(uppercase with underscore)
|
---|
1511 | F77_SYMBOLS=SYMBOL_
|
---|
1512 | else
|
---|
1513 | AC_MSG_RESULT(giving up)
|
---|
1514 | AC_MSG_ERROR(could not determine F77 symbol names)
|
---|
1515 | fi
|
---|
1516 | /bin/rm -f ffunc.f ffunc.o flink flink.c flink.o ffunc
|
---|
1517 | else
|
---|
1518 | F77_SYMBOLS=symbol_
|
---|
1519 | AC_MSG_RESULT(guessing lowercase with underscore)
|
---|
1520 | fi
|
---|
1521 | AC_SUBST(F77_SYMBOLS)
|
---|
1522 |
|
---|
1523 | dnl ----------- check for FORTRAN libraries --------------
|
---|
1524 |
|
---|
1525 | AC_LANG_SAVE
|
---|
1526 | AC_LANG_CPLUSPLUS
|
---|
1527 | LIBSSAV="$LIBS"
|
---|
1528 | LIBS="$LIBSSAV $FLIBS"
|
---|
1529 |
|
---|
1530 | LIBBLAS=""
|
---|
1531 | F77_DGEMM=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DAXPY`
|
---|
1532 | AC_CHECK_FUNC($F77_DGEMM,HAVE_BLAS=yes,[
|
---|
1533 | AC_CHECK_LIB(essl,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lessl"],
|
---|
1534 | AC_CHECK_LIB(blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lblas"])
|
---|
1535 | )]
|
---|
1536 | )
|
---|
1537 | if test X$HAVE_BLAS != Xyes; then
|
---|
1538 | LIBSSAV2="$LIBS"
|
---|
1539 | LIBS="-latlas $LIBS"
|
---|
1540 | AC_CHECK_LIB(f77blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lf77blas -latlas"],
|
---|
1541 | LIBS="$LIBSSAV2")
|
---|
1542 | fi
|
---|
1543 | AC_SUBST(HAVE_BLAS)
|
---|
1544 | if test X$HAVE_BLAS != Xyes; then
|
---|
1545 | echo "WARNING: Could not link to the BLAS library. It can be obtained at"
|
---|
1546 | echo "http://www.netlib.org/blas. Use --with-libdirs and/or --with-libs"
|
---|
1547 | echo "to specify the name of the library."
|
---|
1548 | AC_MSG_ERROR([BLAS is required to complete the build])
|
---|
1549 | fi
|
---|
1550 |
|
---|
1551 | LIBS="$LIBSSAV $LIBBLAS $FLIBS"
|
---|
1552 |
|
---|
1553 | LIBLAPACK=""
|
---|
1554 | F77_DGESVD=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DGESVD`
|
---|
1555 | AC_CHECK_FUNC($F77_DGESVD,HAVE_LAPACK=yes,[
|
---|
1556 | AC_CHECK_LIB(lapack,$F77_DGESVD,[HAVE_LAPACK=yes;LIBLAPACK="-llapack"]
|
---|
1557 | )]
|
---|
1558 | )
|
---|
1559 | AC_SUBST(HAVE_LAPACK)
|
---|
1560 | if test X$HAVE_LAPACK != Xyes; then
|
---|
1561 | echo "Could not link to the LAPACK library. It can be obtained at"
|
---|
1562 | echo "http://www.netlib.org/lapack. Use --with-libdirs and/or --with-libs"
|
---|
1563 | echo "to specify the name of the library."
|
---|
1564 | AC_MSG_ERROR([LAPACK is required to complete the build])
|
---|
1565 | fi
|
---|
1566 |
|
---|
1567 | FLIBS="$LIBLAPACK $LIBBLAS $FLIBS"
|
---|
1568 | AC_LANG_RESTORE
|
---|
1569 |
|
---|
1570 | dnl ----------- check for Scalable BLAS library --------------
|
---|
1571 |
|
---|
1572 | LIBSSAV="$LIBS"
|
---|
1573 | LIBS="$LIBS $FLIBS"
|
---|
1574 | HAVE_SCALABLE_BLAS=no
|
---|
1575 | AC_CHECK_FUNC(sB_init,
|
---|
1576 | HAVE_SCALABLE_BLAS=yes,[
|
---|
1577 | AC_CHECK_LIB(sB_BLAS,sB_init,[
|
---|
1578 | HAVE_SCALABLE_BLAS=yes
|
---|
1579 | LIBSSAV="-lsB_BLAS $LIBSSAV"
|
---|
1580 | ])]
|
---|
1581 | )
|
---|
1582 | LIBS="$LIBSSAV"
|
---|
1583 | if test $HAVE_SCALABLE_BLAS = yes; then
|
---|
1584 | AC_DEFINE(HAVE_SCALABLE_BLAS, 1, ["have scalabale blas"])
|
---|
1585 | fi
|
---|
1586 |
|
---|
1587 | dnl ----------- NIAMA library checks --------------
|
---|
1588 |
|
---|
1589 | AC_LANG_SAVE
|
---|
1590 | AC_LANG_CPLUSPLUS
|
---|
1591 | AC_CHECK_PROG(NIAMACFG,niama-config,niama-config)
|
---|
1592 | if test X$NIAMACFG != X; then
|
---|
1593 | LIBSSAV="$LIBS"
|
---|
1594 | CPPSAV="$CPPFLAGS"
|
---|
1595 | NIAMALIBS="`niama-config --libs` `niama-config --corbalibs`"
|
---|
1596 | CPPFLAGS="$CPPFLAGS `niama-config --cppflags`"
|
---|
1597 | LIBS="$NIAMALIBS $LIBS"
|
---|
1598 | AC_TRY_LINK([
|
---|
1599 | #include <niama.h>
|
---|
1600 | ],[
|
---|
1601 | exit(0);
|
---|
1602 | ],[
|
---|
1603 | AC_DEFINE(HAVE_NIAMA, 1, ["have NIAMA"])
|
---|
1604 | ],[
|
---|
1605 | LIBS="$LIBSSAV"
|
---|
1606 | CPPFLAGS="$CPPSAV"
|
---|
1607 | ]
|
---|
1608 | )
|
---|
1609 | fi
|
---|
1610 | AC_LANG_RESTORE
|
---|
1611 |
|
---|
1612 | dnl ----------- libint library checks --------------
|
---|
1613 |
|
---|
1614 | AC_LANG_SAVE
|
---|
1615 | AC_LANG_CPLUSPLUS
|
---|
1616 | AC_CHECK_HEADERS(libint/libint.h,
|
---|
1617 | AC_CHECK_LIB(int,init_libint_base,
|
---|
1618 | HAVE_LIBINT=yes
|
---|
1619 | AC_DEFINE(HAVE_LIBINT, 1, ["have libint"])
|
---|
1620 | AC_SUBST(HAVE_LIBINT)
|
---|
1621 | LIBS="-lint $LIBS"
|
---|
1622 | )
|
---|
1623 | )
|
---|
1624 | AC_LANG_RESTORE
|
---|
1625 | AM_CONDITIONAL([CONDLIBINT], [test x"$HAVE_LIBINT" = x"1"])
|
---|
1626 |
|
---|
1627 | dnl ----------- libr12 library checks --------------
|
---|
1628 |
|
---|
1629 | AC_LANG_SAVE
|
---|
1630 | AC_LANG_CPLUSPLUS
|
---|
1631 | AC_CHECK_HEADERS(libr12/libr12.h,
|
---|
1632 | AC_CHECK_LIB(r12,init_libr12_base,
|
---|
1633 | HAVE_LIBR12=yes
|
---|
1634 | AC_DEFINE(HAVE_LIBR12, 1, ["have libr12"])
|
---|
1635 | AC_SUBST(HAVE_LIBR12)
|
---|
1636 | LIBS="-lr12 $LIBS"
|
---|
1637 | )
|
---|
1638 | )
|
---|
1639 | AC_LANG_RESTORE
|
---|
1640 | AM_CONDITIONAL([CONDLIBR12], [test x"$HAVE_LIBR12" = x"1"])
|
---|
1641 |
|
---|
1642 | dnl ----------- libderiv library checks --------------
|
---|
1643 |
|
---|
1644 | AC_LANG_SAVE
|
---|
1645 | AC_LANG_CPLUSPLUS
|
---|
1646 | AC_CHECK_HEADERS(libderiv/libderiv.h,
|
---|
1647 | AC_CHECK_LIB(deriv,init_libderiv_base,
|
---|
1648 | HAVE_LIBDERIV=yes
|
---|
1649 | AC_DEFINE(HAVE_LIBDERIV, 1, ["have libderiv"])
|
---|
1650 | AC_SUBST(HAVE_LIBDERIV)
|
---|
1651 | LIBS="-lderiv $LIBS"
|
---|
1652 | )
|
---|
1653 | )
|
---|
1654 | AC_LANG_RESTORE
|
---|
1655 | AM_CONDITIONAL([CONDLIBDERIV], [test x"$HAVE_LIBDERIV" = x"1"])
|
---|
1656 |
|
---|
1657 | dnl ----------- make sure we have everything for cints and mbptr12 ----------
|
---|
1658 |
|
---|
1659 | if test ! X$HAVE_LIBR12 = Xyes -o ! X$HAVE_LIBINT = Xyes; then
|
---|
1660 | EXCLUDED_DIRS="-x SRC_LIB_CHEMISTRY_QC_CINTS -x SRC_LIB_CHEMISTRY_QC_MBPTR12 $EXCLUDED_DIRS"
|
---|
1661 | fi
|
---|
1662 |
|
---|
1663 | dnl --------- Template instantiation. ---------
|
---|
1664 |
|
---|
1665 | if test $template_instantiation = auto; then
|
---|
1666 | AC_MSG_CHECKING(choosing template instantiation method)
|
---|
1667 | if test X$GXX = Xyes; then
|
---|
1668 | AC_MSG_RESULT("gcc (none)")
|
---|
1669 | else
|
---|
1670 | case $target in
|
---|
1671 | *-sgi-irix6.0*)
|
---|
1672 | AC_MSG_RESULT("*-sgi-irix6.0* (none)")
|
---|
1673 | ;;
|
---|
1674 | *-sgi-irix*)
|
---|
1675 | template_instantiation=ptused
|
---|
1676 | AC_MSG_RESULT("*-sgi-irix* (ptused)")
|
---|
1677 | ;;
|
---|
1678 | *-cray-unicos*)
|
---|
1679 | template_instantiation=craysimp
|
---|
1680 | AC_MSG_RESULT("*-cray-unicos* (craysimp)")
|
---|
1681 | ;;
|
---|
1682 | *-dec-osf*)
|
---|
1683 | template_instantiation=repodir
|
---|
1684 | AC_MSG_RESULT("*-dec-osf* (repodir)")
|
---|
1685 | ;;
|
---|
1686 | alpha*)
|
---|
1687 | template_instantiation=repodir
|
---|
1688 | AC_MSG_RESULT("alpha* non-GNU C++ (repodir)")
|
---|
1689 | ;;
|
---|
1690 | *-solaris*)
|
---|
1691 | template_instantiation=sunexpl
|
---|
1692 | AC_MSG_RESULT("*-solaris* (sunexpl)")
|
---|
1693 | ;;
|
---|
1694 | *)
|
---|
1695 | AC_MSG_RESULT("generic non GNU (none)")
|
---|
1696 | ;;
|
---|
1697 | esac
|
---|
1698 | fi
|
---|
1699 | fi
|
---|
1700 |
|
---|
1701 | if test $template_instantiation = auto; then
|
---|
1702 | template_instantiation=none
|
---|
1703 | fi
|
---|
1704 |
|
---|
1705 | AC_MSG_CHECKING(template instantiation flags)
|
---|
1706 | TMPLINST=no
|
---|
1707 | TMPLREPO=
|
---|
1708 | TMPLINLIB=no
|
---|
1709 | case $template_instantiation in
|
---|
1710 | repodir)
|
---|
1711 | TMPLREPO=cxx_repository
|
---|
1712 | TMPLINLIB=yes
|
---|
1713 | ;;
|
---|
1714 | craysimp)
|
---|
1715 | CXXFLAGS="$CXXFLAGS -h simple_templates"
|
---|
1716 | ;;
|
---|
1717 | gnurepo)
|
---|
1718 | TMPLINST=yes
|
---|
1719 | CXXFLAGS="$CXXFLAGS -frepo"
|
---|
1720 | AC_MSG_RESULT(gnurepo)
|
---|
1721 | ;;
|
---|
1722 | gnuexpl)
|
---|
1723 | # automatic template instantiation causes problems with libstc++-v3
|
---|
1724 | CXXFLAGS="$CXXFLAGS -fno-implicit-templates"
|
---|
1725 | EXPLICIT_TEMPLATE_INSTANTIATION=yes
|
---|
1726 | AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"])
|
---|
1727 | ;;
|
---|
1728 | sunexpl)
|
---|
1729 | CXXFLAGS="$CXXFLAGS -instances=explicit"
|
---|
1730 | AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"])
|
---|
1731 | ;;
|
---|
1732 | ptused)
|
---|
1733 | CXXFLAGS="$CXXFLAGS -ptused"
|
---|
1734 | ;;
|
---|
1735 | none)
|
---|
1736 | AC_MSG_RESULT(none)
|
---|
1737 | ;;
|
---|
1738 | *)
|
---|
1739 | AC_MSG_RESULT($template_instantiation)
|
---|
1740 | AC_MSG_ERROR(unknown template instantiation method)
|
---|
1741 | esac
|
---|
1742 |
|
---|
1743 | AC_SUBST(TMPLINST)
|
---|
1744 | AC_SUBST(TMPLREPO)
|
---|
1745 | AC_SUBST(TMPLINLIB)
|
---|
1746 |
|
---|
1747 | dnl --------- Checks that must be done last. ---------
|
---|
1748 |
|
---|
1749 | AC_MSG_CHECKING([for special flags that must be set last])
|
---|
1750 | case $target in
|
---|
1751 | i860-intel-puma*)
|
---|
1752 | LDFLAGS="$LDFLAGS -mpuma -mnoieee"
|
---|
1753 | AC_MSG_RESULT(paragon puma)
|
---|
1754 | ;;
|
---|
1755 | i686-intel-cougar*)
|
---|
1756 | LDFLAGS="$LDFLAGS -mcougar -mnoieee"
|
---|
1757 | AC_MSG_RESULT(teraflop cougar)
|
---|
1758 | ;;
|
---|
1759 | i860-intel-sunmos*)
|
---|
1760 | LDFLAGS="$LDFLAGS -msunmos -mnoieee"
|
---|
1761 | AC_MSG_RESULT(paragon sunmos)
|
---|
1762 | ;;
|
---|
1763 | i860-intel-osf*)
|
---|
1764 | LDFLAGS="$LDFLAGS -mnx -mnoieee"
|
---|
1765 | AC_MSG_RESULT(osf paragon)
|
---|
1766 | ;;
|
---|
1767 | *)
|
---|
1768 | AC_MSG_RESULT(none)
|
---|
1769 | ;;
|
---|
1770 | esac
|
---|
1771 |
|
---|
1772 | dnl --------- Shared library configuration. ---------
|
---|
1773 |
|
---|
1774 | enablelibtool=yes
|
---|
1775 | AC_ARG_ENABLE(libtool,
|
---|
1776 | [ --disable-libtool Do not use libtool.],
|
---|
1777 | [
|
---|
1778 | case $enableval in
|
---|
1779 | yes)
|
---|
1780 | ;;
|
---|
1781 | no)
|
---|
1782 | enablelibtool=no
|
---|
1783 | ;;
|
---|
1784 | *)
|
---|
1785 | AC_MSG_ERROR([Invalid value for --(dis|en)able-libtool ($enableval)])
|
---|
1786 | ;;
|
---|
1787 | esac
|
---|
1788 | ])
|
---|
1789 |
|
---|
1790 | if test "$enablelibtool" = yes; then
|
---|
1791 |
|
---|
1792 | dnl by default make only static libraries
|
---|
1793 | AC_DISABLE_SHARED
|
---|
1794 | AC_PROG_LIBTOOL
|
---|
1795 |
|
---|
1796 | OBJSUF=lo
|
---|
1797 | LIBSUF=la
|
---|
1798 |
|
---|
1799 | else
|
---|
1800 |
|
---|
1801 | enable_shared=no
|
---|
1802 |
|
---|
1803 | fi
|
---|
1804 |
|
---|
1805 | if test "$enable_shared" = "no"; then
|
---|
1806 | OBJSUF=o
|
---|
1807 | LIBSUF=a
|
---|
1808 | fi
|
---|
1809 |
|
---|
1810 | ENABLESHARED=$enable_shared
|
---|
1811 | AC_SUBST(ENABLESHARED)
|
---|
1812 |
|
---|
1813 | dnl --------- CCA component configuration ---------
|
---|
1814 |
|
---|
1815 | have_condcca="false"
|
---|
1816 | if test $components == "yes"; then
|
---|
1817 |
|
---|
1818 | if test $HAVE_MPI == "yes" &&
|
---|
1819 | test $HAVE_MPIPP == "no"; then
|
---|
1820 | AC_MSG_ERROR([libmpi++ needed for mpi cca components])
|
---|
1821 | fi
|
---|
1822 |
|
---|
1823 | if test -z $CCA_CHEM_CONFIG && ! test -x $CCA_CHEM_CONFIG; then
|
---|
1824 | AC_MSG_ERROR([cca-chem-config is required to build CCA component code])
|
---|
1825 | fi
|
---|
1826 |
|
---|
1827 | CCA_CHEM_INCLUDE=`$CCA_CHEM_CONFIG --includedir`
|
---|
1828 | CCA_CHEM_LIB=`$CCA_CHEM_CONFIG --libdir`
|
---|
1829 | CCA_CHEM_PREFIX=`$CCA_CHEM_CONFIG --prefix`
|
---|
1830 | CCA_CHEM_REPO=$CCA_CHEM_PREFIX/repo
|
---|
1831 | AC_SUBST(CCA_CHEM_INCLUDE)
|
---|
1832 | AC_SUBST(CCA_CHEM_LIB)
|
---|
1833 | AC_SUBST(CCA_CHEM_REPO)
|
---|
1834 |
|
---|
1835 | CCAFE_CONFIG=`$CCA_CHEM_CONFIG --ccafe-config`
|
---|
1836 | ENABLE_PYTHON="no" # no need for python checks
|
---|
1837 | AC_CHECK_CCA()
|
---|
1838 |
|
---|
1839 | LIBS="-L$CCAFE_LIB $LIBS"
|
---|
1840 | CCA_CHEM_INCLUDE=-I$CCA_CHEM_INCLUDE
|
---|
1841 | BABEL_INCLUDE=-I$BABEL_INCLUDE
|
---|
1842 | CCA_SPEC_BABEL_INCLUDE=-I$CCA_SPEC_BABEL_INCLUDE
|
---|
1843 | CCAFE_INCLUDE="-I$CCAFE_INCLUDE -I$CCAFE_INCLUDE/dc/babel/babel-cca/server"
|
---|
1844 | CPPFLAGS="$CPPFLAGS $BABEL_INCLUDE $CCA_SPEC_BABEL_INCLUDE $CCA_CHEM_INCLUDE $CCAFE_INCLUDE"
|
---|
1845 |
|
---|
1846 | AC_CHECK_HEADER(sidl.h,
|
---|
1847 | AC_DEFINE(HAVE_SIDL_HEADERS, 1, ["have sidl"]),
|
---|
1848 | AC_MSG_ERROR([problem with babel headers]) )
|
---|
1849 | AC_CHECK_HEADER(gov_cca_IOR.h,
|
---|
1850 | AC_DEFINE(HAVE_CCA_SPEC_BABEL_HEADERS, 1, ["have CCA spec babel headers"]),
|
---|
1851 | AC_MSG_ERROR([problem with cca-spec-babel headers]) )
|
---|
1852 | AC_CHECK_HEADER(Chemistry_QC_Model_IOR.h,
|
---|
1853 | AC_DEFINE(HAVE_CCA_CHEM_HEADERS, 1, ["have CCA chem headers"]),
|
---|
1854 | AC_MSG_ERROR([problem with cca-chem-generic headers]) )
|
---|
1855 |
|
---|
1856 | have_condcca="true"
|
---|
1857 | else
|
---|
1858 | EXCLUDED_DIRS="-x LIB_CCA -x SRC_LIB_CHEMISTRY_CCA -x SRC_LIB_CHEMISTRY_QC_INTCCA $EXCLUDED_DIRS"
|
---|
1859 | fi
|
---|
1860 | AM_CONDITIONAL(CONDCCA, [test x"$have_condcca" = x"true"])
|
---|
1861 |
|
---|
1862 | dnl --------- Find the list of all sc libraries. ---------
|
---|
1863 |
|
---|
1864 | SCLIBS=`$PERL $srcdir/bin/listlibs.pl -I$srcdir/src/lib -DLIBSUF=$LIBSUF $srcdir/src/lib`
|
---|
1865 | AC_SUBST(SCLIBS)
|
---|
1866 |
|
---|
1867 | dnl --------- Define the library directory macros. ---------
|
---|
1868 |
|
---|
1869 | if test "$enableproduction" = "no"; then
|
---|
1870 | AC_DEFINE_DIR(SRC_SCLIBDIR, srcdir/lib, ["source SC libdir"])
|
---|
1871 | fi
|
---|
1872 | AC_DEFINE_DIR(INSTALLED_SCLIBDIR, prefix/lib, ["install SC libdir"])
|
---|
1873 | AC_DEFINE_DIR(SCDATADIR, scdatadir, ["SC data dir"])
|
---|
1874 |
|
---|
1875 | dnl --------- Create the stub Makefiles. ---------
|
---|
1876 |
|
---|
1877 | dnl $PERL $srcdir/bin/objectdir.pl $EXCLUDED_DIRS $srcdir
|
---|
1878 |
|
---|
1879 | ### output files
|
---|
1880 | AC_CONFIG_FILES([
|
---|
1881 | bin/mkf77sym.pl
|
---|
1882 | ])
|
---|
1883 | AC_CONFIG_FILES([
|
---|
1884 | doc/doxygen.cfg
|
---|
1885 | ])
|
---|
1886 | AC_CONFIG_FILES([
|
---|
1887 | Makefile
|
---|
1888 | src/lib/Makefile
|
---|
1889 | src/bin/mpqc/Makefile
|
---|
1890 | ])
|
---|
1891 |
|
---|
1892 | AC_OUTPUT
|
---|
1893 |
|
---|
1894 |
|
---|