Ho hum - forgot timeout case.
[kai/samba.git] / source3 / aclocal.m4
1 dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
2 dnl if the cache file is inconsistent with the current host,
3 dnl target and build system types, execute CMD or print a default
4 dnl error message.
5 AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
6     AC_REQUIRE([AC_CANONICAL_SYSTEM])
7     AC_MSG_CHECKING([config.cache system type])
8     if { test x"${ac_cv_host_system_type+set}" = x"set" &&
9          test x"$ac_cv_host_system_type" != x"$host"; } ||
10        { test x"${ac_cv_build_system_type+set}" = x"set" &&
11          test x"$ac_cv_build_system_type" != x"$build"; } ||
12        { test x"${ac_cv_target_system_type+set}" = x"set" &&
13          test x"$ac_cv_target_system_type" != x"$target"; }; then
14         AC_MSG_RESULT([different])
15         ifelse($#, 1, [$1],
16                 [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
17     else
18         AC_MSG_RESULT([same])
19     fi
20     ac_cv_host_system_type="$host"
21     ac_cv_build_system_type="$build"
22     ac_cv_target_system_type="$target"
23 ])
24
25 dnl based on Automake's maintainer mode
26 AC_DEFUN(SAMBA_MAINTAINER_MODE,[
27   AC_ARG_ENABLE(maintainer-mode,
28         [  --enable-maintainer-mode enable some make rules for maintainers],
29       maint_mode=$enableval, maint_mode=no)
30   if test x"$maint_mode" = x"yes"; then MAINT=; else MAINT='#'; fi
31   AC_SUBST(MAINT)
32   AC_PATH_PROG(AUTOCONF, autoconf, autoconf)
33   AC_SUBST(AUTOCONF)
34   AC_PATH_PROG(AUTOHEADER, autoheader, autoheader)
35   AC_SUBST(AUTOHEADER)
36 ])
37
38
39 dnl test whether dirent has a d_off member
40 AC_DEFUN(AC_DIRENT_D_OFF,
41 [AC_CACHE_CHECK([for d_off in dirent], ac_cv_dirent_d_off,
42 [AC_TRY_COMPILE([
43 #include <unistd.h>
44 #include <sys/types.h>
45 #include <dirent.h>], [struct dirent d; d.d_off;],
46 ac_cv_dirent_d_off=yes, ac_cv_dirent_d_off=no)])
47 if test $ac_cv_dirent_d_off = yes; then
48   AC_DEFINE(HAVE_DIRENT_D_OFF)
49 fi
50 ])
51
52
53 dnl AC_PROG_CC_FLAG(flag)
54 AC_DEFUN(AC_PROG_CC_FLAG,
55 [AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
56 [echo 'void f(){}' > conftest.c
57 if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
58   ac_cv_prog_cc_$1=yes
59 else
60   ac_cv_prog_cc_$1=no
61 fi
62 rm -f conftest*
63 ])])
64
65 dnl check for a function in a library, but don't
66 dnl keep adding the same library to the LIBS variable.
67 dnl AC_LIBTESTFUNC(lib,func)
68 AC_DEFUN(AC_LIBTESTFUNC,
69 [case "$LIBS" in
70   *-l$1*) AC_CHECK_FUNCS($2) ;;
71   *) AC_CHECK_LIB($1, $2) 
72      AC_CHECK_FUNCS($2)
73   ;;
74   esac
75 ])
76
77 dnl Define an AC_DEFINE with ifndef guard.
78 dnl AC_N_DEFINE(VARIABLE [, VALUE])
79 define(AC_N_DEFINE,
80 [cat >> confdefs.h <<\EOF
81 [#ifndef] $1
82 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
83 [#endif]
84 EOF
85 ])
86
87 dnl Add an #include
88 dnl AC_ADD_INCLUDE(VARIABLE)
89 define(AC_ADD_INCLUDE,
90 [cat >> confdefs.h <<\EOF
91 [#include] $1
92 EOF
93 ])
94
95 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
96 ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
97 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
98 ##
99 ## This program is free software; you can redistribute it and/or modify
100 ## it under the terms of the GNU General Public License as published by
101 ## the Free Software Foundation; either version 2 of the License, or
102 ## (at your option) any later version.
103 ##
104 ## This program is distributed in the hope that it will be useful, but
105 ## WITHOUT ANY WARRANTY; without even the implied warranty of
106 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
107 ## General Public License for more details.
108 ##
109 ## You should have received a copy of the GNU General Public License
110 ## along with this program; if not, write to the Free Software
111 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
112 ##
113 ## As a special exception to the GNU General Public License, if you
114 ## distribute this file as part of a program that contains a
115 ## configuration script generated by Autoconf, you may include it under
116 ## the same distribution terms that you use for the rest of that program.
117
118 # serial 40 AC_PROG_LIBTOOL
119 AC_DEFUN(AC_PROG_LIBTOOL,
120 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
121
122 # Save cache, so that ltconfig can load it
123 AC_CACHE_SAVE
124
125 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
126 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
127 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
128 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
129 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
130 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
131 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
132 || AC_MSG_ERROR([libtool configure failed])
133
134 # Reload cache, that may have been modified by ltconfig
135 AC_CACHE_LOAD
136
137 # This can be used to rebuild libtool when needed
138 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
139
140 # Always use our own libtool.
141 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
142 AC_SUBST(LIBTOOL)dnl
143
144 # Redirect the config.log output again, so that the ltconfig log is not
145 # clobbered by the next message.
146 exec 5>>./config.log
147 ])
148
149 AC_DEFUN(AC_LIBTOOL_SETUP,
150 [AC_PREREQ(2.13)dnl
151 AC_REQUIRE([AC_ENABLE_SHARED])dnl
152 AC_REQUIRE([AC_ENABLE_STATIC])dnl
153 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
154 AC_REQUIRE([AC_CANONICAL_HOST])dnl
155 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
156 AC_REQUIRE([AC_PROG_RANLIB])dnl
157 AC_REQUIRE([AC_PROG_CC])dnl
158 AC_REQUIRE([AC_PROG_LD])dnl
159 AC_REQUIRE([AC_PROG_NM])dnl
160 AC_REQUIRE([AC_PROG_LN_S])dnl
161 dnl
162
163 case "$target" in
164 NONE) lt_target="$host" ;;
165 *) lt_target="$target" ;;
166 esac
167
168 # Check for any special flags to pass to ltconfig.
169 libtool_flags="--cache-file=$cache_file"
170 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
171 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
172 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
173 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
174 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
175 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
176 [libtool_flags="$libtool_flags --enable-dlopen"])
177 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
178 [libtool_flags="$libtool_flags --enable-win32-dll"])
179 AC_ARG_ENABLE(libtool-lock,
180   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
181 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
182 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
183
184 # Some flags need to be propagated to the compiler or linker for good
185 # libtool support.
186 case "$lt_target" in
187 *-*-irix6*)
188   # Find out which ABI we are using.
189   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
190   if AC_TRY_EVAL(ac_compile); then
191     case "`/usr/bin/file conftest.o`" in
192     *32-bit*)
193       LD="${LD-ld} -32"
194       ;;
195     *N32*)
196       LD="${LD-ld} -n32"
197       ;;
198     *64-bit*)
199       LD="${LD-ld} -64"
200       ;;
201     esac
202   fi
203   rm -rf conftest*
204   ;;
205
206 *-*-sco3.2v5*)
207   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
208   SAVE_CFLAGS="$CFLAGS"
209   CFLAGS="$CFLAGS -belf"
210   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
211     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
212   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
213     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
214     CFLAGS="$SAVE_CFLAGS"
215   fi
216   ;;
217
218 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
219 [*-*-cygwin* | *-*-mingw*)
220   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
221   AC_CHECK_TOOL(AS, as, false)
222   AC_CHECK_TOOL(OBJDUMP, objdump, false)
223   ;;
224 ])
225 esac
226 ])
227
228 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
229 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
230
231 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
232 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
233
234 # AC_ENABLE_SHARED - implement the --enable-shared flag
235 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
236 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
237 #   `yes'.
238 AC_DEFUN(AC_ENABLE_SHARED, [dnl
239 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
240 AC_ARG_ENABLE(shared,
241 changequote(<<, >>)dnl
242 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
243 changequote([, ])dnl
244 [p=${PACKAGE-default}
245 case "$enableval" in
246 yes) enable_shared=yes ;;
247 no) enable_shared=no ;;
248 *)
249   enable_shared=no
250   # Look at the argument we got.  We use all the common list separators.
251   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
252   for pkg in $enableval; do
253     if test "X$pkg" = "X$p"; then
254       enable_shared=yes
255     fi
256   done
257   IFS="$ac_save_ifs"
258   ;;
259 esac],
260 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
261 ])
262
263 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
264 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
265 AC_ENABLE_SHARED(no)])
266
267 # AC_ENABLE_STATIC - implement the --enable-static flag
268 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
269 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
270 #   `yes'.
271 AC_DEFUN(AC_ENABLE_STATIC, [dnl
272 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
273 AC_ARG_ENABLE(static,
274 changequote(<<, >>)dnl
275 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
276 changequote([, ])dnl
277 [p=${PACKAGE-default}
278 case "$enableval" in
279 yes) enable_static=yes ;;
280 no) enable_static=no ;;
281 *)
282   enable_static=no
283   # Look at the argument we got.  We use all the common list separators.
284   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
285   for pkg in $enableval; do
286     if test "X$pkg" = "X$p"; then
287       enable_static=yes
288     fi
289   done
290   IFS="$ac_save_ifs"
291   ;;
292 esac],
293 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
294 ])
295
296 # AC_DISABLE_STATIC - set the default static flag to --disable-static
297 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
298 AC_ENABLE_STATIC(no)])
299
300
301 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
302 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
303 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
304 #   `yes'.
305 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
306 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
307 AC_ARG_ENABLE(fast-install,
308 changequote(<<, >>)dnl
309 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
310 changequote([, ])dnl
311 [p=${PACKAGE-default}
312 case "$enableval" in
313 yes) enable_fast_install=yes ;;
314 no) enable_fast_install=no ;;
315 *)
316   enable_fast_install=no
317   # Look at the argument we got.  We use all the common list separators.
318   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
319   for pkg in $enableval; do
320     if test "X$pkg" = "X$p"; then
321       enable_fast_install=yes
322     fi
323   done
324   IFS="$ac_save_ifs"
325   ;;
326 esac],
327 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
328 ])
329
330 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
331 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
332 AC_ENABLE_FAST_INSTALL(no)])
333
334 # AC_PROG_LD - find the path to the GNU or non-GNU linker
335 AC_DEFUN(AC_PROG_LD,
336 [AC_ARG_WITH(gnu-ld,
337 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
338 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
339 AC_REQUIRE([AC_PROG_CC])dnl
340 AC_REQUIRE([AC_CANONICAL_HOST])dnl
341 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
342 ac_prog=ld
343 if test "$ac_cv_prog_gcc" = yes; then
344   # Check if gcc -print-prog-name=ld gives a path.
345   AC_MSG_CHECKING([for ld used by GCC])
346   ac_prog=`($CC -print-prog-name=ld) 2>&5`
347   case "$ac_prog" in
348     # Accept absolute paths.
349 changequote(,)dnl
350     [\\/]* | [A-Za-z]:[\\/]*)
351       re_direlt='/[^/][^/]*/\.\./'
352 changequote([,])dnl
353       # Canonicalize the path of ld
354       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
355       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
356         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
357       done
358       test -z "$LD" && LD="$ac_prog"
359       ;;
360   "")
361     # If it fails, then pretend we aren't using GCC.
362     ac_prog=ld
363     ;;
364   *)
365     # If it is relative, then search for the first ld in PATH.
366     with_gnu_ld=unknown
367     ;;
368   esac
369 elif test "$with_gnu_ld" = yes; then
370   AC_MSG_CHECKING([for GNU ld])
371 else
372   AC_MSG_CHECKING([for non-GNU ld])
373 fi
374 AC_CACHE_VAL(ac_cv_path_LD,
375 [if test -z "$LD"; then
376   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
377   for ac_dir in $PATH; do
378     test -z "$ac_dir" && ac_dir=.
379     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
380       ac_cv_path_LD="$ac_dir/$ac_prog"
381       # Check to see if the program is GNU ld.  I'd rather use --version,
382       # but apparently some GNU ld's only accept -v.
383       # Break only if it was the GNU/non-GNU ld that we prefer.
384       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
385         test "$with_gnu_ld" != no && break
386       else
387         test "$with_gnu_ld" != yes && break
388       fi
389     fi
390   done
391   IFS="$ac_save_ifs"
392 else
393   ac_cv_path_LD="$LD" # Let the user override the test with a path.
394 fi])
395 LD="$ac_cv_path_LD"
396 if test -n "$LD"; then
397   AC_MSG_RESULT($LD)
398 else
399   AC_MSG_RESULT(no)
400 fi
401 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
402 AC_PROG_LD_GNU
403 ])
404
405 AC_DEFUN(AC_PROG_LD_GNU,
406 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
407 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
408 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
409   ac_cv_prog_gnu_ld=yes
410 else
411   ac_cv_prog_gnu_ld=no
412 fi])
413 ])
414
415 # AC_PROG_NM - find the path to a BSD-compatible name lister
416 AC_DEFUN(AC_PROG_NM,
417 [AC_MSG_CHECKING([for BSD-compatible nm])
418 AC_CACHE_VAL(ac_cv_path_NM,
419 [if test -n "$NM"; then
420   # Let the user override the test.
421   ac_cv_path_NM="$NM"
422 else
423   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
424   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
425     test -z "$ac_dir" && ac_dir=.
426     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
427       # Check to see if the nm accepts a BSD-compat flag.
428       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
429       #   nm: unknown option "B" ignored
430       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
431         ac_cv_path_NM="$ac_dir/nm -B"
432         break
433       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
434         ac_cv_path_NM="$ac_dir/nm -p"
435         break
436       else
437         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
438         continue # so that we can try to find one that supports BSD flags
439       fi
440     fi
441   done
442   IFS="$ac_save_ifs"
443   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
444 fi])
445 NM="$ac_cv_path_NM"
446 AC_MSG_RESULT([$NM])
447 ])
448
449 # AC_CHECK_LIBM - check for math library
450 AC_DEFUN(AC_CHECK_LIBM,
451 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
452 LIBM=
453 case "$lt_target" in
454 *-*-beos* | *-*-cygwin*)
455   # These system don't have libm
456   ;;
457 *-ncr-sysv4.3*)
458   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
459   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
460   ;;
461 *)
462   AC_CHECK_LIB(m, main, LIBM="-lm")
463   ;;
464 esac
465 ])
466
467 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
468 # the libltdl convenience library, adds --enable-ltdl-convenience to
469 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
470 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
471 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
472 # '${top_builddir}/' (note the single quotes!) if your package is not
473 # flat, and, if you're not using automake, define top_builddir as
474 # appropriate in the Makefiles.
475 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
476   case "$enable_ltdl_convenience" in
477   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
478   "") enable_ltdl_convenience=yes
479       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
480   esac
481   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
482   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
483 ])
484
485 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
486 # the libltdl installable library, and adds --enable-ltdl-install to
487 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
488 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
489 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
490 # '${top_builddir}/' (note the single quotes!) if your package is not
491 # flat, and, if you're not using automake, define top_builddir as
492 # appropriate in the Makefiles.
493 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
494 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
495   AC_CHECK_LIB(ltdl, main,
496   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
497   [if test x"$enable_ltdl_install" = xno; then
498      AC_MSG_WARN([libltdl not installed, but installation disabled])
499    else
500      enable_ltdl_install=yes
501    fi
502   ])
503   if test x"$enable_ltdl_install" = x"yes"; then
504     ac_configure_args="$ac_configure_args --enable-ltdl-install"
505     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
506     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
507   else
508     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
509     LIBLTDL="-lltdl"
510     INCLTDL=
511   fi
512 ])
513
514 dnl old names
515 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
516 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
517 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
518 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
519 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
520 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
521 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
522
523 dnl This is just to silence aclocal about the macro not being used
524 ifelse([AC_DISABLE_FAST_INSTALL])dnl