]> git.sur5r.net Git - openldap/blob - aclocal.m4
ITS#211 ldbmcat core dump fix due to #if[n]def HAVE_BERKELEY_DB typo
[openldap] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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 Copyright 1998 The OpenLDAP Foundation,  All Rights Reserved.
14 dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file
15 dnl
16 dnl OpenLDAP Autoconf Macros
17 dnl
18 builtin(include, build/openldap.m4)dnl
19
20 # Do all the work for Automake.  This macro actually does too much --
21 # some checks are only needed if your package does certain things.
22 # But this isn't really a big deal.
23
24 # serial 1
25
26 dnl Usage:
27 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
28
29 AC_DEFUN(AM_INIT_AUTOMAKE,
30 [AC_REQUIRE([AC_PROG_INSTALL])
31 dnl We require 2.13 because we rely on SHELL being computed by configure.
32 AC_PREREQ([2.13])
33 PACKAGE=[$1]
34 AC_SUBST(PACKAGE)
35 VERSION=[$2]
36 AC_SUBST(VERSION)
37 dnl test to see if srcdir already configured
38 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
39   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
40 fi
41 ifelse([$3],,
42 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
43 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
44 AC_REQUIRE([AM_SANITY_CHECK])
45 AC_REQUIRE([AC_ARG_PROGRAM])
46 dnl FIXME This is truly gross.
47 missing_dir=`cd $ac_aux_dir && pwd`
48 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
49 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
50 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
51 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
52 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
53 dnl Set install_sh for make dist
54 install_sh="$missing_dir/install-sh"
55 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
56 AC_SUBST(install_sh)
57 dnl We check for tar when the user configures the end package.
58 dnl This is sad, since we only need this for "dist".  However,
59 dnl there's no other good way to do it.  We prefer GNU tar if
60 dnl we can find it.  If we can't find a tar, it doesn't really matter.
61 AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
62 dnl We need awk for the "check" target.  The system "awk" is bad on
63 dnl some platforms.
64 AC_REQUIRE([AC_PROG_AWK])
65 AMTARFLAGS=
66 if test -n "$AMTAR"; then
67   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
68     dnl We have GNU tar.
69     AMTARFLAGS=o
70   fi
71 fi
72 AC_SUBST(AMTARFLAGS)
73 AC_REQUIRE([AC_PROG_MAKE_SET])])
74
75 #
76 # Check to make sure that the build environment is sane.
77 #
78
79 AC_DEFUN(AM_SANITY_CHECK,
80 [AC_MSG_CHECKING([whether build environment is sane])
81 # Just in case
82 sleep 1
83 echo timestamp > conftestfile
84 # Do `set' in a subshell so we don't clobber the current shell's
85 # arguments.  Must try -L first in case configure is actually a
86 # symlink; some systems play weird games with the mod time of symlinks
87 # (eg FreeBSD returns the mod time of the symlink's containing
88 # directory).
89 if (
90    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
91    if test "[$]*" = "X"; then
92       # -L didn't work.
93       set X `ls -t $srcdir/configure conftestfile`
94    fi
95    if test "[$]*" != "X $srcdir/configure conftestfile" \
96       && test "[$]*" != "X conftestfile $srcdir/configure"; then
97
98       # If neither matched, then we have a broken ls.  This can happen
99       # if, for instance, CONFIG_SHELL is bash and it inherits a
100       # broken ls alias from the environment.  This has actually
101       # happened.  Such a system could not be considered "sane".
102       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
103 alias in your environment])
104    fi
105
106    test "[$]2" = conftestfile
107    )
108 then
109    # Ok.
110    :
111 else
112    AC_MSG_ERROR([newly created file is older than distributed files!
113 Check your system clock])
114 fi
115 rm -f conftest*
116 AC_MSG_RESULT(yes)])
117
118 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
119 dnl The program must properly implement --version.
120 AC_DEFUN(AM_MISSING_PROG,
121 [AC_MSG_CHECKING(for working $2)
122 # Run test in a subshell; some versions of sh will print an error if
123 # an executable is not found, even if stderr is redirected.
124 # Redirect stdin to placate older versions of autoconf.  Sigh.
125 if ($2 --version) < /dev/null > /dev/null 2>&1; then
126    $1=$2
127    AC_MSG_RESULT(found)
128 else
129    $1="$3/missing $2"
130    AC_MSG_RESULT(missing)
131 fi
132 AC_SUBST($1)])
133
134
135 # serial 40 AC_PROG_LIBTOOL
136 AC_DEFUN(AC_PROG_LIBTOOL,
137 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
138
139 # Save cache, so that ltconfig can load it
140 AC_CACHE_SAVE
141
142 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
143 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
144 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
145 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
146 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
147 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
148 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
149 || AC_MSG_ERROR([libtool configure failed])
150
151 # Reload cache, that may have been modified by ltconfig
152 AC_CACHE_LOAD
153
154 # This can be used to rebuild libtool when needed
155 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
156
157 # Always use our own libtool.
158 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
159 AC_SUBST(LIBTOOL)dnl
160
161 # Redirect the config.log output again, so that the ltconfig log is not
162 # clobbered by the next message.
163 exec 5>>./config.log
164 ])
165
166 AC_DEFUN(AC_LIBTOOL_SETUP,
167 [AC_PREREQ(2.13)dnl
168 AC_REQUIRE([AC_ENABLE_SHARED])dnl
169 AC_REQUIRE([AC_ENABLE_STATIC])dnl
170 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
171 AC_REQUIRE([AC_CANONICAL_HOST])dnl
172 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
173 AC_REQUIRE([AC_PROG_RANLIB])dnl
174 AC_REQUIRE([AC_PROG_CC])dnl
175 AC_REQUIRE([AC_PROG_LD])dnl
176 AC_REQUIRE([AC_PROG_NM])dnl
177 AC_REQUIRE([AC_PROG_LN_S])dnl
178 dnl
179
180 # Check for any special flags to pass to ltconfig.
181 libtool_flags="--cache-file=$cache_file"
182 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
183 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
184 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
185 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
186 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
187 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
188 [libtool_flags="$libtool_flags --enable-dlopen"])
189 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
190 [libtool_flags="$libtool_flags --enable-win32-dll"])
191 AC_ARG_ENABLE(libtool-lock,
192   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
193 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
194 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
195
196 # Some flags need to be propagated to the compiler or linker for good
197 # libtool support.
198 case "$host" in
199 *-*-irix6*)
200   # Find out which ABI we are using.
201   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
202   if AC_TRY_EVAL(ac_compile); then
203     case "`/usr/bin/file conftest.o`" in
204     *32-bit*)
205       LD="${LD-ld} -32"
206       ;;
207     *N32*)
208       LD="${LD-ld} -n32"
209       ;;
210     *64-bit*)
211       LD="${LD-ld} -64"
212       ;;
213     esac
214   fi
215   rm -rf conftest*
216   ;;
217
218 *-*-sco3.2v5*)
219   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
220   SAVE_CFLAGS="$CFLAGS"
221   CFLAGS="$CFLAGS -belf"
222   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
223     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
224   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
225     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
226     CFLAGS="$SAVE_CFLAGS"
227   fi
228   ;;
229
230 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
231 [*-*-cygwin* | *-*-mingw*)
232   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
233   AC_CHECK_TOOL(AS, as, false)
234   AC_CHECK_TOOL(OBJDUMP, objdump, false)
235   ;;
236 ])
237 esac
238 ])
239
240 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
241 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
242
243 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
244 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
245
246 # AC_ENABLE_SHARED - implement the --enable-shared flag
247 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
248 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
249 #   `yes'.
250 AC_DEFUN(AC_ENABLE_SHARED, [dnl
251 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
252 AC_ARG_ENABLE(shared,
253 changequote(<<, >>)dnl
254 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
255 changequote([, ])dnl
256 [p=${PACKAGE-default}
257 case "$enableval" in
258 yes) enable_shared=yes ;;
259 no) enable_shared=no ;;
260 *)
261   enable_shared=no
262   # Look at the argument we got.  We use all the common list separators.
263   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
264   for pkg in $enableval; do
265     if test "X$pkg" = "X$p"; then
266       enable_shared=yes
267     fi
268   done
269   IFS="$ac_save_ifs"
270   ;;
271 esac],
272 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
273 ])
274
275 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
276 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
277 AC_ENABLE_SHARED(no)])
278
279 # AC_ENABLE_STATIC - implement the --enable-static flag
280 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
281 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
282 #   `yes'.
283 AC_DEFUN(AC_ENABLE_STATIC, [dnl
284 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
285 AC_ARG_ENABLE(static,
286 changequote(<<, >>)dnl
287 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
288 changequote([, ])dnl
289 [p=${PACKAGE-default}
290 case "$enableval" in
291 yes) enable_static=yes ;;
292 no) enable_static=no ;;
293 *)
294   enable_static=no
295   # Look at the argument we got.  We use all the common list separators.
296   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
297   for pkg in $enableval; do
298     if test "X$pkg" = "X$p"; then
299       enable_static=yes
300     fi
301   done
302   IFS="$ac_save_ifs"
303   ;;
304 esac],
305 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
306 ])
307
308 # AC_DISABLE_STATIC - set the default static flag to --disable-static
309 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
310 AC_ENABLE_STATIC(no)])
311
312
313 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
314 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
315 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
316 #   `yes'.
317 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
318 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
319 AC_ARG_ENABLE(fast-install,
320 changequote(<<, >>)dnl
321 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
322 changequote([, ])dnl
323 [p=${PACKAGE-default}
324 case "$enableval" in
325 yes) enable_fast_install=yes ;;
326 no) enable_fast_install=no ;;
327 *)
328   enable_fast_install=no
329   # Look at the argument we got.  We use all the common list separators.
330   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
331   for pkg in $enableval; do
332     if test "X$pkg" = "X$p"; then
333       enable_fast_install=yes
334     fi
335   done
336   IFS="$ac_save_ifs"
337   ;;
338 esac],
339 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
340 ])
341
342 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
343 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
344 AC_ENABLE_FAST_INSTALL(no)])
345
346 # AC_PROG_LD - find the path to the GNU or non-GNU linker
347 AC_DEFUN(AC_PROG_LD,
348 [AC_ARG_WITH(gnu-ld,
349 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
350 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
351 AC_REQUIRE([AC_PROG_CC])dnl
352 AC_REQUIRE([AC_CANONICAL_HOST])dnl
353 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
354 ac_prog=ld
355 if test "$ac_cv_prog_gcc" = yes; then
356   # Check if gcc -print-prog-name=ld gives a path.
357   AC_MSG_CHECKING([for ld used by GCC])
358   ac_prog=`($CC -print-prog-name=ld) 2>&5`
359   case "$ac_prog" in
360     # Accept absolute paths.
361 changequote(,)dnl
362     [\\/]* | [A-Za-z]:[\\/]*)
363       re_direlt='/[^/][^/]*/\.\./'
364 changequote([,])dnl
365       # Canonicalize the path of ld
366       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
367       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
368         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
369       done
370       test -z "$LD" && LD="$ac_prog"
371       ;;
372   "")
373     # If it fails, then pretend we aren't using GCC.
374     ac_prog=ld
375     ;;
376   *)
377     # If it is relative, then search for the first ld in PATH.
378     with_gnu_ld=unknown
379     ;;
380   esac
381 elif test "$with_gnu_ld" = yes; then
382   AC_MSG_CHECKING([for GNU ld])
383 else
384   AC_MSG_CHECKING([for non-GNU ld])
385 fi
386 AC_CACHE_VAL(ac_cv_path_LD,
387 [if test -z "$LD"; then
388   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
389   for ac_dir in $PATH; do
390     test -z "$ac_dir" && ac_dir=.
391     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
392       ac_cv_path_LD="$ac_dir/$ac_prog"
393       # Check to see if the program is GNU ld.  I'd rather use --version,
394       # but apparently some GNU ld's only accept -v.
395       # Break only if it was the GNU/non-GNU ld that we prefer.
396       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
397         test "$with_gnu_ld" != no && break
398       else
399         test "$with_gnu_ld" != yes && break
400       fi
401     fi
402   done
403   IFS="$ac_save_ifs"
404 else
405   ac_cv_path_LD="$LD" # Let the user override the test with a path.
406 fi])
407 LD="$ac_cv_path_LD"
408 if test -n "$LD"; then
409   AC_MSG_RESULT($LD)
410 else
411   AC_MSG_RESULT(no)
412 fi
413 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
414 AC_SUBST(LD)
415 AC_PROG_LD_GNU
416 ])
417
418 AC_DEFUN(AC_PROG_LD_GNU,
419 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
420 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
421 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
422   ac_cv_prog_gnu_ld=yes
423 else
424   ac_cv_prog_gnu_ld=no
425 fi])
426 ])
427
428 # AC_PROG_NM - find the path to a BSD-compatible name lister
429 AC_DEFUN(AC_PROG_NM,
430 [AC_MSG_CHECKING([for BSD-compatible nm])
431 AC_CACHE_VAL(ac_cv_path_NM,
432 [if test -n "$NM"; then
433   # Let the user override the test.
434   ac_cv_path_NM="$NM"
435 else
436   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
437   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
438     test -z "$ac_dir" && ac_dir=.
439     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
440       # Check to see if the nm accepts a BSD-compat flag.
441       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
442       #   nm: unknown option "B" ignored
443       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
444         ac_cv_path_NM="$ac_dir/nm -B"
445         break
446       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
447         ac_cv_path_NM="$ac_dir/nm -p"
448         break
449       else
450         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
451         continue # so that we can try to find one that supports BSD flags
452       fi
453     fi
454   done
455   IFS="$ac_save_ifs"
456   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
457 fi])
458 NM="$ac_cv_path_NM"
459 AC_MSG_RESULT([$NM])
460 AC_SUBST(NM)
461 ])
462
463 # AC_CHECK_LIBM - check for math library
464 AC_DEFUN(AC_CHECK_LIBM,
465 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
466 LIBM=
467 case "$host" in
468 *-*-beos* | *-*-cygwin*)
469   # These system don't have libm
470   ;;
471 *-ncr-sysv4.3*)
472   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
473   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
474   ;;
475 *)
476   AC_CHECK_LIB(m, main, LIBM="-lm")
477   ;;
478 esac
479 ])
480
481 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
482 # the libltdl convenience library, adds --enable-ltdl-convenience to
483 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
484 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
485 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
486 # '${top_builddir}/' (note the single quotes!) if your package is not
487 # flat, and, if you're not using automake, define top_builddir as
488 # appropriate in the Makefiles.
489 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
490   case "$enable_ltdl_convenience" in
491   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
492   "") enable_ltdl_convenience=yes
493       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
494   esac
495   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
496   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
497 ])
498
499 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
500 # the libltdl installable library, and adds --enable-ltdl-install to
501 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
502 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
503 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
504 # '${top_builddir}/' (note the single quotes!) if your package is not
505 # flat, and, if you're not using automake, define top_builddir as
506 # appropriate in the Makefiles.
507 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
508 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
509   AC_CHECK_LIB(ltdl, main,
510   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
511   [if test x"$enable_ltdl_install" = xno; then
512      AC_MSG_WARN([libltdl not installed, but installation disabled])
513    else
514      enable_ltdl_install=yes
515    fi
516   ])
517   if test x"$enable_ltdl_install" = x"yes"; then
518     ac_configure_args="$ac_configure_args --enable-ltdl-install"
519     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
520     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
521   else
522     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
523     LIBLTDL="-lltdl"
524     INCLTDL=
525   fi
526 ])
527
528 dnl old names
529 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
530 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
531 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
532 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
533 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
534 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
535 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
536
537 dnl This is just to silence aclocal about the macro not being used
538 ifelse([AC_DISABLE_FAST_INSTALL])dnl
539
540
541 # serial 1
542
543 # @defmac AC_PROG_CC_STDC
544 # @maindex PROG_CC_STDC
545 # @ovindex CC
546 # If the C compiler in not in ANSI C mode by default, try to add an option
547 # to output variable @code{CC} to make it so.  This macro tries various
548 # options that select ANSI C on some system or another.  It considers the
549 # compiler to be in ANSI C mode if it handles function prototypes correctly.
550 #
551 # If you use this macro, you should check after calling it whether the C
552 # compiler has been set to accept ANSI C; if not, the shell variable
553 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
554 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
555 # program @code{ansi2knr}, which comes with Ghostscript.
556 # @end defmac
557
558 AC_DEFUN(AM_PROG_CC_STDC,
559 [AC_REQUIRE([AC_PROG_CC])
560 AC_BEFORE([$0], [AC_C_INLINE])
561 AC_BEFORE([$0], [AC_C_CONST])
562 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
563 dnl a magic option to avoid problems with ANSI preprocessor commands
564 dnl like #elif.
565 dnl FIXME: can't do this because then AC_AIX won't work due to a
566 dnl circular dependency.
567 dnl AC_BEFORE([$0], [AC_PROG_CPP])
568 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
569 AC_CACHE_VAL(am_cv_prog_cc_stdc,
570 [am_cv_prog_cc_stdc=no
571 ac_save_CC="$CC"
572 # Don't try gcc -ansi; that turns off useful extensions and
573 # breaks some systems' header files.
574 # AIX                   -qlanglvl=ansi
575 # Ultrix and OSF/1      -std1
576 # HP-UX 10.20 and later -Ae
577 # HP-UX older versions  -Aa -D_HPUX_SOURCE
578 # SVR4                  -Xc -D__EXTENSIONS__
579 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
580 do
581   CC="$ac_save_CC $ac_arg"
582   AC_TRY_COMPILE(
583 [#include <stdarg.h>
584 #include <stdio.h>
585 #include <sys/types.h>
586 #include <sys/stat.h>
587 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
588 struct buf { int x; };
589 FILE * (*rcsopen) (struct buf *, struct stat *, int);
590 static char *e (p, i)
591      char **p;
592      int i;
593 {
594   return p[i];
595 }
596 static char *f (char * (*g) (char **, int), char **p, ...)
597 {
598   char *s;
599   va_list v;
600   va_start (v,p);
601   s = g (p, va_arg (v,int));
602   va_end (v);
603   return s;
604 }
605 int test (int i, double x);
606 struct s1 {int (*f) (int a);};
607 struct s2 {int (*f) (double a);};
608 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
609 int argc;
610 char **argv;
611 ], [
612 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
613 ],
614 [am_cv_prog_cc_stdc="$ac_arg"; break])
615 done
616 CC="$ac_save_CC"
617 ])
618 if test -z "$am_cv_prog_cc_stdc"; then
619   AC_MSG_RESULT([none needed])
620 else
621   AC_MSG_RESULT($am_cv_prog_cc_stdc)
622 fi
623 case "x$am_cv_prog_cc_stdc" in
624   x|xno) ;;
625   *) CC="$CC $am_cv_prog_cc_stdc" ;;
626 esac
627 ])
628
629 dnl From Jim Meyering.
630
631 # serial 1
632
633 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
634 [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
635  AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
636                 am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
637   [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
638
639   gwinsz_in_termios_h=no
640   if test $am_cv_sys_posix_termios = yes; then
641     AC_EGREP_CPP([yes],
642     [#include <sys/types.h>
643 #     include <termios.h>
644 #     ifdef TIOCGWINSZ
645         yes
646 #     endif
647     ], gwinsz_in_termios_h=yes)
648   fi
649
650   if test $gwinsz_in_termios_h = no; then
651     AC_EGREP_CPP([yes],
652     [#include <sys/types.h>
653 #     include <sys/ioctl.h>
654 #     ifdef TIOCGWINSZ
655         yes
656 #     endif
657     ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
658   fi
659   ])
660   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
661     AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1,
662               [Define if TIOCGWINSZ requires sys/ioctl.h])
663   fi
664 ])
665
666 dnl From Jim Meyering.
667
668 # serial 1
669
670 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
671 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
672   [AC_TRY_LINK([#include <sys/types.h>
673 #include <unistd.h>
674 #include <termios.h>],
675   [/* SunOS 4.0.3 has termios.h but not the library calls.  */
676    tcgetattr(0, 0);],
677   am_cv_sys_posix_termios=yes,
678   am_cv_sys_posix_termios=no)])
679 ])
680
681 # From Ulrich Drepper.
682
683 # serial 1
684
685 AC_DEFUN(AM_TYPE_PTRDIFF_T,
686   [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
687      [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
688                      am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
689    if test $am_cv_type_ptrdiff_t = yes; then
690      AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])
691    fi
692 ])
693