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 additions' names
15 dnl with AC_ but with GINAC_ in order to avoid future trouble.
16 dnl ===========================================================================
18 dnl Generally, it is a bad idea to put specialized header files for a library
19 dnl into a generic directory like /usr/local/include/. Instead, one should put
20 dnl them into a subdirectory. GiNaC does it, NTL does it. Unfortunately, CLN
21 dnl doesn't do so but some people choose to do it by hand. In these cases we
22 dnl need to #include <CLN/cln.h>, otherwise #include <cln.h>. This macro
23 dnl tries to be clever and find out the correct way by defining the variable
24 dnl HAVE_CLN_CLN_H in config.h:
25 AC_DEFUN(GINAC_CHECK_CLN_H,
27 AC_CHECK_HEADERS(CLN/cln.h, ,
28 AC_CHECK_HEADERS(cln.h, ,
29 AC_MSG_ERROR([cannot find header for Bruno Haible's CLN]);
34 dnl This macro is needed because the generic AC_CHECK_LIB doesn't work because
35 dnl C++ is more strongly typed than C. Therefore we need to work with the
36 dnl more fundamental AC_TRY_LINK instead.
37 AC_DEFUN(GINAC_CHECK_LIBCLN,
39 AC_MSG_CHECKING([how to link with libcln])
41 AC_CACHE_VAL(ginac_cv_lib_cln_link,
43 case "${ac_cv_header_CLN_cln_h}" in
45 AC_TRY_LINK([#include <CLN/cln.h>],
47 ginac_cv_lib_cln_link="-lcln",
48 ginac_cv_lib_cln_link="fail")
51 AC_TRY_LINK([#include <cln.h>],
53 ginac_cv_lib_cln_link="-lcln",
54 ginac_cv_lib_cln_link="fail")
58 case "${ginac_cv_lib_cln_link}" in
61 LIBS="-lcln ${saved_LIBS}"
62 AC_MSG_RESULT([-lcln])
63 GINAC_CHECK_LIBCLN_SANITY
69 AC_MSG_WARN([linking with libcln failed])
71 dnl should never ever get here:
78 dnl Check if the CLN library suits our needs, i.e. if it is new enough, by
79 dnl trying to run into a little bug which was present till version 1.0.1 and
81 AC_DEFUN(GINAC_CHECK_LIBCLN_SANITY,
83 AC_MSG_CHECKING([whether libcln behaves sane])
84 AC_CACHE_VAL(ginac_cv_lib_cln_integrity,
86 case "${ac_cv_header_CLN_cln_h}" in
88 AC_TRY_RUN([#include <CLN/cln.h>
90 cl_RA q(3); q = q/2; cl_RA p(3); p = p/2;
91 if (q+p != 3) return 1; else return 0;
93 ginac_cv_lib_cln_integrity="sane",
94 ginac_cv_lib_cln_integrity="insane",
95 ginac_cv_lib_cln_integrity="guessing sane")
98 AC_TRY_RUN([#include <cln.h>
100 cl_RA q(3); q = q/2; cl_RA p(3); p = p/2;
101 if (q+p != 3) return 1; else return 0;
103 ginac_cv_lib_cln_integrity="sane",
104 ginac_cv_lib_cln_integrity="insane",
105 ginac_cv_lib_cln_integrity="guessing sane")
109 case "${ginac_cv_lib_cln_integrity}" in
110 dnl exit status was 0:
114 dnl exit status was not 0:
117 AC_MSG_WARN([maybe version of libcln is older than 1.0.2?])
119 dnl test-program was not run because we are cross-compiling:
121 AC_MSG_RESULT([hopefully])
123 dnl should never ever get here:
125 AC_MSG_WARN([you found a bug in the configure script!])
130 # Like AC_CONFIG_HEADER, but automatically create stamp file.
132 AC_DEFUN(AM_CONFIG_HEADER,
134 AC_CONFIG_HEADER([$1])
135 dnl When config.status generates a header, we must update the stamp-h file.
136 dnl This file resides in the same directory as the config header
137 dnl that is generated. We must strip everything past the first ":",
138 dnl and everything past the last "/".
139 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
140 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
141 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
143 for am_file in <<$1>>; do
144 case " <<$>>CONFIG_HEADERS " in
145 *" <<$>>am_file "*<<)>>
146 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
149 am_indx=`expr "<<$>>am_indx" + 1`
153 # Do all the work for Automake. This macro actually does too much --
154 # some checks are only needed if your package does certain things.
155 # But this isn't really a big deal.
160 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
162 AC_DEFUN(AM_INIT_AUTOMAKE,
163 [AC_REQUIRE([AM_PROG_INSTALL])
168 dnl test to see if srcdir already configured
169 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
170 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
173 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
174 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
175 AC_REQUIRE([AM_SANITY_CHECK])
176 AC_REQUIRE([AC_ARG_PROGRAM])
177 dnl FIXME This is truly gross.
178 missing_dir=`cd $ac_aux_dir && pwd`
179 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
180 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
181 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
182 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
183 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
184 AC_REQUIRE([AC_PROG_MAKE_SET])])
189 AC_DEFUN(AM_PROG_INSTALL,
190 [AC_REQUIRE([AC_PROG_INSTALL])
191 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
192 AC_SUBST(INSTALL_SCRIPT)dnl
196 # Check to make sure that the build environment is sane.
199 AC_DEFUN(AM_SANITY_CHECK,
200 [AC_MSG_CHECKING([whether build environment is sane])
203 echo timestamp > conftestfile
204 # Do `set' in a subshell so we don't clobber the current shell's
205 # arguments. Must try -L first in case configure is actually a
206 # symlink; some systems play weird games with the mod time of symlinks
207 # (eg FreeBSD returns the mod time of the symlink's containing
210 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
211 if test "[$]*" = "X"; then
213 set X `ls -t $srcdir/configure conftestfile`
215 if test "[$]*" != "X $srcdir/configure conftestfile" \
216 && test "[$]*" != "X conftestfile $srcdir/configure"; then
218 # If neither matched, then we have a broken ls. This can happen
219 # if, for instance, CONFIG_SHELL is bash and it inherits a
220 # broken ls alias from the environment. This has actually
221 # happened. Such a system could not be considered "sane".
222 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
223 alias in your environment])
226 test "[$]2" = conftestfile
232 AC_MSG_ERROR([newly created file is older than distributed files!
233 Check your system clock])
238 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
239 dnl The program must properly implement --version.
240 AC_DEFUN(AM_MISSING_PROG,
241 [AC_MSG_CHECKING(for working $2)
242 # Run test in a subshell; some versions of sh will print an error if
243 # an executable is not found, even if stderr is redirected.
244 # Redirect stdin to placate older versions of autoconf. Sigh.
245 if ($2 --version) < /dev/null > /dev/null 2>&1; then
250 AC_MSG_RESULT(missing)
254 # Add --enable-maintainer-mode option to configure.
259 AC_DEFUN(AM_MAINTAINER_MODE,
260 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
261 dnl maintainer-mode is disabled by default
262 AC_ARG_ENABLE(maintainer-mode,
263 [ --enable-maintainer-mode enable make rules and dependencies not useful
264 (and sometimes confusing) to the casual installer],
265 USE_MAINTAINER_MODE=$enableval,
266 USE_MAINTAINER_MODE=no)
267 AC_MSG_RESULT($USE_MAINTAINER_MODE)
268 if test $USE_MAINTAINER_MODE = yes; then
278 # serial 24 AM_PROG_LIBTOOL
279 AC_DEFUN(AM_PROG_LIBTOOL,
280 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
281 AC_REQUIRE([AM_ENABLE_STATIC])dnl
282 AC_REQUIRE([AC_CANONICAL_HOST])dnl
283 AC_REQUIRE([AC_PROG_RANLIB])dnl
284 AC_REQUIRE([AC_PROG_CC])dnl
285 AC_REQUIRE([AM_PROG_LD])dnl
286 AC_REQUIRE([AM_PROG_NM])dnl
287 AC_REQUIRE([AC_PROG_LN_S])dnl
289 # Always use our own libtool.
290 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
293 # Check for any special flags to pass to ltconfig.
295 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
296 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
297 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
298 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
299 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
301 # Some flags need to be propagated to the compiler or linker for good
305 # Find out which ABI we are using.
306 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
307 if AC_TRY_EVAL(ac_compile); then
308 case "`/usr/bin/file conftest.o`" in
324 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
325 CFLAGS="$CFLAGS -belf"
329 # Actually configure libtool. ac_aux_dir is where install-sh is found.
330 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
331 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
332 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
333 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
334 || AC_MSG_ERROR([libtool configure failed])
337 # AM_ENABLE_SHARED - implement the --enable-shared flag
338 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
339 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
341 AC_DEFUN(AM_ENABLE_SHARED,
342 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
343 AC_ARG_ENABLE(shared,
344 changequote(<<, >>)dnl
345 << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
347 [ --enable-shared=PKGS only build shared libraries if the current package
348 appears as an element in the PKGS list],
349 [p=${PACKAGE-default}
351 yes) enable_shared=yes ;;
352 no) enable_shared=no ;;
355 # Look at the argument we got. We use all the common list separators.
356 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
357 for pkg in $enableval; do
358 if test "X$pkg" = "X$p"; then
365 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
368 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
369 AC_DEFUN(AM_DISABLE_SHARED,
370 [AM_ENABLE_SHARED(no)])
372 # AM_DISABLE_STATIC - set the default static flag to --disable-static
373 AC_DEFUN(AM_DISABLE_STATIC,
374 [AM_ENABLE_STATIC(no)])
376 # AM_ENABLE_STATIC - implement the --enable-static flag
377 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
378 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
380 AC_DEFUN(AM_ENABLE_STATIC,
381 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
382 AC_ARG_ENABLE(static,
383 changequote(<<, >>)dnl
384 << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
386 [ --enable-static=PKGS only build shared libraries if the current package
387 appears as an element in the PKGS list],
388 [p=${PACKAGE-default}
390 yes) enable_static=yes ;;
391 no) enable_static=no ;;
394 # Look at the argument we got. We use all the common list separators.
395 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
396 for pkg in $enableval; do
397 if test "X$pkg" = "X$p"; then
404 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
408 # AM_PROG_LD - find the path to the GNU or non-GNU linker
411 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
412 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
413 AC_REQUIRE([AC_PROG_CC])
415 if test "$ac_cv_prog_gcc" = yes; then
416 # Check if gcc -print-prog-name=ld gives a path.
417 AC_MSG_CHECKING([for ld used by GCC])
418 ac_prog=`($CC -print-prog-name=ld) 2>&5`
420 # Accept absolute paths.
422 test -z "$LD" && LD="$ac_prog"
425 # If it fails, then pretend we aren't using GCC.
429 # If it is relative, then search for the first ld in PATH.
433 elif test "$with_gnu_ld" = yes; then
434 AC_MSG_CHECKING([for GNU ld])
436 AC_MSG_CHECKING([for non-GNU ld])
438 AC_CACHE_VAL(ac_cv_path_LD,
439 [if test -z "$LD"; then
440 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
441 for ac_dir in $PATH; do
442 test -z "$ac_dir" && ac_dir=.
443 if test -f "$ac_dir/$ac_prog"; then
444 ac_cv_path_LD="$ac_dir/$ac_prog"
445 # Check to see if the program is GNU ld. I'd rather use --version,
446 # but apparently some GNU ld's only accept -v.
447 # Break only if it was the GNU/non-GNU ld that we prefer.
448 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
449 test "$with_gnu_ld" != no && break
451 test "$with_gnu_ld" != yes && break
457 ac_cv_path_LD="$LD" # Let the user override the test with a path.
460 if test -n "$LD"; then
465 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
470 AC_DEFUN(AM_PROG_LD_GNU,
471 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
472 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
473 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
474 ac_cv_prog_gnu_ld=yes
480 # AM_PROG_NM - find the path to a BSD-compatible name lister
482 [AC_MSG_CHECKING([for BSD-compatible nm])
483 AC_CACHE_VAL(ac_cv_path_NM,
486 ac_cv_path_NM="$NM" # Let the user override the test with a path.
489 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
490 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
491 test -z "$ac_dir" && ac_dir=.
492 if test -f $ac_dir/nm; then
493 # Check to see if the nm accepts a BSD-compat flag.
494 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
495 # nm: unknown option "B" ignored
496 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
497 ac_cv_path_NM="$ac_dir/nm -B"
498 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
499 ac_cv_path_NM="$ac_dir/nm -p"
501 ac_cv_path_NM="$ac_dir/nm"
507 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
517 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
518 AC_DEFUN(AM_PROG_LEX,
519 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
520 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")