]> www.ginac.de Git - ginac.git/blob - aclocal.m4
- a little bit more consistent evaluation of zeta(x)
[ginac.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.3
2
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.
7
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.
12
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
16 dnl future trouble.
17 dnl ===========================================================================
18
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,
27     [AC_PROVIDE([$0])
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]);
31         )
32     )
33 ])
34
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,
39     [AC_PROVIDE([$0])
40     AC_MSG_CHECKING([how to link with libcln])
41     saved_LIBS="${LIBS}"
42     AC_CACHE_VAL(ginac_cv_lib_cln_link,
43         [LIBS="-lcln"
44         case "${ac_cv_header_CLN_cln_h}" in
45         "yes")
46             AC_TRY_LINK([#include <CLN/cln.h>],
47                 [factorial(1);],
48                 ginac_cv_lib_cln_link="-lcln",
49                 ginac_cv_lib_cln_link="fail")
50             ;;
51         *)
52             AC_TRY_LINK([#include <cln.h>],
53                 [factorial(1);],
54                 ginac_cv_lib_cln_link="-lcln",
55                 ginac_cv_lib_cln_link="fail")
56             ;;
57         esac
58     ])
59     case "${ginac_cv_lib_cln_link}" in
60 dnl linking worked:
61     "-lcln")
62         LIBS="-lcln ${saved_LIBS}"
63         AC_MSG_RESULT([-lcln])
64         GINAC_CHECK_LIBCLN_SANITY
65     ;;
66 dnl linking failed:
67     "fail")
68         LIBS="${saved_LIBS}"
69         AC_MSG_RESULT([])
70         AC_MSG_WARN([linking with libcln failed])
71     ;;
72 dnl should never ever get here:
73     *)
74         LIBS="${saved_LIBS}"
75     ;;
76     esac
77 ])
78
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
81 dnl then removed.
82 AC_DEFUN(GINAC_CHECK_LIBCLN_SANITY,
83     [AC_PROVIDE([$0])
84     AC_MSG_CHECKING([whether libcln behaves sane])
85     AC_CACHE_VAL(ginac_cv_lib_cln_integrity,
86         [
87         case "${ac_cv_header_CLN_cln_h}" in
88         "yes")
89             AC_TRY_RUN([#include <CLN/cln.h>
90 int main() {
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;
93 }],
94                 ginac_cv_lib_cln_integrity="sane",
95                 ginac_cv_lib_cln_integrity="insane",
96                 ginac_cv_lib_cln_integrity="guessing sane")
97             ;;
98         *)
99             AC_TRY_RUN([#include <cln.h>
100 int main() {
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;
103 }],
104                 ginac_cv_lib_cln_integrity="sane",
105                 ginac_cv_lib_cln_integrity="insane",
106                 ginac_cv_lib_cln_integrity="guessing sane")
107             ;;
108         esac
109     ])
110     case "${ginac_cv_lib_cln_integrity}" in
111 dnl exit status was 0:
112     "sane")
113         AC_MSG_RESULT([yes])
114     ;;
115 dnl exit status was not 0:
116     "insane")
117         AC_MSG_RESULT([no])
118         AC_MSG_WARN([maybe version of libcln is older than 1.0.2?])
119     ;;
120 dnl test-program was not run because we are cross-compiling:
121     "guessing sane")
122         AC_MSG_RESULT([hopefully])
123     ;;
124 dnl should never ever get here:
125     *)
126         AC_MSG_WARN([you found a bug in the configure script!])
127     ;;
128     esac
129 ])
130
131 # Like AC_CONFIG_HEADER, but automatically create stamp file.
132
133 AC_DEFUN(AM_CONFIG_HEADER,
134 [AC_PREREQ([2.12])
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>>,
143 <<am_indx=1
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
148     ;;
149   esac
150   am_indx=`expr "<<$>>am_indx" + 1`
151 done<<>>dnl>>)
152 changequote([,]))])
153
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.
157
158 # serial 1
159
160 dnl Usage:
161 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
162
163 AC_DEFUN(AM_INIT_AUTOMAKE,
164 [AC_REQUIRE([AM_PROG_INSTALL])
165 PACKAGE=[$1]
166 AC_SUBST(PACKAGE)
167 VERSION=[$2]
168 AC_SUBST(VERSION)
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])
172 fi
173 ifelse([$3],,
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])])
186
187
188 # serial 1
189
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
194 ])
195
196 #
197 # Check to make sure that the build environment is sane.
198 #
199
200 AC_DEFUN(AM_SANITY_CHECK,
201 [AC_MSG_CHECKING([whether build environment is sane])
202 # Just in case
203 sleep 1
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
209 # directory).
210 if (
211    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
212    if test "[$]*" = "X"; then
213       # -L didn't work.
214       set X `ls -t $srcdir/configure conftestfile`
215    fi
216    if test "[$]*" != "X $srcdir/configure conftestfile" \
217       && test "[$]*" != "X conftestfile $srcdir/configure"; then
218
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])
225    fi
226
227    test "[$]2" = conftestfile
228    )
229 then
230    # Ok.
231    :
232 else
233    AC_MSG_ERROR([newly created file is older than distributed files!
234 Check your system clock])
235 fi
236 rm -f conftest*
237 AC_MSG_RESULT(yes)])
238
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
247    $1=$2
248    AC_MSG_RESULT(found)
249 else
250    $1="$3/missing $2"
251    AC_MSG_RESULT(missing)
252 fi
253 AC_SUBST($1)])
254
255 # Add --enable-maintainer-mode option to configure.
256 # From Jim Meyering
257
258 # serial 1
259
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
270     MAINT=
271   else
272     MAINT='#M#'
273   fi
274   AC_SUBST(MAINT)dnl
275 ]
276 )
277
278
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
289 dnl
290 # Always use our own libtool.
291 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
292 AC_SUBST(LIBTOOL)dnl
293
294 # Check for any special flags to pass to ltconfig.
295 libtool_flags=
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"
301
302 # Some flags need to be propagated to the compiler or linker for good
303 # libtool support.
304 case "$host" in
305 *-*-irix6*)
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
310     *32-bit*)
311       LD="${LD-ld} -32"
312       ;;
313     *N32*)
314       LD="${LD-ld} -n32"
315       ;;
316     *64-bit*)
317       LD="${LD-ld} -64"
318       ;;
319     esac
320   fi
321   rm -rf conftest*
322   ;;
323
324 *-*-sco3.2v5*)
325   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
326   CFLAGS="$CFLAGS -belf"
327   ;;
328 esac
329
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])
336 ])
337
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
341 #   `yes'.
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]
347 changequote([, ])dnl
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}
351 case "$enableval" in
352 yes) enable_shared=yes ;;
353 no) enable_shared=no ;;
354 *)
355   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
360       enable_shared=yes
361     fi
362   done
363   IFS="$ac_save_ifs"
364   ;;
365 esac],
366 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
367 ])
368
369 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
370 AC_DEFUN(AM_DISABLE_SHARED,
371 [AM_ENABLE_SHARED(no)])
372
373 # AM_DISABLE_STATIC - set the default static flag to --disable-static
374 AC_DEFUN(AM_DISABLE_STATIC,
375 [AM_ENABLE_STATIC(no)])
376
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
380 #   `yes'.
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]
386 changequote([, ])dnl
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}
390 case "$enableval" in
391 yes) enable_static=yes ;;
392 no) enable_static=no ;;
393 *)
394   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
399       enable_static=yes
400     fi
401   done
402   IFS="$ac_save_ifs"
403   ;;
404 esac],
405 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
406 ])
407
408
409 # AM_PROG_LD - find the path to the GNU or non-GNU linker
410 AC_DEFUN(AM_PROG_LD,
411 [AC_ARG_WITH(gnu-ld,
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])
415 ac_prog=ld
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`
420   case "$ac_prog" in
421   # Accept absolute paths.
422   /* | [A-Za-z]:\\*)
423     test -z "$LD" && LD="$ac_prog"
424     ;;
425   "")
426     # If it fails, then pretend we aren't using GCC.
427     ac_prog=ld
428     ;;
429   *)
430     # If it is relative, then search for the first ld in PATH.
431     with_gnu_ld=unknown
432     ;;
433   esac
434 elif test "$with_gnu_ld" = yes; then
435   AC_MSG_CHECKING([for GNU ld])
436 else
437   AC_MSG_CHECKING([for non-GNU ld])
438 fi
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
451       else
452         test "$with_gnu_ld" != yes && break
453       fi
454     fi
455   done
456   IFS="$ac_save_ifs"
457 else
458   ac_cv_path_LD="$LD" # Let the user override the test with a path.
459 fi])
460 LD="$ac_cv_path_LD"
461 if test -n "$LD"; then
462   AC_MSG_RESULT($LD)
463 else
464   AC_MSG_RESULT(no)
465 fi
466 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
467 AC_SUBST(LD)
468 AM_PROG_LD_GNU
469 ])
470
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
476 else
477   ac_cv_prog_gnu_ld=no
478 fi])
479 ])
480
481 # AM_PROG_NM - find the path to a BSD-compatible name lister
482 AC_DEFUN(AM_PROG_NM,
483 [AC_MSG_CHECKING([for BSD-compatible nm])
484 AC_CACHE_VAL(ac_cv_path_NM,
485 [case "$NM" in
486 /* | [A-Za-z]:\\*)
487   ac_cv_path_NM="$NM" # Let the user override the test with a path.
488   ;;
489 *)
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"
501       else
502         ac_cv_path_NM="$ac_dir/nm"
503       fi
504       break
505     fi
506   done
507   IFS="$ac_save_ifs"
508   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
509   ;;
510 esac])
511 NM="$ac_cv_path_NM"
512 AC_MSG_RESULT([$NM])
513 AC_SUBST(NM)
514 ])
515
516
517 dnl AM_PROG_LEX
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")
522 AC_PROG_LEX
523 AC_DECL_YYTEXT])
524