]> www.ginac.de Git - ginac.git/blob - aclocal.m4
- series expansion of pseries objects should now work as expected
[ginac.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file 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([for doublefactorial in -lcln])
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                 [doublefactorial(2);],
48                 ginac_cv_lib_cln_link="-lcln",
49                 ginac_cv_lib_cln_link="fail")
50             ;;
51         *)
52             AC_TRY_LINK([#include <cln.h>],
53                 [doublefactorial(2);],
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="${ginac_cv_lib_cln_link} ${saved_LIBS}"
63         AC_MSG_RESULT("yes")
64     ;;
65 dnl linking failed:
66     "fail")
67         LIBS="${saved_LIBS}"
68         AC_MSG_RESULT([no])
69         AC_MSG_ERROR([You either need to set \$LDFLAGS or update CLN])
70     ;;
71 dnl should never ever get here:
72     *)
73         LIBS="${saved_LIBS}"
74         AC_MSG_WARN([you found a bug in the configure script!])
75     ;;
76     esac
77 ])
78
79 # Like AC_CONFIG_HEADER, but automatically create stamp file.
80
81 AC_DEFUN(AM_CONFIG_HEADER,
82 [AC_PREREQ([2.12])
83 AC_CONFIG_HEADER([$1])
84 dnl When config.status generates a header, we must update the stamp-h file.
85 dnl This file resides in the same directory as the config header
86 dnl that is generated.  We must strip everything past the first ":",
87 dnl and everything past the last "/".
88 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
89 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
90 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
91 <<am_indx=1
92 for am_file in <<$1>>; do
93   case " <<$>>CONFIG_HEADERS " in
94   *" <<$>>am_file "*<<)>>
95     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
96     ;;
97   esac
98   am_indx=`expr "<<$>>am_indx" + 1`
99 done<<>>dnl>>)
100 changequote([,]))])
101
102 # Do all the work for Automake.  This macro actually does too much --
103 # some checks are only needed if your package does certain things.
104 # But this isn't really a big deal.
105
106 # serial 1
107
108 dnl Usage:
109 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
110
111 AC_DEFUN(AM_INIT_AUTOMAKE,
112 [AC_REQUIRE([AC_PROG_INSTALL])
113 PACKAGE=[$1]
114 AC_SUBST(PACKAGE)
115 VERSION=[$2]
116 AC_SUBST(VERSION)
117 dnl test to see if srcdir already configured
118 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
119   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
120 fi
121 ifelse([$3],,
122 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
123 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
124 AC_REQUIRE([AM_SANITY_CHECK])
125 AC_REQUIRE([AC_ARG_PROGRAM])
126 dnl FIXME This is truly gross.
127 missing_dir=`cd $ac_aux_dir && pwd`
128 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
129 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
130 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
131 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
132 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
133 AC_REQUIRE([AC_PROG_MAKE_SET])])
134
135 #
136 # Check to make sure that the build environment is sane.
137 #
138
139 AC_DEFUN(AM_SANITY_CHECK,
140 [AC_MSG_CHECKING([whether build environment is sane])
141 # Just in case
142 sleep 1
143 echo timestamp > conftestfile
144 # Do `set' in a subshell so we don't clobber the current shell's
145 # arguments.  Must try -L first in case configure is actually a
146 # symlink; some systems play weird games with the mod time of symlinks
147 # (eg FreeBSD returns the mod time of the symlink's containing
148 # directory).
149 if (
150    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
151    if test "[$]*" = "X"; then
152       # -L didn't work.
153       set X `ls -t $srcdir/configure conftestfile`
154    fi
155    if test "[$]*" != "X $srcdir/configure conftestfile" \
156       && test "[$]*" != "X conftestfile $srcdir/configure"; then
157
158       # If neither matched, then we have a broken ls.  This can happen
159       # if, for instance, CONFIG_SHELL is bash and it inherits a
160       # broken ls alias from the environment.  This has actually
161       # happened.  Such a system could not be considered "sane".
162       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
163 alias in your environment])
164    fi
165
166    test "[$]2" = conftestfile
167    )
168 then
169    # Ok.
170    :
171 else
172    AC_MSG_ERROR([newly created file is older than distributed files!
173 Check your system clock])
174 fi
175 rm -f conftest*
176 AC_MSG_RESULT(yes)])
177
178 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
179 dnl The program must properly implement --version.
180 AC_DEFUN(AM_MISSING_PROG,
181 [AC_MSG_CHECKING(for working $2)
182 # Run test in a subshell; some versions of sh will print an error if
183 # an executable is not found, even if stderr is redirected.
184 # Redirect stdin to placate older versions of autoconf.  Sigh.
185 if ($2 --version) < /dev/null > /dev/null 2>&1; then
186    $1=$2
187    AC_MSG_RESULT(found)
188 else
189    $1="$3/missing $2"
190    AC_MSG_RESULT(missing)
191 fi
192 AC_SUBST($1)])
193
194 # Add --enable-maintainer-mode option to configure.
195 # From Jim Meyering
196
197 # serial 1
198
199 AC_DEFUN(AM_MAINTAINER_MODE,
200 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
201   dnl maintainer-mode is disabled by default
202   AC_ARG_ENABLE(maintainer-mode,
203 [  --enable-maintainer-mode enable make rules and dependencies not useful
204                           (and sometimes confusing) to the casual installer],
205       USE_MAINTAINER_MODE=$enableval,
206       USE_MAINTAINER_MODE=no)
207   AC_MSG_RESULT($USE_MAINTAINER_MODE)
208   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
209   MAINT=$MAINTAINER_MODE_TRUE
210   AC_SUBST(MAINT)dnl
211 ]
212 )
213
214 # Define a conditional.
215
216 AC_DEFUN(AM_CONDITIONAL,
217 [AC_SUBST($1_TRUE)
218 AC_SUBST($1_FALSE)
219 if $2; then
220   $1_TRUE=
221   $1_FALSE='#'
222 else
223   $1_TRUE='#'
224   $1_FALSE=
225 fi])
226
227
228 # serial 40 AC_PROG_LIBTOOL
229 AC_DEFUN(AC_PROG_LIBTOOL,
230 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
231
232 # Save cache, so that ltconfig can load it
233 AC_CACHE_SAVE
234
235 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
236 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
237 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
238 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
239 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
240 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
241 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
242 || AC_MSG_ERROR([libtool configure failed])
243
244 # Reload cache, that may have been modified by ltconfig
245 AC_CACHE_LOAD
246
247 # This can be used to rebuild libtool when needed
248 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
249
250 # Always use our own libtool.
251 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
252 AC_SUBST(LIBTOOL)dnl
253
254 # Redirect the config.log output again, so that the ltconfig log is not
255 # clobbered by the next message.
256 exec 5>>./config.log
257 ])
258
259 AC_DEFUN(AC_LIBTOOL_SETUP,
260 [AC_PREREQ(2.13)dnl
261 AC_REQUIRE([AC_ENABLE_SHARED])dnl
262 AC_REQUIRE([AC_ENABLE_STATIC])dnl
263 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
264 AC_REQUIRE([AC_CANONICAL_HOST])dnl
265 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
266 AC_REQUIRE([AC_PROG_RANLIB])dnl
267 AC_REQUIRE([AC_PROG_CC])dnl
268 AC_REQUIRE([AC_PROG_LD])dnl
269 AC_REQUIRE([AC_PROG_NM])dnl
270 AC_REQUIRE([AC_PROG_LN_S])dnl
271 dnl
272
273 case "$target" in
274 NONE) lt_target="$host" ;;
275 *) lt_target="$target" ;;
276 esac
277
278 # Check for any special flags to pass to ltconfig.
279 libtool_flags="--cache-file=$cache_file"
280 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
281 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
282 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
283 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
284 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
285 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
286 [libtool_flags="$libtool_flags --enable-dlopen"])
287 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
288 [libtool_flags="$libtool_flags --enable-win32-dll"])
289 AC_ARG_ENABLE(libtool-lock,
290   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
291 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
292 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
293
294 # Some flags need to be propagated to the compiler or linker for good
295 # libtool support.
296 case "$lt_target" in
297 *-*-irix6*)
298   # Find out which ABI we are using.
299   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
300   if AC_TRY_EVAL(ac_compile); then
301     case "`/usr/bin/file conftest.o`" in
302     *32-bit*)
303       LD="${LD-ld} -32"
304       ;;
305     *N32*)
306       LD="${LD-ld} -n32"
307       ;;
308     *64-bit*)
309       LD="${LD-ld} -64"
310       ;;
311     esac
312   fi
313   rm -rf conftest*
314   ;;
315
316 *-*-sco3.2v5*)
317   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
318   SAVE_CFLAGS="$CFLAGS"
319   CFLAGS="$CFLAGS -belf"
320   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
321     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
322   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
323     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
324     CFLAGS="$SAVE_CFLAGS"
325   fi
326   ;;
327
328 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
329 [*-*-cygwin* | *-*-mingw*)
330   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
331   AC_CHECK_TOOL(AS, as, false)
332   AC_CHECK_TOOL(OBJDUMP, objdump, false)
333   ;;
334 ])
335 esac
336 ])
337
338 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
339 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
340
341 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
342 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
343
344 # AC_ENABLE_SHARED - implement the --enable-shared flag
345 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
346 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
347 #   `yes'.
348 AC_DEFUN(AC_ENABLE_SHARED, [dnl
349 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
350 AC_ARG_ENABLE(shared,
351 changequote(<<, >>)dnl
352 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
353 changequote([, ])dnl
354 [p=${PACKAGE-default}
355 case "$enableval" in
356 yes) enable_shared=yes ;;
357 no) enable_shared=no ;;
358 *)
359   enable_shared=no
360   # Look at the argument we got.  We use all the common list separators.
361   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
362   for pkg in $enableval; do
363     if test "X$pkg" = "X$p"; then
364       enable_shared=yes
365     fi
366   done
367   IFS="$ac_save_ifs"
368   ;;
369 esac],
370 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
371 ])
372
373 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
374 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
375 AC_ENABLE_SHARED(no)])
376
377 # AC_ENABLE_STATIC - implement the --enable-static flag
378 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
379 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
380 #   `yes'.
381 AC_DEFUN(AC_ENABLE_STATIC, [dnl
382 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
383 AC_ARG_ENABLE(static,
384 changequote(<<, >>)dnl
385 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
386 changequote([, ])dnl
387 [p=${PACKAGE-default}
388 case "$enableval" in
389 yes) enable_static=yes ;;
390 no) enable_static=no ;;
391 *)
392   enable_static=no
393   # Look at the argument we got.  We use all the common list separators.
394   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
395   for pkg in $enableval; do
396     if test "X$pkg" = "X$p"; then
397       enable_static=yes
398     fi
399   done
400   IFS="$ac_save_ifs"
401   ;;
402 esac],
403 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
404 ])
405
406 # AC_DISABLE_STATIC - set the default static flag to --disable-static
407 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
408 AC_ENABLE_STATIC(no)])
409
410
411 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
412 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
413 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
414 #   `yes'.
415 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
416 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
417 AC_ARG_ENABLE(fast-install,
418 changequote(<<, >>)dnl
419 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
420 changequote([, ])dnl
421 [p=${PACKAGE-default}
422 case "$enableval" in
423 yes) enable_fast_install=yes ;;
424 no) enable_fast_install=no ;;
425 *)
426   enable_fast_install=no
427   # Look at the argument we got.  We use all the common list separators.
428   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
429   for pkg in $enableval; do
430     if test "X$pkg" = "X$p"; then
431       enable_fast_install=yes
432     fi
433   done
434   IFS="$ac_save_ifs"
435   ;;
436 esac],
437 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
438 ])
439
440 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
441 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
442 AC_ENABLE_FAST_INSTALL(no)])
443
444 # AC_PROG_LD - find the path to the GNU or non-GNU linker
445 AC_DEFUN(AC_PROG_LD,
446 [AC_ARG_WITH(gnu-ld,
447 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
448 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
449 AC_REQUIRE([AC_PROG_CC])dnl
450 AC_REQUIRE([AC_CANONICAL_HOST])dnl
451 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
452 ac_prog=ld
453 if test "$ac_cv_prog_gcc" = yes; then
454   # Check if gcc -print-prog-name=ld gives a path.
455   AC_MSG_CHECKING([for ld used by GCC])
456   ac_prog=`($CC -print-prog-name=ld) 2>&5`
457   case "$ac_prog" in
458     # Accept absolute paths.
459 changequote(,)dnl
460     [\\/]* | [A-Za-z]:[\\/]*)
461       re_direlt='/[^/][^/]*/\.\./'
462 changequote([,])dnl
463       # Canonicalize the path of ld
464       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
465       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
466         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
467       done
468       test -z "$LD" && LD="$ac_prog"
469       ;;
470   "")
471     # If it fails, then pretend we aren't using GCC.
472     ac_prog=ld
473     ;;
474   *)
475     # If it is relative, then search for the first ld in PATH.
476     with_gnu_ld=unknown
477     ;;
478   esac
479 elif test "$with_gnu_ld" = yes; then
480   AC_MSG_CHECKING([for GNU ld])
481 else
482   AC_MSG_CHECKING([for non-GNU ld])
483 fi
484 AC_CACHE_VAL(ac_cv_path_LD,
485 [if test -z "$LD"; then
486   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
487   for ac_dir in $PATH; do
488     test -z "$ac_dir" && ac_dir=.
489     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
490       ac_cv_path_LD="$ac_dir/$ac_prog"
491       # Check to see if the program is GNU ld.  I'd rather use --version,
492       # but apparently some GNU ld's only accept -v.
493       # Break only if it was the GNU/non-GNU ld that we prefer.
494       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
495         test "$with_gnu_ld" != no && break
496       else
497         test "$with_gnu_ld" != yes && break
498       fi
499     fi
500   done
501   IFS="$ac_save_ifs"
502 else
503   ac_cv_path_LD="$LD" # Let the user override the test with a path.
504 fi])
505 LD="$ac_cv_path_LD"
506 if test -n "$LD"; then
507   AC_MSG_RESULT($LD)
508 else
509   AC_MSG_RESULT(no)
510 fi
511 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
512 AC_PROG_LD_GNU
513 ])
514
515 AC_DEFUN(AC_PROG_LD_GNU,
516 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
517 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
518 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
519   ac_cv_prog_gnu_ld=yes
520 else
521   ac_cv_prog_gnu_ld=no
522 fi])
523 ])
524
525 # AC_PROG_NM - find the path to a BSD-compatible name lister
526 AC_DEFUN(AC_PROG_NM,
527 [AC_MSG_CHECKING([for BSD-compatible nm])
528 AC_CACHE_VAL(ac_cv_path_NM,
529 [if test -n "$NM"; then
530   # Let the user override the test.
531   ac_cv_path_NM="$NM"
532 else
533   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
534   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
535     test -z "$ac_dir" && ac_dir=.
536     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
537       # Check to see if the nm accepts a BSD-compat flag.
538       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
539       #   nm: unknown option "B" ignored
540       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
541         ac_cv_path_NM="$ac_dir/nm -B"
542         break
543       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
544         ac_cv_path_NM="$ac_dir/nm -p"
545         break
546       else
547         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
548         continue # so that we can try to find one that supports BSD flags
549       fi
550     fi
551   done
552   IFS="$ac_save_ifs"
553   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
554 fi])
555 NM="$ac_cv_path_NM"
556 AC_MSG_RESULT([$NM])
557 ])
558
559 # AC_CHECK_LIBM - check for math library
560 AC_DEFUN(AC_CHECK_LIBM,
561 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
562 LIBM=
563 case "$lt_target" in
564 *-*-beos* | *-*-cygwin*)
565   # These system don't have libm
566   ;;
567 *-ncr-sysv4.3*)
568   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
569   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
570   ;;
571 *)
572   AC_CHECK_LIB(m, main, LIBM="-lm")
573   ;;
574 esac
575 ])
576
577 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
578 # the libltdl convenience library, adds --enable-ltdl-convenience to
579 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
580 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
581 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
582 # '${top_builddir}/' (note the single quotes!) if your package is not
583 # flat, and, if you're not using automake, define top_builddir as
584 # appropriate in the Makefiles.
585 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
586   case "$enable_ltdl_convenience" in
587   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
588   "") enable_ltdl_convenience=yes
589       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
590   esac
591   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
592   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
593 ])
594
595 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
596 # the libltdl installable library, and adds --enable-ltdl-install to
597 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
598 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
599 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
600 # '${top_builddir}/' (note the single quotes!) if your package is not
601 # flat, and, if you're not using automake, define top_builddir as
602 # appropriate in the Makefiles.
603 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
604 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
605   AC_CHECK_LIB(ltdl, main,
606   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
607   [if test x"$enable_ltdl_install" = xno; then
608      AC_MSG_WARN([libltdl not installed, but installation disabled])
609    else
610      enable_ltdl_install=yes
611    fi
612   ])
613   if test x"$enable_ltdl_install" = x"yes"; then
614     ac_configure_args="$ac_configure_args --enable-ltdl-install"
615     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
616     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
617   else
618     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
619     LIBLTDL="-lltdl"
620     INCLTDL=
621   fi
622 ])
623
624 dnl old names
625 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
626 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
627 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
628 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
629 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
630 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
631 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
632
633 dnl This is just to silence aclocal about the macro not being used
634 ifelse([AC_DISABLE_FAST_INSTALL])dnl
635
636
637 dnl AM_PROG_LEX
638 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
639 AC_DEFUN(AM_PROG_LEX,
640 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
641 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
642 AC_PROG_LEX
643 AC_DECL_YYTEXT])
644