source: ThirdParty/mpqc_open/configure.ac@ 416a65

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 ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 416a65 was 416a65, checked in by Frederik Heber <heber@…>, 8 years ago

FIX: mpqc's autoconf did not removed test file due to typo.

  • Property mode set to 100644
File size: 49.0 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
455fi
456AC_ARG_WITH(sc-datadir,
457[ --with-sc-datadir Specifies arch-independent install subdir.],
458scdatadir=$withval
459)
460AC_SUBST(scdatadir)
461
462AC_ARG_WITH(include,
463[ --with-include Specifies include directories (-Idir1 -Idir2).],
464EXTRAINCLUDE=$withval
465CPPFLAGS=$withval
466echo Using extra include directories: $withval
467)
468
469template_instantiation=none
470AC_ARG_WITH(template,
471[ --with-template Specifies template instantation model.],
472template_instantiation=$withval
473echo Using extra include directories: $withval
474)
475
476scincludedir=$includedir
477AC_ARG_WITH(sc-includedir,
478[ --with-sc-includedir Specifies include file install subdir.],
479scincludedir=$withval
480)
481AC_SUBST(scincludedir)
482
483AC_ARG_WITH(libs,
484[ --with-libs Specifies libraries (-llib1 -llib2).],
485LIBS=$withval
486echo Using extra libraries: $withval
487)
488
489XTRA_FLIBS=
490AC_ARG_WITH(extra-flibs,
491[ --with-extra-flibs Specifies libs needing a F77 runtime (-llib1 -llib2).],
492XTRA_FLIBS=$withval
493echo Using extra FORTRAN libraries: $withval
494)
495
496have_flibs=no
497AC_ARG_WITH(flibs,
498[ --with-flibs Specifies the F77 runtime (by default, will guess).],
499FLIBS=$withval
500have_flibs=yes
501echo Using FORTRAN runtime libraries: $withval
502)
503
504LDFLAGS=
505LIBDIRS=
506AC_ARG_WITH(libdirs,
507[ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).],
508LIBDIRS=$withval
509LDFLAGS=$withval
510echo Using extra library directories: $withval
511)
512
513AC_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
525dnl --------- Want absolute path for srcdir, not relative. ---------
526
527if 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
534fi
535
536dnl --------- Get the path to the compile dir. ---------
537
538compiledir=`pwd`
539AC_SUBST(compiledir)
540
541dnl --------- Need actual paths for substitution outside of a makefile. ---------
542
543if 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
551else
552 scbindir=$exec_prefix/bin
553 sclibdir=$exec_prefix/lib
554fi
555AC_SUBST(scbindir)
556AC_SUBST(sclibdir)
557
558dnl --------- Checks for programs. ---------
559AC_PROG_LN_S
560AC_PROG_INSTALL
561dnl obsolete because of LT_INIT
562dnl AC_PROG_RANLIB
563AC_PROG_CC
564dnl ac_prog_cxx's order isn't what i need
565AC_CHECK_PROGS(CXX, g++ c++ gcc CC cxx xlC_r, gcc)
566dnl sees if CXX is a GNU compiler
567AC_PROG_CXX
568if test ! "$F77" = no ; then
569 AC_PROG_F77
570 if test "X$have_flibs" = Xno; then
571 AC_F77_LIBRARY_LDFLAGS
572 fi
573fi
574FLIBS="$XTRA_FLIBS $FLIBS"
575AC_PROG_CPP
576AC_PROG_CXXCPP
577AC_CHECK_PROG(AR,ar,ar)
578AC_CHECK_PROG(PERL,perl,perl)
579AC_CHECK_PROG(WISH,wish,/usr/bin/wish)
580
581dnl --------- use libtool ---------------------
582
583LT_INIT([static])
584
585dnl The lack of certain tools is a show stopper
586
587changequote(<<, >>)dnl
588
589if [ 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
593fi
594
595changequote([, ])dnl
596
597dnl --------- Check for the graph generator used by doxygen
598
599DOT_PATH=""
600if test X$DOT = Xno; then
601 HAVE_DOT=NO
602elif test X$DOT = Xyes; then
603 AC_CHECK_PROG(HAVE_DOT,dot,YES,NO)
604else
605 HAVE_DOT=YES
606 DOT_PATH=$DOT
607fi
608AC_SUBST(DOT_PATH)
609AC_SUBST(HAVE_DOT)
610
611dnl -------- 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
622dnl -------- Checks for compiler/linker options. ----------
623
624# options needed only for optimization
625COPTIONS_OPT=-O
626# options needed only for debugging
627COPTIONS_DBG=-g
628# options that are always needed
629COPTIONS_MISC=
630
631# options needed only for optimization
632CXXOPTIONS_OPT=-O
633# options needed only for debugging
634CXXOPTIONS_DBG=-g
635# options that are always needed
636CXXOPTIONS_MISC=
637
638OBJSUF=o
639LIBSUF=a
640
641dnl -- check how dependency information is built --
642
643# The GNU compilers work with:
644CCDEPENDSUF=none
645CXXDEPENDSUF=none
646CCDEPENDFLAGS=-M
647CXXDEPENDFLAGS=-M
648
649/bin/rm -f depcheck.u depcheck.c depcheck.o
650
651# Check for an IBM visual age C compiler
652echo "#include <stdio.h>" > depcheck.c
653$CC $CPPFLAGS $CFLAGS -M depcheck.c > /dev/null 2>&1
654if test -f depcheck.u; then
655 CCDEPENDSUF=u
656fi
657/bin/rm -f depcheck.u depcheck.c depcheck.o
658
659# Check for an IBM visual age C++ compiler
660echo "#include <iostream>" > depcheck.cc
661$CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1
662if test -f depcheck.u; then
663 CXXDEPENDSUF=u
664 CXXDEPENDFLAGS="-M -E"
665fi
666/bin/rm -f depcheck.u depcheck.cc depcheck.o
667
668dnl -- special misc options --
669
670AC_MSG_CHECKING([for miscellaneous flags])
671case $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 ;;
681esac
682
683dnl -- special optimization options --
684
685AC_MSG_CHECKING([for special optimization options])
686case $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 ;;
728changequote(<<, >>)dnl
729 mips*-sgi-irix6.[01]*)
730changequote([, ])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 ;;
750changequote(<<, >>)dnl
751 i[56]86-*)
752changequote([, ])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 ;;
770esac
771
772dnl -- special architecture options --
773
774case $target_cpu in
775 i786)
776 opt_target_cpu=pentium4
777 ;;
778 *)
779 opt_target_cpu=$target_cpu
780 ;;
781esac
782
783if 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)
793fi
794
795if 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)
802fi
803
804AC_MSG_CHECKING([for special architecture options])
805case $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 ;;
829changequote(<<, >>)dnl
830 i[4567]86-* | pentium-* | pentium4-* | pentiumpro-* | k6-* | athlon-*)
831changequote([, ])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 ;;
899esac
900
901dnl -- check for overriden optimization options --
902
903if test -n "$GIVEN_COPTIONS_OPT"; then
904 COPTIONS_OPT=$GIVEN_COPTIONS_OPT
905 AC_MSG_NOTICE("overriding C optimization flags with $COPTIONS_OPT")
906fi
907
908if test -n "$GIVEN_CXXOPTIONS_OPT"; then
909 CXXOPTIONS_OPT=$GIVEN_CXXOPTIONS_OPT
910 AC_MSG_NOTICE("overriding C++ optimization flags with $CXXOPTIONS_OPT")
911fi
912
913dnl ----------- check for C++ typename ---------------
914dnl This is done before template flags are set to avoid
915dnl undefined symbol problems.
916
917AC_LANG_SAVE
918AC_LANG_CPLUSPLUS
919AC_MSG_CHECKING("for C++ typename keyword")
920AC_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],[
927AC_DEFINE(HAVE_TYPENAME, 1, ["use typename keyword"])
928AC_MSG_RESULT("yes")
929],
930AC_MSG_RESULT("no")
931AC_DEFINE(typename, [], ["remove usage of absent typename keyword by empty define"])
932);
933AC_LANG_RESTORE
934
935dnl ----------- check for C++ restrict extension ---------------
936
937AC_LANG_SAVE
938AC_LANG_CPLUSPLUS
939AC_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)
945AC_LANG_RESTORE
946
947dnl ---------- Checks for C++ header files. -----------
948
949AC_LANG_SAVE
950AC_LANG_CPLUSPLUS
951AC_CHECK_HEADERS(iostream sstream)
952AC_LANG_RESTORE
953
954AC_MSG_CHECKING(iostream name)
955if test x$ac_cv_header_iostream = xyes; then
956 iostream=iostream
957else
958 iostream=iostream.h
959fi
960AC_MSG_RESULT($iostream)
961
962dnl ----------- check for namespace std ---------------
963
964AC_LANG_SAVE
965AC_LANG_CPLUSPLUS
966AC_MSG_CHECKING("for namespace std")
967AC_TRY_LINK([
968#include <$iostream>
969using namespace std;
970],[
971 ostream &o = cout;
972 o << endl;
973],[
974AC_DEFINE(USING_NAMESPACE_STD, 1, ["using namespace std"])
975NAMESPACE_STD=std::
976AC_MSG_RESULT("yes")
977],
978NAMESPACE_STD=
979AC_MSG_RESULT("no")
980);
981AC_LANG_RESTORE
982
983dnl ----------- check for GNU libc++-v3 prerelease bug ---------------
984
985if test X$GXX = Xyes; then
986AC_LANG_SAVE
987AC_LANG_CPLUSPLUS
988AC_MSG_CHECKING("for GNU libc++-v3 prerelease bug")
989AC_TRY_LINK([
990#include <stdio.h>
991#include <$iostream>
992],[
993],[
994AC_MSG_RESULT("no")
995],
996EXTRADEFINES="$EXTRADEFINES -D_ISOC99_SOURCE=1"
997AC_MSG_RESULT("yes")
998);
999AC_LANG_RESTORE
1000fi
1001
1002dnl -- other options --
1003
1004if test $DEBUG = yes; then
1005 CFLAGS="$COPTIONS_DBG $COPTIONS_MISC"
1006 CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_MISC"
1007 LDFLAGS="$LDFLAGS -g"
1008elif test $DEBUG = opt; then
1009 CFLAGS="$COPTIONS_DBG $COPTIONS_OPT $COPTIONS_MISC"
1010 CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_OPT $CXXOPTIONS_MISC"
1011 LDFLAGS="$LDFLAGS -g"
1012else
1013 CFLAGS="$COPTIONS_OPT $COPTIONS_MISC"
1014 CXXFLAGS="$CXXOPTIONS_OPT $CXXOPTIONS_MISC"
1015fi
1016
1017AC_SUBST(EXTRAINCLUDE)
1018
1019AC_SUBST(CFLAGS)
1020AC_SUBST(CXXFLAGS)
1021
1022AC_SUBST(LDFLAGS)
1023AC_SUBST(LIBDIRS)
1024
1025AC_SUBST(OBJSUF)
1026AC_SUBST(LIBSUF)
1027AC_SUBST(CCDEPENDSUF)
1028AC_SUBST(CXXDEPENDSUF)
1029AC_SUBST(CCDEPENDFLAGS)
1030AC_SUBST(CXXDEPENDFLAGS)
1031
1032dnl -------- Checks for architecture specific features. --------
1033dnl (Doesn't work for cross compilation.)
1034dnl AC_CHECK_SIZEOF(void*)
1035
1036dnl This version works on more machines without the need to run
1037dnl a test program.
1038AC_DEFUN([SC_C_BIGENDIAN],
1039[AC_CHECK_HEADERS(fp.h endian.h machine/endian.h sys/endian.h sys/machine.h)
1040AC_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.
1043AC_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.
1064AC_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)])
1088if test $sc_cv_c_bigendian = unknown; then
1089AC_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,
1099AC_MSG_ERROR([Could not determine endianness and cross compiling])
1100)
1101fi])
1102if test $sc_cv_c_bigendian = yes; then
1103 AC_DEFINE(WORDS_BIGENDIAN, 1, ["use big endian encoding"])
1104fi
1105])
1106
1107SC_C_BIGENDIAN
1108
1109dnl --------- Checks for libraries. ---------
1110dnl -- libpthread should be linked in last.
1111dnl -- Check on pthread_join since pthread_create, but not pthread_join,
1112dnl -- seems to be in libc on IRIX and we must generate a -lpthread in LIBS.
1113if test "(" X$PARALLEL = Xyes -a X$THREADS != Xno ")" -o X$THREADS = Xyes; then
1114
1115AC_MSG_CHECKING([pthreads])
1116dnl see if posix threads are automatically linked ...
1117AC_LANG_SAVE
1118AC_LANG_CPLUSPLUS
1119LIBSSAV="$LIBS"
1120AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
1121HAVE_PTHREAD=yes],[
1122HAVE_PTHREAD=no])
1123AC_LANG_RESTORE
1124
1125dnl see if posix threads are in -lpthread
1126if test $HAVE_PTHREAD = no; then
1127AC_LANG_SAVE
1128AC_LANG_CPLUSPLUS
1129LIBSSAV="$LIBS"
1130LIBS="$LIBS -lpthread"
1131AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
1132HAVE_PTHREAD=yes],[
1133HAVE_PTHREAD=no
1134LIBS="$LIBSSAV"])
1135AC_LANG_RESTORE
1136fi
1137
1138dnl see if posix threads are in -lpthreads
1139if test $HAVE_PTHREAD = no; then
1140AC_LANG_SAVE
1141AC_LANG_CPLUSPLUS
1142LIBSSAV="$LIBS"
1143LIBS="$LIBS -lpthreads"
1144AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
1145HAVE_PTHREAD=yes],[
1146HAVE_PTHREAD=no
1147LIBS="$LIBSSAV"])
1148AC_LANG_RESTORE
1149fi
1150AM_CONDITIONAL(COND_PTHREAD, [test X$HAVE_PTHREAD = Xyes])
1151
1152AC_MSG_RESULT($HAVE_PTHREAD)
1153fi
1154if test X$HAVE_PTHREAD = Xyes; then
1155 AC_DEFINE(HAVE_PTHREAD, 1, ["use pthreads"])
1156 EXTRADEFINES="-D_REENTRANT $EXTRADEFINES"
1157 AC_CHECK_FUNC(pthread_attr_getstacksize, [HAVE_PTHREAD_ATTR_GETINHERITSCHED=yes], [HAVE_PTHREAD_ATTR_GETINHERITSCHED=no])
1158 AC_CHECK_FUNC(pthread_attr_setstacksize, [HAVE_PTHREAD_ATTR_GETSCHEDPARAM=yes], [HAVE_PTHREAD_ATTR_GETSCHEDPARAM=no])
1159 AC_CHECK_FUNC(pthread_attr_setscope, [HAVE_PTHREAD_ATTR_GETSCHEDPOLICY=yes], [HAVE_PTHREAD_ATTR_GETSCHEDPOLICY=no])
1160 AC_CHECK_FUNC(pthread_attr_getscope, [HAVE_PTHREAD_ATTR_GETSCOPE=yes], [HAVE_PTHREAD_ATTR_GETSCOPE=no])
1161 AC_CHECK_FUNC(pthread_attr_setinheritsched, [HAVE_PTHREAD_ATTR_GETSTACKSIZE=yes], [HAVE_PTHREAD_ATTR_GETSTACKSIZE=no])
1162 AC_CHECK_FUNC(pthread_attr_getinheritsched, [HAVE_PTHREAD_ATTR_SETINHERITSCHED=yes], [HAVE_PTHREAD_ATTR_SETINHERITSCHED=no])
1163 AC_CHECK_FUNC(pthread_attr_setschedpolicy, [HAVE_PTHREAD_ATTR_SETSCHEDPARAM=yes], [HAVE_PTHREAD_ATTR_SETSCHEDPARAM=no])
1164 AC_CHECK_FUNC(pthread_attr_getschedpolicy, [HAVE_PTHREAD_ATTR_SETSCHEDPOLICY=yes], [HAVE_PTHREAD_ATTR_SETSCHEDPOLICY=no])
1165 AC_CHECK_FUNC(pthread_attr_setschedparam, [HAVE_PTHREAD_ATTR_SETSCOPE=yes], [HAVE_PTHREAD_ATTR_SETSCOPE=no])
1166 AC_CHECK_FUNC(pthread_attr_getschedparam, [HAVE_PTHREAD_ATTR_SETSTACKSIZE=yes], [HAVE_PTHREAD_ATTR_SETSTACKSIZE=no])
1167 AC_CHECK_FUNC(sched_get_priority_max, [HAVE_SCHED_GET_PRIORITY_MAX=yes], [HAVE_SCHED_GET_PRIORITY_MAX=no])
1168 AC_CHECK_FUNC(sched_get_priority_min, [HAVE_SCHED_GET_PRIORITY_MIN=yes], [HAVE_SCHED_GET_PRIORITY_MIN=no])
1169fi
1170AC_DEFINE(HAVE_PTHREAD_ATTR_GETINHERITSCHED, [$HAVE_PTHREAD_ATTR_GETINHERITSCHED], ["use pthread_attr_getstacksize"])
1171AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCHEDPARAM, [$HAVE_PTHREAD_ATTR_GETSCHEDPARAM], ["use pthread_attr_setstacksize"])
1172AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCHEDPOLICY, [$HAVE_PTHREAD_ATTR_GETSCHEDPOLICY], ["use pthread_attr_setscope"])
1173AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCOPE, [$HAVE_PTHREAD_ATTR_GETSCOPE], ["use pthread_attr_getscope"])
1174AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE, [$HAVE_PTHREAD_ATTR_GETSTACKSIZE], ["use pthread_attr_setinheritsched"])
1175AC_DEFINE(HAVE_PTHREAD_ATTR_SETINHERITSCHED, [$HAVE_PTHREAD_ATTR_SETINHERITSCHED], ["use pthread_attr_getinheritsched"])
1176AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPARAM, [$HAVE_PTHREAD_ATTR_SETSCHEDPARAM], ["use pthread_attr_setschedpolicy"])
1177AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY, [$HAVE_PTHREAD_ATTR_SETSCHEDPOLICY], ["use pthread_attr_getschedpolicy"])
1178AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCOPE, [$HAVE_PTHREAD_ATTR_SETSCOPE], ["use pthread_attr_setschedparam"])
1179AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE, [$HAVE_PTHREAD_ATTR_SETSTACKSIZE], ["use pthread_attr_getschedparam"])
1180AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MAX, [$HAVE_SCHED_GET_PRIORITY_MAX], ["use sched_get_priority_max"])
1181AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MIN, [$HAVE_SCHED_GET_PRIORITY_MIN], ["use sched_get_priority_max"])
1182
1183AC_CHECK_LIB(dl,main)
1184dnl commented out for Cray X1 (-lsun falsely detected)
1185dnl AC_CHECK_LIB(sun,main)
1186AC_CHECK_LIB(m,main)
1187AC_CHECK_LIB(fl,main)
1188AC_CHECK_HEADER(perf.h,[
1189 AC_CHECK_LIB(perf,perf_set_config,[
1190 HAVE_PERF=yes
1191 LIBS="-lperf $LIBS"
1192 AC_DEFINE(HAVE_PERF, 1, ["use perf"])
1193 ])
1194 ]
1195)
1196
1197AC_CHECK_HEADER(execinfo.h,HAVE_EXECINFO_H_INC=1)
1198AC_CHECK_FUNC(backtrace, HAVE_BACKTRACE_FUNC=1)
1199AC_CHECK_FUNC(backtrace_symbols_fd, HAVE_BACKTRACE_SYMBOLS_FD_FUNC=1)
1200if test -n "$HAVE_EXECINFO_H_INC" -a -n "$HAVE_BACKTRACE_FUNC" -a -n "$HAVE_BACKTRACE_SYMBOLS_FD_FUNC"; then
1201 AC_DEFINE(HAVE_BACKTRACE, 1, ["use backtrace"])
1202fi
1203
1204if test X$PARALLEL = Xyes; then
1205
1206 dnl ----- check for the mpi library
1207 AC_LANG_SAVE
1208 AC_LANG_CPLUSPLUS
1209 dnl Must use try_link since check_header runs cpp which doesn't
1210 dnl always find mpi.h (if mpicc and no -I is used for example)
1211 AC_MSG_CHECKING(for mpi.h)
1212 AC_TRY_LINK([#include <mpi.h>],[],have_mpi_h=yes,have_mpi_h=no)
1213 AC_MSG_RESULT($have_mpi_h)
1214 if test "$have_mpi_h" = yes; then
1215 AC_CHECK_FUNC(MPI_Init,HAVE_MPI=yes,HAVE_MPI=no)
1216 if test "$HAVE_MPI" = no; then
1217 AC_CHECK_LIB(mpi,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpi $LIBS"])
1218 fi
1219 if test "$HAVE_MPI" = no; then
1220 AC_CHECK_LIB(mpich,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpich $LIBS"])
1221 fi
1222 fi
1223 if test X$HAVE_MPI = Xyes; then
1224 AC_DEFINE(HAVE_MPI, 1, ["have MPI"])
1225 AC_CHECK_FUNC(MPI_File_open,
1226 [HAVE_MPIIO=yes;AC_DEFINE(HAVE_MPIIO, 1, ["have MPI IO extensions"])])
1227 AC_CHECK_FUNC(MPI_Init_thread,
1228 [AC_DEFINE(HAVE_MPI_INIT_THREAD, 1, ["have MPI init thread"])])
1229 HAVE_MPIPP=no;
1230 AC_CHECK_LIB(mpi++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lmpi++ $LIBS"])
1231 if test X$HAVE_MPIPP = Xno; then
1232 AC_CHECK_LIB(pmpich++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lpmpich++ $LIBS"])
1233 fi
1234 AC_DEFINE(HAVE_MPIPP, 1, ["have MPI PP"])
1235 fi
1236 AC_LANG_RESTORE
1237fi
1238AM_CONDITIONAL(COND_MPI, [test X$HAVE_MPI = Xyes])
1239
1240if test X$HAVE_MPI != Xyes -a $ALWAYS_USE_MPI = yes; then
1241 AC_MSG_ERROR([--enable-always-use-mpi is set but MPI is not available])
1242elif test $ALWAYS_USE_MPI = yes; then
1243 AC_DEFINE(ALWAYS_USE_MPI, 1, ["always use MPI"])
1244fi
1245
1246 dnl ------ check for the armci library
1247 AC_LANG_SAVE
1248 AC_LANG_CPLUSPLUS
1249 AC_CHECK_HEADER(armci.h,[
1250 AC_CHECK_FUNC(ARMCI_Init,HAVE_ARMCI=yes,[
1251 AC_CHECK_LIB(armci,ARMCI_Init,[HAVE_ARMCI=yes;LIBS="-larmci $LIBS"])
1252 ])
1253 ])
1254 AC_LANG_RESTORE
1255
1256 if test X$HAVE_ARMCI = Xyes; then
1257 AC_DEFINE(HAVE_ARMCI, 1, ["use ARMCI"])
1258 fi
1259AM_CONDITIONAL(COND_ARMCI, [test X$HAVE_ARMCI = Xyes])
1260
1261if test $DEFAULT_PARALLEL = mtmpi -a X$HAVE_MPI != Xyes; then
1262 AC_MSG_ERROR([--with-default-parallel=mtmpi but MPI not available])
1263fi
1264if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_MPI != Xyes; then
1265 AC_MSG_ERROR([--with-default-parallel=armcimpi but MPI not available])
1266fi
1267if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_ARMCI != Xyes; then
1268 AC_MSG_ERROR([--with-default-parallel=armcimpi but ARMCI not available])
1269fi
1270
1271AC_SUBST(HAVE_PERF)
1272AC_SUBST(HAVE_MPI)
1273AC_SUBST(ALWAYS_USE_MPI)
1274AC_SUBST(HAVE_ARMCI)
1275AC_SUBST(HAVE_MPIIO)
1276AC_SUBST(EXTRADEFINES)
1277
1278dnl ---------- Checks for header files. -----------
1279
1280AC_HEADER_STDC
1281AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h pwd.h)
1282AC_CHECK_HEADERS(sys/times.h sys/resource.h time.h machine/fpu.h asm/fpu.h)
1283AC_CHECK_HEADERS(termios.h sys/stat.h sys/types.h dlfcn.h stdint.h)
1284
1285dnl -- Checks for typedefs, structures, and compiler characteristics. --
1286AC_C_CONST
1287AC_TYPE_SIZE_T
1288AC_STRUCT_TM
1289
1290dnl --------- Checks for library functions. ---------
1291AC_TYPE_SIGNAL
1292AC_FUNC_VPRINTF
1293AC_CHECK_FUNCS(strerror sigfillset signal system getpwuid geteuid)
1294AC_CHECK_FUNCS(gethostname time ctime)
1295AC_CHECK_FUNCS(setrlimit setenv)
1296
1297dnl --------- Check for an isnan and make sure it can be used
1298dnl with iostream (it can't on OS X)
1299AC_LANG_SAVE
1300AC_LANG_CPLUSPLUS
1301AC_MSG_CHECKING(isnan and iostream)
1302AC_LINK_IFELSE([AC_LANG_PROGRAM([
1303 #include <iostream>
1304 #include <math.h>],[isnan(1.0); return 0;
1305 ])],
1306 AC_DEFINE(HAVE_ISNAN,1, ["isnan available"])
1307 AC_MSG_RESULT(yes),
1308 AC_MSG_RESULT(no)
1309)
1310AC_LANG_RESTORE
1311
1312dnl --------- Check for the glibc extensions to C99 fenv.h. ---------
1313
1314AC_CHECK_HEADERS(fenv.h)
1315AC_CHECK_FUNCS(feenableexcept fedisableexcept)
1316
1317dnl --------- Checks for a C++ linkable fchdir. ---------
1318AC_LANG_SAVE
1319AC_LANG_CPLUSPLUS
1320AC_MSG_CHECKING([fchdir])
1321AC_TRY_COMPILE([#include <unistd.h>],[
1322fchdir(0);
1323],[HAVE_FCHDIR=yes
1324AC_DEFINE(HAVE_FCHDIR, 1, ["have fchdir"])
1325AC_MSG_RESULT(yes)],[
1326AC_MSG_RESULT(no)
1327HAVE_FCHDIR=no
1328])
1329AC_LANG_RESTORE
1330AC_SUBST(HAVE_FCHDIR)
1331
1332dnl --------- Check for ios::fmtflags. ---------
1333
1334AC_LANG_SAVE
1335AC_LANG_CPLUSPLUS
1336AC_MSG_CHECKING([ios::fmtflags])
1337AC_TRY_COMPILE([#include <$iostream>],[
1338$NAMESPACE_STD ios::fmtflags flags;
1339],[HAVE_IOS_FMTFLAGS=yes
1340AC_DEFINE(HAVE_IOS_FMTFLAGS, 1, ["have iostream format flags"])
1341AC_MSG_RESULT(yes)],[
1342AC_MSG_RESULT(no)
1343HAVE_IOS_FMTFLAGS=no
1344])
1345AC_LANG_RESTORE
1346AC_SUBST(HAVE_IOS_FMTFLAGS)
1347
1348dnl --------- check for long long ---------
1349
1350if test X"$LONGLONG" = Xyes; then
1351AC_LANG_SAVE
1352AC_LANG_CPLUSPLUS
1353AC_MSG_CHECKING(long long)
1354AC_TRY_COMPILE([],[
1355long long i;
1356],[AC_DEFINE(HAVE_LONG_LONG, 1, ["have long long"])
1357AC_MSG_RESULT(yes)],[
1358AC_MSG_RESULT(no)
1359])
1360AC_LANG_RESTORE
1361fi
1362
1363dnl --------- Check for sgetn. ---------
1364
1365AC_LANG_SAVE
1366AC_LANG_CPLUSPLUS
1367AC_MSG_CHECKING([sgetn])
1368AC_TRY_COMPILE([#include <$iostream>],[
1369char *c=0;
1370$NAMESPACE_STD streambuf *s=0; s->sgetn(c,0);
1371],[HAVE_SGETN=yes
1372AC_DEFINE(HAVE_SGETN, 1, ["have sgetn"])
1373AC_MSG_RESULT(yes)],[
1374AC_MSG_RESULT(no)
1375HAVE_SGETN=no
1376])
1377AC_LANG_RESTORE
1378AC_SUBST(HAVE_SGETN)
1379
1380dnl --------- Check for pubseekoff. ---------
1381
1382AC_LANG_SAVE
1383AC_LANG_CPLUSPLUS
1384AC_MSG_CHECKING([pubseekoff])
1385AC_TRY_COMPILE([#include <$iostream>],[
1386$NAMESPACE_STD cout.rdbuf()->pubseekoff(0,$NAMESPACE_STD ios::beg,
1387 $NAMESPACE_STD ios::out);
1388],[HAVE_PUBSEEKOFF=yes
1389AC_DEFINE(HAVE_PUBSEEKOFF, 1, ["have pubseekoff"])
1390AC_MSG_RESULT(yes)],[
1391AC_MSG_RESULT(no)
1392HAVE_PUBSEEKOFF=no
1393])
1394AC_LANG_RESTORE
1395AC_SUBST(HAVE_PUBSEEKOFF)
1396
1397dnl --------- Check for seekoff. ---------
1398
1399AC_LANG_SAVE
1400AC_LANG_CPLUSPLUS
1401AC_MSG_CHECKING([seekoff])
1402AC_TRY_COMPILE([#include <$iostream>],[
1403$NAMESPACE_STD cout.rdbuf()->seekoff(0,$NAMESPACE_STD ios::beg,
1404 $NAMESPACE_STD ios::out);
1405],[HAVE_SEEKOFF=yes
1406AC_DEFINE(HAVE_SEEKOFF, 1, ["have seekoff"])
1407AC_MSG_RESULT(yes)],[
1408AC_MSG_RESULT(no)
1409HAVE_SEEKOFF=no
1410])
1411AC_LANG_RESTORE
1412AC_SUBST(HAVE_SEEKOFF)
1413
1414dnl --------- Check for signal handler argument lists. ---------
1415
1416AC_LANG_SAVE
1417AC_LANG_CPLUSPLUS
1418AC_MSG_CHECKING([signal handler needs ellipsis])
1419AC_TRY_LINK([
1420#include <signal.h>
1421extern "C" {
1422 typedef void (*signal_handler)(...);
1423 void handler(int);
1424}
1425void handler(int) {}
1426],[
1427 signal(SIGINT, (signal_handler)handler);
1428],
1429AC_DEFINE(SIGHASELLIP, 1, ["signal handler needs ellipsis"]) AC_MSG_RESULT(yes),
1430AC_MSG_RESULT(no))
1431AC_LANG_RESTORE
1432
1433dnl --------- Checks for rand functions ---------
1434
1435AC_LANG_SAVE
1436AC_LANG_CPLUSPLUS
1437AC_CHECK_FUNCS(drand48)
1438AC_LANG_RESTORE
1439
1440dnl --------- Checks for SYSV IPC. ---------
1441
1442if test "X$SYSVIPC" = Xyes; then
1443 AC_CHECK_FUNCS(shmget semget)
1444 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h sys/shm.h)
1445 AC_MSG_CHECKING([for SYSV IPC])
1446 if test X$ac_cv_func_shmget = Xyes -a \
1447 X$ac_cv_func_semget = Xyes -a \
1448 X$ac_cv_header_sys_ipc_h = Xyes -a \
1449 X$ac_cv_header_sys_sem_h = Xyes -a \
1450 X$ac_cv_header_sys_shm_h = Xyes; then
1451 HAVE_SYSV_IPC=yes
1452 AC_DEFINE(HAVE_SYSV_IPC, 1, ["use SYSVIPC"])
1453 else
1454 HAVE_SYSV_IPC=no
1455 fi
1456 AC_MSG_RESULT($HAVE_SYSV_IPC)
1457 AC_SUBST(HAVE_SYSV_IPC)
1458else
1459 HAVE_SYSV_IPC=no
1460 AC_SUBST(HAVE_SYSV_IPC)
1461fi
1462AM_CONDITIONAL(COND_SYSV_IPC, [test "X$HAVE_SYSV_IPC" = Xyes])
1463
1464AC_LANG_SAVE
1465AC_LANG_CPLUSPLUS
1466AC_MSG_CHECKING([if semctl requires semun])
1467AC_TRY_LINK([
1468#include <sys/types.h>
1469#include <sys/ipc.h>
1470#include <sys/sem.h>
1471],[
1472 int val = 0;
1473 semctl(0,0,0,val);
1474],[
1475case $target in
1476 *-sgi-irix*)
1477 AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(sgi-irix -- yes)
1478 ;;
1479 *)
1480 AC_MSG_RESULT(no)
1481 ;;
1482esac
1483],
1484AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(yes))
1485AC_LANG_RESTORE
1486AC_DEFINE(SHMTYPE, [char *], ["type to use in shared memory"])
1487
1488dnl ----------- See if Fortran works --------------
1489
1490AC_MSG_CHECKING(if fortran compiler works)
1491if test -n "$F77" -a "$F77" != no ; then
1492 /bin/rm -f ffunc.f flink.c
1493 echo " program main" > ffunc.f
1494 echo " end" >> ffunc.f
1495 if $F77 -o ffunc ffunc.f 1>&5 2>&5; then
1496 AC_MSG_RESULT(yes)
1497 else
1498 AC_MSG_RESULT(no)
1499 AC_MSG_FAILURE(fortran compiler does not work)
1500 fi
1501 /bin/rm -f ffunc ffunc.f
1502fi
1503
1504dnl ----------- Fortran symbol names --------------
1505
1506AC_MSG_CHECKING(fortran symbols)
1507if test -n "$F77" -a "$F77" != no ; then
1508 /bin/rm -f ffunc.f flink.c
1509 echo " subroutine ffunc()" > ffunc.f
1510 echo " return" >> ffunc.f
1511 echo " end" >> ffunc.f
1512 $F77 -c ffunc.f 1>/dev/null 2>/dev/null
1513 echo "main(){ FF(); return 0; }" > flink.c
1514 if $CC -o flink -DFF=ffunc flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1515 AC_MSG_RESULT(same as C)
1516 F77_SYMBOLS=symbol
1517 elif $CC -o flink -DFF=ffunc_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1518 AC_MSG_RESULT(lowercase with underscore)
1519 F77_SYMBOLS=symbol_
1520 elif $CC -o flink -DFF=FFUNC flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1521 AC_MSG_RESULT(uppercase)
1522 F77_SYMBOLS=SYMBOL
1523 elif $CC -o flink -DFF=FFUNC_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1524 AC_MSG_RESULT(uppercase with underscore)
1525 F77_SYMBOLS=SYMBOL_
1526 else
1527 AC_MSG_RESULT(giving up)
1528 AC_MSG_ERROR(could not determine F77 symbol names)
1529 fi
1530 /bin/rm -f ffunc.f ffunc.o flink flink.c flink.o ffunc
1531else
1532 F77_SYMBOLS=symbol_
1533 AC_MSG_RESULT(guessing lowercase with underscore)
1534fi
1535AC_SUBST(F77_SYMBOLS)
1536
1537dnl ----------- check for FORTRAN libraries --------------
1538
1539AC_LANG_SAVE
1540AC_LANG_CPLUSPLUS
1541LIBSSAV="$LIBS"
1542LIBS="$LIBSSAV $FLIBS"
1543
1544LIBBLAS=""
1545F77_DGEMM=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DAXPY`
1546AC_CHECK_FUNC($F77_DGEMM,HAVE_BLAS=yes,[
1547 AC_CHECK_LIB(essl,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lessl"],
1548 AC_CHECK_LIB(blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lblas"])
1549 )]
1550)
1551if test X$HAVE_BLAS != Xyes; then
1552 LIBSSAV2="$LIBS"
1553 LIBS="-latlas $LIBS"
1554 AC_CHECK_LIB(f77blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lf77blas -latlas"],
1555 LIBS="$LIBSSAV2")
1556fi
1557AC_SUBST(HAVE_BLAS)
1558if test X$HAVE_BLAS != Xyes; then
1559 echo "WARNING: Could not link to the BLAS library. It can be obtained at"
1560 echo "http://www.netlib.org/blas. Use --with-libdirs and/or --with-libs"
1561 echo "to specify the name of the library."
1562 AC_MSG_ERROR([BLAS is required to complete the build])
1563fi
1564
1565LIBS="$LIBSSAV $LIBBLAS $FLIBS"
1566
1567LIBLAPACK=""
1568F77_DGESVD=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DGESVD`
1569AC_CHECK_FUNC($F77_DGESVD,HAVE_LAPACK=yes,[
1570 AC_CHECK_LIB(lapack,$F77_DGESVD,[HAVE_LAPACK=yes;LIBLAPACK="-llapack"]
1571 )]
1572)
1573AC_DEFINE(HAVE_LAPACK, [$HAVE_LAPACK], ["use lapack"])
1574if test X$HAVE_LAPACK != Xyes; then
1575 echo "Could not link to the LAPACK library. It can be obtained at"
1576 echo "http://www.netlib.org/lapack. Use --with-libdirs and/or --with-libs"
1577 echo "to specify the name of the library."
1578 AC_MSG_ERROR([LAPACK is required to complete the build])
1579fi
1580
1581FLIBS="$LIBLAPACK $LIBBLAS $FLIBS"
1582AC_LANG_RESTORE
1583
1584dnl ----------- check for Scalable BLAS library --------------
1585
1586LIBSSAV="$LIBS"
1587LIBS="$LIBS $FLIBS"
1588HAVE_SCALABLE_BLAS=no
1589AC_CHECK_FUNC(sB_init,
1590 HAVE_SCALABLE_BLAS=yes,[
1591 AC_CHECK_LIB(sB_BLAS,sB_init,[
1592 HAVE_SCALABLE_BLAS=yes
1593 LIBSSAV="-lsB_BLAS $LIBSSAV"
1594 ])]
1595)
1596LIBS="$LIBSSAV"
1597if test $HAVE_SCALABLE_BLAS = yes; then
1598 AC_DEFINE(HAVE_SCALABLE_BLAS, 1, ["have scalabale blas"])
1599fi
1600
1601dnl ----------- NIAMA library checks --------------
1602
1603AC_LANG_SAVE
1604AC_LANG_CPLUSPLUS
1605AC_CHECK_PROG(NIAMACFG,niama-config,niama-config)
1606if test X$NIAMACFG != X; then
1607 LIBSSAV="$LIBS"
1608 CPPSAV="$CPPFLAGS"
1609 NIAMALIBS="`niama-config --libs` `niama-config --corbalibs`"
1610 CPPFLAGS="$CPPFLAGS `niama-config --cppflags`"
1611 LIBS="$NIAMALIBS $LIBS"
1612AC_TRY_LINK([
1613#include <niama.h>
1614],[
1615 exit(0);
1616],[
1617 AC_DEFINE(HAVE_NIAMA, 1, ["have NIAMA"])
1618],[
1619 LIBS="$LIBSSAV"
1620 CPPFLAGS="$CPPSAV"
1621]
1622)
1623fi
1624AC_LANG_RESTORE
1625
1626dnl ----------- libint library checks --------------
1627
1628AC_LANG_SAVE
1629AC_LANG_CPLUSPLUS
1630AC_CHECK_HEADERS(libint/libint.h,
1631 HAVE_LIBINT_LIBINT_H=yes
1632 AC_CHECK_LIB(int,init_libint_base,
1633 HAVE_LIBINT=yes
1634 AC_DEFINE(HAVE_LIBINT, 1, ["have libint"])
1635 AC_SUBST(HAVE_LIBINT)
1636 LIBS="-lint $LIBS"
1637 ),
1638 HAVE_LIBINT_LIBINT_H=no
1639 )
1640AC_LANG_RESTORE
1641AC_DEFINE(HAVE_LIBINT_LIBINT_H, [$HAVE_LIBINT_LIBINT_H], ["use libint.h"])
1642AM_CONDITIONAL([COND_LIBINT], [test x"$HAVE_LIBINT" = x"1"])
1643
1644dnl ----------- libr12 library checks --------------
1645
1646AC_LANG_SAVE
1647AC_LANG_CPLUSPLUS
1648AC_CHECK_HEADERS(libr12/libr12.h,
1649 HAVE_LIBR12_LIBR12_H=yes
1650 AC_CHECK_LIB(r12,init_libr12_base,
1651 HAVE_LIBR12=yes
1652 AC_DEFINE(HAVE_LIBR12, 1, ["have libr12"])
1653 AC_SUBST(HAVE_LIBR12)
1654 LIBS="-lr12 $LIBS"
1655 ),
1656 HAVE_LIBR12_LIBR12_H=no
1657 )
1658AC_LANG_RESTORE
1659AC_DEFINE(HAVE_LIBR12_LIBR12_H, [$HAVE_LIBR12_LIBR12_H], ["use libr12.h"])
1660AM_CONDITIONAL([COND_LIBR12], [test x"$HAVE_LIBR12" = x"1"])
1661
1662dnl ----------- libderiv library checks --------------
1663
1664AC_LANG_SAVE
1665AC_LANG_CPLUSPLUS
1666AC_CHECK_HEADERS(libderiv/libderiv.h,
1667 HAVE_LIBDERIV_LIBDERIV_H=yes
1668 AC_CHECK_LIB(deriv,init_libderiv_base,
1669 HAVE_LIBDERIV=yes
1670 AC_DEFINE(HAVE_LIBDERIV, 1, ["have libderiv"])
1671 AC_SUBST(HAVE_LIBDERIV)
1672 LIBS="-lderiv $LIBS"
1673 ),
1674 HAVE_LIBDERIV_LIBDERIV_H=no
1675 )
1676AC_LANG_RESTORE
1677AC_DEFINE(HAVE_LIBDERIV_LIBDERIV_H, [$HAVE_LIBDERIV_LIBDERIV_H], ["use libderiv.h"])
1678AM_CONDITIONAL([COND_LIBDERIV], [test x"$HAVE_LIBDERIV" = x"1"])
1679
1680dnl ----------- make sure we have everything for cints and mbptr12 ----------
1681
1682if test ! X$HAVE_LIBR12 = Xyes -o ! X$HAVE_LIBINT = Xyes; then
1683 EXCLUDED_DIRS="-x SRC_LIB_CHEMISTRY_QC_CINTS -x SRC_LIB_CHEMISTRY_QC_MBPTR12 $EXCLUDED_DIRS"
1684fi
1685
1686dnl --------- Template instantiation. ---------
1687
1688if test $template_instantiation = auto; then
1689AC_MSG_CHECKING(choosing template instantiation method)
1690 if test X$GXX = Xyes; then
1691 AC_MSG_RESULT("gcc (none)")
1692 else
1693 case $target in
1694 *-sgi-irix6.0*)
1695 AC_MSG_RESULT("*-sgi-irix6.0* (none)")
1696 ;;
1697 *-sgi-irix*)
1698 template_instantiation=ptused
1699 AC_MSG_RESULT("*-sgi-irix* (ptused)")
1700 ;;
1701 *-cray-unicos*)
1702 template_instantiation=craysimp
1703 AC_MSG_RESULT("*-cray-unicos* (craysimp)")
1704 ;;
1705 *-dec-osf*)
1706 template_instantiation=repodir
1707 AC_MSG_RESULT("*-dec-osf* (repodir)")
1708 ;;
1709 alpha*)
1710 template_instantiation=repodir
1711 AC_MSG_RESULT("alpha* non-GNU C++ (repodir)")
1712 ;;
1713 *-solaris*)
1714 template_instantiation=sunexpl
1715 AC_MSG_RESULT("*-solaris* (sunexpl)")
1716 ;;
1717 *)
1718 AC_MSG_RESULT("generic non GNU (none)")
1719 ;;
1720 esac
1721 fi
1722fi
1723
1724if test $template_instantiation = auto; then
1725 template_instantiation=none
1726fi
1727
1728AC_MSG_CHECKING(template instantiation flags)
1729TMPLINST=no
1730TMPLREPO=
1731TMPLINLIB=no
1732case $template_instantiation in
1733 repodir)
1734 TMPLREPO=cxx_repository
1735 TMPLINLIB=yes
1736 ;;
1737 craysimp)
1738 CXXFLAGS="$CXXFLAGS -h simple_templates"
1739 ;;
1740 gnurepo)
1741 TMPLINST=yes
1742 CXXFLAGS="$CXXFLAGS -frepo"
1743 AC_MSG_RESULT(gnurepo)
1744 ;;
1745 gnuexpl)
1746 # automatic template instantiation causes problems with libstc++-v3
1747 CXXFLAGS="$CXXFLAGS -fno-implicit-templates"
1748 EXPLICIT_TEMPLATE_INSTANTIATION=yes
1749 AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"])
1750 ;;
1751 sunexpl)
1752 CXXFLAGS="$CXXFLAGS -instances=explicit"
1753 AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"])
1754 ;;
1755 ptused)
1756 CXXFLAGS="$CXXFLAGS -ptused"
1757 ;;
1758 none)
1759 AC_MSG_RESULT(none)
1760 ;;
1761 *)
1762 AC_MSG_RESULT($template_instantiation)
1763 AC_MSG_ERROR(unknown template instantiation method)
1764esac
1765
1766AC_SUBST(TMPLINST)
1767AC_SUBST(TMPLREPO)
1768AC_SUBST(TMPLINLIB)
1769
1770dnl --------- Checks that must be done last. ---------
1771
1772AC_MSG_CHECKING([for special flags that must be set last])
1773case $target in
1774 i860-intel-puma*)
1775 LDFLAGS="$LDFLAGS -mpuma -mnoieee"
1776 AC_MSG_RESULT(paragon puma)
1777 ;;
1778 i686-intel-cougar*)
1779 LDFLAGS="$LDFLAGS -mcougar -mnoieee"
1780 AC_MSG_RESULT(teraflop cougar)
1781 ;;
1782 i860-intel-sunmos*)
1783 LDFLAGS="$LDFLAGS -msunmos -mnoieee"
1784 AC_MSG_RESULT(paragon sunmos)
1785 ;;
1786 i860-intel-osf*)
1787 LDFLAGS="$LDFLAGS -mnx -mnoieee"
1788 AC_MSG_RESULT(osf paragon)
1789 ;;
1790 *)
1791 AC_MSG_RESULT(none)
1792 ;;
1793esac
1794
1795dnl --------- Shared library configuration. ---------
1796
1797enablelibtool=yes
1798AC_ARG_ENABLE(libtool,
1799[ --disable-libtool Do not use libtool.],
1800[
1801case $enableval in
1802 yes)
1803 ;;
1804 no)
1805 enablelibtool=no
1806 ;;
1807 *)
1808 AC_MSG_ERROR([Invalid value for --(dis|en)able-libtool ($enableval)])
1809 ;;
1810esac
1811])
1812
1813if test "$enablelibtool" = yes; then
1814
1815dnl by default make only static libraries
1816AC_DISABLE_SHARED
1817AC_PROG_LIBTOOL
1818
1819OBJSUF=lo
1820LIBSUF=la
1821
1822else
1823
1824enable_shared=no
1825
1826fi
1827
1828if test "$enable_shared" = "no"; then
1829 OBJSUF=o
1830 LIBSUF=a
1831fi
1832
1833ENABLESHARED=$enable_shared
1834AC_SUBST(ENABLESHARED)
1835
1836dnl --------- CCA component configuration ---------
1837
1838have_condcca="false"
1839if test $components == "yes"; then
1840
1841 if test $HAVE_MPI == "yes" &&
1842 test $HAVE_MPIPP == "no"; then
1843 AC_MSG_ERROR([libmpi++ needed for mpi cca components])
1844 fi
1845
1846 if test -z $CCA_CHEM_CONFIG && ! test -x $CCA_CHEM_CONFIG; then
1847 AC_MSG_ERROR([cca-chem-config is required to build CCA component code])
1848 fi
1849
1850 CCA_CHEM_INCLUDE=`$CCA_CHEM_CONFIG --includedir`
1851 CCA_CHEM_LIB=`$CCA_CHEM_CONFIG --libdir`
1852 CCA_CHEM_PREFIX=`$CCA_CHEM_CONFIG --prefix`
1853 CCA_CHEM_REPO=$CCA_CHEM_PREFIX/repo
1854 AC_SUBST(CCA_CHEM_INCLUDE)
1855 AC_SUBST(CCA_CHEM_LIB)
1856 AC_SUBST(CCA_CHEM_REPO)
1857
1858 CCAFE_CONFIG=`$CCA_CHEM_CONFIG --ccafe-config`
1859 ENABLE_PYTHON="no" # no need for python checks
1860 AC_CHECK_CCA()
1861
1862 LIBS="-L$CCAFE_LIB $LIBS"
1863 CCA_CHEM_INCLUDE=-I$CCA_CHEM_INCLUDE
1864 BABEL_INCLUDE=-I$BABEL_INCLUDE
1865 CCA_SPEC_BABEL_INCLUDE=-I$CCA_SPEC_BABEL_INCLUDE
1866 CCAFE_INCLUDE="-I$CCAFE_INCLUDE -I$CCAFE_INCLUDE/dc/babel/babel-cca/server"
1867 CPPFLAGS="$CPPFLAGS $BABEL_INCLUDE $CCA_SPEC_BABEL_INCLUDE $CCA_CHEM_INCLUDE $CCAFE_INCLUDE"
1868
1869 AC_CHECK_HEADER(sidl.h,
1870 AC_DEFINE(HAVE_SIDL_HEADERS, 1, ["have sidl"]),
1871 AC_MSG_ERROR([problem with babel headers]) )
1872 AC_CHECK_HEADER(gov_cca_IOR.h,
1873 AC_DEFINE(HAVE_CCA_SPEC_BABEL_HEADERS, 1, ["have CCA spec babel headers"]),
1874 AC_MSG_ERROR([problem with cca-spec-babel headers]) )
1875 AC_CHECK_HEADER(Chemistry_QC_Model_IOR.h,
1876 AC_DEFINE(HAVE_CCA_CHEM_HEADERS, 1, ["have CCA chem headers"]),
1877 AC_MSG_ERROR([problem with cca-chem-generic headers]) )
1878
1879 have_condcca="true"
1880else
1881 EXCLUDED_DIRS="-x LIB_CCA -x SRC_LIB_CHEMISTRY_CCA -x SRC_LIB_CHEMISTRY_QC_INTCCA $EXCLUDED_DIRS"
1882fi
1883AM_CONDITIONAL(COND_CCA, [test x"$have_condcca" = x"true"])
1884
1885dnl --------- Find the list of all sc libraries. ---------
1886
1887SCLIBS=`$PERL $srcdir/bin/listlibs.pl -I$srcdir/src/lib -DLIBSUF=$LIBSUF $srcdir/src/lib`
1888AC_SUBST(SCLIBS)
1889
1890dnl --------- Define the library directory macros. ---------
1891
1892if test "$enableproduction" = "no"; then
1893# abs_srcdir is not available, only srcdir, which is insufficient
1894abs_srcdir=$(readlink -m "${srcdir}")
1895AC_DEFINE_DIR(SRC_SCLIBDIR, abs_srcdir/lib, ["source SC libdir"])
1896fi
1897AC_DEFINE_DIR(INSTALLED_SCLIBDIR, prefix/lib, ["install SC libdir"])
1898AC_DEFINE_DIR(SCDATADIR, scdatadir, ["SC data dir"])
1899
1900dnl --------- Create the stub Makefiles. ---------
1901
1902dnl $PERL $srcdir/bin/objectdir.pl $EXCLUDED_DIRS $srcdir
1903
1904### output files
1905AC_CONFIG_FILES([
1906 bin/mkf77sym.pl
1907])
1908AC_CONFIG_FILES([
1909 doc/doxygen.cfg
1910])
1911AC_CONFIG_FILES([
1912 Makefile
1913 src/lib/Makefile
1914 src/bin/mpqc/Makefile
1915])
1916AC_CONFIG_TESTDIR([src/bin/mpqc/validate])
1917AC_CONFIG_FILES([
1918 src/bin/mpqc/validate/atlocal
1919 src/bin/mpqc/validate/Makefile
1920])
1921AC_CONFIG_FILES([src/bin/mpqc/validate/molecuilder_mpqc], [chmod +x src/bin/mpqc/validate/molecuilder_mpqc])
1922
1923AC_OUTPUT
1924
1925
Note: See TracBrowser for help on using the repository browser.