4 # This macro checks for fftw header files and libraries,
5 # including the possible prefixing with s or d to determine precision.
6 # Arg 1 is the fftw header/library name to check for, without
7 # prefix or anything else (e.g. rfftw_mpi for real MPI transforms)
8 # Arg 2 is the value of $enable_float, i.e. yes/no for precision=4/8.
9 AC_DEFUN(ACX_CHECK_FFTW,
11 if test -z "$ac_fftw_firstname"; then
13 if test "$2" = "no"; then
25 # check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
26 AC_MSG_CHECKING([for $1.h])
27 AC_TRY_COMPILE([#include <$1.h>],,
35 if test -n "$fftwname"; then
36 # we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
37 AC_TRY_COMPILE([#include <$fftwname.h>],
38 [int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; ],
44 if test "$ok" != "yes"; then
45 xfftwname=${fftwcheckprefix}${fftwname}
46 AC_MSG_CHECKING([for $xfftwname.h])
47 AC_TRY_COMPILE([#include <$xfftwname.h>],,AC_MSG_RESULT(yes),
50 AC_MSG_ERROR([Cannot find any $prec precision $fftwname.h or $xfftwname.h]
51 [Do you have $prec precision FFTW installed? If you are using packages,]
52 [note that you also need fftw-devel to compile GROMACS. You can find the ]
53 [software at www.fftw.org, and detailed instructions at www.gromacs.org.]
54 [If you compiled FFTW yourself: ]
55 [Note that the default FFTW setup is double precision. Change the FFTW]
56 [configuration to single with --enable-float. If you want MPI support,]
57 [use --enable-mpi. It is a good idea to install both single & double.]
58 [If your sysadm doesn't want to install it you can do it to a location]
59 [in your home directory and provide the correct paths in the CPPFLAGS]
60 [and LDFLAGS environment variables before running configure.]
61 [That is also necessary to do if your compiler doesn't search]
62 [/usr/local/include and /usr/local/lib by default.]
63 [You can find information at www.gromacs.org, or in the INSTALL file.])
65 AC_TRY_COMPILE([#include <$xfftwname.h>],[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];],
68 usedprefix=$fftwcheckprefix
71 AC_MSG_ERROR([Cannot find any $prec precision $fftwname.h or $xfftwname.h]
72 [Do you have $prec precision FFTW installed? If you are using packages,]
73 [note that you also need fftw-devel to compile GROMACS. You can find the ]
74 [software at www.fftw.org, and detailed instructions at www.gromacs.org.]
75 [If you compiled FFTW yourself: ]
76 [Note that the default FFTW setup is double precision. Change the FFTW]
77 [configuration to single with --enable-float. If you want MPI support,]
78 [use --enable-mpi. It is a good idea to install both single & double.]
79 [If your sysadm doesn't want to install it you can do it to a location]
80 [in your home directory and provide the correct paths in the CPPFLAGS]
81 [and LDFLAGS environment variables before running configure.]
82 [That is also necessary to do if your compiler doesn't search]
83 [/usr/local/include and /usr/local/lib by default.]
84 [You can find information at www.gromacs.org, or in the INSTALL file.])])
87 AC_CHECK_LIB($fftwname,main,,AC_MSG_ERROR([Can't find a library to match the $fftwname header]))
88 ac_fftw_savedprefix=$usedprefix
89 ac_fftw_firstname=$fftwname
93 fftwname=${ac_fftw_savedprefix}$1
94 AC_MSG_CHECKING([for $fftwname.h])
96 [#include <$fftwname.h>],,AC_MSG_RESULT(yes)
97 AC_CHECK_LIB($fftwname,main,,AC_MSG_ERROR([Can't find a library to match the $fftwname header])),
100 AC_MSG_ERROR([Cant find $fftwname.h header. Make sure all your fftw prefixes match - we already use $ac_fftw_firstname.h])
109 dnl macro from the fftw distribution (http://www.fftw.org)
110 dnl like AC_SUBST, but replace XXX_variable_XXX instead of @variable@
111 dnl This macro protects VARIABLE from being diverted twice
112 dnl if this macro is called twice for it.
113 dnl AC_SUBST(VARIABLE)
114 define(ACX_SUBST_XXX,
115 [ifdef([ACX_SUBST_XXX_$1], ,
116 [define([ACX_SUBST_XXX_$1], )dnl
117 AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
123 # ACX_F77_NAME_MANGLING
124 # ---------------------
125 # This is a macro adopted from the fftw distribution (http://www.fftw.org)
126 # to determine how we should call fortran functions from C.
127 AC_DEFUN(ACX_F77_NAME_MANGLING,
129 AC_REQUIRE([AC_PROG_CC])
130 AC_REQUIRE([AC_PROG_F77])
131 AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
132 AC_MSG_CHECKING(fortran name mangling)
133 cat > mangle-func.f <<EOF
141 ac_try='$F77 -c $FFLAGS mangle-func.f 1>&AC_FD_CC'
142 if AC_TRY_EVAL(ac_try); then
145 echo "configure: failed program was:" >&AC_FD_CC
146 cat mangle-func.f >&AC_FD_CC
148 AC_MSG_ERROR(failed to compile fortran test program)
151 ac_f77_mangle_type=unknown
155 LIBS="mangle-func.o $FLIBS $LIBS"
156 AC_TRY_LINK(,foobar();,
157 ac_f77_mangle_type=lowercase,
158 AC_TRY_LINK(,foobar_();,
159 ac_f77_mangle_type=lowercase-underscore,
160 AC_TRY_LINK(,FOOBAR();,
161 ac_f77_mangle_type=uppercase,
162 AC_TRY_LINK(,FOOBAR_();,
163 ac_f77_mangle_type=uppercase-underscore))))
166 AC_MSG_RESULT($ac_f77_mangle_type)
169 case $ac_f77_mangle_type in
171 AC_DEFINE(F77_NAME_LOWERCASE,,[call f77 with lowercase, no underscore])
174 lowercase-underscore)
175 AC_DEFINE(F77_NAME_LOWERCASE_UNDERSCORE,,[call f77 with lowercase and underscore])
179 AC_DEFINE(F77_NAME_UPPERCASE,,[call f77 with uppercase, no underscore])
182 uppercase-underscore)
183 AC_DEFINE(F77_NAME_UPPERCASE_UNDERSCORE,,[call f77 with uppercase and underscore])
188 AC_MSG_CHECKING(whether f77 functions with underscore get an extra underscore)
193 LIBS="mangle-func.o $FLIBS $LIBS"
194 AC_TRY_LINK(,$mangle_try();,
195 [ac_f77_mangle_underscore=yes;
196 AC_DEFINE(F77_NAME_EXTRA_UNDERSCORE,,[Append extra underscore to already underscored names])],
197 [ac_f77_mangle_underscore=no])
201 AC_MSG_RESULT($ac_f77_mangle_underscore)
210 dnl AC_FIND_MOTIF : find OSF/Motif or LessTif, and provide variables
211 dnl to easily use them in a Makefile.
213 dnl Adapted from a macro by Andreas Zeller.
215 dnl The variables provided are :
216 dnl link_motif (e.g. -L/usr/lesstif/lib -lXm -lXt)
217 dnl include_motif (e.g. -I/usr/lesstif/lib)
218 dnl motif_libraries (e.g. /usr/lesstif/lib)
219 dnl motif_includes (e.g. /usr/lesstif/include)
221 dnl The link_motif and include_motif variables should be fit to put on
222 dnl your application's link line in your Makefile.
224 AC_DEFUN(AC_FIND_MOTIF,
226 AC_REQUIRE([AC_PATH_XTRA])
231 dnl AC_ARG_WITH(motif,
232 dnl [ --without-motif do not use Motif widgets])
233 dnl Treat --without-motif like
234 dnl --without-motif-includes --without-motif-libraries.
236 if test "$no_x" = "yes"
242 AC_ARG_WITH(motif-includes,
243 [ --with-motif-includes=DIR Motif include files are in DIR],
244 motif_includes="$withval")
246 AC_ARG_WITH(motif-libraries,
247 [ --with-motif-libraries=DIR Motif libraries are in DIR],
248 motif_libraries="$withval")
250 AC_MSG_CHECKING(for Motif)
255 # Search the include files.
257 if test "$motif_includes" = ""; then
258 AC_CACHE_VAL(ac_cv_motif_includes,
260 ac_motif_save_LIBS="$LIBS"
261 ac_motif_save_INCLUDES="$INCLUDES"
262 ac_motif_save_CPPFLAGS="$CPPFLAGS"
263 ac_motif_save_LDFLAGS="$LDFLAGS"
265 LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS"
266 INCLUDES="$X_CFLAGS $INCLUDES"
267 CPPFLAGS="$X_CFLAGS $CPPFLAGS"
268 LDFLAGS="$X_LIBS $LDFLAGS"
270 ac_cv_motif_includes="none"
271 AC_TRY_COMPILE([#include <Xm/Xm.h>],[int a;],
273 # Xm/Xm.h is in the standard search path.
274 ac_cv_motif_includes=
277 # Xm/Xm.h is not in the standard search path.
278 # Locate it and put its directory in `motif_includes'
280 # /usr/include/Motif* are used on HP-UX (Motif).
281 # /usr/include/X11* are used on HP-UX (X and Athena).
282 # /usr/dt is used on Solaris (Motif).
283 # /usr/openwin is used on Solaris (X and Athena).
284 # Other directories are just guesses.
285 for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \
286 /usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \
287 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \
288 /usr/dt/include /usr/openwin/include \
289 /usr/dt/*/include /opt/*/include /usr/include/Motif* \
290 "${prefix}"/*/include /usr/*/include /usr/local/*/include \
291 "${prefix}"/include/* /usr/include/* /usr/local/include/*; do
292 if test -f "$dir/Xm/Xm.h"; then
293 ac_cv_motif_includes="$dir"
299 LIBS="$ac_motif_save_LIBS"
300 INCLUDES="$ac_motif_save_INCLUDES"
301 CPPFLAGS="$ac_motif_save_CPPFLAGS"
302 LDFLAGS="$ac_motif_save_LDFLAGS"
304 motif_includes="$ac_cv_motif_includes"
308 # Now for the libraries.
310 if test "$motif_libraries" = ""; then
311 AC_CACHE_VAL(ac_cv_motif_libraries,
313 ac_motif_save_LIBS="$LIBS"
314 ac_motif_save_INCLUDES="$INCLUDES"
315 ac_motif_save_CPPFLAGS="$CPPFLAGS"
316 ac_motif_save_LDFLAGS="$LDFLAGS"
318 LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS"
319 INCLUDES="$X_CFLAGS $INCLUDES"
320 CPPFLAGS="$X_CFLAGS $CPPFLAGS"
321 LDFLAGS="$X_LIBS $LDFLAGS"
323 ac_cv_motif_libraries="none"
324 AC_TRY_LINK([#include <Xm/Xm.h>],[XtToolkitInitialize();],
326 # libXm.a is in the standard search path.
327 ac_cv_motif_libraries=
330 # libXm.a is not in the standard search path.
331 # Locate it and put its directory in `motif_libraries'
333 # /usr/lib/Motif* are used on HP-UX (Motif).
334 # /usr/lib/X11* are used on HP-UX (X and Athena).
335 # /usr/dt is used on Solaris (Motif).
336 # /usr/lesstif is used on Linux (Lesstif).
337 # /usr/openwin is used on Solaris (X and Athena).
338 # Other directories are just guesses.
339 for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \
340 /usr/lib/Motif2.0 /usr/lib/Motif1.2 /usr/lib/Motif1.1 \
341 /usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 \
342 /usr/dt/lib /usr/openwin/lib \
343 /usr/dt/*/lib /opt/*/lib /usr/lib/Motif* \
344 /usr/lesstif*/lib /usr/lib/Lesstif* \
345 "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \
346 "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do
347 if test -d "$dir" && test "`ls $dir/libXm.* 2> /dev/null`" != ""; then
348 ac_cv_motif_libraries="$dir"
354 LIBS="$ac_motif_save_LIBS"
355 INCLUDES="$ac_motif_save_INCLUDES"
356 CPPFLAGS="$ac_motif_save_CPPFLAGS"
357 LDFLAGS="$ac_motif_save_LDFLAGS"
360 motif_libraries="$ac_cv_motif_libraries"
363 # Provide an easier way to link
365 if test "$motif_includes" = "none" -o "$motif_libraries" = "none"; then
371 if test "$with_motif" != "no"; then
372 if test "$motif_libraries" = ""; then
373 link_motif="-lXm -lXt"
374 MOTIF_LIBS="-lXm -lXt"
376 link_motif="-L$motif_libraries -lXm -lXt"
377 MOTIF_LIBS="-L$motif_libraries -lXm -lXt"
379 if test "$motif_includes" != ""; then
380 include_motif="-I$motif_includes"
381 MOTIF_INCLUDES="-I$motif_includes"
383 LIBS="$LIBS $MOTIF_LIBS"
384 INCLUDES="$INCLUDES $MOTIF_INCLUDES"
385 AC_DEFINE(HAVE_MOTIF,,[Use motif/lesstif libraries])
393 motif_libraries_result="$motif_libraries"
394 motif_includes_result="$motif_includes"
395 test "$motif_libraries_result" = "" && motif_libraries_result="in default path"
396 test "$motif_includes_result" = "" && motif_includes_result="in default path"
397 test "$motif_libraries_result" = "none" && motif_libraries_result="(none)"
398 test "$motif_includes_result" = "none" && motif_includes_result="(none)"
400 [libraries $motif_libraries_result, headers $motif_includes_result])
404 dnl macro modified from the fftw distribution (www.fftw.org)
405 AC_DEFUN(ACX_CHECK_CC_FLAGS,
407 AC_REQUIRE([AC_PROG_CC])
408 AC_CACHE_CHECK(whether $CC accepts $1, ac_$2,
409 [echo 'void f(){}' > conftest.c
410 if test -z "`$CC $1 -c conftest.c 2>&1`"; then
417 if test "$ac_$2" = yes; then
426 dnl macro modified from the fftw distribution (www.fftw.org)
427 AC_DEFUN(ACX_CHECK_F77_FLAGS,
429 AC_REQUIRE([AC_PROG_F77])
430 AC_CACHE_CHECK(whether $F77 accepts $1, ac_$2,
431 [cat > conftest.f << EOF
436 if test -z "`$F77 $1 -c conftest.f `"; then
443 if test "$ac_$2" = yes; then
454 # ---------------------------
455 # Macro to extend the exact CPU for some hosts
456 AC_DEFUN(ACX_DETECT_GMXCPU,
458 AC_REQUIRE([AC_CANONICAL_HOST])
461 # Determine the exact cpu type on some common systems where it is
462 # not visible from the host triplet.
463 # (on e.g. intel and dec/tru64 the host type is enough)
465 case "${host_cpu}-${host_os}" in
468 # we need to fool the combination of m4, sh and awk - thus the seemingly unnecessary n
469 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ n=1; print $n }'`
470 if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER4 >/dev/null 2>&1; then
472 elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER3 >/dev/null 2>&1; then
474 elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER2 >/dev/null 2>&1; then
482 if /usr/sbin/lscfg -vp | grep PowerPC | grep 604 >/dev/null 2>&1; then
484 elif /usr/sbin/lscfg -vp | grep PowerPC | grep 603 >/dev/null 2>&1; then
486 elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64a >/dev/null 2>&1; then
488 elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64b >/dev/null 2>&1; then
490 elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64c >/dev/null 2>&1; then
498 if /sbin/hinv | grep CPU | grep R12000 >/dev/null 2>&1; then
500 elif /sbin/hinv | grep CPU | grep R10000 >/dev/null 2>&1; then
502 elif /sbin/hinv | grep CPU | grep R8000 >/dev/null 2>&1; then
504 elif /sbin/hinv | grep CPU | grep R5000 >/dev/null 2>&1; then
512 if /usr/sbin/prtconf | grep UltraSPARC-III >/dev/null 2>&1; then
514 elif /usr/sbin/prtconf | grep UltraSPARC-IIi >/dev/null 2>&1; then
516 elif /usr/sbin/prtconf | grep UltraSPARC-II >/dev/null 2>&1; then
518 elif /usr/sbin/prtconf | grep UltraSPARC >/dev/null 2>&1; then
533 ###############################################################
534 # Macro modified from the fftw distribution (www.fftw.org)
535 # to determine optimization flags.
536 # Note that we have modified config.guess and config.sub
537 # to provide extended information on the detailed type of CPU.
538 # In general we assume you have recent versions of the compilers
539 # that support the highest optimization we know of. If not, you
540 # can always override these flags, but it's better to upgrade :-)
541 ###############################################################
542 AC_DEFUN(ACX_COMPILER_MAXOPT,
544 AC_REQUIRE([AC_PROG_CC])
545 AC_REQUIRE([AC_PROG_F77])
546 AC_REQUIRE([AC_CANONICAL_HOST])
548 # Try to determine "good" native compiler flags if none specified on command
549 # line. To avoid repeating the entire procedure for fortran flags, we first
550 # determine our suggested choices for both C and fortran, and then possibly
551 # override them with user choices.
555 case "${host_cpu}-${host_os}" in
560 xCFLAGS="-fast -xO5 -xtarget=ultra3 -fsimple=2 -fnonstd -dalign"
564 xCFLAGS="-fast -xO5 -xtarget=ultra2i -fsimple=2 -fnonstd -dalign"
568 xCFLAGS="-fast -xO5 -xtarget=ultra2 -fsimple=2 -fnonstd -dalign"
572 xCFLAGS="-fast -xO5 -xtarget=ultra -fsimple=2 -fnonstd -dalign"
576 xCFLAGS="-native -fast -xO5 -fsimple=2 -fnonstd -dalign"
583 xCFLAGS="-Ae +O3 +Oall"
585 # If you haven't noticed, we don't like hp very much...
586 # but perhaps that will change if they make something nice out of ia64.
590 # dont use inter-procedure analysis for the innerloops - they take
591 # forever to compile with it, and it doesnt help at all.
594 xCFLAGS="-O3 -qarch=pwr4 -qtune=pwr4 -qlanglvl=ansi -qmaxmem=16384"
595 xFFLAGS="-O3 -Q -qarch=pwr4 -qtune=pwr4 -qmaxmem=16384 -qhot -qnoipa"
598 xCFLAGS="-O3 -qarch=pwr3 -qtune=pwr3 -qlanglvl=ansi -qmaxmem=16384"
599 xFFLAGS="-O3 -Q -qarch=pwr3 -qtune=pwr3 -qmaxmem=16384 -qhot -qnoipa"
602 xCFLAGS="-O3 -qarch=pwr2 -qtune=pwr2 -qlanglvl=ansi -qmaxmem=16384"
603 xFFLAGS="-O3 -Q -qarch=pwr2 -qtune=pwr2 -qmaxmem=16384 -qhot -qnoipa"
606 xCFLAGS="-O3 -qarch=pwr -qtune=pwr -qlanglvl=ansi -qmaxmem=16384"
607 xFFLAGS="-O3 -Q -qarch=pwr -qtune=pwr -qmaxmem=16384 -qhot -qnoipa"
610 # I don't think people are using anything older than power2, so we tune for
611 # pwr, but dont set the arch since it is nice to have common binaries
612 # that run also on powerpc.
613 xCFLAGS="-O3 -qlanglvl=ansi -qtune=pwr -qmaxmem=16384"
614 xFFLAGS="-O3 -Q -qtune=pwr -qmaxmem=16384 -qhot"
622 xCFLAGS="-O3 -qarch=604 -qtune=604 -qlanglvl=ansi -qmaxmem=16384"
623 xFFLAGS="-O3 -Q -qarch=604 -qtune=604 -qmaxmem=16384 -qhot"
626 xCFLAGS="-O3 -qarch=603 -qtune=603 -qlanglvl=ansi -qmaxmem=16384"
627 xFFLAGS="-O3 -Q -qarch=603 -qtune=603 -qmaxmem=16384 -qhot"
630 xCFLAGS="-O3 -qarch=rs64a -qtune=rs64a -qlanglvl=ansi -qmaxmem=16384"
631 xFFLAGS="-O3 -Q -qarch=rs64a -qtune=rs64a -qmaxmem=16384 -qhot"
634 xCFLAGS="-O3 -qarch=rs64b -qtune=rs64b -qlanglvl=ansi -qmaxmem=16384"
635 xFFLAGS="-O3 -Q -qarch=rs64b -qtune=rs64b -qmaxmem=16384 -qhot"
638 xCFLAGS="-O3 -qarch=rs64c -qtune=rs64c -qlanglvl=ansi -qmaxmem=16384"
639 xFFLAGS="-O3 -Q -qarch=rs64c -qtune=rs64c -qmaxmem=16384 -qhot"
642 xCFLAGS="-O3 -qlanglvl=ansi -qmaxmem=16384"
643 xFFLAGS="-O3 -Q -qmaxmem=16384 -qhot"
649 xCFLAGS="-O3 -OPT:IEEE_arithmetic=3 -OPT:rsqrt=ON -SWP:loop_overhead -INLINE:=ON -LNO:opt=1 -LNO:ou_further=3 -OPT:Olimit=0:roundoff=3:alias=typed -woff 1174 -D__INLINE_INTRINSICS"
650 xFFLAGS="-O3 -OPT:IEEE_arithmetic=3 -OPT:rsqrt=ON -SWP:loop_overhead -INLINE:=ON -LNO:opt=1 -LNO:ou_further=3 -OPT:Olimit=0:roundoff=3:alias=typed -OPT:cray_ivdep=TRUE"
652 if $CC -version | grep "Version 7.1" > /dev/null 2>&1; then
653 xCFLAGS="$xCFLAGS -GCM:aggressive_speculation -GCM:array_speculation"
654 xFFLAGS="$xFFLAGS -GCM:aggressive_speculation -GCM:array_speculation"
657 if $CC -version | grep "Version 7.3" > /dev/null 2>&1; then
658 xCFLAGS="$xCFLAGS -SWP:heur=fdms,nhms,fdnms"
659 xFFLAGS="$xFFLAGS -SWP:heur=fdms,nhms,fdnms"
661 LDFLAGS="$LDFLAGS -woff 84"
665 xCFLAGS="-n32 -r12000 -mips4 $xCFLAGS"
666 xFFLAGS="-n32 -r12000 -mips4 $xFFLAGS"
667 xLDFLAGS="-n32 -r12000 -mips4"
670 xCFLAGS="-n32 -r10000 -mips4 $xCFLAGS"
671 xFFLAGS="-n32 -r10000 -mips4 $xFFLAGS"
672 xLDFLAGS="-n32 -r10000 -mips4"
675 xCFLAGS="-n32 -r8000 -mips4 $xCFLAGS"
676 xFFLAGS="-n32 -r8000 -mips4 $xFFLAGS"
677 xLDFLAGS="-n32 -r8000 -mips4"
680 xCFLAGS="-n32 -r5000 -mips4 $xCFLAGS"
681 xFFLAGS="-n32 -r5000 -mips4 $xFFLAGS"
682 xLDFLAGS="-n32 -r5000 -mips4"
685 xCFLAGS="-n32 $xCFLAGS"
686 xFFLAGS="-n32 $xFFLAGS"
693 # NB: -arch implies -tune according to the cc manual.
694 # We dont use -ifo since it conflicts with dependency
695 # generation on old versions of the compiler.
696 case "${host_cpu}" in
698 # extract the processor from cpu type (e.g. alphaev56 -> ev56)
699 evtype=`echo ${host_cpu} | sed 's/alpha//'`
700 xCFLAGS="-std1 -fast -O4 -no_ifo -arch $evtype -unroll 2 -fp_reorder"
701 xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
705 xCFLAGS="-std1 -fast -O4 -no_ifo -arch host -unroll 2 -fp_reorder"
706 xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
713 case "${host_cpu}" in
715 # extract the processor from cpu type (e.g. alphaev56 -> ev56)
716 evtype=`echo ${host_cpu} | sed 's/alpha//'`
717 tmpCFLAGS="-std1 -fast -O4 -no_ifo -arch $evtype -unroll 2 -fp_reorder"
718 tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
722 tmpCFLAGS="-std1 -fast -O4 -no_ifo -arch host -unroll 2 -fp_reorder"
723 tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
727 if $CC -V 2> /dev/null | grep Compaq > /dev/null 2>&1; then
731 if test "$enable_fortran" = "yes"; then
732 if $F77 -V 2> /dev/null | grep Compaq > /dev/null 2>&1; then
739 # most of these systems (e.g. linux, FreeBSD) use gcc which is treated
740 # further down, but we can at least check if the Portland compilers are used:
741 if $CC -V 2> /dev/null | grep Portland > /dev/null 2>&1; then
742 case "${host_cpu}" in
750 xCFLAGS="$pgiopt -fast -pc 32"
752 if test "$enable_fortran" = "yes"; then
753 if $F77 -V 2> /dev/null | grep Portland > /dev/null 2>&1; then
759 # Phew, end of all those operating systems and processors!
761 # use default flags for gcc/g77 on all systems
762 if test $ac_cv_prog_gcc = yes; then
763 xCFLAGS="-O6 -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
764 # -malign-double for x86 systems
765 ACX_CHECK_CC_FLAGS(-malign-double,align_double,xCFLAGS="$xCFLAGS -malign-double")
768 if test $enable_fortran = yes; then
769 if test $ac_cv_prog_g77 = yes; then
770 xFFLAGS="-O3 -ffast-math -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
771 # -malign-double for f77 on x86 systems - haven't checked that this works yet.
772 #ACX_CHECK_F77_FLAGS(-malign-double,align_double,xFFLAGS="$xFFLAGS -malign-double")
778 if test "$GCC" = "yes"; then
779 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
780 # try to guess correct CPU flags, at least for linux
781 case "${host_cpu}" in
782 # i586/i686 cpu flags don't improve speed, thus no need to use them.
783 # don't check f77 separately - we assume f77 and gcc are similar
786 cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
787 is60x=`echo $cputype | egrep "^60[0-9]e?$"`
788 if test -n "$is60x"; then
789 ACX_CHECK_CC_FLAGS(-mcpu=$cputype,m_cpu_60x,CPU_FLAGS=-mcpu=$cputype)
790 elif test "$cputype" = 750; then
791 ACX_CHECK_CC_FLAGS(-mcpu=750,m_cpu_750,CPU_FLAGS=-mcpu=750)
793 if test -z "$CPU_FLAGS"; then
794 ACX_CHECK_CC_FLAGS(-mcpu=powerpc,m_cpu_powerpc,CPU_FLAGS=-mcpu=powerpc)
796 if test -z "$CPU_FLAGS"; then
797 ACX_CHECK_CC_FLAGS(-mpowerpc,m_powerpc,CPU_FLAGS=-mpowerpc)
801 AM_CONDITIONAL(GNU_CC,false)
804 if test -n "$CPU_FLAGS"; then
805 xCFLAGS="$xCFLAGS $CPU_FLAGS"
806 xFFLAGS="$xFFLAGS $CPU_FLAGS"
809 # Now check if the user provided anything special for C or fortran...
810 # Not nice to have checked everything then, but otherwise we would have
811 # to use entirely separate checks for C and fortran flags, doubling the code.
812 if test "$ac_test_CFLAGS" != "set"; then
814 # Use the extra link optimization flags on e.g. irix only when
815 # we are using our own C compiler flags
816 LDFLAGS="$LDFLAGS $xLDFLAGS"
818 if test -z "$CFLAGS"; then
819 echo "*******************************************************************"
820 echo "* WARNING: No special optimization settings found for the C *"
821 echo "* compiler. Use make CFLAGS=..., or edit the top level Makefile. *"
822 echo "* Reverting to the default setting CFLAGS=-O3. (mail us about it!)*"
823 echo "*******************************************************************"
826 ACX_CHECK_CC_FLAGS(${CFLAGS}, guessed_cflags, , [
827 echo "*******************************************************************"
828 echo "* Sorry, these optimization settings don't seem to work for *"
829 echo "* your C compiler. Use make CFLAGS=..., or edit the top Makefile. *"
830 echo "*******************************************************************"
834 echo "******************************************"
835 echo "* Using CFLAGS from environment variable *"
836 echo "******************************************"
839 if test "$enable_fortran" = "yes"; then
840 if test "$ac_test_FFLAGS" != "set"; then
842 if test -z "$FFLAGS"; then
843 echo "*******************************************************************"
844 echo "* WARNING: No special optimization settings found for the fortran *"
845 echo "* compiler. Use make FFLAGS=..., or edit the top level Makefile. *"
846 echo "* Reverting to the default setting FFLAGS=-O3. (mail us about it!)*"
847 echo "*******************************************************************"
850 ACX_CHECK_F77_FLAGS(${FFLAGS}, guessed_fflags, , [
851 echo "*******************************************************************"
852 echo "* Sorry, these optimization settings don't seem to work for *"
853 echo "* your f77 compiler. Use make FFLAGS=.., or edit the top Makefile.*"
854 echo "*******************************************************************"
858 echo "******************************************"
859 echo "* Using FFLAGS from environment variable *"
860 echo "******************************************"
871 ## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
872 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
873 ## Free Software Foundation, Inc.
874 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
876 ## This program is free software; you can redistribute it and/or modify
877 ## it under the terms of the GNU General Public License as published by
878 ## the Free Software Foundation; either version 2 of the License, or
879 ## (at your option) any later version.
881 ## This program is distributed in the hope that it will be useful, but
882 ## WITHOUT ANY WARRANTY; without even the implied warranty of
883 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
884 ## General Public License for more details.
886 ## You should have received a copy of the GNU General Public License
887 ## along with this program; if not, write to the Free Software
888 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
890 ## As a special exception to the GNU General Public License, if you
891 ## distribute this file as part of a program that contains a
892 ## configuration script generated by Autoconf, you may include it under
893 ## the same distribution terms that you use for the rest of that program.
895 # serial 46 AC_PROG_LIBTOOL
896 AC_DEFUN([AC_PROG_LIBTOOL],
897 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
898 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
899 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
900 AC_PROVIDE_IFELSE([AC_PROG_CXX],
902 [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
904 AC_PROVIDE_IFELSE([AC_PROG_F77],
906 [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
909 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
910 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
911 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
912 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
914 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
916 [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
918 [ifdef([AC_PROG_GCJ],
919 [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
921 ifdef([A][M_PROG_GCJ],
922 [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
924 ifdef([LT_AC_PROG_GCJ],
925 [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
928 AC_DEFUN([_AC_PROG_LIBTOOL],
929 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
930 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
931 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
933 # Save cache, so that ltconfig can load it
936 # Actually configure libtool. ac_aux_dir is where install-sh is found.
937 AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
938 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
939 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
940 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
941 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
942 deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
943 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
944 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
945 || AC_MSG_ERROR([libtool configure failed])
947 # Reload cache, that may have been modified by ltconfig
950 # This can be used to rebuild libtool when needed
951 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
953 # Always use our own libtool.
954 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
957 # Redirect the config.log output again, so that the ltconfig log is not
958 # clobbered by the next message.
962 AC_DEFUN([AC_LIBTOOL_SETUP],
964 AC_REQUIRE([AC_ENABLE_SHARED])dnl
965 AC_REQUIRE([AC_ENABLE_STATIC])dnl
966 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
967 AC_REQUIRE([AC_CANONICAL_HOST])dnl
968 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
969 AC_REQUIRE([AC_PROG_CC])dnl
970 AC_REQUIRE([AC_PROG_LD])dnl
971 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
972 AC_REQUIRE([AC_PROG_NM])dnl
973 AC_REQUIRE([AC_PROG_LN_S])dnl
974 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
975 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
976 AC_REQUIRE([AC_OBJEXT])dnl
977 AC_REQUIRE([AC_EXEEXT])dnl
980 # Only perform the check for file, if the check method requires it
981 case $deplibs_check_method in
983 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
989 AC_CHECK_TOOL(RANLIB, ranlib, :)
990 AC_CHECK_TOOL(STRIP, strip, :)
992 # Check for any special flags to pass to ltconfig.
993 libtool_flags="--cache-file=$cache_file"
994 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
995 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
996 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
997 test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
998 test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
999 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1000 [libtool_flags="$libtool_flags --enable-dlopen"])
1001 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1002 [libtool_flags="$libtool_flags --enable-win32-dll"])
1003 AC_ARG_ENABLE(libtool-lock,
1004 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1005 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1006 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1009 [ --with-pic try to use only PIC/non-PIC [default=both]],
1010 pic_mode="$withval", pic_mode=default)
1011 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
1012 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
1014 # Some flags need to be propagated to the compiler or linker for good
1018 # Find out which ABI we are using.
1019 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1020 if AC_TRY_EVAL(ac_compile); then
1021 case `/usr/bin/file conftest.$ac_objext` in
1037 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1038 SAVE_CFLAGS="$CFLAGS"
1039 CFLAGS="$CFLAGS -belf"
1040 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1043 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1045 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1046 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1047 CFLAGS="$SAVE_CFLAGS"
1051 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1052 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1053 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1054 AC_CHECK_TOOL(AS, as, false)
1055 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1057 # recent cygwin and mingw systems supply a stub DllMain which the user
1058 # can override, but on older systems we have to supply one
1059 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1061 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1062 DllMain (0, 0, 0);],
1063 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1066 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1067 # old mingw systems require "-dll" to link a DLL, while more recent ones
1069 SAVE_CFLAGS="$CFLAGS"
1070 CFLAGS="$CFLAGS -mdll"
1071 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1072 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1073 CFLAGS="$SAVE_CFLAGS" ;;
1074 *-*-cygwin* | *-*-pw32*)
1075 # cygwin systems need to pass --dll to the linker, and not link
1076 # crt.o which will require a WinMain@16 definition.
1077 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1084 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1085 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1087 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1088 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1090 # AC_ENABLE_SHARED - implement the --enable-shared flag
1091 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1092 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1094 AC_DEFUN([AC_ENABLE_SHARED],
1095 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1096 AC_ARG_ENABLE(shared,
1097 changequote(<<, >>)dnl
1098 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1099 changequote([, ])dnl
1100 [p=${PACKAGE-default}
1102 yes) enable_shared=yes ;;
1103 no) enable_shared=no ;;
1106 # Look at the argument we got. We use all the common list separators.
1107 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1108 for pkg in $enableval; do
1109 if test "X$pkg" = "X$p"; then
1116 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1119 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1120 AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1121 AC_ENABLE_SHARED(no)])
1123 # AC_ENABLE_STATIC - implement the --enable-static flag
1124 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1125 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1127 AC_DEFUN([AC_ENABLE_STATIC],
1128 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1129 AC_ARG_ENABLE(static,
1130 changequote(<<, >>)dnl
1131 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1132 changequote([, ])dnl
1133 [p=${PACKAGE-default}
1135 yes) enable_static=yes ;;
1136 no) enable_static=no ;;
1139 # Look at the argument we got. We use all the common list separators.
1140 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1141 for pkg in $enableval; do
1142 if test "X$pkg" = "X$p"; then
1149 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1152 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1153 AC_DEFUN([AC_DISABLE_STATIC],
1154 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1155 AC_ENABLE_STATIC(no)])
1158 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1159 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1160 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1162 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
1163 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1164 AC_ARG_ENABLE(fast-install,
1165 changequote(<<, >>)dnl
1166 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1167 changequote([, ])dnl
1168 [p=${PACKAGE-default}
1170 yes) enable_fast_install=yes ;;
1171 no) enable_fast_install=no ;;
1173 enable_fast_install=no
1174 # Look at the argument we got. We use all the common list separators.
1175 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1176 for pkg in $enableval; do
1177 if test "X$pkg" = "X$p"; then
1178 enable_fast_install=yes
1184 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1187 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
1188 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
1189 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1190 AC_ENABLE_FAST_INSTALL(no)])
1192 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
1193 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
1194 # Where MODE is either `yes' or `no'. If omitted, it defaults to
1196 AC_DEFUN([AC_LIBTOOL_PICMODE],
1197 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1198 pic_mode=ifelse($#,1,$1,default)])
1201 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
1202 AC_DEFUN([AC_PATH_TOOL_PREFIX],
1203 [AC_MSG_CHECKING([for $1])
1204 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
1207 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
1210 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
1213 ac_save_MAGIC_CMD="$MAGIC_CMD"
1214 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1215 dnl $ac_dummy forces splitting on constant user-supplied paths.
1216 dnl POSIX.2 word splitting is done only on the output of word expansions,
1217 dnl not every word. This closes a longstanding sh security hole.
1218 ac_dummy="ifelse([$2], , $PATH, [$2])"
1219 for ac_dir in $ac_dummy; do
1220 test -z "$ac_dir" && ac_dir=.
1221 if test -f $ac_dir/$1; then
1222 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
1223 if test -n "$file_magic_test_file"; then
1224 case $deplibs_check_method in
1226 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
1227 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
1228 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
1229 egrep "$file_magic_regex" > /dev/null; then
1234 *** Warning: the command libtool uses to detect shared libraries,
1235 *** $file_magic_cmd, produces output that libtool cannot recognize.
1236 *** The result is that libtool may fail to recognize shared libraries
1237 *** as such. This will affect the creation of libtool libraries that
1238 *** depend on shared libraries, but programs linked with such libtool
1239 *** libraries will work regardless of this problem. Nevertheless, you
1240 *** may want to report the problem to your system manager and/or to
1241 *** bug-libtool@gnu.org
1251 MAGIC_CMD="$ac_save_MAGIC_CMD"
1254 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
1255 if test -n "$MAGIC_CMD"; then
1256 AC_MSG_RESULT($MAGIC_CMD)
1263 # AC_PATH_MAGIC - find a file program which can recognise a shared library
1264 AC_DEFUN([AC_PATH_MAGIC],
1265 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
1266 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
1267 if test -z "$lt_cv_path_MAGIC_CMD"; then
1268 if test -n "$ac_tool_prefix"; then
1269 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
1277 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1278 AC_DEFUN([AC_PROG_LD],
1279 [AC_ARG_WITH(gnu-ld,
1280 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1281 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1282 AC_REQUIRE([AC_PROG_CC])dnl
1283 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1284 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1286 if test "$GCC" = yes; then
1287 # Check if gcc -print-prog-name=ld gives a path.
1288 AC_MSG_CHECKING([for ld used by GCC])
1291 # gcc leaves a trailing carriage return which upsets mingw
1292 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1294 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1297 # Accept absolute paths.
1298 [[\\/]* | [A-Za-z]:[\\/]*)]
1299 re_direlt=['/[^/][^/]*/\.\./']
1300 # Canonicalize the path of ld
1301 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1302 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1303 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1305 test -z "$LD" && LD="$ac_prog"
1308 # If it fails, then pretend we aren't using GCC.
1312 # If it is relative, then search for the first ld in PATH.
1316 elif test "$with_gnu_ld" = yes; then
1317 AC_MSG_CHECKING([for GNU ld])
1319 AC_MSG_CHECKING([for non-GNU ld])
1321 AC_CACHE_VAL(lt_cv_path_LD,
1322 [if test -z "$LD"; then
1323 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1324 for ac_dir in $PATH; do
1325 test -z "$ac_dir" && ac_dir=.
1326 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1327 lt_cv_path_LD="$ac_dir/$ac_prog"
1328 # Check to see if the program is GNU ld. I'd rather use --version,
1329 # but apparently some GNU ld's only accept -v.
1330 # Break only if it was the GNU/non-GNU ld that we prefer.
1331 if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1332 test "$with_gnu_ld" != no && break
1334 test "$with_gnu_ld" != yes && break
1340 lt_cv_path_LD="$LD" # Let the user override the test with a path.
1343 if test -n "$LD"; then
1348 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1352 AC_DEFUN([AC_PROG_LD_GNU],
1353 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
1354 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1355 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1356 lt_cv_prog_gnu_ld=yes
1358 lt_cv_prog_gnu_ld=no
1360 with_gnu_ld=$lt_cv_prog_gnu_ld
1363 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
1364 # -- PORTME Some linkers may need a different reload flag.
1365 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
1366 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
1367 [lt_cv_ld_reload_flag='-r'])
1368 reload_flag=$lt_cv_ld_reload_flag
1369 test -n "$reload_flag" && reload_flag=" $reload_flag"
1372 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
1373 # -- PORTME fill in with the dynamic library characteristics
1374 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
1375 [AC_CACHE_CHECK([how to recognise dependant libraries],
1376 lt_cv_deplibs_check_method,
1377 [lt_cv_file_magic_cmd='$MAGIC_CMD'
1378 lt_cv_file_magic_test_file=
1379 lt_cv_deplibs_check_method='unknown'
1380 # Need to set the preceding variable on all platforms that support
1381 # interlibrary dependencies.
1382 # 'none' -- dependencies not supported.
1383 # `unknown' -- same as none, but documents that we really don't know.
1384 # 'pass_all' -- all dependencies passed with no checks.
1385 # 'test_compile' -- check by making test program.
1386 # 'file_magic [regex]' -- check by looking for files in library path
1387 # which responds to the $file_magic_cmd with a given egrep regex.
1388 # If you have `file' or equivalent on your system and you're not sure
1389 # whether `pass_all' will *always* work, you probably want this one.
1393 lt_cv_deplibs_check_method=pass_all
1397 lt_cv_deplibs_check_method=pass_all
1401 lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
1402 lt_cv_file_magic_cmd='/usr/bin/file -L'
1403 lt_cv_file_magic_test_file=/shlib/libc.so
1406 cygwin* | mingw* |pw32*)
1407 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
1408 lt_cv_file_magic_cmd='$OBJDUMP -f'
1411 darwin* | rhapsody*)
1412 lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
1413 lt_cv_file_magic_cmd='/usr/bin/file -L'
1415 rhapsody* | darwin1.[012])
1416 lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
1419 lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
1425 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1428 # Not sure whether the presence of OpenBSD here was a mistake.
1429 # Let's accept both of them until this is cleared up.
1430 lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
1431 lt_cv_file_magic_cmd=/usr/bin/file
1432 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
1436 lt_cv_deplibs_check_method=pass_all
1441 lt_cv_deplibs_check_method=pass_all
1445 lt_cv_deplibs_check_method=['file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
1446 lt_cv_file_magic_cmd=/usr/bin/file
1447 lt_cv_file_magic_test_file=/usr/lib/libc.sl
1453 # this will be overridden with pass_all, but let us keep it just in case
1454 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
1458 *-32|*"-32 ") libmagic=32-bit;;
1459 *-n32|*"-n32 ") libmagic=N32;;
1460 *-64|*"-64 ") libmagic=64-bit;;
1461 *) libmagic=never-match;;
1463 # this will be overridden with pass_all, but let us keep it just in case
1464 lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
1467 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
1468 lt_cv_deplibs_check_method=pass_all
1471 # This must be Linux ELF.
1474 alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
1475 lt_cv_deplibs_check_method=pass_all ;;
1477 # glibc up to 2.1.1 does not perform some relocations on ARM
1478 lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
1480 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
1484 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1485 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
1487 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
1492 [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
1493 lt_cv_file_magic_cmd=/usr/bin/file
1494 lt_cv_file_magic_test_file=/usr/lib/libnls.so
1497 osf3* | osf4* | osf5*)
1498 # this will be overridden with pass_all, but let us keep it just in case
1499 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
1500 lt_cv_file_magic_test_file=/shlib/libc.so
1501 lt_cv_deplibs_check_method=pass_all
1505 lt_cv_deplibs_check_method=pass_all
1509 lt_cv_deplibs_check_method=pass_all
1510 lt_cv_file_magic_test_file=/lib/libc.so
1513 [sysv5uw[78]* | sysv4*uw2*)]
1514 lt_cv_deplibs_check_method=pass_all
1517 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1518 case $host_vendor in
1520 lt_cv_deplibs_check_method=pass_all
1523 lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]']
1524 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
1530 file_magic_cmd=$lt_cv_file_magic_cmd
1531 deplibs_check_method=$lt_cv_deplibs_check_method
1535 # AC_PROG_NM - find the path to a BSD-compatible name lister
1536 AC_DEFUN([AC_PROG_NM],
1537 [AC_MSG_CHECKING([for BSD-compatible nm])
1538 AC_CACHE_VAL(lt_cv_path_NM,
1539 [if test -n "$NM"; then
1540 # Let the user override the test.
1543 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1544 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1545 test -z "$ac_dir" && ac_dir=.
1546 tmp_nm=$ac_dir/${ac_tool_prefix}nm
1547 if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
1548 # Check to see if the nm accepts a BSD-compat flag.
1549 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1550 # nm: unknown option "B" ignored
1551 # Tru64's nm complains that /dev/null is an invalid object file
1552 if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
1553 lt_cv_path_NM="$tmp_nm -B"
1555 elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1556 lt_cv_path_NM="$tmp_nm -p"
1559 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
1560 continue # so that we can try to find one that supports BSD flags
1565 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
1568 AC_MSG_RESULT([$NM])
1571 # AC_CHECK_LIBM - check for math library
1572 AC_DEFUN([AC_CHECK_LIBM],
1573 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1576 *-*-beos* | *-*-cygwin* | *-*-pw32*)
1577 # These system don't have libm
1580 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1581 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1584 AC_CHECK_LIB(m, main, LIBM="-lm")
1589 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1590 # the libltdl convenience library and INCLTDL to the include flags for
1591 # the libltdl header and adds --enable-ltdl-convenience to the
1592 # configure arguments. Note that LIBLTDL and INCLTDL are not
1593 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
1594 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
1595 # with '${top_builddir}/' and INCLTDL will be prefixed with
1596 # '${top_srcdir}/' (note the single quotes!). If your package is not
1597 # flat and you're not using automake, define top_builddir and
1598 # top_srcdir appropriately in the Makefiles.
1599 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
1600 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1601 case $enable_ltdl_convenience in
1602 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1603 "") enable_ltdl_convenience=yes
1604 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1606 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
1607 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1610 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1611 # the libltdl installable library and INCLTDL to the include flags for
1612 # the libltdl header and adds --enable-ltdl-install to the configure
1613 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
1614 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
1615 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
1616 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
1617 # with '${top_srcdir}/' (note the single quotes!). If your package is
1618 # not flat and you're not using automake, define top_builddir and
1619 # top_srcdir appropriately in the Makefiles.
1620 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1621 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
1622 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1623 AC_CHECK_LIB(ltdl, main,
1624 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1625 [if test x"$enable_ltdl_install" = xno; then
1626 AC_MSG_WARN([libltdl not installed, but installation disabled])
1628 enable_ltdl_install=yes
1631 if test x"$enable_ltdl_install" = x"yes"; then
1632 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1633 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
1634 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1636 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1642 # If this macro is not defined by Autoconf, define it here.
1643 ifdef([AC_PROVIDE_IFELSE],
1645 [define([AC_PROVIDE_IFELSE],
1646 [ifdef([AC_PROVIDE_$1],
1649 # AC_LIBTOOL_F77 - enable support for fortran libraries
1650 AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_AC_LIBTOOL_F77])])
1652 AC_DEFUN([_AC_LIBTOOL_F77],
1654 if test "$ac_cv_prog_f77_works" = "yes"; then
1655 AC_REQUIRE([AC_PROG_F77])
1656 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-f77.sh"
1658 lt_save_CFLAGS="$CFLAGS"
1659 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1660 dnl is set to the fortran compiler.
1661 AR="$AR" LTCC="$CC" CC="$F77" F77="$F77" CFLAGS="$FFLAGS" CPPFLAGS="" \
1662 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1663 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1664 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1665 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1666 deplibs_check_method="$deplibs_check_method" \
1667 file_magic_cmd="$file_magic_cmd" \
1668 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1669 --build="$build" --add-tag=F77 $ac_aux_dir/ltcf-f77.sh $host \
1670 || AC_MSG_ERROR([libtool tag configuration failed])
1672 CFLAGS="$lt_save_CFLAGS"
1674 # Redirect the config.log output again, so that the ltconfig log is not
1675 # clobbered by the next message.
1676 exec 5>>./config.log
1680 # AC_LIBTOOL_CXX - enable support for C++ libraries
1681 AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
1683 AC_DEFUN([_AC_LIBTOOL_CXX],
1684 [AC_REQUIRE([AC_PROG_CXX])
1685 AC_REQUIRE([AC_PROG_CXXCPP])
1686 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
1688 lt_save_CFLAGS="$CFLAGS"
1689 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1690 dnl is set to the C++ compiler.
1691 AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
1692 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1693 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1694 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1695 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1696 deplibs_check_method="$deplibs_check_method" \
1697 file_magic_cmd="$file_magic_cmd" \
1698 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1699 --build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
1700 || AC_MSG_ERROR([libtool tag configuration failed])
1702 CFLAGS="$lt_save_CFLAGS"
1704 # Redirect the config.log output again, so that the ltconfig log is not
1705 # clobbered by the next message.
1706 exec 5>>./config.log
1709 # AC_LIBTOOL_GCJ - enable support for GCJ libraries
1710 AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
1712 AC_DEFUN([_AC_LIBTOOL_GCJ],
1713 [AC_REQUIRE([AC_PROG_LIBTOOL])
1714 AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
1715 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
1716 [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
1717 [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
1718 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
1719 [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
1720 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
1722 lt_save_CFLAGS="$CFLAGS"
1723 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1724 dnl is set to the C++ compiler.
1725 AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
1726 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1727 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1728 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1729 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1730 deplibs_check_method="$deplibs_check_method" \
1731 file_magic_cmd="$file_magic_cmd" \
1732 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1733 --build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
1734 || AC_MSG_ERROR([libtool tag configuration failed])
1736 CFLAGS="$lt_save_CFLAGS"
1738 # Redirect the config.log output again, so that the ltconfig log is not
1739 # clobbered by the next message.
1740 exec 5>>./config.log
1744 AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
1745 AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
1746 AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
1747 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
1748 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
1749 AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
1750 AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
1752 dnl This is just to silence aclocal about the macro not being used
1753 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1754 ifelse([AC_DISABLE_SHARED])dnl
1756 AC_DEFUN([LT_AC_PROG_GCJ],
1757 [AC_CHECK_TOOL(GCJ, gcj, no)
1758 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"