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