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