1 dnl aclocal.m4 generated automatically by aclocal 1.3
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl ===========================================================================
14 dnl Additional macros used to configure GiNaC. We don't start our own
15 dnl additions' names with AC_ but with GINAC_ in order to steer clear of
17 dnl ===========================================================================
19 dnl Generally, it is a bad idea to put specialized header files for a library
20 dnl into a generic directory like /usr/local/include/. Instead, one should put
21 dnl them into a subdirectory. GiNaC does it, NTL does it. Unfortunately, CLN
22 dnl doesn't do so but some people choose to do it by hand. In these cases we
23 dnl need to #include <CLN/cln.h>, otherwise #include <cln.h>. This macro
24 dnl tries to be clever and find out the correct way by defining the variable
25 dnl HAVE_CLN_CLN_H in config.h:
26 AC_DEFUN(GINAC_CHECK_CLN_H,
28 AC_CHECK_HEADERS(CLN/cln.h, ,
29 AC_CHECK_HEADERS(cln.h, ,
30 AC_MSG_ERROR([cannot find header for Bruno Haible's CLN]);
35 dnl This macro is needed because the generic AC_CHECK_LIB doesn't work because
36 dnl C++ is more strongly typed than C. Therefore we need to work with the
37 dnl more fundamental AC_TRY_LINK instead.
38 AC_DEFUN(GINAC_CHECK_LIBCLN,
40 AC_MSG_CHECKING([how to link with libcln])
42 AC_CACHE_VAL(ginac_cv_lib_cln_link,
44 case "${ac_cv_header_CLN_cln_h}" in
46 AC_TRY_LINK([#include <CLN/cln.h>],
48 ginac_cv_lib_cln_link="-lcln",
49 ginac_cv_lib_cln_link="fail")
52 AC_TRY_LINK([#include <cln.h>],
54 ginac_cv_lib_cln_link="-lcln",
55 ginac_cv_lib_cln_link="fail")
59 case "${ginac_cv_lib_cln_link}" in
62 LIBS="-lcln ${saved_LIBS}"
63 AC_MSG_RESULT([-lcln])
64 GINAC_CHECK_LIBCLN_SANITY
70 AC_MSG_WARN([linking with libcln failed])
72 dnl should never ever get here:
79 dnl Check if the CLN library suits our needs, i.e. if it is new enough, by
80 dnl trying to run into a little bug which was present till version 1.0.1 and
82 AC_DEFUN(GINAC_CHECK_LIBCLN_SANITY,
84 AC_MSG_CHECKING([whether libcln behaves sane])
85 AC_CACHE_VAL(ginac_cv_lib_cln_integrity,
87 case "${ac_cv_header_CLN_cln_h}" in
89 AC_TRY_RUN([#include <CLN/cln.h>
91 cl_RA q(3); q = q/2; cl_RA p(3); p = p/2;
92 if (q+p != 3) return 1; else return 0;
94 ginac_cv_lib_cln_integrity="sane",
95 ginac_cv_lib_cln_integrity="insane",
96 ginac_cv_lib_cln_integrity="guessing sane")
99 AC_TRY_RUN([#include <cln.h>
101 cl_RA q(3); q = q/2; cl_RA p(3); p = p/2;
102 if (q+p != 3) return 1; else return 0;
104 ginac_cv_lib_cln_integrity="sane",
105 ginac_cv_lib_cln_integrity="insane",
106 ginac_cv_lib_cln_integrity="guessing sane")
110 case "${ginac_cv_lib_cln_integrity}" in
111 dnl exit status was 0:
115 dnl exit status was not 0:
118 AC_MSG_WARN([maybe version of libcln is older than 1.0.2?])
120 dnl test-program was not run because we are cross-compiling:
122 AC_MSG_RESULT([hopefully])
124 dnl should never ever get here:
126 AC_MSG_WARN([you found a bug in the configure script!])
131 # Like AC_CONFIG_HEADER, but automatically create stamp file.
133 AC_DEFUN(AM_CONFIG_HEADER,
135 AC_CONFIG_HEADER([$1])
136 dnl When config.status generates a header, we must update the stamp-h file.
137 dnl This file resides in the same directory as the config header
138 dnl that is generated. We must strip everything past the first ":",
139 dnl and everything past the last "/".
140 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
141 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
142 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
144 for am_file in <<$1>>; do
145 case " <<$>>CONFIG_HEADERS " in
146 *" <<$>>am_file "*<<)>>
147 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
150 am_indx=`expr "<<$>>am_indx" + 1`
154 # Do all the work for Automake. This macro actually does too much --
155 # some checks are only needed if your package does certain things.
156 # But this isn't really a big deal.
161 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
163 AC_DEFUN(AM_INIT_AUTOMAKE,
164 [AC_REQUIRE([AM_PROG_INSTALL])
169 dnl test to see if srcdir already configured
170 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
171 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
174 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
175 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
176 AC_REQUIRE([AM_SANITY_CHECK])
177 AC_REQUIRE([AC_ARG_PROGRAM])
178 dnl FIXME This is truly gross.
179 missing_dir=`cd $ac_aux_dir && pwd`
180 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
181 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
182 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
183 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
184 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
185 AC_REQUIRE([AC_PROG_MAKE_SET])])
190 AC_DEFUN(AM_PROG_INSTALL,
191 [AC_REQUIRE([AC_PROG_INSTALL])
192 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
193 AC_SUBST(INSTALL_SCRIPT)dnl
197 # Check to make sure that the build environment is sane.
200 AC_DEFUN(AM_SANITY_CHECK,
201 [AC_MSG_CHECKING([whether build environment is sane])
204 echo timestamp > conftestfile
205 # Do `set' in a subshell so we don't clobber the current shell's
206 # arguments. Must try -L first in case configure is actually a
207 # symlink; some systems play weird games with the mod time of symlinks
208 # (eg FreeBSD returns the mod time of the symlink's containing
211 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
212 if test "[$]*" = "X"; then
214 set X `ls -t $srcdir/configure conftestfile`
216 if test "[$]*" != "X $srcdir/configure conftestfile" \
217 && test "[$]*" != "X conftestfile $srcdir/configure"; then
219 # If neither matched, then we have a broken ls. This can happen
220 # if, for instance, CONFIG_SHELL is bash and it inherits a
221 # broken ls alias from the environment. This has actually
222 # happened. Such a system could not be considered "sane".
223 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
224 alias in your environment])
227 test "[$]2" = conftestfile
233 AC_MSG_ERROR([newly created file is older than distributed files!
234 Check your system clock])
239 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
240 dnl The program must properly implement --version.
241 AC_DEFUN(AM_MISSING_PROG,
242 [AC_MSG_CHECKING(for working $2)
243 # Run test in a subshell; some versions of sh will print an error if
244 # an executable is not found, even if stderr is redirected.
245 # Redirect stdin to placate older versions of autoconf. Sigh.
246 if ($2 --version) < /dev/null > /dev/null 2>&1; then
251 AC_MSG_RESULT(missing)
255 # Add --enable-maintainer-mode option to configure.
260 AC_DEFUN(AM_MAINTAINER_MODE,
261 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
262 dnl maintainer-mode is disabled by default
263 AC_ARG_ENABLE(maintainer-mode,
264 [ --enable-maintainer-mode enable make rules and dependencies not useful
265 (and sometimes confusing) to the casual installer],
266 USE_MAINTAINER_MODE=$enableval,
267 USE_MAINTAINER_MODE=no)
268 AC_MSG_RESULT($USE_MAINTAINER_MODE)
269 if test $USE_MAINTAINER_MODE = yes; then
279 # serial 24 AM_PROG_LIBTOOL
280 AC_DEFUN(AM_PROG_LIBTOOL,
281 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
282 AC_REQUIRE([AM_ENABLE_STATIC])dnl
283 AC_REQUIRE([AC_CANONICAL_HOST])dnl
284 AC_REQUIRE([AC_PROG_RANLIB])dnl
285 AC_REQUIRE([AC_PROG_CC])dnl
286 AC_REQUIRE([AM_PROG_LD])dnl
287 AC_REQUIRE([AM_PROG_NM])dnl
288 AC_REQUIRE([AC_PROG_LN_S])dnl
290 # Always use our own libtool.
291 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
294 # Check for any special flags to pass to ltconfig.
296 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
297 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
298 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
299 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
300 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
302 # Some flags need to be propagated to the compiler or linker for good
306 # Find out which ABI we are using.
307 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
308 if AC_TRY_EVAL(ac_compile); then
309 case "`/usr/bin/file conftest.o`" in
325 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
326 CFLAGS="$CFLAGS -belf"
330 # Actually configure libtool. ac_aux_dir is where install-sh is found.
331 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
332 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
333 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
334 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
335 || AC_MSG_ERROR([libtool configure failed])
338 # AM_ENABLE_SHARED - implement the --enable-shared flag
339 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
340 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
342 AC_DEFUN(AM_ENABLE_SHARED,
343 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
344 AC_ARG_ENABLE(shared,
345 changequote(<<, >>)dnl
346 << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
348 [ --enable-shared=PKGS only build shared libraries if the current package
349 appears as an element in the PKGS list],
350 [p=${PACKAGE-default}
352 yes) enable_shared=yes ;;
353 no) enable_shared=no ;;
356 # Look at the argument we got. We use all the common list separators.
357 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
358 for pkg in $enableval; do
359 if test "X$pkg" = "X$p"; then
366 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
369 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
370 AC_DEFUN(AM_DISABLE_SHARED,
371 [AM_ENABLE_SHARED(no)])
373 # AM_DISABLE_STATIC - set the default static flag to --disable-static
374 AC_DEFUN(AM_DISABLE_STATIC,
375 [AM_ENABLE_STATIC(no)])
377 # AM_ENABLE_STATIC - implement the --enable-static flag
378 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
379 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
381 AC_DEFUN(AM_ENABLE_STATIC,
382 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
383 AC_ARG_ENABLE(static,
384 changequote(<<, >>)dnl
385 << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
387 [ --enable-static=PKGS only build shared libraries if the current package
388 appears as an element in the PKGS list],
389 [p=${PACKAGE-default}
391 yes) enable_static=yes ;;
392 no) enable_static=no ;;
395 # Look at the argument we got. We use all the common list separators.
396 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
397 for pkg in $enableval; do
398 if test "X$pkg" = "X$p"; then
405 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
409 # AM_PROG_LD - find the path to the GNU or non-GNU linker
412 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
413 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
414 AC_REQUIRE([AC_PROG_CC])
416 if test "$ac_cv_prog_gcc" = yes; then
417 # Check if gcc -print-prog-name=ld gives a path.
418 AC_MSG_CHECKING([for ld used by GCC])
419 ac_prog=`($CC -print-prog-name=ld) 2>&5`
421 # Accept absolute paths.
423 test -z "$LD" && LD="$ac_prog"
426 # If it fails, then pretend we aren't using GCC.
430 # If it is relative, then search for the first ld in PATH.
434 elif test "$with_gnu_ld" = yes; then
435 AC_MSG_CHECKING([for GNU ld])
437 AC_MSG_CHECKING([for non-GNU ld])
439 AC_CACHE_VAL(ac_cv_path_LD,
440 [if test -z "$LD"; then
441 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
442 for ac_dir in $PATH; do
443 test -z "$ac_dir" && ac_dir=.
444 if test -f "$ac_dir/$ac_prog"; then
445 ac_cv_path_LD="$ac_dir/$ac_prog"
446 # Check to see if the program is GNU ld. I'd rather use --version,
447 # but apparently some GNU ld's only accept -v.
448 # Break only if it was the GNU/non-GNU ld that we prefer.
449 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
450 test "$with_gnu_ld" != no && break
452 test "$with_gnu_ld" != yes && break
458 ac_cv_path_LD="$LD" # Let the user override the test with a path.
461 if test -n "$LD"; then
466 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
471 AC_DEFUN(AM_PROG_LD_GNU,
472 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
473 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
474 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
475 ac_cv_prog_gnu_ld=yes
481 # AM_PROG_NM - find the path to a BSD-compatible name lister
483 [AC_MSG_CHECKING([for BSD-compatible nm])
484 AC_CACHE_VAL(ac_cv_path_NM,
487 ac_cv_path_NM="$NM" # Let the user override the test with a path.
490 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
491 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
492 test -z "$ac_dir" && ac_dir=.
493 if test -f $ac_dir/nm; then
494 # Check to see if the nm accepts a BSD-compat flag.
495 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
496 # nm: unknown option "B" ignored
497 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
498 ac_cv_path_NM="$ac_dir/nm -B"
499 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
500 ac_cv_path_NM="$ac_dir/nm -p"
502 ac_cv_path_NM="$ac_dir/nm"
508 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
518 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
519 AC_DEFUN(AM_PROG_LEX,
520 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
521 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")