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.
14 dnl Copyright 1998-2001 The OpenLDAP Foundation, Redwood City, California, USA
15 dnl All rights reserved.
17 dnl Redistribution and use in source and binary forms, with or without
18 dnl modification, are permitted only as authorized by the OpenLDAP
19 dnl Public License. A copy of this license is available at
20 dnl http://www.OpenLDAP.org/license.html or in file LICENSE in the
21 dnl top-level directory of the distribution.
23 dnl OpenLDAP Autoconf Macros
26 builtin(include, build/openldap.m4)dnl
28 # Do all the work for Automake. This macro actually does too much --
29 # some checks are only needed if your package does certain things.
30 # But this isn't really a big deal.
35 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
37 AC_DEFUN(AM_INIT_AUTOMAKE,
38 [AC_REQUIRE([AC_PROG_INSTALL])
39 dnl We require 2.13 because we rely on SHELL being computed by configure.
45 dnl test to see if srcdir already configured
46 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
47 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
50 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
51 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
52 AC_REQUIRE([AM_SANITY_CHECK])
53 AC_REQUIRE([AC_ARG_PROGRAM])
54 dnl FIXME This is truly gross.
55 missing_dir=`cd $ac_aux_dir && pwd`
56 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
57 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
58 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
59 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
60 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
61 dnl Set install_sh for make dist
62 install_sh="$missing_dir/install-sh"
63 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
65 dnl We check for tar when the user configures the end package.
66 dnl This is sad, since we only need this for "dist". However,
67 dnl there's no other good way to do it. We prefer GNU tar if
68 dnl we can find it. If we can't find a tar, it doesn't really matter.
69 AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
70 dnl We need awk for the "check" target. The system "awk" is bad on
72 AC_REQUIRE([AC_PROG_AWK])
74 if test -n "$AMTAR"; then
75 if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
81 AC_REQUIRE([AC_PROG_MAKE_SET])])
84 # Check to make sure that the build environment is sane.
87 AC_DEFUN(AM_SANITY_CHECK,
88 [AC_MSG_CHECKING([whether build environment is sane])
91 echo timestamp > conftestfile
92 # Do `set' in a subshell so we don't clobber the current shell's
93 # arguments. Must try -L first in case configure is actually a
94 # symlink; some systems play weird games with the mod time of symlinks
95 # (eg FreeBSD returns the mod time of the symlink's containing
98 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
99 if test "[$]*" = "X"; then
101 set X `ls -t $srcdir/configure conftestfile`
103 if test "[$]*" != "X $srcdir/configure conftestfile" \
104 && test "[$]*" != "X conftestfile $srcdir/configure"; then
106 # If neither matched, then we have a broken ls. This can happen
107 # if, for instance, CONFIG_SHELL is bash and it inherits a
108 # broken ls alias from the environment. This has actually
109 # happened. Such a system could not be considered "sane".
110 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
111 alias in your environment])
114 test "[$]2" = conftestfile
120 AC_MSG_ERROR([newly created file is older than distributed files!
121 Check your system clock])
126 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
127 dnl The program must properly implement --version.
128 AC_DEFUN(AM_MISSING_PROG,
129 [AC_MSG_CHECKING(for working $2)
130 # Run test in a subshell; some versions of sh will print an error if
131 # an executable is not found, even if stderr is redirected.
132 # Redirect stdin to placate older versions of autoconf. Sigh.
133 if ($2 --version) < /dev/null > /dev/null 2>&1; then
138 AC_MSG_RESULT(missing)
143 # serial 40 AC_PROG_LIBTOOL
144 AC_DEFUN(AC_PROG_LIBTOOL,
145 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
147 # Save cache, so that ltconfig can load it
150 # Actually configure libtool. ac_aux_dir is where install-sh is found.
151 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
152 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
153 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
154 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
155 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
156 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
157 || AC_MSG_ERROR([libtool configure failed])
159 # Reload cache, that may have been modified by ltconfig
162 # This can be used to rebuild libtool when needed
163 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
165 # Always use our own libtool.
166 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
169 # Redirect the config.log output again, so that the ltconfig log is not
170 # clobbered by the next message.
174 AC_DEFUN(AC_LIBTOOL_SETUP,
176 AC_REQUIRE([AC_ENABLE_SHARED])dnl
177 AC_REQUIRE([AC_ENABLE_STATIC])dnl
178 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
179 AC_REQUIRE([AC_CANONICAL_HOST])dnl
180 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
181 AC_REQUIRE([AC_PROG_RANLIB])dnl
182 AC_REQUIRE([AC_PROG_CC])dnl
183 AC_REQUIRE([AC_PROG_LD])dnl
184 AC_REQUIRE([AC_PROG_NM])dnl
185 AC_REQUIRE([AC_PROG_LN_S])dnl
189 NONE) lt_target="$host" ;;
190 *) lt_target="$target" ;;
193 # Check for any special flags to pass to ltconfig.
194 libtool_flags="--cache-file=$cache_file"
195 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
196 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
197 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
198 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
199 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
200 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
201 [libtool_flags="$libtool_flags --enable-dlopen"])
202 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
203 [libtool_flags="$libtool_flags --enable-win32-dll"])
204 AC_ARG_ENABLE(libtool-lock,
205 [ --disable-libtool-lock avoid locking (might break parallel builds)])
206 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
207 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
209 # Some flags need to be propagated to the compiler or linker for good
213 # Find out which ABI we are using.
214 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
215 if AC_TRY_EVAL(ac_compile); then
216 case "`/usr/bin/file conftest.o`" in
232 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
233 SAVE_CFLAGS="$CFLAGS"
234 CFLAGS="$CFLAGS -belf"
235 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
236 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
237 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
238 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
239 CFLAGS="$SAVE_CFLAGS"
243 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
244 [*-*-cygwin* | *-*-mingw*)
245 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
246 AC_CHECK_TOOL(AS, as, false)
247 AC_CHECK_TOOL(OBJDUMP, objdump, false)
253 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
254 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
256 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
257 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
259 # AC_ENABLE_SHARED - implement the --enable-shared flag
260 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
261 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
263 AC_DEFUN(AC_ENABLE_SHARED, [dnl
264 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
265 AC_ARG_ENABLE(shared,
266 changequote(<<, >>)dnl
267 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
269 [p=${PACKAGE-default}
271 yes) enable_shared=yes ;;
272 no) enable_shared=no ;;
275 # Look at the argument we got. We use all the common list separators.
276 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
277 for pkg in $enableval; do
278 if test "X$pkg" = "X$p"; then
285 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
288 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
289 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
290 AC_ENABLE_SHARED(no)])
292 # AC_ENABLE_STATIC - implement the --enable-static flag
293 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
294 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
296 AC_DEFUN(AC_ENABLE_STATIC, [dnl
297 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
298 AC_ARG_ENABLE(static,
299 changequote(<<, >>)dnl
300 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
302 [p=${PACKAGE-default}
304 yes) enable_static=yes ;;
305 no) enable_static=no ;;
308 # Look at the argument we got. We use all the common list separators.
309 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
310 for pkg in $enableval; do
311 if test "X$pkg" = "X$p"; then
318 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
321 # AC_DISABLE_STATIC - set the default static flag to --disable-static
322 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
323 AC_ENABLE_STATIC(no)])
326 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
327 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
328 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
330 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
331 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
332 AC_ARG_ENABLE(fast-install,
333 changequote(<<, >>)dnl
334 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
336 [p=${PACKAGE-default}
338 yes) enable_fast_install=yes ;;
339 no) enable_fast_install=no ;;
341 enable_fast_install=no
342 # Look at the argument we got. We use all the common list separators.
343 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
344 for pkg in $enableval; do
345 if test "X$pkg" = "X$p"; then
346 enable_fast_install=yes
352 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
355 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
356 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
357 AC_ENABLE_FAST_INSTALL(no)])
359 # AC_PROG_LD - find the path to the GNU or non-GNU linker
362 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
363 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
364 AC_REQUIRE([AC_PROG_CC])dnl
365 AC_REQUIRE([AC_CANONICAL_HOST])dnl
366 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
368 if test "$ac_cv_prog_gcc" = yes; then
369 # Check if gcc -print-prog-name=ld gives a path.
370 AC_MSG_CHECKING([for ld used by GCC])
371 ac_prog=`($CC -print-prog-name=ld) 2>&5`
373 # Accept absolute paths.
375 [\\/]* | [A-Za-z]:[\\/]*)
376 re_direlt='/[^/][^/]*/\.\./'
378 # Canonicalize the path of ld
379 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
380 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
381 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
383 test -z "$LD" && LD="$ac_prog"
386 # If it fails, then pretend we aren't using GCC.
390 # If it is relative, then search for the first ld in PATH.
394 elif test "$with_gnu_ld" = yes; then
395 AC_MSG_CHECKING([for GNU ld])
397 AC_MSG_CHECKING([for non-GNU ld])
399 AC_CACHE_VAL(ac_cv_path_LD,
400 [if test -z "$LD"; then
401 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
402 for ac_dir in $PATH; do
403 test -z "$ac_dir" && ac_dir=.
404 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
405 ac_cv_path_LD="$ac_dir/$ac_prog"
406 # Check to see if the program is GNU ld. I'd rather use --version,
407 # but apparently some GNU ld's only accept -v.
408 # Break only if it was the GNU/non-GNU ld that we prefer.
409 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
410 test "$with_gnu_ld" != no && break
412 test "$with_gnu_ld" != yes && break
418 ac_cv_path_LD="$LD" # Let the user override the test with a path.
421 if test -n "$LD"; then
426 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
430 AC_DEFUN(AC_PROG_LD_GNU,
431 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
432 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
433 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
434 ac_cv_prog_gnu_ld=yes
440 # AC_PROG_NM - find the path to a BSD-compatible name lister
442 [AC_MSG_CHECKING([for BSD-compatible nm])
443 AC_CACHE_VAL(ac_cv_path_NM,
444 [if test -n "$NM"; then
445 # Let the user override the test.
448 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
449 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
450 test -z "$ac_dir" && ac_dir=.
451 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
452 # Check to see if the nm accepts a BSD-compat flag.
453 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
454 # nm: unknown option "B" ignored
455 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
456 ac_cv_path_NM="$ac_dir/nm -B"
458 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
459 ac_cv_path_NM="$ac_dir/nm -p"
462 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
463 continue # so that we can try to find one that supports BSD flags
468 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
474 # AC_CHECK_LIBM - check for math library
475 AC_DEFUN(AC_CHECK_LIBM,
476 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
479 *-*-beos* | *-*-cygwin*)
480 # These system don't have libm
483 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
484 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
487 AC_CHECK_LIB(m, main, LIBM="-lm")
492 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
493 # the libltdl convenience library, adds --enable-ltdl-convenience to
494 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
495 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
496 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
497 # '${top_builddir}/' (note the single quotes!) if your package is not
498 # flat, and, if you're not using automake, define top_builddir as
499 # appropriate in the Makefiles.
500 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
501 case "$enable_ltdl_convenience" in
502 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
503 "") enable_ltdl_convenience=yes
504 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
506 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
507 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
510 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
511 # the libltdl installable library, and adds --enable-ltdl-install to
512 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
513 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
514 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
515 # '${top_builddir}/' (note the single quotes!) if your package is not
516 # flat, and, if you're not using automake, define top_builddir as
517 # appropriate in the Makefiles.
518 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
519 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
520 AC_CHECK_LIB(ltdl, main,
521 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
522 [if test x"$enable_ltdl_install" = xno; then
523 AC_MSG_WARN([libltdl not installed, but installation disabled])
525 enable_ltdl_install=yes
528 if test x"$enable_ltdl_install" = x"yes"; then
529 ac_configure_args="$ac_configure_args --enable-ltdl-install"
530 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
531 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
533 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
540 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
541 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
542 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
543 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
544 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
545 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
546 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
548 dnl This is just to silence aclocal about the macro not being used
549 ifelse([AC_DISABLE_FAST_INSTALL])dnl
554 # @defmac AC_PROG_CC_STDC
555 # @maindex PROG_CC_STDC
557 # If the C compiler in not in ANSI C mode by default, try to add an option
558 # to output variable @code{CC} to make it so. This macro tries various
559 # options that select ANSI C on some system or another. It considers the
560 # compiler to be in ANSI C mode if it handles function prototypes correctly.
562 # If you use this macro, you should check after calling it whether the C
563 # compiler has been set to accept ANSI C; if not, the shell variable
564 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
565 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
566 # program @code{ansi2knr}, which comes with Ghostscript.
569 AC_DEFUN(AM_PROG_CC_STDC,
570 [AC_REQUIRE([AC_PROG_CC])
571 AC_BEFORE([$0], [AC_C_INLINE])
572 AC_BEFORE([$0], [AC_C_CONST])
573 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
574 dnl a magic option to avoid problems with ANSI preprocessor commands
576 dnl FIXME: can't do this because then AC_AIX won't work due to a
577 dnl circular dependency.
578 dnl AC_BEFORE([$0], [AC_PROG_CPP])
579 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
580 AC_CACHE_VAL(am_cv_prog_cc_stdc,
581 [am_cv_prog_cc_stdc=no
583 # Don't try gcc -ansi; that turns off useful extensions and
584 # breaks some systems' header files.
586 # Ultrix and OSF/1 -std1
587 # HP-UX 10.20 and later -Ae
588 # HP-UX older versions -Aa -D_HPUX_SOURCE
589 # SVR4 -Xc -D__EXTENSIONS__
590 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
592 CC="$ac_save_CC $ac_arg"
596 #include <sys/types.h>
597 #include <sys/stat.h>
598 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
599 struct buf { int x; };
600 FILE * (*rcsopen) (struct buf *, struct stat *, int);
601 static char *e (p, i)
607 static char *f (char * (*g) (char **, int), char **p, ...)
612 s = g (p, va_arg (v,int));
616 int test (int i, double x);
617 struct s1 {int (*f) (int a);};
618 struct s2 {int (*f) (double a);};
619 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
623 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
625 [am_cv_prog_cc_stdc="$ac_arg"; break])
629 if test -z "$am_cv_prog_cc_stdc"; then
630 AC_MSG_RESULT([none needed])
632 AC_MSG_RESULT($am_cv_prog_cc_stdc)
634 case "x$am_cv_prog_cc_stdc" in
636 *) CC="$CC $am_cv_prog_cc_stdc" ;;
640 dnl From Jim Meyering.
644 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
645 [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
646 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
647 am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
648 [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
650 gwinsz_in_termios_h=no
651 if test $am_cv_sys_posix_termios = yes; then
653 [#include <sys/types.h>
654 # include <termios.h>
658 ], gwinsz_in_termios_h=yes)
661 if test $gwinsz_in_termios_h = no; then
663 [#include <sys/types.h>
664 # include <sys/ioctl.h>
668 ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
671 if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
672 AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1,
673 [Define if TIOCGWINSZ requires sys/ioctl.h])
677 dnl From Jim Meyering.
681 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
682 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
683 [AC_TRY_LINK([#include <sys/types.h>
685 #include <termios.h>],
686 [/* SunOS 4.0.3 has termios.h but not the library calls. */
688 am_cv_sys_posix_termios=yes,
689 am_cv_sys_posix_termios=no)])
692 # From Ulrich Drepper.
696 AC_DEFUN(AM_TYPE_PTRDIFF_T,
697 [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
698 [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
699 am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
700 if test $am_cv_type_ptrdiff_t = yes; then
701 AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])