]> sjero.net Git - wget/blob - aclocal.m4
[svn] Linking with OpenSSL previously required the user to set up all the
[wget] / aclocal.m4
1 AC_DEFUN(AM_C_PROTOTYPES,
2 [AC_REQUIRE([AM_PROG_CC_STDC])
3 AC_BEFORE([$0], [AC_C_INLINE])
4 AC_MSG_CHECKING([for function prototypes])
5 if test "$am_cv_prog_cc_stdc" != no; then
6   AC_MSG_RESULT(yes)
7   AC_DEFINE(PROTOTYPES)
8   U= ANSI2KNR=
9 else
10   AC_MSG_RESULT(no)
11   U=_ ANSI2KNR=./ansi2knr
12   # Ensure some checks needed by ansi2knr itself.
13   AC_HEADER_STDC
14   AC_CHECK_HEADERS(string.h)
15 fi
16 AC_SUBST(U)dnl
17 AC_SUBST(ANSI2KNR)dnl
18 ])
19
20
21 # serial 1
22
23 # @defmac AC_PROG_CC_STDC
24 # @maindex PROG_CC_STDC
25 # @ovindex CC
26 # If the C compiler in not in ANSI C mode by default, try to add an option
27 # to output variable @code{CC} to make it so.  This macro tries various
28 # options that select ANSI C on some system or another.  It considers the
29 # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
30 # handles function prototypes correctly.
31 #
32 # If you use this macro, you should check after calling it whether the C
33 # compiler has been set to accept ANSI C; if not, the shell variable
34 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
35 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
36 # program @code{ansi2knr}, which comes with Ghostscript.
37 # @end defmac
38
39 AC_DEFUN(AM_PROG_CC_STDC,
40 [AC_REQUIRE([AC_PROG_CC])
41 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
42 AC_CACHE_VAL(am_cv_prog_cc_stdc,
43 [am_cv_prog_cc_stdc=no
44 ac_save_CC="$CC"
45 # Don't try gcc -ansi; that turns off useful extensions and
46 # breaks some systems' header files.
47 # AIX                   -qlanglvl=ansi
48 # Ultrix and OSF/1      -std1
49 # HP-UX                 -Aa -D_HPUX_SOURCE
50 # SVR4                  -Xc -D__EXTENSIONS__
51 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
52 do
53   CC="$ac_save_CC $ac_arg"
54   AC_TRY_COMPILE(
55 [#if !defined(__STDC__) || __STDC__ != 1
56 choke me
57 #endif
58 /* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
59 #ifdef _SEQUENT_
60 # include <sys/types.h>
61 # include <sys/stat.h>
62 #endif
63 ], [
64 int test (int i, double x);
65 struct s1 {int (*f) (int a);};
66 struct s2 {int (*f) (double a);};],
67 [am_cv_prog_cc_stdc="$ac_arg"; break])
68 done
69 CC="$ac_save_CC"
70 ])
71 AC_MSG_RESULT($am_cv_prog_cc_stdc)
72 case "x$am_cv_prog_cc_stdc" in
73   x|xno) ;;
74   *) CC="$CC $am_cv_prog_cc_stdc" ;;
75 esac
76 ])
77
78 AC_DEFUN(WGET_STRUCT_UTIMBUF,
79 [AC_MSG_CHECKING(for struct utimbuf)
80 if test x"$ac_cv_header_utime_h" = xyes; then
81   AC_EGREP_CPP([struct[         ]+utimbuf],
82     [#include <utime.h>],
83     [AC_DEFINE(HAVE_STRUCT_UTIMBUF)
84       AC_MSG_RESULT(yes)],
85     AC_MSG_RESULT(no))
86 else
87   AC_MSG_RESULT(no)
88 fi])
89
90 \f
91 # This code originates from Ulrich Drepper's AM_WITH_NLS.
92
93 AC_DEFUN(WGET_WITH_NLS,
94   [AC_MSG_CHECKING([whether NLS is requested])
95     dnl Default is enabled NLS
96     AC_ARG_ENABLE(nls,
97       [  --disable-nls           do not use Native Language Support],
98       HAVE_NLS=$enableval, HAVE_NLS=yes)
99     AC_MSG_RESULT($HAVE_NLS)
100
101     dnl If something goes wrong, we may still decide not to use NLS.
102     dnl For this reason, defer AC_SUBST'ing HAVE_NLS until the very
103     dnl last moment.
104
105     if test x"$HAVE_NLS" = xyes; then
106       AC_MSG_RESULT("language catalogs: $ALL_LINGUAS")
107       AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
108         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
109       AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
110           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
111       AC_SUBST(MSGFMT)
112       AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
113       CATOBJEXT=.gmo
114       INSTOBJEXT=.mo
115       DATADIRNAME=share
116
117       dnl Test whether we really found GNU xgettext.
118       if test "$XGETTEXT" != ":"; then
119         dnl If it is no GNU xgettext we define it as : so that the
120         dnl Makefiles still can work.
121         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
122           : ;
123         else
124           AC_MSG_RESULT(
125             [found xgettext programs is not GNU xgettext; ignore it])
126           XGETTEXT=":"
127         fi
128       fi
129
130       AC_CHECK_HEADERS(locale.h libintl.h)
131
132       AC_CHECK_FUNCS(gettext, [], [
133         AC_CHECK_LIB(intl, gettext, [
134           dnl gettext is in libintl; announce the fact manually.
135           LIBS="-lintl $LIBS"
136           AC_DEFINE(HAVE_GETTEXT)
137         ], [
138           AC_MSG_RESULT(
139             [gettext not found; disabling NLS])
140           HAVE_NLS=no
141         ])
142       ])
143
144       dnl These rules are solely for the distribution goal.  While doing this
145       dnl we only have to keep exactly one list of the available catalogs
146       dnl in configure.in.
147       for lang in $ALL_LINGUAS; do
148         GMOFILES="$GMOFILES $lang.gmo"
149         POFILES="$POFILES $lang.po"
150       done
151       dnl Construct list of names of catalog files to be constructed.
152       for lang in $ALL_LINGUAS; do
153         CATALOGS="$CATALOGS ${lang}${CATOBJEXT}"
154       done
155
156       dnl Make all variables we use known to autoconf.
157       AC_SUBST(CATALOGS)
158       AC_SUBST(CATOBJEXT)
159       AC_SUBST(DATADIRNAME)
160       AC_SUBST(GMOFILES)
161       AC_SUBST(INSTOBJEXT)
162       AC_SUBST(INTLLIBS)
163       AC_SUBST(POFILES)
164     fi
165     AC_SUBST(HAVE_NLS)
166     dnl Some independently maintained files, such as po/Makefile.in,
167     dnl use `USE_NLS', so support it.
168     USE_NLS=$HAVE_NLS
169     AC_SUBST(USE_NLS)
170     if test "x$HAVE_NLS" = xyes; then
171       AC_DEFINE(HAVE_NLS)
172     fi
173   ])
174
175 dnl Generate list of files to be processed by xgettext which will
176 dnl be included in po/Makefile.
177 dnl
178 dnl This is not strictly an Autoconf macro, because it is run from
179 dnl within `config.status' rather than from within configure.  This
180 dnl is why special rules must be applied for it.
181 AC_DEFUN(WGET_PROCESS_PO,
182   [srcdir=$ac_given_srcdir # Advanced autoconf hackery
183    dnl I wonder what the following several lines do...
184    if test "x$srcdir" != "x."; then
185      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
186        posrcprefix="$srcdir/"
187      else
188        posrcprefix="../$srcdir/"
189      fi
190    else
191      posrcprefix="../"
192    fi
193    rm -f po/POTFILES
194    dnl Use `echo' rather than AC_MSG_RESULT, because this is run from
195    dnl `config.status'.
196    echo "generating po/POTFILES from $srcdir/po/POTFILES.in"
197    sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\,"  \
198        -e "\$s/\(.*\) \\\\/\1/" \
199         < $srcdir/po/POTFILES.in > po/POTFILES
200    echo "creating po/Makefile"
201    sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
202   ])
203
204 # Search path for a program which passes the given test.
205 # Ulrich Drepper <drepper@cygnus.com>, 1996.
206 #
207 # This file may be copied and used freely without restrictions.  It
208 # can be used in projects which are not available under the GNU Public
209 # License but which still want to provide support for the GNU gettext
210 # functionality.  Please note that the actual code is *not* freely
211 # available.
212
213 # serial 1
214
215 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
216 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
217 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
218 [# Extract the first word of "$2", so it can be a program name with args.
219 set dummy $2; ac_word=[$]2
220 AC_MSG_CHECKING([for $ac_word])
221 AC_CACHE_VAL(ac_cv_path_$1,
222 [case "[$]$1" in
223   /*)
224   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
225   ;;
226   *)
227   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
228   for ac_dir in ifelse([$5], , $PATH, [$5]); do
229     test -z "$ac_dir" && ac_dir=.
230     if test -f $ac_dir/$ac_word; then
231       if [$3]; then
232         ac_cv_path_$1="$ac_dir/$ac_word"
233         break
234       fi
235     fi
236   done
237   IFS="$ac_save_ifs"
238 dnl If no 4th arg is given, leave the cache variable unset,
239 dnl so AC_PATH_PROGS will keep looking.
240 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
241 ])dnl
242   ;;
243 esac])dnl
244 $1="$ac_cv_path_$1"
245 if test -n "[$]$1"; then
246   AC_MSG_RESULT([$]$1)
247 else
248   AC_MSG_RESULT(no)
249 fi
250 AC_SUBST($1)dnl
251 ])
252
253
254 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
255 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
256 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
257 ##
258 ## This program is free software; you can redistribute it and/or modify
259 ## it under the terms of the GNU General Public License as published by
260 ## the Free Software Foundation; either version 2 of the License, or
261 ## (at your option) any later version.
262 ##
263 ## This program is distributed in the hope that it will be useful, but
264 ## WITHOUT ANY WARRANTY; without even the implied warranty of
265 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
266 ## General Public License for more details.
267 ##
268 ## You should have received a copy of the GNU General Public License
269 ## along with this program; if not, write to the Free Software
270 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
271 ##
272 ## As a special exception to the GNU General Public License, if you
273 ## distribute this file as part of a program that contains a
274 ## configuration script generated by Autoconf, you may include it under
275 ## the same distribution terms that you use for the rest of that program.
276
277 # serial 40 AC_PROG_LIBTOOL
278 AC_DEFUN(AC_PROG_LIBTOOL,
279 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
280
281 # Save cache, so that ltconfig can load it
282 AC_CACHE_SAVE
283
284 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
285 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
286 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
287 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
288 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
289 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
290 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
291 || AC_MSG_ERROR([libtool configure failed])
292
293 # Reload cache, that may have been modified by ltconfig
294 AC_CACHE_LOAD
295
296 # This can be used to rebuild libtool when needed
297 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
298
299 # Always use our own libtool.
300 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
301 AC_SUBST(LIBTOOL)dnl
302
303 # Redirect the config.log output again, so that the ltconfig log is not
304 # clobbered by the next message.
305 exec 5>>./config.log
306 ])
307
308 AC_DEFUN(AC_LIBTOOL_SETUP,
309 [AC_PREREQ(2.13)dnl
310 AC_REQUIRE([AC_ENABLE_SHARED])dnl
311 AC_REQUIRE([AC_ENABLE_STATIC])dnl
312 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
313 AC_REQUIRE([AC_CANONICAL_HOST])dnl
314 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
315 AC_REQUIRE([AC_PROG_RANLIB])dnl
316 AC_REQUIRE([AC_PROG_CC])dnl
317 AC_REQUIRE([AC_PROG_LD])dnl
318 AC_REQUIRE([AC_PROG_NM])dnl
319 AC_REQUIRE([AC_PROG_LN_S])dnl
320 dnl
321
322 case "$target" in
323 NONE) lt_target="$host" ;;
324 *) lt_target="$target" ;;
325 esac
326
327 # Check for any special flags to pass to ltconfig.
328 libtool_flags="--cache-file=$cache_file"
329 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
330 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
331 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
332 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
333 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
334 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
335 [libtool_flags="$libtool_flags --enable-dlopen"])
336 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
337 [libtool_flags="$libtool_flags --enable-win32-dll"])
338 AC_ARG_ENABLE(libtool-lock,
339   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
340 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
341 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
342
343 # Some flags need to be propagated to the compiler or linker for good
344 # libtool support.
345 case "$lt_target" in
346 *-*-irix6*)
347   # Find out which ABI we are using.
348   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
349   if AC_TRY_EVAL(ac_compile); then
350     case "`/usr/bin/file conftest.o`" in
351     *32-bit*)
352       LD="${LD-ld} -32"
353       ;;
354     *N32*)
355       LD="${LD-ld} -n32"
356       ;;
357     *64-bit*)
358       LD="${LD-ld} -64"
359       ;;
360     esac
361   fi
362   rm -rf conftest*
363   ;;
364
365 *-*-sco3.2v5*)
366   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
367   SAVE_CFLAGS="$CFLAGS"
368   CFLAGS="$CFLAGS -belf"
369   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
370     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
371   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
372     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
373     CFLAGS="$SAVE_CFLAGS"
374   fi
375   ;;
376
377 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
378 [*-*-cygwin* | *-*-mingw*)
379   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
380   AC_CHECK_TOOL(AS, as, false)
381   AC_CHECK_TOOL(OBJDUMP, objdump, false)
382   ;;
383 ])
384 esac
385 ])
386
387 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
388 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
389
390 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
391 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
392
393 # AC_ENABLE_SHARED - implement the --enable-shared flag
394 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
395 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
396 #   `yes'.
397 AC_DEFUN(AC_ENABLE_SHARED, [dnl
398 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
399 AC_ARG_ENABLE(shared,
400 changequote(<<, >>)dnl
401 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
402 changequote([, ])dnl
403 [p=${PACKAGE-default}
404 case "$enableval" in
405 yes) enable_shared=yes ;;
406 no) enable_shared=no ;;
407 *)
408   enable_shared=no
409   # Look at the argument we got.  We use all the common list separators.
410   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
411   for pkg in $enableval; do
412     if test "X$pkg" = "X$p"; then
413       enable_shared=yes
414     fi
415   done
416   IFS="$ac_save_ifs"
417   ;;
418 esac],
419 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
420 ])
421
422 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
423 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
424 AC_ENABLE_SHARED(no)])
425
426 # AC_ENABLE_STATIC - implement the --enable-static flag
427 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
428 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
429 #   `yes'.
430 AC_DEFUN(AC_ENABLE_STATIC, [dnl
431 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
432 AC_ARG_ENABLE(static,
433 changequote(<<, >>)dnl
434 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
435 changequote([, ])dnl
436 [p=${PACKAGE-default}
437 case "$enableval" in
438 yes) enable_static=yes ;;
439 no) enable_static=no ;;
440 *)
441   enable_static=no
442   # Look at the argument we got.  We use all the common list separators.
443   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
444   for pkg in $enableval; do
445     if test "X$pkg" = "X$p"; then
446       enable_static=yes
447     fi
448   done
449   IFS="$ac_save_ifs"
450   ;;
451 esac],
452 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
453 ])
454
455 # AC_DISABLE_STATIC - set the default static flag to --disable-static
456 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
457 AC_ENABLE_STATIC(no)])
458
459
460 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
461 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
462 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
463 #   `yes'.
464 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
465 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
466 AC_ARG_ENABLE(fast-install,
467 changequote(<<, >>)dnl
468 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
469 changequote([, ])dnl
470 [p=${PACKAGE-default}
471 case "$enableval" in
472 yes) enable_fast_install=yes ;;
473 no) enable_fast_install=no ;;
474 *)
475   enable_fast_install=no
476   # Look at the argument we got.  We use all the common list separators.
477   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
478   for pkg in $enableval; do
479     if test "X$pkg" = "X$p"; then
480       enable_fast_install=yes
481     fi
482   done
483   IFS="$ac_save_ifs"
484   ;;
485 esac],
486 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
487 ])
488
489 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
490 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
491 AC_ENABLE_FAST_INSTALL(no)])
492
493 # AC_PROG_LD - find the path to the GNU or non-GNU linker
494 AC_DEFUN(AC_PROG_LD,
495 [AC_ARG_WITH(gnu-ld,
496 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
497 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
498 AC_REQUIRE([AC_PROG_CC])dnl
499 AC_REQUIRE([AC_CANONICAL_HOST])dnl
500 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
501 ac_prog=ld
502 if test "$ac_cv_prog_gcc" = yes; then
503   # Check if gcc -print-prog-name=ld gives a path.
504   AC_MSG_CHECKING([for ld used by GCC])
505   ac_prog=`($CC -print-prog-name=ld) 2>&5`
506   case "$ac_prog" in
507     # Accept absolute paths.
508 changequote(,)dnl
509     [\\/]* | [A-Za-z]:[\\/]*)
510       re_direlt='/[^/][^/]*/\.\./'
511 changequote([,])dnl
512       # Canonicalize the path of ld
513       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
514       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
515         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
516       done
517       test -z "$LD" && LD="$ac_prog"
518       ;;
519   "")
520     # If it fails, then pretend we aren't using GCC.
521     ac_prog=ld
522     ;;
523   *)
524     # If it is relative, then search for the first ld in PATH.
525     with_gnu_ld=unknown
526     ;;
527   esac
528 elif test "$with_gnu_ld" = yes; then
529   AC_MSG_CHECKING([for GNU ld])
530 else
531   AC_MSG_CHECKING([for non-GNU ld])
532 fi
533 AC_CACHE_VAL(ac_cv_path_LD,
534 [if test -z "$LD"; then
535   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
536   for ac_dir in $PATH; do
537     test -z "$ac_dir" && ac_dir=.
538     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
539       ac_cv_path_LD="$ac_dir/$ac_prog"
540       # Check to see if the program is GNU ld.  I'd rather use --version,
541       # but apparently some GNU ld's only accept -v.
542       # Break only if it was the GNU/non-GNU ld that we prefer.
543       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
544         test "$with_gnu_ld" != no && break
545       else
546         test "$with_gnu_ld" != yes && break
547       fi
548     fi
549   done
550   IFS="$ac_save_ifs"
551 else
552   ac_cv_path_LD="$LD" # Let the user override the test with a path.
553 fi])
554 LD="$ac_cv_path_LD"
555 if test -n "$LD"; then
556   AC_MSG_RESULT($LD)
557 else
558   AC_MSG_RESULT(no)
559 fi
560 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
561 AC_PROG_LD_GNU
562 ])
563
564 AC_DEFUN(AC_PROG_LD_GNU,
565 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
566 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
567 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
568   ac_cv_prog_gnu_ld=yes
569 else
570   ac_cv_prog_gnu_ld=no
571 fi])
572 ])
573
574 # AC_PROG_NM - find the path to a BSD-compatible name lister
575 AC_DEFUN(AC_PROG_NM,
576 [AC_MSG_CHECKING([for BSD-compatible nm])
577 AC_CACHE_VAL(ac_cv_path_NM,
578 [if test -n "$NM"; then
579   # Let the user override the test.
580   ac_cv_path_NM="$NM"
581 else
582   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
583   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
584     test -z "$ac_dir" && ac_dir=.
585     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
586       # Check to see if the nm accepts a BSD-compat flag.
587       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
588       #   nm: unknown option "B" ignored
589       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
590         ac_cv_path_NM="$ac_dir/nm -B"
591         break
592       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
593         ac_cv_path_NM="$ac_dir/nm -p"
594         break
595       else
596         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
597         continue # so that we can try to find one that supports BSD flags
598       fi
599     fi
600   done
601   IFS="$ac_save_ifs"
602   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
603 fi])
604 NM="$ac_cv_path_NM"
605 AC_MSG_RESULT([$NM])
606 ])
607
608 # AC_CHECK_LIBM - check for math library
609 AC_DEFUN(AC_CHECK_LIBM,
610 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
611 LIBM=
612 case "$lt_target" in
613 *-*-beos* | *-*-cygwin*)
614   # These system don't have libm
615   ;;
616 *-ncr-sysv4.3*)
617   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
618   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
619   ;;
620 *)
621   AC_CHECK_LIB(m, main, LIBM="-lm")
622   ;;
623 esac
624 ])
625
626 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
627 # the libltdl convenience library and INCLTDL to the include flags for
628 # the libltdl header and adds --enable-ltdl-convenience to the
629 # configure arguments.  Note that LIBLTDL and INCLTDL are not
630 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
631 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
632 # with '${top_builddir}/' and INCLTDL will be prefixed with
633 # '${top_srcdir}/' (note the single quotes!).  If your package is not
634 # flat and you're not using automake, define top_builddir and
635 # top_srcdir appropriately in the Makefiles.
636 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
637   case "$enable_ltdl_convenience" in
638   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
639   "") enable_ltdl_convenience=yes
640       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
641   esac
642   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
643   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
644 ])
645
646 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
647 # the libltdl installable library and INCLTDL to the include flags for
648 # the libltdl header and adds --enable-ltdl-install to the configure
649 # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
650 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
651 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
652 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
653 # with '${top_srcdir}/' (note the single quotes!).  If your package is
654 # not flat and you're not using automake, define top_builddir and
655 # top_srcdir appropriately in the Makefiles.
656 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
657 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
658   AC_CHECK_LIB(ltdl, main,
659   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
660   [if test x"$enable_ltdl_install" = xno; then
661      AC_MSG_WARN([libltdl not installed, but installation disabled])
662    else
663      enable_ltdl_install=yes
664    fi
665   ])
666   if test x"$enable_ltdl_install" = x"yes"; then
667     ac_configure_args="$ac_configure_args --enable-ltdl-install"
668     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
669     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
670   else
671     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
672     LIBLTDL="-lltdl"
673     INCLTDL=
674   fi
675 ])
676
677 dnl old names
678 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
679 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
680 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
681 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
682 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
683 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
684 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
685
686 dnl This is just to silence aclocal about the macro not being used
687 ifelse([AC_DISABLE_FAST_INSTALL])dnl