1 # aclocal.m4 generated automatically by aclocal 1.4f
3 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
17 # This macro checks for fftw header files and libraries,
18 # including the possible prefixing with s or d to determine precision.
19 # Arg 1 is the fftw header/library name to check for, without
20 # prefix or anything else (e.g. rfftw_mpi for real MPI transforms)
21 # Arg 2 is the value of $enable_float, i.e. yes/no for precision=4/8.
22 AC_DEFUN(ACX_CHECK_FFTW,
24 if test -z "$ac_fftw_firstname"; then
26 if test "$2" = "no"; then
38 # check header doesn't work, since we must use mpicc to get includes, not just /lib/cpp
39 AC_MSG_CHECKING([for $1.h])
40 AC_TRY_COMPILE([#include <$1.h>],,
48 if test -n "$fftwname"; then
49 # we cannot run the code since an MPI program might not be allowed on a login node of a supercomputer
50 AC_TRY_COMPILE([#include <$fftwname.h>],
51 [int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)]; ],
57 if test "$ok" != "yes"; then
58 xfftwname=${fftwcheckprefix}${fftwname}
59 AC_MSG_CHECKING([for $xfftwname.h])
60 AC_TRY_COMPILE([#include <$xfftwname.h>],,AC_MSG_RESULT(yes),
63 AC_MSG_ERROR([Cannot find any $prec precision $fftwname.h or $xfftwname.h]
64 [Do you have $prec precision FFTW installed? If you are using packages,]
65 [note that you also need fftw-devel to compile GROMACS. You can find the ]
66 [software at www.fftw.org, and detailed instructions at www.gromacs.org.]
67 [If you compiled FFTW yourself: ]
68 [Note that the default FFTW setup is double precision. Change the FFTW]
69 [configuration to single with --enable-float. If you want MPI support,]
70 [use --enable-mpi. It is a good idea to install both single & double.]
71 [If your sysadm doesn't want to install it you can do it to a location]
72 [in your home directory and provide the correct paths in the CPPFLAGS]
73 [and LDFLAGS environment variables before running configure.]
74 [That is also necessary to do if your compiler doesn't search]
75 [/usr/local/include and /usr/local/lib by default.]
76 [You can find information at www.gromacs.org, or in the INSTALL file.])
78 AC_TRY_COMPILE([#include <$xfftwname.h>],[int _array_ [1 - 2 * !((sizeof(fftw_real)) == $realsize)];],
81 usedprefix=$fftwcheckprefix
84 AC_MSG_ERROR([Cannot find any $prec precision $fftwname.h or $xfftwname.h]
85 [Do you have $prec precision FFTW installed? If you are using packages,]
86 [note that you also need fftw-devel to compile GROMACS. You can find the ]
87 [software at www.fftw.org, and detailed instructions at www.gromacs.org.]
88 [If you compiled FFTW yourself: ]
89 [Note that the default FFTW setup is double precision. Change the FFTW]
90 [configuration to single with --enable-float. If you want MPI support,]
91 [use --enable-mpi. It is a good idea to install both single & double.]
92 [If your sysadm doesn't want to install it you can do it to a location]
93 [in your home directory and provide the correct paths in the CPPFLAGS]
94 [and LDFLAGS environment variables before running configure.]
95 [That is also necessary to do if your compiler doesn't search]
96 [/usr/local/include and /usr/local/lib by default.]
97 [You can find information at www.gromacs.org, or in the INSTALL file.])])
100 AC_CHECK_LIB($fftwname,main,,AC_MSG_ERROR([Can't find a library to match the $fftwname header]))
101 ac_fftw_savedprefix=$usedprefix
102 ac_fftw_firstname=$fftwname
106 fftwname=${ac_fftw_savedprefix}$1
107 AC_MSG_CHECKING([for $fftwname.h])
109 [#include <$fftwname.h>],,AC_MSG_RESULT(yes)
110 AC_CHECK_LIB($fftwname,main,,AC_MSG_ERROR([Can't find a library to match the $fftwname header])),
113 AC_MSG_ERROR([Cant find $fftwname.h header. Make sure all your fftw prefixes match - we already use $ac_fftw_firstname.h])
122 dnl macro from the fftw distribution (http://www.fftw.org)
123 dnl like AC_SUBST, but replace XXX_variable_XXX instead of @variable@
124 dnl This macro protects VARIABLE from being diverted twice
125 dnl if this macro is called twice for it.
126 dnl AC_SUBST(VARIABLE)
127 define(ACX_SUBST_XXX,
128 [ifdef([ACX_SUBST_XXX_$1], ,
129 [define([ACX_SUBST_XXX_$1], )dnl
130 AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
136 # ACX_F77_NAME_MANGLING
137 # ---------------------
138 # This is a macro adopted from the fftw distribution (http://www.fftw.org)
139 # to determine how we should call fortran functions from C.
140 AC_DEFUN(ACX_F77_NAME_MANGLING,
142 AC_REQUIRE([AC_PROG_CC])
143 AC_REQUIRE([AC_PROG_F77])
144 AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
145 AC_MSG_CHECKING(fortran name mangling)
146 cat > mangle-func.f <<EOF
154 ac_try='$F77 -c $FFLAGS mangle-func.f 1>&AC_FD_CC'
155 if AC_TRY_EVAL(ac_try); then
158 echo "configure: failed program was:" >&AC_FD_CC
159 cat mangle-func.f >&AC_FD_CC
161 AC_MSG_ERROR(failed to compile fortran test program)
164 ac_f77_mangle_type=unknown
168 LIBS="mangle-func.o $FLIBS $LIBS"
169 AC_TRY_LINK(,foobar();,
170 ac_f77_mangle_type=lowercase,
171 AC_TRY_LINK(,foobar_();,
172 ac_f77_mangle_type=lowercase-underscore,
173 AC_TRY_LINK(,FOOBAR();,
174 ac_f77_mangle_type=uppercase,
175 AC_TRY_LINK(,FOOBAR_();,
176 ac_f77_mangle_type=uppercase-underscore))))
179 AC_MSG_RESULT($ac_f77_mangle_type)
182 case $ac_f77_mangle_type in
184 AC_DEFINE(F77_NAME_LOWERCASE,,[call f77 with lowercase, no underscore])
187 lowercase-underscore)
188 AC_DEFINE(F77_NAME_LOWERCASE_UNDERSCORE,,[call f77 with lowercase and underscore])
192 AC_DEFINE(F77_NAME_UPPERCASE,,[call f77 with uppercase, no underscore])
195 uppercase-underscore)
196 AC_DEFINE(F77_NAME_UPPERCASE_UNDERSCORE,,[call f77 with uppercase and underscore])
201 AC_MSG_CHECKING(whether f77 functions with underscore get an extra underscore)
206 LIBS="mangle-func.o $FLIBS $LIBS"
207 AC_TRY_LINK(,$mangle_try();,
208 [ac_f77_mangle_underscore=yes;
209 AC_DEFINE(F77_NAME_EXTRA_UNDERSCORE,,[Append extra underscore to already underscored names])],
210 [ac_f77_mangle_underscore=no])
214 AC_MSG_RESULT($ac_f77_mangle_underscore)
223 dnl AC_FIND_MOTIF : find OSF/Motif or LessTif, and provide variables
224 dnl to easily use them in a Makefile.
226 dnl Adapted from a macro by Andreas Zeller.
228 dnl The variables provided are :
229 dnl link_motif (e.g. -L/usr/lesstif/lib -lXm -lXt)
230 dnl include_motif (e.g. -I/usr/lesstif/lib)
231 dnl motif_libraries (e.g. /usr/lesstif/lib)
232 dnl motif_includes (e.g. /usr/lesstif/include)
234 dnl The link_motif and include_motif variables should be fit to put on
235 dnl your application's link line in your Makefile.
237 AC_DEFUN(AC_FIND_MOTIF,
239 AC_REQUIRE([AC_PATH_XTRA])
244 dnl AC_ARG_WITH(motif,
245 dnl [ --without-motif do not use Motif widgets])
246 dnl Treat --without-motif like
247 dnl --without-motif-includes --without-motif-libraries.
249 if test "$no_x" = "yes"
255 AC_ARG_WITH(motif-includes,
256 [ --with-motif-includes=DIR Motif include files are in DIR],
257 motif_includes="$withval")
259 AC_ARG_WITH(motif-libraries,
260 [ --with-motif-libraries=DIR Motif libraries are in DIR],
261 motif_libraries="$withval")
263 AC_MSG_CHECKING(for Motif)
268 # Search the include files.
270 if test "$motif_includes" = ""; then
271 AC_CACHE_VAL(ac_cv_motif_includes,
273 ac_motif_save_LIBS="$LIBS"
274 ac_motif_save_INCLUDES="$INCLUDES"
275 ac_motif_save_CPPFLAGS="$CPPFLAGS"
276 ac_motif_save_LDFLAGS="$LDFLAGS"
278 LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS"
279 INCLUDES="$X_CFLAGS $INCLUDES"
280 CPPFLAGS="$X_CFLAGS $CPPFLAGS"
281 LDFLAGS="$X_LIBS $LDFLAGS"
283 ac_cv_motif_includes="none"
284 AC_TRY_COMPILE([#include <Xm/Xm.h>],[int a;],
286 # Xm/Xm.h is in the standard search path.
287 ac_cv_motif_includes=
290 # Xm/Xm.h is not in the standard search path.
291 # Locate it and put its directory in `motif_includes'
293 # /usr/include/Motif* are used on HP-UX (Motif).
294 # /usr/include/X11* are used on HP-UX (X and Athena).
295 # /usr/dt is used on Solaris (Motif).
296 # /usr/openwin is used on Solaris (X and Athena).
297 # Other directories are just guesses.
298 for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \
299 /usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \
300 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \
301 /usr/dt/include /usr/openwin/include \
302 /usr/dt/*/include /opt/*/include /usr/include/Motif* \
303 "${prefix}"/*/include /usr/*/include /usr/local/*/include \
304 "${prefix}"/include/* /usr/include/* /usr/local/include/*; do
305 if test -f "$dir/Xm/Xm.h"; then
306 ac_cv_motif_includes="$dir"
312 LIBS="$ac_motif_save_LIBS"
313 INCLUDES="$ac_motif_save_INCLUDES"
314 CPPFLAGS="$ac_motif_save_CPPFLAGS"
315 LDFLAGS="$ac_motif_save_LDFLAGS"
317 motif_includes="$ac_cv_motif_includes"
321 # Now for the libraries.
323 if test "$motif_libraries" = ""; then
324 AC_CACHE_VAL(ac_cv_motif_libraries,
326 ac_motif_save_LIBS="$LIBS"
327 ac_motif_save_INCLUDES="$INCLUDES"
328 ac_motif_save_CPPFLAGS="$CPPFLAGS"
329 ac_motif_save_LDFLAGS="$LDFLAGS"
331 LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS"
332 INCLUDES="$X_CFLAGS $INCLUDES"
333 CPPFLAGS="$X_CFLAGS $CPPFLAGS"
334 LDFLAGS="$X_LIBS $LDFLAGS"
336 ac_cv_motif_libraries="none"
337 AC_TRY_LINK([#include <Xm/Xm.h>],[XtToolkitInitialize();],
339 # libXm.a is in the standard search path.
340 ac_cv_motif_libraries=
343 # libXm.a is not in the standard search path.
344 # Locate it and put its directory in `motif_libraries'
346 # /usr/lib/Motif* are used on HP-UX (Motif).
347 # /usr/lib/X11* are used on HP-UX (X and Athena).
348 # /usr/dt is used on Solaris (Motif).
349 # /usr/lesstif is used on Linux (Lesstif).
350 # /usr/openwin is used on Solaris (X and Athena).
351 # Other directories are just guesses.
352 for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \
353 /usr/lib/Motif2.0 /usr/lib/Motif1.2 /usr/lib/Motif1.1 \
354 /usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 \
355 /usr/dt/lib /usr/openwin/lib \
356 /usr/dt/*/lib /opt/*/lib /usr/lib/Motif* \
357 /usr/lesstif*/lib /usr/lib/Lesstif* \
358 "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \
359 "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do
360 if test -d "$dir" && test "`ls $dir/libXm.* 2> /dev/null`" != ""; then
361 ac_cv_motif_libraries="$dir"
367 LIBS="$ac_motif_save_LIBS"
368 INCLUDES="$ac_motif_save_INCLUDES"
369 CPPFLAGS="$ac_motif_save_CPPFLAGS"
370 LDFLAGS="$ac_motif_save_LDFLAGS"
373 motif_libraries="$ac_cv_motif_libraries"
376 # Provide an easier way to link
378 if test "$motif_includes" = "none" -o "$motif_libraries" = "none"; then
384 if test "$with_motif" != "no"; then
385 if test "$motif_libraries" = ""; then
386 link_motif="-lXm -lXt"
387 MOTIF_LIBS="-lXm -lXt"
389 link_motif="-L$motif_libraries -lXm -lXt"
390 MOTIF_LIBS="-L$motif_libraries -lXm -lXt"
392 if test "$motif_includes" != ""; then
393 include_motif="-I$motif_includes"
394 MOTIF_INCLUDES="-I$motif_includes"
396 LIBS="$LIBS $MOTIF_LIBS"
397 INCLUDES="$INCLUDES $MOTIF_INCLUDES"
398 AC_DEFINE(HAVE_MOTIF,,[Use motif/lesstif libraries])
406 motif_libraries_result="$motif_libraries"
407 motif_includes_result="$motif_includes"
408 test "$motif_libraries_result" = "" && motif_libraries_result="in default path"
409 test "$motif_includes_result" = "" && motif_includes_result="in default path"
410 test "$motif_libraries_result" = "none" && motif_libraries_result="(none)"
411 test "$motif_includes_result" = "none" && motif_includes_result="(none)"
413 [libraries $motif_libraries_result, headers $motif_includes_result])
417 dnl macro modified from the fftw distribution (www.fftw.org)
418 AC_DEFUN(ACX_CHECK_CC_FLAGS,
420 AC_REQUIRE([AC_PROG_CC])
421 AC_CACHE_CHECK(whether $CC accepts $1, ac_$2,
422 [echo 'void f(){}' > conftest.c
423 if test -z "`$CC $1 -c conftest.c 2>&1`"; then
430 if test "$ac_$2" = yes; then
439 dnl macro modified from the fftw distribution (www.fftw.org)
440 AC_DEFUN(ACX_CHECK_F77_FLAGS,
442 AC_REQUIRE([AC_PROG_F77])
443 AC_CACHE_CHECK(whether $F77 accepts $1, ac_$2,
444 [cat > conftest.f << EOF
449 if test -z "`$F77 $1 -c conftest.f `"; then
456 if test "$ac_$2" = yes; then
467 # ---------------------------
468 # Macro to extend the exact CPU for some hosts
469 AC_DEFUN(ACX_DETECT_GMXCPU,
471 AC_REQUIRE([AC_CANONICAL_HOST])
474 # Determine the exact cpu type on some common systems where it is
475 # not visible from the host triplet.
476 # (on e.g. intel and dec/tru64 the host type is enough)
478 case "${host_cpu}-${host_os}" in
481 # we need to fool the combination of m4, sh and awk - thus the seemingly unnecessary n
482 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ n=1; print $n }'`
483 if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER4 >/dev/null 2>&1; then
485 elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER3 >/dev/null 2>&1; then
487 elif /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER2 >/dev/null 2>&1; then
495 if /usr/sbin/lscfg -vp | grep PowerPC | grep 604 >/dev/null 2>&1; then
497 elif /usr/sbin/lscfg -vp | grep PowerPC | grep 603 >/dev/null 2>&1; then
499 elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64a >/dev/null 2>&1; then
501 elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64b >/dev/null 2>&1; then
503 elif /usr/sbin/lscfg -vp | grep PowerPC | grep rs64c >/dev/null 2>&1; then
511 if /sbin/hinv | grep CPU | grep R12000 >/dev/null 2>&1; then
513 elif /sbin/hinv | grep CPU | grep R10000 >/dev/null 2>&1; then
515 elif /sbin/hinv | grep CPU | grep R8000 >/dev/null 2>&1; then
517 elif /sbin/hinv | grep CPU | grep R5000 >/dev/null 2>&1; then
525 if /usr/sbin/prtconf | grep UltraSPARC-III >/dev/null 2>&1; then
527 elif /usr/sbin/prtconf | grep UltraSPARC-IIi >/dev/null 2>&1; then
529 elif /usr/sbin/prtconf | grep UltraSPARC-II >/dev/null 2>&1; then
531 elif /usr/sbin/prtconf | grep UltraSPARC >/dev/null 2>&1; then
546 # Macro modified from the fftw distribution (www.fftw.org)
547 # to determine optimization flags.
548 # Note that we have modified config.guess and config.sub
549 # to provide extended information on the detailed type of CPU.
550 # In general we assume you have recent versions of the compilers
551 # that support the highest optimization we know of. If not, you
552 # can always override these flags, but it's better to upgrade :-)
553 AC_DEFUN(ACX_COMPILER_MAXOPT,
555 AC_REQUIRE([AC_PROG_CC])
556 AC_REQUIRE([AC_PROG_F77])
557 AC_REQUIRE([AC_CANONICAL_HOST])
559 # Try to determine "good" native compiler flags if none specified on command
560 # line. To avoid repeating the entire procedure for fortran flags, we first
561 # determine our suggested choices for both C and fortran, and then possibly
562 # override them with user choices.
566 case "${host_cpu}-${host_os}" in
571 xCFLAGS="-fast -xO5 -xtarget=ultra3 -fsimple=2 -fnonstd -dalign"
575 xCFLAGS="-fast -xO5 -xtarget=ultra2i -fsimple=2 -fnonstd -dalign"
579 xCFLAGS="-fast -xO5 -xtarget=ultra2 -fsimple=2 -fnonstd -dalign"
583 xCFLAGS="-fast -xO5 -xtarget=ultra -fsimple=2 -fnonstd -dalign"
587 xCFLAGS="-native -fast -xO5 -fsimple=2 -fnonstd -dalign"
594 xCFLAGS="-Ae +O3 +Oall"
596 # If you haven't noticed, we don't like hp very much...
597 # but perhaps that will change if they make something nice out of ia64.
601 # dont use inter-procedure analysis for the innerloops - they take
602 # forever to compile with it, and it doesnt help at all.
605 xCFLAGS="-O3 -qarch=pwr4 -qtune=pwr4 -qlanglvl=ansi -qmaxmem=16384"
606 xFFLAGS="-O3 -Q -qarch=pwr4 -qtune=pwr4 -qmaxmem=16384 -qhot -qnoipa"
609 xCFLAGS="-O3 -qarch=pwr3 -qtune=pwr3 -qlanglvl=ansi -qmaxmem=16384"
610 xFFLAGS="-O3 -Q -qarch=pwr3 -qtune=pwr3 -qmaxmem=16384 -qhot -qnoipa"
613 xCFLAGS="-O3 -qarch=pwr2 -qtune=pwr2 -qlanglvl=ansi -qmaxmem=16384"
614 xFFLAGS="-O3 -Q -qarch=pwr2 -qtune=pwr2 -qmaxmem=16384 -qhot -qnoipa"
617 xCFLAGS="-O3 -qarch=pwr -qtune=pwr -qlanglvl=ansi -qmaxmem=16384"
618 xFFLAGS="-O3 -Q -qarch=pwr -qtune=pwr -qmaxmem=16384 -qhot -qnoipa"
621 # I don't think people are using anything older than power2, so we tune for
622 # pwr, but dont set the arch since it is nice to have common binaries
623 # that run also on powerpc.
624 xCFLAGS="-O3 -qlanglvl=ansi -qtune=pwr -qmaxmem=16384"
625 xFFLAGS="-O3 -Q -qtune=pwr -qmaxmem=16384 -qhot"
633 xCFLAGS="-O3 -qarch=604 -qtune=604 -qlanglvl=ansi -qmaxmem=16384"
634 xFFLAGS="-O3 -Q -qarch=604 -qtune=604 -qmaxmem=16384 -qhot"
637 xCFLAGS="-O3 -qarch=603 -qtune=603 -qlanglvl=ansi -qmaxmem=16384"
638 xFFLAGS="-O3 -Q -qarch=603 -qtune=603 -qmaxmem=16384 -qhot"
641 xCFLAGS="-O3 -qarch=rs64a -qtune=rs64a -qlanglvl=ansi -qmaxmem=16384"
642 xFFLAGS="-O3 -Q -qarch=rs64a -qtune=rs64a -qmaxmem=16384 -qhot"
645 xCFLAGS="-O3 -qarch=rs64b -qtune=rs64b -qlanglvl=ansi -qmaxmem=16384"
646 xFFLAGS="-O3 -Q -qarch=rs64b -qtune=rs64b -qmaxmem=16384 -qhot"
649 xCFLAGS="-O3 -qarch=rs64c -qtune=rs64c -qlanglvl=ansi -qmaxmem=16384"
650 xFFLAGS="-O3 -Q -qarch=rs64c -qtune=rs64c -qmaxmem=16384 -qhot"
653 xCFLAGS="-O3 -qlanglvl=ansi -qmaxmem=16384"
654 xFFLAGS="-O3 -Q -qmaxmem=16384 -qhot"
660 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"
661 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"
663 if $CC -version | grep "Version 7.1" > /dev/null 2>&1; then
664 xCFLAGS="$xCFLAGS -GCM:aggressive_speculation -GCM:array_speculation"
665 xFFLAGS="$xFFLAGS -GCM:aggressive_speculation -GCM:array_speculation"
668 if $CC -version | grep "Version 7.3" > /dev/null 2>&1; then
669 xCFLAGS="$xCFLAGS -SWP:heur=fdms,nhms,fdnms"
670 xFFLAGS="$xFFLAGS -SWP:heur=fdms,nhms,fdnms"
672 LDFLAGS="$LDFLAGS -woff 84"
676 xCFLAGS="-n32 -r12000 -mips4 $xCFLAGS"
677 xFFLAGS="-n32 -r12000 -mips4 $xFFLAGS"
678 xLDFLAGS="-n32 -r12000 -mips4"
681 xCFLAGS="-n32 -r10000 -mips4 $xCFLAGS"
682 xFFLAGS="-n32 -r10000 -mips4 $xFFLAGS"
683 xLDFLAGS="-n32 -r10000 -mips4"
686 xCFLAGS="-n32 -r8000 -mips4 $xCFLAGS"
687 xFFLAGS="-n32 -r8000 -mips4 $xFFLAGS"
688 xLDFLAGS="-n32 -r8000 -mips4"
691 xCFLAGS="-n32 -r5000 -mips4 $xCFLAGS"
692 xFFLAGS="-n32 -r5000 -mips4 $xFFLAGS"
693 xLDFLAGS="-n32 -r5000 -mips4"
696 xCFLAGS="-n32 $xCFLAGS"
697 xFFLAGS="-n32 $xFFLAGS"
704 # NB: -arch implies -tune according to the cc manual.
705 # We dont use -ifo since it conflicts with dependency
706 # generation on old versions of the compiler.
707 case "${host_cpu}" in
709 # extract the processor from cpu type (e.g. alphaev56 -> ev56)
710 evtype=`echo ${host_cpu} | sed 's/alpha//'`
711 xCFLAGS="-std1 -fast -O4 -no_ifo -arch $evtype -unroll 2 -fp_reorder"
712 xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
716 xCFLAGS="-std1 -fast -O4 -no_ifo -arch host -unroll 2 -fp_reorder"
717 xFFLAGS="$xCFLAGS -assume noaccuracy_sensitive"
724 case "${host_cpu}" in
726 # extract the processor from cpu type (e.g. alphaev56 -> ev56)
727 evtype=`echo ${host_cpu} | sed 's/alpha//'`
728 tmpCFLAGS="-std1 -fast -O4 -no_ifo -arch $evtype -unroll 2 -fp_reorder"
729 tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
733 tmpCFLAGS="-std1 -fast -O4 -no_ifo -arch host -unroll 2 -fp_reorder"
734 tmpFFLAGS="$tmpCFLAGS -assume noaccuracy_sensitive"
738 if $CC -V 2> /dev/null | grep Compaq > /dev/null 2>&1; then
742 if test "$enable_fortran" = "yes"; then
743 if $F77 -V 2> /dev/null | grep Compaq > /dev/null 2>&1; then
750 # most of these systems (e.g. linux, FreeBSD) use gcc which is treated
751 # further down, but we can at least check if the Portland compilers are used:
752 if $CC -V 2> /dev/null | grep Portland > /dev/null 2>&1; then
753 case "${host_cpu}" in
761 xCFLAGS="$pgiopt -fast -pc 32"
763 if test "$enable_fortran" = "yes"; then
764 if $F77 -V 2> /dev/null | grep Portland > /dev/null 2>&1; then
770 # Phew, end of all those operating systems and processors!
772 # use default flags for gcc/g77 on all systems
773 if test $ac_cv_prog_gcc = yes; then
774 xCFLAGS="-O6 -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
775 # -malign-double for x86 systems
776 ACX_CHECK_CC_FLAGS(-malign-double,align_double,xCFLAGS="$xCFLAGS -malign-double")
779 if test $enable_fortran = yes; then
780 if test $ac_cv_prog_g77 = yes; then
781 xFFLAGS="-O3 -ffast-math -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
782 # -malign-double for f77 on x86 systems - haven't checked that this works yet.
783 #ACX_CHECK_F77_FLAGS(-malign-double,align_double,xFFLAGS="$xFFLAGS -malign-double")
789 if test "$GCC" = "yes"; then
790 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
791 # try to guess correct CPU flags, at least for linux
792 case "${host_cpu}" in
793 # i586/i686 cpu flags don't improve speed, thus no need to use them.
794 # don't check f77 separately - we assume f77 and gcc are similar
797 cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
798 is60x=`echo $cputype | egrep "^60[0-9]e?$"`
799 if test -n "$is60x"; then
800 ACX_CHECK_CC_FLAGS(-mcpu=$cputype,m_cpu_60x,CPU_FLAGS=-mcpu=$cputype)
801 elif test "$cputype" = 750; then
802 ACX_CHECK_CC_FLAGS(-mcpu=750,m_cpu_750,CPU_FLAGS=-mcpu=750)
804 if test -z "$CPU_FLAGS"; then
805 ACX_CHECK_CC_FLAGS(-mcpu=powerpc,m_cpu_powerpc,CPU_FLAGS=-mcpu=powerpc)
807 if test -z "$CPU_FLAGS"; then
808 ACX_CHECK_CC_FLAGS(-mpowerpc,m_powerpc,CPU_FLAGS=-mpowerpc)
812 AM_CONDITIONAL(GNU_CC,false)
815 if test -n "$CPU_FLAGS"; then
816 xCFLAGS="$xCFLAGS $CPU_FLAGS"
817 xFFLAGS="$xFFLAGS $CPU_FLAGS"
820 # Now check if the user provided anything special for C or fortran...
821 # Not nice to have checked everything then, but otherwise we would have
822 # to use entirely separate checks for C and fortran flags, doubling the code.
823 if test "$ac_test_CFLAGS" != "set"; then
825 # Use the extra link optimization flags on e.g. irix only when
826 # we are using our own C compiler flags
827 LDFLAGS="$LDFLAGS $xLDFLAGS"
829 if test -z "$CFLAGS"; then
830 echo "*******************************************************************"
831 echo "* WARNING: No special optimization settings found for the C *"
832 echo "* compiler. Use make CFLAGS=..., or edit the top level Makefile. *"
833 echo "* Reverting to the default setting CFLAGS=-O3. (mail us about it!)*"
834 echo "*******************************************************************"
837 ACX_CHECK_CC_FLAGS(${CFLAGS}, guessed_cflags, , [
838 echo "*******************************************************************"
839 echo "* Sorry, these optimization settings don't seem to work for *"
840 echo "* your C compiler. Use make CFLAGS=..., or edit the top Makefile. *"
841 echo "*******************************************************************"
845 echo "******************************************"
846 echo "* Using CFLAGS from environment variable *"
847 echo "******************************************"
850 if test "$enable_fortran" = "yes"; then
851 if test "$ac_test_FFLAGS" != "set"; then
853 if test -z "$FFLAGS"; then
854 echo "*******************************************************************"
855 echo "* WARNING: No special optimization settings found for the fortran *"
856 echo "* compiler. Use make FFLAGS=..., or edit the top level Makefile. *"
857 echo "* Reverting to the default setting FFLAGS=-O3. (mail us about it!)*"
858 echo "*******************************************************************"
861 ACX_CHECK_F77_FLAGS(${FFLAGS}, guessed_fflags, , [
862 echo "*******************************************************************"
863 echo "* Sorry, these optimization settings don't seem to work for *"
864 echo "* your f77 compiler. Use make FFLAGS=.., or edit the top Makefile.*"
865 echo "*******************************************************************"
869 echo "******************************************"
870 echo "* Using FFLAGS from environment variable *"
871 echo "******************************************"
883 # serial 46 AC_PROG_LIBTOOL
884 AC_DEFUN([AC_PROG_LIBTOOL],
885 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
886 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
887 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
888 AC_PROVIDE_IFELSE([AC_PROG_CXX],
890 [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
892 AC_PROVIDE_IFELSE([AC_PROG_F77],
894 [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
897 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
898 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
899 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
900 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
902 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
904 [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
906 [ifdef([AC_PROG_GCJ],
907 [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
909 ifdef([A][M_PROG_GCJ],
910 [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
912 ifdef([LT_AC_PROG_GCJ],
913 [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
916 AC_DEFUN([_AC_PROG_LIBTOOL],
917 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
918 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
919 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
921 # Save cache, so that ltconfig can load it
924 # Actually configure libtool. ac_aux_dir is where install-sh is found.
925 AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
926 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
927 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
928 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
929 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
930 deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
931 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
932 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
933 || AC_MSG_ERROR([libtool configure failed])
935 # Reload cache, that may have been modified by ltconfig
938 # This can be used to rebuild libtool when needed
939 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
941 # Always use our own libtool.
942 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
945 # Redirect the config.log output again, so that the ltconfig log is not
946 # clobbered by the next message.
950 AC_DEFUN([AC_LIBTOOL_SETUP],
952 AC_REQUIRE([AC_ENABLE_SHARED])dnl
953 AC_REQUIRE([AC_ENABLE_STATIC])dnl
954 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
955 AC_REQUIRE([AC_CANONICAL_HOST])dnl
956 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
957 AC_REQUIRE([AC_PROG_CC])dnl
958 AC_REQUIRE([AC_PROG_LD])dnl
959 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
960 AC_REQUIRE([AC_PROG_NM])dnl
961 AC_REQUIRE([AC_PROG_LN_S])dnl
962 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
963 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
964 AC_REQUIRE([AC_OBJEXT])dnl
965 AC_REQUIRE([AC_EXEEXT])dnl
968 # Only perform the check for file, if the check method requires it
969 case $deplibs_check_method in
971 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
977 AC_CHECK_TOOL(RANLIB, ranlib, :)
978 AC_CHECK_TOOL(STRIP, strip, :)
980 # Check for any special flags to pass to ltconfig.
981 libtool_flags="--cache-file=$cache_file"
982 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
983 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
984 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
985 test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
986 test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
987 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
988 [libtool_flags="$libtool_flags --enable-dlopen"])
989 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
990 [libtool_flags="$libtool_flags --enable-win32-dll"])
991 AC_ARG_ENABLE(libtool-lock,
992 [ --disable-libtool-lock avoid locking (might break parallel builds)])
993 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
994 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
997 [ --with-pic try to use only PIC/non-PIC [default=both]],
998 pic_mode="$withval", pic_mode=default)
999 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
1000 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
1002 # Some flags need to be propagated to the compiler or linker for good
1006 # Find out which ABI we are using.
1007 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1008 if AC_TRY_EVAL(ac_compile); then
1009 case `/usr/bin/file conftest.$ac_objext` in
1025 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1026 SAVE_CFLAGS="$CFLAGS"
1027 CFLAGS="$CFLAGS -belf"
1028 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1031 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1033 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1034 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1035 CFLAGS="$SAVE_CFLAGS"
1039 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1040 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1041 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1042 AC_CHECK_TOOL(AS, as, false)
1043 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1045 # recent cygwin and mingw systems supply a stub DllMain which the user
1046 # can override, but on older systems we have to supply one
1047 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1049 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1050 DllMain (0, 0, 0);],
1051 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1054 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1055 # old mingw systems require "-dll" to link a DLL, while more recent ones
1057 SAVE_CFLAGS="$CFLAGS"
1058 CFLAGS="$CFLAGS -mdll"
1059 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1060 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1061 CFLAGS="$SAVE_CFLAGS" ;;
1062 *-*-cygwin* | *-*-pw32*)
1063 # cygwin systems need to pass --dll to the linker, and not link
1064 # crt.o which will require a WinMain@16 definition.
1065 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1072 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1073 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1075 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1076 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1078 # AC_ENABLE_SHARED - implement the --enable-shared flag
1079 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1080 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1082 AC_DEFUN([AC_ENABLE_SHARED],
1083 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1084 AC_ARG_ENABLE(shared,
1085 changequote(<<, >>)dnl
1086 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1087 changequote([, ])dnl
1088 [p=${PACKAGE-default}
1090 yes) enable_shared=yes ;;
1091 no) enable_shared=no ;;
1094 # Look at the argument we got. We use all the common list separators.
1095 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1096 for pkg in $enableval; do
1097 if test "X$pkg" = "X$p"; then
1104 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1107 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1108 AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1109 AC_ENABLE_SHARED(no)])
1111 # AC_ENABLE_STATIC - implement the --enable-static flag
1112 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1113 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1115 AC_DEFUN([AC_ENABLE_STATIC],
1116 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1117 AC_ARG_ENABLE(static,
1118 changequote(<<, >>)dnl
1119 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1120 changequote([, ])dnl
1121 [p=${PACKAGE-default}
1123 yes) enable_static=yes ;;
1124 no) enable_static=no ;;
1127 # Look at the argument we got. We use all the common list separators.
1128 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1129 for pkg in $enableval; do
1130 if test "X$pkg" = "X$p"; then
1137 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1140 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1141 AC_DEFUN([AC_DISABLE_STATIC],
1142 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1143 AC_ENABLE_STATIC(no)])
1146 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1147 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1148 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1150 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
1151 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1152 AC_ARG_ENABLE(fast-install,
1153 changequote(<<, >>)dnl
1154 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1155 changequote([, ])dnl
1156 [p=${PACKAGE-default}
1158 yes) enable_fast_install=yes ;;
1159 no) enable_fast_install=no ;;
1161 enable_fast_install=no
1162 # Look at the argument we got. We use all the common list separators.
1163 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1164 for pkg in $enableval; do
1165 if test "X$pkg" = "X$p"; then
1166 enable_fast_install=yes
1172 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1175 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
1176 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
1177 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1178 AC_ENABLE_FAST_INSTALL(no)])
1180 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
1181 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
1182 # Where MODE is either `yes' or `no'. If omitted, it defaults to
1184 AC_DEFUN([AC_LIBTOOL_PICMODE],
1185 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1186 pic_mode=ifelse($#,1,$1,default)])
1189 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
1190 AC_DEFUN([AC_PATH_TOOL_PREFIX],
1191 [AC_MSG_CHECKING([for $1])
1192 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
1195 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
1198 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
1201 ac_save_MAGIC_CMD="$MAGIC_CMD"
1202 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1203 dnl $ac_dummy forces splitting on constant user-supplied paths.
1204 dnl POSIX.2 word splitting is done only on the output of word expansions,
1205 dnl not every word. This closes a longstanding sh security hole.
1206 ac_dummy="ifelse([$2], , $PATH, [$2])"
1207 for ac_dir in $ac_dummy; do
1208 test -z "$ac_dir" && ac_dir=.
1209 if test -f $ac_dir/$1; then
1210 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
1211 if test -n "$file_magic_test_file"; then
1212 case $deplibs_check_method in
1214 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
1215 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
1216 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
1217 egrep "$file_magic_regex" > /dev/null; then
1222 *** Warning: the command libtool uses to detect shared libraries,
1223 *** $file_magic_cmd, produces output that libtool cannot recognize.
1224 *** The result is that libtool may fail to recognize shared libraries
1225 *** as such. This will affect the creation of libtool libraries that
1226 *** depend on shared libraries, but programs linked with such libtool
1227 *** libraries will work regardless of this problem. Nevertheless, you
1228 *** may want to report the problem to your system manager and/or to
1229 *** bug-libtool@gnu.org
1239 MAGIC_CMD="$ac_save_MAGIC_CMD"
1242 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
1243 if test -n "$MAGIC_CMD"; then
1244 AC_MSG_RESULT($MAGIC_CMD)
1251 # AC_PATH_MAGIC - find a file program which can recognise a shared library
1252 AC_DEFUN([AC_PATH_MAGIC],
1253 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
1254 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
1255 if test -z "$lt_cv_path_MAGIC_CMD"; then
1256 if test -n "$ac_tool_prefix"; then
1257 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
1265 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1266 AC_DEFUN([AC_PROG_LD],
1267 [AC_ARG_WITH(gnu-ld,
1268 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1269 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1270 AC_REQUIRE([AC_PROG_CC])dnl
1271 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1272 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1274 if test "$GCC" = yes; then
1275 # Check if gcc -print-prog-name=ld gives a path.
1276 AC_MSG_CHECKING([for ld used by GCC])
1279 # gcc leaves a trailing carriage return which upsets mingw
1280 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1282 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1285 # Accept absolute paths.
1286 [[\\/]* | [A-Za-z]:[\\/]*)]
1287 re_direlt=['/[^/][^/]*/\.\./']
1288 # Canonicalize the path of ld
1289 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1290 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1291 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1293 test -z "$LD" && LD="$ac_prog"
1296 # If it fails, then pretend we aren't using GCC.
1300 # If it is relative, then search for the first ld in PATH.
1304 elif test "$with_gnu_ld" = yes; then
1305 AC_MSG_CHECKING([for GNU ld])
1307 AC_MSG_CHECKING([for non-GNU ld])
1309 AC_CACHE_VAL(lt_cv_path_LD,
1310 [if test -z "$LD"; then
1311 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1312 for ac_dir in $PATH; do
1313 test -z "$ac_dir" && ac_dir=.
1314 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1315 lt_cv_path_LD="$ac_dir/$ac_prog"
1316 # Check to see if the program is GNU ld. I'd rather use --version,
1317 # but apparently some GNU ld's only accept -v.
1318 # Break only if it was the GNU/non-GNU ld that we prefer.
1319 if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1320 test "$with_gnu_ld" != no && break
1322 test "$with_gnu_ld" != yes && break
1328 lt_cv_path_LD="$LD" # Let the user override the test with a path.
1331 if test -n "$LD"; then
1336 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1340 AC_DEFUN([AC_PROG_LD_GNU],
1341 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
1342 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1343 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1344 lt_cv_prog_gnu_ld=yes
1346 lt_cv_prog_gnu_ld=no
1348 with_gnu_ld=$lt_cv_prog_gnu_ld
1351 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
1352 # -- PORTME Some linkers may need a different reload flag.
1353 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
1354 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
1355 [lt_cv_ld_reload_flag='-r'])
1356 reload_flag=$lt_cv_ld_reload_flag
1357 test -n "$reload_flag" && reload_flag=" $reload_flag"
1360 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
1361 # -- PORTME fill in with the dynamic library characteristics
1362 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
1363 [AC_CACHE_CHECK([how to recognise dependant libraries],
1364 lt_cv_deplibs_check_method,
1365 [lt_cv_file_magic_cmd='$MAGIC_CMD'
1366 lt_cv_file_magic_test_file=
1367 lt_cv_deplibs_check_method='unknown'
1368 # Need to set the preceding variable on all platforms that support
1369 # interlibrary dependencies.
1370 # 'none' -- dependencies not supported.
1371 # `unknown' -- same as none, but documents that we really don't know.
1372 # 'pass_all' -- all dependencies passed with no checks.
1373 # 'test_compile' -- check by making test program.
1374 # 'file_magic [regex]' -- check by looking for files in library path
1375 # which responds to the $file_magic_cmd with a given egrep regex.
1376 # If you have `file' or equivalent on your system and you're not sure
1377 # whether `pass_all' will *always* work, you probably want this one.
1381 lt_cv_deplibs_check_method=pass_all
1385 lt_cv_deplibs_check_method=pass_all
1389 lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
1390 lt_cv_file_magic_cmd='/usr/bin/file -L'
1391 lt_cv_file_magic_test_file=/shlib/libc.so
1394 cygwin* | mingw* |pw32*)
1395 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
1396 lt_cv_file_magic_cmd='$OBJDUMP -f'
1399 darwin* | rhapsody*)
1400 lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
1401 lt_cv_file_magic_cmd='/usr/bin/file -L'
1403 rhapsody* | darwin1.[012])
1404 lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
1407 lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
1413 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1416 # Not sure whether the presence of OpenBSD here was a mistake.
1417 # Let's accept both of them until this is cleared up.
1418 lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
1419 lt_cv_file_magic_cmd=/usr/bin/file
1420 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
1424 lt_cv_deplibs_check_method=pass_all
1429 lt_cv_deplibs_check_method=pass_all
1433 lt_cv_deplibs_check_method=['file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
1434 lt_cv_file_magic_cmd=/usr/bin/file
1435 lt_cv_file_magic_test_file=/usr/lib/libc.sl
1441 # this will be overridden with pass_all, but let us keep it just in case
1442 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
1446 *-32|*"-32 ") libmagic=32-bit;;
1447 *-n32|*"-n32 ") libmagic=N32;;
1448 *-64|*"-64 ") libmagic=64-bit;;
1449 *) libmagic=never-match;;
1451 # this will be overridden with pass_all, but let us keep it just in case
1452 lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
1455 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
1456 lt_cv_deplibs_check_method=pass_all
1459 # This must be Linux ELF.
1462 alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
1463 lt_cv_deplibs_check_method=pass_all ;;
1465 # glibc up to 2.1.1 does not perform some relocations on ARM
1466 lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
1468 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
1472 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1473 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
1475 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
1480 [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
1481 lt_cv_file_magic_cmd=/usr/bin/file
1482 lt_cv_file_magic_test_file=/usr/lib/libnls.so
1485 osf3* | osf4* | osf5*)
1486 # this will be overridden with pass_all, but let us keep it just in case
1487 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
1488 lt_cv_file_magic_test_file=/shlib/libc.so
1489 lt_cv_deplibs_check_method=pass_all
1493 lt_cv_deplibs_check_method=pass_all
1497 lt_cv_deplibs_check_method=pass_all
1498 lt_cv_file_magic_test_file=/lib/libc.so
1501 [sysv5uw[78]* | sysv4*uw2*)]
1502 lt_cv_deplibs_check_method=pass_all
1505 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1506 case $host_vendor in
1508 lt_cv_deplibs_check_method=pass_all
1511 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]']
1512 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
1518 file_magic_cmd=$lt_cv_file_magic_cmd
1519 deplibs_check_method=$lt_cv_deplibs_check_method
1523 # AC_PROG_NM - find the path to a BSD-compatible name lister
1524 AC_DEFUN([AC_PROG_NM],
1525 [AC_MSG_CHECKING([for BSD-compatible nm])
1526 AC_CACHE_VAL(lt_cv_path_NM,
1527 [if test -n "$NM"; then
1528 # Let the user override the test.
1531 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1532 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1533 test -z "$ac_dir" && ac_dir=.
1534 tmp_nm=$ac_dir/${ac_tool_prefix}nm
1535 if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
1536 # Check to see if the nm accepts a BSD-compat flag.
1537 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1538 # nm: unknown option "B" ignored
1539 # Tru64's nm complains that /dev/null is an invalid object file
1540 if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
1541 lt_cv_path_NM="$tmp_nm -B"
1543 elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1544 lt_cv_path_NM="$tmp_nm -p"
1547 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
1548 continue # so that we can try to find one that supports BSD flags
1553 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
1556 AC_MSG_RESULT([$NM])
1559 # AC_CHECK_LIBM - check for math library
1560 AC_DEFUN([AC_CHECK_LIBM],
1561 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1564 *-*-beos* | *-*-cygwin* | *-*-pw32*)
1565 # These system don't have libm
1568 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1569 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1572 AC_CHECK_LIB(m, main, LIBM="-lm")
1577 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1578 # the libltdl convenience library and INCLTDL to the include flags for
1579 # the libltdl header and adds --enable-ltdl-convenience to the
1580 # configure arguments. Note that LIBLTDL and INCLTDL are not
1581 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
1582 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
1583 # with '${top_builddir}/' and INCLTDL will be prefixed with
1584 # '${top_srcdir}/' (note the single quotes!). If your package is not
1585 # flat and you're not using automake, define top_builddir and
1586 # top_srcdir appropriately in the Makefiles.
1587 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
1588 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1589 case $enable_ltdl_convenience in
1590 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1591 "") enable_ltdl_convenience=yes
1592 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1594 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
1595 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1598 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1599 # the libltdl installable library and INCLTDL to the include flags for
1600 # the libltdl header and adds --enable-ltdl-install to the configure
1601 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
1602 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
1603 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
1604 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
1605 # with '${top_srcdir}/' (note the single quotes!). If your package is
1606 # not flat and you're not using automake, define top_builddir and
1607 # top_srcdir appropriately in the Makefiles.
1608 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1609 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
1610 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1611 AC_CHECK_LIB(ltdl, main,
1612 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1613 [if test x"$enable_ltdl_install" = xno; then
1614 AC_MSG_WARN([libltdl not installed, but installation disabled])
1616 enable_ltdl_install=yes
1619 if test x"$enable_ltdl_install" = x"yes"; then
1620 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1621 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
1622 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1624 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1630 # If this macro is not defined by Autoconf, define it here.
1631 ifdef([AC_PROVIDE_IFELSE],
1633 [define([AC_PROVIDE_IFELSE],
1634 [ifdef([AC_PROVIDE_$1],
1637 # AC_LIBTOOL_F77 - enable support for fortran libraries
1638 AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_AC_LIBTOOL_F77])])
1640 AC_DEFUN([_AC_LIBTOOL_F77],
1642 if test "$ac_cv_prog_f77_works" = "yes"; then
1643 AC_REQUIRE([AC_PROG_F77])
1644 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-f77.sh"
1646 lt_save_CFLAGS="$CFLAGS"
1647 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1648 dnl is set to the fortran compiler.
1649 AR="$AR" LTCC="$CC" CC="$F77" F77="$F77" CFLAGS="$FFLAGS" CPPFLAGS="" \
1650 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1651 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1652 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1653 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1654 deplibs_check_method="$deplibs_check_method" \
1655 file_magic_cmd="$file_magic_cmd" \
1656 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1657 --build="$build" --add-tag=F77 $ac_aux_dir/ltcf-f77.sh $host \
1658 || AC_MSG_ERROR([libtool tag configuration failed])
1660 CFLAGS="$lt_save_CFLAGS"
1662 # Redirect the config.log output again, so that the ltconfig log is not
1663 # clobbered by the next message.
1664 exec 5>>./config.log
1668 # AC_LIBTOOL_CXX - enable support for C++ libraries
1669 AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
1671 AC_DEFUN([_AC_LIBTOOL_CXX],
1672 [AC_REQUIRE([AC_PROG_CXX])
1673 AC_REQUIRE([AC_PROG_CXXCPP])
1674 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
1676 lt_save_CFLAGS="$CFLAGS"
1677 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1678 dnl is set to the C++ compiler.
1679 AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
1680 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1681 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1682 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1683 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1684 deplibs_check_method="$deplibs_check_method" \
1685 file_magic_cmd="$file_magic_cmd" \
1686 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1687 --build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
1688 || AC_MSG_ERROR([libtool tag configuration failed])
1690 CFLAGS="$lt_save_CFLAGS"
1692 # Redirect the config.log output again, so that the ltconfig log is not
1693 # clobbered by the next message.
1694 exec 5>>./config.log
1697 # AC_LIBTOOL_GCJ - enable support for GCJ libraries
1698 AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
1700 AC_DEFUN([_AC_LIBTOOL_GCJ],
1701 [AC_REQUIRE([AC_PROG_LIBTOOL])
1702 AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
1703 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
1704 [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
1705 [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
1706 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
1707 [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
1708 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
1710 lt_save_CFLAGS="$CFLAGS"
1711 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1712 dnl is set to the C++ compiler.
1713 AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
1714 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1715 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1716 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1717 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1718 deplibs_check_method="$deplibs_check_method" \
1719 file_magic_cmd="$file_magic_cmd" \
1720 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1721 --build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
1722 || AC_MSG_ERROR([libtool tag configuration failed])
1724 CFLAGS="$lt_save_CFLAGS"
1726 # Redirect the config.log output again, so that the ltconfig log is not
1727 # clobbered by the next message.
1728 exec 5>>./config.log
1732 AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
1733 AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
1734 AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
1735 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
1736 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
1737 AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
1738 AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
1740 dnl This is just to silence aclocal about the macro not being used
1741 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1742 ifelse([AC_DISABLE_SHARED])dnl
1744 AC_DEFUN([LT_AC_PROG_GCJ],
1745 [AC_CHECK_TOOL(GCJ, gcj, no)
1746 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
1752 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1753 # -------------------------------------
1754 # Define a conditional.
1756 # FIXME: Once using 2.50, use this:
1757 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
1758 AC_DEFUN([AM_CONDITIONAL],
1759 [ifelse([$1], [TRUE],
1760 [errprint(__file__:__line__: [$0: invalid condition: $1
1763 ifelse([$1], [FALSE],
1764 [errprint(__file__:__line__: [$0: invalid condition: $1
1768 AC_SUBST([$1_FALSE])
1777 # Do all the work for Automake. This macro actually does too much --
1778 # some checks are only needed if your package does certain things.
1779 # But this isn't really a big deal.
1783 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1784 # written in clear, in which case automake, when reading aclocal.m4,
1785 # will think it sees a *use*, and therefore will trigger all it's
1786 # C support machinery. Also note that it means that autoscan, seeing
1787 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1790 # We require 2.13 because we rely on SHELL being computed by configure.
1793 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
1794 # -----------------------------------------------------------
1795 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
1796 # The purpose of this macro is to provide the user with a means to
1797 # check macros which are provided without letting her know how the
1798 # information is coded.
1799 # If this macro is not defined by Autoconf, define it here.
1800 ifdef([AC_PROVIDE_IFELSE],
1802 [define([AC_PROVIDE_IFELSE],
1803 [ifdef([AC_PROVIDE_$1],
1807 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
1808 # ----------------------------------------------
1809 AC_DEFUN([AM_INIT_AUTOMAKE],
1810 [AC_REQUIRE([AC_PROG_INSTALL])dnl
1811 # test to see if srcdir already configured
1812 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
1813 test -f $srcdir/config.status; then
1814 AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
1817 # Define the identity of the package.
1819 AC_SUBST(PACKAGE)dnl
1821 AC_SUBST(VERSION)dnl
1823 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1824 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
1826 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
1827 # the ones we care about.
1828 ifdef([m4_pattern_allow],
1829 [m4_pattern_allow([^AM_(C|CPP|CXX|OBJC|F|R|GCJ)FLAGS])])dnl
1831 # Some tools Automake needs.
1832 AC_REQUIRE([AM_SANITY_CHECK])dnl
1833 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1834 AM_MISSING_PROG(ACLOCAL, aclocal)
1835 AM_MISSING_PROG(AUTOCONF, autoconf)
1836 AM_MISSING_PROG(AUTOMAKE, automake)
1837 AM_MISSING_PROG(AUTOHEADER, autoheader)
1838 AM_MISSING_PROG(MAKEINFO, makeinfo)
1839 AM_MISSING_PROG(AMTAR, tar)
1840 AM_MISSING_INSTALL_SH
1841 AM_PROG_INSTALL_STRIP
1842 # We need awk for the "check" target. The system "awk" is bad on
1844 AC_REQUIRE([AC_PROG_AWK])dnl
1845 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1846 AC_REQUIRE([AM_DEP_TRACK])dnl
1847 AC_REQUIRE([AM_SET_DEPDIR])dnl
1848 AC_PROVIDE_IFELSE([AC_PROG_][CC],
1849 [AM_DEPENDENCIES(CC)],
1850 [define([AC_PROG_][CC],
1851 defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
1852 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
1853 [AM_DEPENDENCIES(CXX)],
1854 [define([AC_PROG_][CXX],
1855 defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
1859 # Check to make sure that the build environment is sane.
1866 AC_DEFUN([AM_SANITY_CHECK],
1867 [AC_MSG_CHECKING([whether build environment is sane])
1870 echo timestamp > conftest.file
1871 # Do `set' in a subshell so we don't clobber the current shell's
1872 # arguments. Must try -L first in case configure is actually a
1873 # symlink; some systems play weird games with the mod time of symlinks
1874 # (eg FreeBSD returns the mod time of the symlink's containing
1877 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1878 if test "$[*]" = "X"; then
1880 set X `ls -t $srcdir/configure conftest.file`
1883 if test "$[*]" != "X $srcdir/configure conftest.file" \
1884 && test "$[*]" != "X conftest.file $srcdir/configure"; then
1886 # If neither matched, then we have a broken ls. This can happen
1887 # if, for instance, CONFIG_SHELL is bash and it inherits a
1888 # broken ls alias from the environment. This has actually
1889 # happened. Such a system could not be considered "sane".
1890 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1891 alias in your environment])
1894 test "$[2]" = conftest.file
1900 AC_MSG_ERROR([newly created file is older than distributed files!
1901 Check your system clock])
1903 AC_MSG_RESULT(yes)])
1908 # AM_MISSING_PROG(NAME, PROGRAM)
1909 # ------------------------------
1910 AC_DEFUN([AM_MISSING_PROG],
1911 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1912 $1=${$1-"${am_missing_run}$2"}
1916 # AM_MISSING_INSTALL_SH
1917 # ---------------------
1918 # Like AM_MISSING_PROG, but only looks for install-sh.
1919 AC_DEFUN([AM_MISSING_INSTALL_SH],
1920 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1921 if test -z "$install_sh"; then
1922 for install_sh in "$ac_aux_dir/install-sh" \
1923 "$ac_aux_dir/install.sh" \
1924 "${am_missing_run}${ac_auxdir}/install-sh";
1926 test -f "$install_sh" && break
1928 # FIXME: an evil hack: we remove the SHELL invocation from
1929 # install_sh because automake adds it back in. Sigh.
1930 install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
1932 AC_SUBST(install_sh)])
1935 # AM_MISSING_HAS_RUN
1936 # ------------------
1937 # Define MISSING if not defined so far and test if it supports --run.
1938 # If it does, set am_missing_run to use it, otherwise, to nothing.
1939 AC_DEFUN([AM_MISSING_HAS_RUN],
1940 [test x"${MISSING+set}" = xset ||
1941 MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
1942 # Use eval to expand $SHELL
1943 if eval "$MISSING --run true"; then
1944 am_missing_run="$MISSING --run "
1948 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
1954 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1955 # $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
1956 # Of course, Automake must honor this variable whenever it call a tool
1957 # from the auxiliary directory. The problem is that $srcdir (hence
1958 # $ac_aux_dir) can be either an absolute path or a path relative to
1959 # $top_srcdir or absolute, this depends on how configure is run. This
1960 # is pretty anoying since it makes $ac_aux_dir quite unusable in
1961 # subdirectories: on the top source directory, any form will work
1962 # fine, but in subdirectories relative pat needs to be adapted.
1963 # - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
1964 # relative, but fail if $srcdir is absolute
1965 # - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
1966 # absolute, and success on relative paths.
1968 # Consequently, we define and use $am_aux_dir, the "always absolute"
1969 # version of $ac_aux_dir.
1971 AC_DEFUN([AM_AUX_DIR_EXPAND], [
1972 # expand $ac_aux_dir to an absolute path
1973 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
1976 # One issue with vendor `install' (even GNU) is that you can't
1977 # specify the program used to strip binaries. This is especially
1978 # annoying in cross-compiling environments, where the build's strip
1979 # is unlikely to handle the host's binaries.
1980 # Fortunately install-sh will honor a STRIPPROG variable, so we
1981 # always use install-sh in `make install-strip', and initialize
1982 # STRIPPROG with the value of the STRIP variable (set by the user).
1983 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1984 [AC_REQUIRE([AM_MISSING_INSTALL_SH])dnl
1985 _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
1986 INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
1987 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1991 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1992 # written in clear, in which case automake, when reading aclocal.m4,
1993 # will think it sees a *use*, and therefore will trigger all it's
1994 # C support machinery. Also note that it means that autoscan, seeing
1995 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1997 # AM_DEPENDENCIES(NAME)
1998 # ---------------------
1999 # See how the compiler implements dependency checking.
2000 # NAME is "CC", "CXX" or "OBJC".
2001 # We try a few techniques and use that to set a single cache variable.
2002 AC_DEFUN([AM_DEPENDENCIES],
2003 [AC_REQUIRE([AM_SET_DEPDIR])dnl
2004 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2007 [AC_REQUIRE([AC_PROG_][CC])dnl
2008 AC_REQUIRE([AC_PROG_][CPP])
2011 [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
2012 AC_REQUIRE([AC_PROG_][CXXCPP])
2015 [$1], OBJC, [am_compiler_list='gcc3 gcc'
2018 [$1], GCJ, [am_compiler_list='gcc3 gcc'
2021 [AC_REQUIRE([AC_PROG_][$1])dnl
2025 AC_REQUIRE([AM_MAKE_INCLUDE])
2026 AC_REQUIRE([AM_DEP_TRACK])
2028 AC_CACHE_CHECK([dependency style of $depcc],
2029 [am_cv_$1_dependencies_compiler_type],
2030 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2031 # We make a subdir and do the tests there. Otherwise we can end up
2032 # making bogus files that we don't know about and never remove. For
2033 # instance it was reported that on HP-UX the gcc test will end up
2034 # making a dummy file named `D' -- because `-MD' means `put the output
2037 # Copy depcomp to subdir because otherwise we won't find it if we're
2038 # using a relative directory.
2039 cp "$am_depcomp" confdir
2042 am_cv_$1_dependencies_compiler_type=none
2043 if test "$am_compiler_list" = ""; then
2044 am_compiler_list="`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`"
2046 for depmode in $am_compiler_list; do
2047 # We need to recreate these files for each test, as the compiler may
2048 # overwrite some of them when testing with obscure command lines.
2049 # This happens at least with the AIX C compiler.
2050 echo '#include "conftest.h"' > conftest.c
2051 echo 'int i;' > conftest.h
2055 # after this tag, mechanisms are not by side-effect, so they'll
2056 # only be used when explicitly requested
2057 if test "x$enable_dependency_tracking" = xyes; then
2065 # We check with `-c' and `-o' for the sake of the "dashmstdout"
2066 # mode. It turns out that the SunPro C++ compiler does not properly
2067 # handle `-M -o', and we need to detect this.
2068 if depmode="$depmode" \
2069 source=conftest.c object=conftest.o \
2070 depfile=conftest.Po tmpdepfile=conftest.TPo \
2071 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
2072 grep conftest.h conftest.Po > /dev/null 2>&1; then
2073 am_cv_$1_dependencies_compiler_type="$depmode"
2081 am_cv_$1_dependencies_compiler_type=none
2084 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
2085 AC_SUBST([$1DEPMODE])
2091 # Choose a directory name for dependency files.
2092 # This macro is AC_REQUIREd in AM_DEPENDENCIES
2093 AC_DEFUN([AM_SET_DEPDIR],
2094 [if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
2096 # We redirect because .deps might already exist and be populated.
2097 # In this situation we don't want to see an error.
2098 rmdir .deps > /dev/null 2>&1
2108 AC_DEFUN([AM_DEP_TRACK],
2109 [AC_ARG_ENABLE(dependency-tracking,
2110 [ --disable-dependency-tracking Speeds up one-time builds
2111 --enable-dependency-tracking Do not reject slow dependency extractors])
2112 if test "x$enable_dependency_tracking" != xno; then
2113 am_depcomp="$ac_aux_dir/depcomp"
2116 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2117 pushdef([subst], defn([AC_SUBST]))
2118 subst(AMDEPBACKSLASH)
2122 # Generate code to set up dependency tracking.
2123 # This macro should only be invoked once -- use via AC_REQUIRE.
2125 # AM_OUTPUT_DEPENDENCY_COMMANDS
2128 # This code is only required when automatic dependency tracking
2129 # is enabled. FIXME. This creates each `.P' file that we will
2130 # need in order to bootstrap the dependency handling code.
2131 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
2132 AC_OUTPUT_COMMANDS([
2133 test x"$AMDEP_TRUE" != x"" ||
2134 for mf in $CONFIG_FILES; do
2136 Makefile) dirpart=.;;
2137 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
2140 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
2141 # Extract the definition of DEP_FILES from the Makefile without
2143 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
2144 test -z "$DEPDIR" && continue
2145 # When using ansi2knr, U may be empty or an underscore; expand it
2146 U=`sed -n -e '/^U = / s///p' < "$mf"`
2147 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
2148 # We invoke sed twice because it is the simplest approach to
2149 # changing $(DEPDIR) to its actual value in the expansion.
2150 for file in `sed -n -e '
2151 /^DEP_FILES = .*\\\\$/ {
2160 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
2161 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2162 # Make sure the directory exists.
2163 test -f "$dirpart/$file" && continue
2164 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
2165 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
2166 # echo "creating $dirpart/$file"
2167 echo '# dummy' > "$dirpart/$file"
2170 ], [AMDEP_TRUE="$AMDEP_TRUE"
2171 ac_aux_dir="$ac_aux_dir"])])
2175 # Check to see how make treats includes.
2176 AC_DEFUN([AM_MAKE_INCLUDE],
2177 [am_make=${MAKE-make}
2178 cat > confinc << 'END'
2182 # If we don't find an include directive, just comment out the code.
2183 AC_MSG_CHECKING([for style of include used by $am_make])
2187 # First try GNU make style include.
2188 echo "include confinc" > confmf
2189 # We grep out `Entering directory' and `Leaving directory'
2190 # messages which can occur if `w' ends up in MAKEFLAGS.
2191 # In particular we don't look at `^make:' because GNU make might
2192 # be invoked under some other name (usually "gmake"), in which
2193 # case it prints its new name instead of `make'.
2194 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
2199 # Now try BSD make style include.
2200 if test "$_am_include" = "#"; then
2201 echo '.include "confinc"' > confmf
2202 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
2203 _am_include=.include
2208 AC_SUBST(_am_include)
2210 AC_MSG_RESULT($_am_result)
2211 rm -f confinc confmf
2214 # Like AC_CONFIG_HEADER, but automatically create stamp file.
2218 # When config.status generates a header, we must update the stamp-h file.
2219 # This file resides in the same directory as the config header
2220 # that is generated. We must strip everything past the first ":",
2221 # and everything past the last "/".
2225 AC_DEFUN([AM_CONFIG_HEADER],
2226 [AC_CONFIG_HEADER([$1])
2228 ifelse(patsubst([$1], [[^ ]], []),
2230 [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
2231 patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
2233 for am_file in $1; do
2234 case " $CONFIG_HEADERS " in
2236 echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
2239 am_indx=\`expr \$am_indx + 1\`
2246 AC_DEFUN([AM_WITH_DMALLOC],
2247 [AC_MSG_CHECKING([if malloc debugging is wanted])
2248 AC_ARG_WITH(dmalloc,
2249 [ --with-dmalloc use dmalloc, as in
2250 http://www.dmalloc.com/dmalloc.tar.gz],
2251 [if test "$withval" = yes; then
2253 AC_DEFINE(WITH_DMALLOC,1,
2254 [Define if using the dmalloc debugging malloc package])
2255 LIBS="$LIBS -ldmalloc"
2256 LDFLAGS="$LDFLAGS -g"
2259 fi], [AC_MSG_RESULT(no)])