1 dnl aclocal.m4 generated automatically by aclocal 1.3
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in 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.
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.
14 dnl OpenLDAP Autoconf Macros
16 builtin(include, build/openldap.m4)dnl
18 # Do all the work for Automake. This macro actually does too much --
19 # some checks are only needed if your package does certain things.
20 # But this isn't really a big deal.
25 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
27 AC_DEFUN(AM_INIT_AUTOMAKE,
28 [AC_REQUIRE([AM_PROG_INSTALL])
33 dnl test to see if srcdir already configured
34 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
35 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
38 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
39 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
40 AC_REQUIRE([AM_SANITY_CHECK])
41 AC_REQUIRE([AC_ARG_PROGRAM])
42 dnl FIXME This is truly gross.
43 missing_dir=`cd $ac_aux_dir && pwd`
44 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
45 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
46 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
47 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
48 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
49 AC_REQUIRE([AC_PROG_MAKE_SET])])
54 AC_DEFUN(AM_PROG_INSTALL,
55 [AC_REQUIRE([AC_PROG_INSTALL])
56 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
57 AC_SUBST(INSTALL_SCRIPT)dnl
61 # Check to make sure that the build environment is sane.
64 AC_DEFUN(AM_SANITY_CHECK,
65 [AC_MSG_CHECKING([whether build environment is sane])
68 echo timestamp > conftestfile
69 # Do `set' in a subshell so we don't clobber the current shell's
70 # arguments. Must try -L first in case configure is actually a
71 # symlink; some systems play weird games with the mod time of symlinks
72 # (eg FreeBSD returns the mod time of the symlink's containing
75 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
76 if test "[$]*" = "X"; then
78 set X `ls -t $srcdir/configure conftestfile`
80 if test "[$]*" != "X $srcdir/configure conftestfile" \
81 && test "[$]*" != "X conftestfile $srcdir/configure"; then
83 # If neither matched, then we have a broken ls. This can happen
84 # if, for instance, CONFIG_SHELL is bash and it inherits a
85 # broken ls alias from the environment. This has actually
86 # happened. Such a system could not be considered "sane".
87 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
88 alias in your environment])
91 test "[$]2" = conftestfile
97 AC_MSG_ERROR([newly created file is older than distributed files!
98 Check your system clock])
103 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
104 dnl The program must properly implement --version.
105 AC_DEFUN(AM_MISSING_PROG,
106 [AC_MSG_CHECKING(for working $2)
107 # Run test in a subshell; some versions of sh will print an error if
108 # an executable is not found, even if stderr is redirected.
109 # Redirect stdin to placate older versions of autoconf. Sigh.
110 if ($2 --version) < /dev/null > /dev/null 2>&1; then
115 AC_MSG_RESULT(missing)
120 # serial 24 AM_PROG_LIBTOOL
121 AC_DEFUN(AM_PROG_LIBTOOL,
122 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
123 AC_REQUIRE([AM_ENABLE_STATIC])dnl
124 AC_REQUIRE([AC_CANONICAL_HOST])dnl
125 AC_REQUIRE([AC_PROG_RANLIB])dnl
126 AC_REQUIRE([AC_PROG_CC])dnl
127 AC_REQUIRE([AM_PROG_LD])dnl
128 AC_REQUIRE([AM_PROG_NM])dnl
129 AC_REQUIRE([AC_PROG_LN_S])dnl
131 # Always use our own libtool.
132 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
135 # Check for any special flags to pass to ltconfig.
137 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
138 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
139 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
140 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
141 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
143 # Some flags need to be propagated to the compiler or linker for good
147 # Find out which ABI we are using.
148 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
149 if AC_TRY_EVAL(ac_compile); then
150 case "`/usr/bin/file conftest.o`" in
166 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
167 CFLAGS="$CFLAGS -belf"
171 # Actually configure libtool. ac_aux_dir is where install-sh is found.
172 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
173 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
174 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
175 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
176 || AC_MSG_ERROR([libtool configure failed])
179 # AM_ENABLE_SHARED - implement the --enable-shared flag
180 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
181 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
183 AC_DEFUN(AM_ENABLE_SHARED,
184 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
185 AC_ARG_ENABLE(shared,
186 changequote(<<, >>)dnl
187 << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
189 [ --enable-shared=PKGS only build shared libraries if the current package
190 appears as an element in the PKGS list],
191 [p=${PACKAGE-default}
193 yes) enable_shared=yes ;;
194 no) enable_shared=no ;;
197 # Look at the argument we got. We use all the common list separators.
198 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
199 for pkg in $enableval; do
200 if test "X$pkg" = "X$p"; then
207 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
210 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
211 AC_DEFUN(AM_DISABLE_SHARED,
212 [AM_ENABLE_SHARED(no)])
214 # AM_DISABLE_STATIC - set the default static flag to --disable-static
215 AC_DEFUN(AM_DISABLE_STATIC,
216 [AM_ENABLE_STATIC(no)])
218 # AM_ENABLE_STATIC - implement the --enable-static flag
219 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
220 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
222 AC_DEFUN(AM_ENABLE_STATIC,
223 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
224 AC_ARG_ENABLE(static,
225 changequote(<<, >>)dnl
226 << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
228 [ --enable-static=PKGS only build shared libraries if the current package
229 appears as an element in the PKGS list],
230 [p=${PACKAGE-default}
232 yes) enable_static=yes ;;
233 no) enable_static=no ;;
236 # Look at the argument we got. We use all the common list separators.
237 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
238 for pkg in $enableval; do
239 if test "X$pkg" = "X$p"; then
246 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
250 # AM_PROG_LD - find the path to the GNU or non-GNU linker
253 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
254 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
255 AC_REQUIRE([AC_PROG_CC])
257 if test "$ac_cv_prog_gcc" = yes; then
258 # Check if gcc -print-prog-name=ld gives a path.
259 AC_MSG_CHECKING([for ld used by GCC])
260 ac_prog=`($CC -print-prog-name=ld) 2>&5`
262 # Accept absolute paths.
264 test -z "$LD" && LD="$ac_prog"
267 # If it fails, then pretend we aren't using GCC.
271 # If it is relative, then search for the first ld in PATH.
275 elif test "$with_gnu_ld" = yes; then
276 AC_MSG_CHECKING([for GNU ld])
278 AC_MSG_CHECKING([for non-GNU ld])
280 AC_CACHE_VAL(ac_cv_path_LD,
281 [if test -z "$LD"; then
282 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
283 for ac_dir in $PATH; do
284 test -z "$ac_dir" && ac_dir=.
285 if test -f "$ac_dir/$ac_prog"; then
286 ac_cv_path_LD="$ac_dir/$ac_prog"
287 # Check to see if the program is GNU ld. I'd rather use --version,
288 # but apparently some GNU ld's only accept -v.
289 # Break only if it was the GNU/non-GNU ld that we prefer.
290 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
291 test "$with_gnu_ld" != no && break
293 test "$with_gnu_ld" != yes && break
299 ac_cv_path_LD="$LD" # Let the user override the test with a path.
302 if test -n "$LD"; then
307 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
312 AC_DEFUN(AM_PROG_LD_GNU,
313 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
314 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
315 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
316 ac_cv_prog_gnu_ld=yes
322 # AM_PROG_NM - find the path to a BSD-compatible name lister
324 [AC_MSG_CHECKING([for BSD-compatible nm])
325 AC_CACHE_VAL(ac_cv_path_NM,
328 ac_cv_path_NM="$NM" # Let the user override the test with a path.
331 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
332 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
333 test -z "$ac_dir" && ac_dir=.
334 if test -f $ac_dir/nm; then
335 # Check to see if the nm accepts a BSD-compat flag.
336 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
337 # nm: unknown option "B" ignored
338 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
339 ac_cv_path_NM="$ac_dir/nm -B"
340 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
341 ac_cv_path_NM="$ac_dir/nm -p"
343 ac_cv_path_NM="$ac_dir/nm"
349 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
360 # @defmac AC_PROG_CC_STDC
361 # @maindex PROG_CC_STDC
363 # If the C compiler in not in ANSI C mode by default, try to add an option
364 # to output variable @code{CC} to make it so. This macro tries various
365 # options that select ANSI C on some system or another. It considers the
366 # compiler to be in ANSI C mode if it handles function prototypes correctly.
368 # If you use this macro, you should check after calling it whether the C
369 # compiler has been set to accept ANSI C; if not, the shell variable
370 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
371 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
372 # program @code{ansi2knr}, which comes with Ghostscript.
375 AC_DEFUN(AM_PROG_CC_STDC,
376 [AC_REQUIRE([AC_PROG_CC])
377 AC_BEFORE([$0], [AC_C_INLINE])
378 AC_BEFORE([$0], [AC_C_CONST])
379 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
380 dnl a magic option to avoid problems with ANSI preprocessor commands
382 dnl FIXME: can't do this because then AC_AIX won't work due to a
383 dnl circular dependency.
384 dnl AC_BEFORE([$0], [AC_PROG_CPP])
385 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
386 AC_CACHE_VAL(am_cv_prog_cc_stdc,
387 [am_cv_prog_cc_stdc=no
389 # Don't try gcc -ansi; that turns off useful extensions and
390 # breaks some systems' header files.
392 # Ultrix and OSF/1 -std1
393 # HP-UX -Aa -D_HPUX_SOURCE
394 # SVR4 -Xc -D__EXTENSIONS__
395 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
397 CC="$ac_save_CC $ac_arg"
401 #include <sys/types.h>
402 #include <sys/stat.h>
403 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
404 struct buf { int x; };
405 FILE * (*rcsopen) (struct buf *, struct stat *, int);
406 static char *e (p, i)
412 static char *f (char * (*g) (char **, int), char **p, ...)
417 s = g (p, va_arg (v,int));
421 int test (int i, double x);
422 struct s1 {int (*f) (int a);};
423 struct s2 {int (*f) (double a);};
424 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
428 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
430 [am_cv_prog_cc_stdc="$ac_arg"; break])
434 if test -z "$am_cv_prog_cc_stdc"; then
435 AC_MSG_RESULT([none needed])
437 AC_MSG_RESULT($am_cv_prog_cc_stdc)
439 case "x$am_cv_prog_cc_stdc" in
441 *) CC="$CC $am_cv_prog_cc_stdc" ;;
445 dnl From Jim Meyering.
449 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
450 [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
451 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
452 am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
453 [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
455 gwinsz_in_termios_h=no
456 if test $am_cv_sys_posix_termios = yes; then
458 [#include <sys/types.h>
459 # include <termios.h>
463 ], gwinsz_in_termios_h=yes)
466 if test $gwinsz_in_termios_h = no; then
468 [#include <sys/types.h>
469 # include <sys/ioctl.h>
473 ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
476 if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
477 AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
481 dnl From Jim Meyering.
485 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
486 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
487 [AC_TRY_LINK([#include <sys/types.h>
489 #include <termios.h>],
490 [/* SunOS 4.0.3 has termios.h but not the library calls. */
492 am_cv_sys_posix_termios=yes,
493 am_cv_sys_posix_termios=no)])
496 # From Ulrich Drepper.
500 AC_DEFUN(AM_TYPE_PTRDIFF_T,
501 [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
502 [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
503 am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
504 if test $am_cv_type_ptrdiff_t = yes; then
505 AC_DEFINE(HAVE_PTRDIFF_T)