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