source: ThirdParty/mpqc_open/configure.ac@ fbf005

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since fbf005 was ba1152, checked in by Frederik Heber <heber@…>, 8 years ago

Removed libfl dependence in mpqc.

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