1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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.
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.
15 dnl Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
16 dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file
18 dnl OpenLDAP Autoconf Macros
20 builtin(include, build/openldap.m4)dnl
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.
29 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
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.
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])
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"
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
66 AC_REQUIRE([AC_PROG_AWK])
68 if test -n "$AMTAR"; then
69 if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
75 AC_REQUIRE([AC_PROG_MAKE_SET])])
78 # Check to make sure that the build environment is sane.
81 AC_DEFUN(AM_SANITY_CHECK,
82 [AC_MSG_CHECKING([whether build environment is sane])
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
92 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
93 if test "[$]*" = "X"; then
95 set X `ls -t $srcdir/configure conftestfile`
97 if test "[$]*" != "X $srcdir/configure conftestfile" \
98 && test "[$]*" != "X conftestfile $srcdir/configure"; then
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])
108 test "[$]2" = conftestfile
114 AC_MSG_ERROR([newly created file is older than distributed files!
115 Check your system clock])
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
132 AC_MSG_RESULT(missing)
137 # serial 40 AC_PROG_LIBTOOL
138 AC_DEFUN(AC_PROG_LIBTOOL,
139 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
141 # Save cache, so that ltconfig can load it
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 $host \
151 || AC_MSG_ERROR([libtool configure failed])
153 # Reload cache, that may have been modified by ltconfig
156 # This can be used to rebuild libtool when needed
157 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
159 # Always use our own libtool.
160 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
163 # Redirect the config.log output again, so that the ltconfig log is not
164 # clobbered by the next message.
168 AC_DEFUN(AC_LIBTOOL_SETUP,
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
182 # Check for any special flags to pass to ltconfig.
183 libtool_flags="--cache-file=$cache_file"
184 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
185 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
186 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
187 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
188 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
189 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
190 [libtool_flags="$libtool_flags --enable-dlopen"])
191 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
192 [libtool_flags="$libtool_flags --enable-win32-dll"])
193 AC_ARG_ENABLE(libtool-lock,
194 [ --disable-libtool-lock avoid locking (might break parallel builds)])
195 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
196 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
198 # Some flags need to be propagated to the compiler or linker for good
202 # Find out which ABI we are using.
203 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
204 if AC_TRY_EVAL(ac_compile); then
205 case "`/usr/bin/file conftest.o`" in
221 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
222 SAVE_CFLAGS="$CFLAGS"
223 CFLAGS="$CFLAGS -belf"
224 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
225 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
226 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
227 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
228 CFLAGS="$SAVE_CFLAGS"
232 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
233 [*-*-cygwin* | *-*-mingw*)
234 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
235 AC_CHECK_TOOL(AS, as, false)
236 AC_CHECK_TOOL(OBJDUMP, objdump, false)
242 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
243 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
245 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
246 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
248 # AC_ENABLE_SHARED - implement the --enable-shared flag
249 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
250 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
252 AC_DEFUN(AC_ENABLE_SHARED, [dnl
253 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
254 AC_ARG_ENABLE(shared,
255 changequote(<<, >>)dnl
256 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
258 [p=${PACKAGE-default}
260 yes) enable_shared=yes ;;
261 no) enable_shared=no ;;
264 # Look at the argument we got. We use all the common list separators.
265 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
266 for pkg in $enableval; do
267 if test "X$pkg" = "X$p"; then
274 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
277 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
278 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
279 AC_ENABLE_SHARED(no)])
281 # AC_ENABLE_STATIC - implement the --enable-static flag
282 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
283 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
285 AC_DEFUN(AC_ENABLE_STATIC, [dnl
286 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
287 AC_ARG_ENABLE(static,
288 changequote(<<, >>)dnl
289 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
291 [p=${PACKAGE-default}
293 yes) enable_static=yes ;;
294 no) enable_static=no ;;
297 # Look at the argument we got. We use all the common list separators.
298 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
299 for pkg in $enableval; do
300 if test "X$pkg" = "X$p"; then
307 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
310 # AC_DISABLE_STATIC - set the default static flag to --disable-static
311 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
312 AC_ENABLE_STATIC(no)])
315 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
316 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
317 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
319 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
320 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
321 AC_ARG_ENABLE(fast-install,
322 changequote(<<, >>)dnl
323 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
325 [p=${PACKAGE-default}
327 yes) enable_fast_install=yes ;;
328 no) enable_fast_install=no ;;
330 enable_fast_install=no
331 # Look at the argument we got. We use all the common list separators.
332 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
333 for pkg in $enableval; do
334 if test "X$pkg" = "X$p"; then
335 enable_fast_install=yes
341 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
344 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
345 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
346 AC_ENABLE_FAST_INSTALL(no)])
348 # AC_PROG_LD - find the path to the GNU or non-GNU linker
351 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
352 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
353 AC_REQUIRE([AC_PROG_CC])dnl
354 AC_REQUIRE([AC_CANONICAL_HOST])dnl
355 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
357 if test "$ac_cv_prog_gcc" = yes; then
358 # Check if gcc -print-prog-name=ld gives a path.
359 AC_MSG_CHECKING([for ld used by GCC])
360 ac_prog=`($CC -print-prog-name=ld) 2>&5`
362 # Accept absolute paths.
364 [\\/]* | [A-Za-z]:[\\/]*)
365 re_direlt='/[^/][^/]*/\.\./'
367 # Canonicalize the path of ld
368 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
369 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
370 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
372 test -z "$LD" && LD="$ac_prog"
375 # If it fails, then pretend we aren't using GCC.
379 # If it is relative, then search for the first ld in PATH.
383 elif test "$with_gnu_ld" = yes; then
384 AC_MSG_CHECKING([for GNU ld])
386 AC_MSG_CHECKING([for non-GNU ld])
388 AC_CACHE_VAL(ac_cv_path_LD,
389 [if test -z "$LD"; then
390 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
391 for ac_dir in $PATH; do
392 test -z "$ac_dir" && ac_dir=.
393 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
394 ac_cv_path_LD="$ac_dir/$ac_prog"
395 # Check to see if the program is GNU ld. I'd rather use --version,
396 # but apparently some GNU ld's only accept -v.
397 # Break only if it was the GNU/non-GNU ld that we prefer.
398 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
399 test "$with_gnu_ld" != no && break
401 test "$with_gnu_ld" != yes && break
407 ac_cv_path_LD="$LD" # Let the user override the test with a path.
410 if test -n "$LD"; then
415 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
420 AC_DEFUN(AC_PROG_LD_GNU,
421 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
422 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
423 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
424 ac_cv_prog_gnu_ld=yes
430 # AC_PROG_NM - find the path to a BSD-compatible name lister
432 [AC_MSG_CHECKING([for BSD-compatible nm])
433 AC_CACHE_VAL(ac_cv_path_NM,
434 [if test -n "$NM"; then
435 # Let the user override the test.
438 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
439 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
440 test -z "$ac_dir" && ac_dir=.
441 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
442 # Check to see if the nm accepts a BSD-compat flag.
443 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
444 # nm: unknown option "B" ignored
445 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
446 ac_cv_path_NM="$ac_dir/nm -B"
448 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
449 ac_cv_path_NM="$ac_dir/nm -p"
452 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
453 continue # so that we can try to find one that supports BSD flags
458 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
465 # AC_CHECK_LIBM - check for math library
466 AC_DEFUN(AC_CHECK_LIBM,
467 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
470 *-*-beos* | *-*-cygwin*)
471 # These system don't have libm
474 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
475 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
478 AC_CHECK_LIB(m, main, LIBM="-lm")
483 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
484 # the libltdl convenience library, adds --enable-ltdl-convenience to
485 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
486 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
487 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
488 # '${top_builddir}/' (note the single quotes!) if your package is not
489 # flat, and, if you're not using automake, define top_builddir as
490 # appropriate in the Makefiles.
491 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
492 case "$enable_ltdl_convenience" in
493 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
494 "") enable_ltdl_convenience=yes
495 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
497 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
498 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
501 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
502 # the libltdl installable library, and adds --enable-ltdl-install to
503 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
504 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
505 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
506 # '${top_builddir}/' (note the single quotes!) if your package is not
507 # flat, and, if you're not using automake, define top_builddir as
508 # appropriate in the Makefiles.
509 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
510 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
511 AC_CHECK_LIB(ltdl, main,
512 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
513 [if test x"$enable_ltdl_install" = xno; then
514 AC_MSG_WARN([libltdl not installed, but installation disabled])
516 enable_ltdl_install=yes
519 if test x"$enable_ltdl_install" = x"yes"; then
520 ac_configure_args="$ac_configure_args --enable-ltdl-install"
521 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
522 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
524 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
531 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
532 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
533 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
534 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
535 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
536 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
537 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
539 dnl This is just to silence aclocal about the macro not being used
540 ifelse([AC_DISABLE_FAST_INSTALL])dnl
545 # @defmac AC_PROG_CC_STDC
546 # @maindex PROG_CC_STDC
548 # If the C compiler in not in ANSI C mode by default, try to add an option
549 # to output variable @code{CC} to make it so. This macro tries various
550 # options that select ANSI C on some system or another. It considers the
551 # compiler to be in ANSI C mode if it handles function prototypes correctly.
553 # If you use this macro, you should check after calling it whether the C
554 # compiler has been set to accept ANSI C; if not, the shell variable
555 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
556 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
557 # program @code{ansi2knr}, which comes with Ghostscript.
560 AC_DEFUN(AM_PROG_CC_STDC,
561 [AC_REQUIRE([AC_PROG_CC])
562 AC_BEFORE([$0], [AC_C_INLINE])
563 AC_BEFORE([$0], [AC_C_CONST])
564 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
565 dnl a magic option to avoid problems with ANSI preprocessor commands
567 dnl FIXME: can't do this because then AC_AIX won't work due to a
568 dnl circular dependency.
569 dnl AC_BEFORE([$0], [AC_PROG_CPP])
570 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
571 AC_CACHE_VAL(am_cv_prog_cc_stdc,
572 [am_cv_prog_cc_stdc=no
574 # Don't try gcc -ansi; that turns off useful extensions and
575 # breaks some systems' header files.
577 # Ultrix and OSF/1 -std1
578 # HP-UX 10.20 and later -Ae
579 # HP-UX older versions -Aa -D_HPUX_SOURCE
580 # SVR4 -Xc -D__EXTENSIONS__
581 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
583 CC="$ac_save_CC $ac_arg"
587 #include <sys/types.h>
588 #include <sys/stat.h>
589 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
590 struct buf { int x; };
591 FILE * (*rcsopen) (struct buf *, struct stat *, int);
592 static char *e (p, i)
598 static char *f (char * (*g) (char **, int), char **p, ...)
603 s = g (p, va_arg (v,int));
607 int test (int i, double x);
608 struct s1 {int (*f) (int a);};
609 struct s2 {int (*f) (double a);};
610 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
614 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
616 [am_cv_prog_cc_stdc="$ac_arg"; break])
620 if test -z "$am_cv_prog_cc_stdc"; then
621 AC_MSG_RESULT([none needed])
623 AC_MSG_RESULT($am_cv_prog_cc_stdc)
625 case "x$am_cv_prog_cc_stdc" in
627 *) CC="$CC $am_cv_prog_cc_stdc" ;;
631 dnl From Jim Meyering.
635 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
636 [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
637 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
638 am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
639 [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
641 gwinsz_in_termios_h=no
642 if test $am_cv_sys_posix_termios = yes; then
644 [#include <sys/types.h>
645 # include <termios.h>
649 ], gwinsz_in_termios_h=yes)
652 if test $gwinsz_in_termios_h = no; then
654 [#include <sys/types.h>
655 # include <sys/ioctl.h>
659 ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
662 if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
663 AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1,
664 [Define if TIOCGWINSZ requires sys/ioctl.h])
668 dnl From Jim Meyering.
672 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
673 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
674 [AC_TRY_LINK([#include <sys/types.h>
676 #include <termios.h>],
677 [/* SunOS 4.0.3 has termios.h but not the library calls. */
679 am_cv_sys_posix_termios=yes,
680 am_cv_sys_posix_termios=no)])
683 # From Ulrich Drepper.
687 AC_DEFUN(AM_TYPE_PTRDIFF_T,
688 [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
689 [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
690 am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
691 if test $am_cv_type_ptrdiff_t = yes; then
692 AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])