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