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