1 # aclocal.m4 generated automatically by aclocal 1.5
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 dnl ---------------------------------------------------------------------------
15 dnl Look for the curses libraries. Older curses implementations may require
16 dnl termcap/termlib to be linked as well.
17 AC_DEFUN([CF_CURSES_LIBS],[
18 AC_CHECK_FUNC(initscr,,[
21 AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
24 AC_CHECK_LIB(cur_colr,initscr,[
25 LIBS="-lcur_colr $LIBS"
26 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
27 ac_cv_func_initscr=yes
29 AC_CHECK_LIB(Hcurses,initscr,[
30 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
31 LIBS="-lHcurses $LIBS"
32 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
33 ac_cv_func_initscr=yes
36 linux*) # Suse Linux does not follow /usr/lib convention
41 if test ".$With5lib" != ".no" ; then
42 if test -d /usr/5lib ; then
44 CPPFLAGS="$CPPFLAGS -I/usr/5include"
45 LIBS="$LIBS -L/usr/5lib"
49 if test ".$ac_cv_func_initscr" != .yes ; then
54 # Check for library containing tgoto. Do this before curses library
55 # because it may be needed to link the test-case for initscr.
56 AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
57 for cf_term_lib in termcap termlib unknown
59 AC_CHECK_LIB($cf_term_lib,tgoto,[break])
63 # Check for library containing initscr
64 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
65 for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
67 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
69 test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
71 LIBS="-l$cf_curs_lib $cf_save_LIBS"
72 if test "$cf_term_lib" = unknown ; then
73 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
74 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
78 AC_MSG_RESULT($cf_result)
79 test $cf_result = no && AC_ERROR(Cannot link curses library)
80 elif test "$cf_term_lib" != predefined ; then
81 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
82 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
83 [initscr(); tgoto((char *)0, 0, 0);],
86 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
87 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
92 AC_MSG_RESULT($cf_result)
98 # Do all the work for Automake. This macro actually does too much --
99 # some checks are only needed if your package does certain things.
100 # But this isn't really a big deal.
104 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
105 # written in clear, in which case automake, when reading aclocal.m4,
106 # will think it sees a *use*, and therefore will trigger all it's
107 # C support machinery. Also note that it means that autoscan, seeing
108 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
111 # We require 2.13 because we rely on SHELL being computed by configure.
114 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
115 # -----------------------------------------------------------
116 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
117 # The purpose of this macro is to provide the user with a means to
118 # check macros which are provided without letting her know how the
119 # information is coded.
120 # If this macro is not defined by Autoconf, define it here.
121 ifdef([AC_PROVIDE_IFELSE],
123 [define([AC_PROVIDE_IFELSE],
124 [ifdef([AC_PROVIDE_$1],
128 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
129 # ----------------------------------------------
130 AC_DEFUN([AM_INIT_AUTOMAKE],
131 [AC_REQUIRE([AC_PROG_INSTALL])dnl
132 # test to see if srcdir already configured
133 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
134 test -f $srcdir/config.status; then
135 AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
138 # Define the identity of the package.
144 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
145 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
147 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
148 # the ones we care about.
149 ifdef([m4_pattern_allow],
150 [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
152 # Autoconf 2.50 always computes EXEEXT. However we need to be
153 # compatible with 2.13, for now. So we always define EXEEXT, but we
156 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
157 # requests that it be used. This is a bit dumb.
161 # Some tools Automake needs.
162 AC_REQUIRE([AM_SANITY_CHECK])dnl
163 AC_REQUIRE([AC_ARG_PROGRAM])dnl
164 AM_MISSING_PROG(ACLOCAL, aclocal)
165 AM_MISSING_PROG(AUTOCONF, autoconf)
166 AM_MISSING_PROG(AUTOMAKE, automake)
167 AM_MISSING_PROG(AUTOHEADER, autoheader)
168 AM_MISSING_PROG(MAKEINFO, makeinfo)
169 AM_MISSING_PROG(AMTAR, tar)
171 AM_PROG_INSTALL_STRIP
172 # We need awk for the "check" target. The system "awk" is bad on
174 AC_REQUIRE([AC_PROG_AWK])dnl
175 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
176 AC_REQUIRE([AM_DEP_TRACK])dnl
177 AC_REQUIRE([AM_SET_DEPDIR])dnl
178 AC_PROVIDE_IFELSE([AC_PROG_][CC],
179 [_AM_DEPENDENCIES(CC)],
180 [define([AC_PROG_][CC],
181 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
182 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
183 [_AM_DEPENDENCIES(CXX)],
184 [define([AC_PROG_][CXX],
185 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
189 # Check to make sure that the build environment is sane.
196 AC_DEFUN([AM_SANITY_CHECK],
197 [AC_MSG_CHECKING([whether build environment is sane])
200 echo timestamp > conftest.file
201 # Do `set' in a subshell so we don't clobber the current shell's
202 # arguments. Must try -L first in case configure is actually a
203 # symlink; some systems play weird games with the mod time of symlinks
204 # (eg FreeBSD returns the mod time of the symlink's containing
207 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
208 if test "$[*]" = "X"; then
210 set X `ls -t $srcdir/configure conftest.file`
213 if test "$[*]" != "X $srcdir/configure conftest.file" \
214 && test "$[*]" != "X conftest.file $srcdir/configure"; then
216 # If neither matched, then we have a broken ls. This can happen
217 # if, for instance, CONFIG_SHELL is bash and it inherits a
218 # broken ls alias from the environment. This has actually
219 # happened. Such a system could not be considered "sane".
220 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
221 alias in your environment])
224 test "$[2]" = conftest.file
230 AC_MSG_ERROR([newly created file is older than distributed files!
231 Check your system clock])
238 # AM_MISSING_PROG(NAME, PROGRAM)
239 # ------------------------------
240 AC_DEFUN([AM_MISSING_PROG],
241 [AC_REQUIRE([AM_MISSING_HAS_RUN])
242 $1=${$1-"${am_missing_run}$2"}
248 # Define MISSING if not defined so far and test if it supports --run.
249 # If it does, set am_missing_run to use it, otherwise, to nothing.
250 AC_DEFUN([AM_MISSING_HAS_RUN],
251 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
252 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
253 # Use eval to expand $SHELL
254 if eval "$MISSING --run true"; then
255 am_missing_run="$MISSING --run "
259 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
265 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
266 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
267 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
269 # Of course, Automake must honor this variable whenever it calls a
270 # tool from the auxiliary directory. The problem is that $srcdir (and
271 # therefore $ac_aux_dir as well) can be either absolute or relative,
272 # depending on how configure is run. This is pretty annoying, since
273 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
274 # source directory, any form will work fine, but in subdirectories a
275 # relative path needs to be adjusted first.
277 # $ac_aux_dir/missing
278 # fails when called from a subdirectory if $ac_aux_dir is relative
279 # $top_srcdir/$ac_aux_dir/missing
280 # fails if $ac_aux_dir is absolute,
281 # fails when called from a subdirectory in a VPATH build with
282 # a relative $ac_aux_dir
284 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
285 # are both prefixed by $srcdir. In an in-source build this is usually
286 # harmless because $srcdir is `.', but things will broke when you
287 # start a VPATH build or use an absolute $srcdir.
289 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
290 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
291 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
292 # and then we would define $MISSING as
293 # MISSING="\${SHELL} $am_aux_dir/missing"
294 # This will work as long as MISSING is not called from configure, because
295 # unfortunately $(top_srcdir) has no meaning in configure.
296 # However there are other variables, like CC, which are often used in
297 # configure, and could therefore not use this "fixed" $ac_aux_dir.
299 # Another solution, used here, is to always expand $ac_aux_dir to an
300 # absolute PATH. The drawback is that using absolute paths prevent a
301 # configured tree to be moved without reconfiguration.
303 AC_DEFUN([AM_AUX_DIR_EXPAND], [
304 # expand $ac_aux_dir to an absolute path
305 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
310 # Define $install_sh.
311 AC_DEFUN([AM_PROG_INSTALL_SH],
312 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
313 install_sh=${install_sh-"$am_aux_dir/install-sh"}
314 AC_SUBST(install_sh)])
316 # One issue with vendor `install' (even GNU) is that you can't
317 # specify the program used to strip binaries. This is especially
318 # annoying in cross-compiling environments, where the build's strip
319 # is unlikely to handle the host's binaries.
320 # Fortunately install-sh will honor a STRIPPROG variable, so we
321 # always use install-sh in `make install-strip', and initialize
322 # STRIPPROG with the value of the STRIP variable (set by the user).
323 AC_DEFUN([AM_PROG_INSTALL_STRIP],
324 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
325 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
326 AC_SUBST([INSTALL_STRIP_PROGRAM])])
328 # serial 4 -*- Autoconf -*-
332 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
333 # written in clear, in which case automake, when reading aclocal.m4,
334 # will think it sees a *use*, and therefore will trigger all it's
335 # C support machinery. Also note that it means that autoscan, seeing
336 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
340 # _AM_DEPENDENCIES(NAME)
341 # ---------------------
342 # See how the compiler implements dependency checking.
343 # NAME is "CC", "CXX" or "OBJC".
344 # We try a few techniques and use that to set a single cache variable.
346 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
347 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
348 # dependency, and given that the user is not expected to run this macro,
349 # just rely on AC_PROG_CC.
350 AC_DEFUN([_AM_DEPENDENCIES],
351 [AC_REQUIRE([AM_SET_DEPDIR])dnl
352 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
353 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
354 AC_REQUIRE([AM_DEP_TRACK])dnl
356 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
357 [$1], CXX, [depcc="$CXX" am_compiler_list=],
358 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
359 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
360 [depcc="$$1" am_compiler_list=])
362 AC_CACHE_CHECK([dependency style of $depcc],
363 [am_cv_$1_dependencies_compiler_type],
364 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
365 # We make a subdir and do the tests there. Otherwise we can end up
366 # making bogus files that we don't know about and never remove. For
367 # instance it was reported that on HP-UX the gcc test will end up
368 # making a dummy file named `D' -- because `-MD' means `put the output
371 # Copy depcomp to subdir because otherwise we won't find it if we're
372 # using a relative directory.
373 cp "$am_depcomp" conftest.dir
376 am_cv_$1_dependencies_compiler_type=none
377 if test "$am_compiler_list" = ""; then
378 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
380 for depmode in $am_compiler_list; do
381 # We need to recreate these files for each test, as the compiler may
382 # overwrite some of them when testing with obscure command lines.
383 # This happens at least with the AIX C compiler.
384 echo '#include "conftest.h"' > conftest.c
385 echo 'int i;' > conftest.h
386 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
390 # after this tag, mechanisms are not by side-effect, so they'll
391 # only be used when explicitly requested
392 if test "x$enable_dependency_tracking" = xyes; then
400 # We check with `-c' and `-o' for the sake of the "dashmstdout"
401 # mode. It turns out that the SunPro C++ compiler does not properly
402 # handle `-M -o', and we need to detect this.
403 if depmode=$depmode \
404 source=conftest.c object=conftest.o \
405 depfile=conftest.Po tmpdepfile=conftest.TPo \
406 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
407 grep conftest.h conftest.Po > /dev/null 2>&1 &&
408 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
409 am_cv_$1_dependencies_compiler_type=$depmode
417 am_cv_$1_dependencies_compiler_type=none
420 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
421 AC_SUBST([$1DEPMODE])
427 # Choose a directory name for dependency files.
428 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
429 AC_DEFUN([AM_SET_DEPDIR],
430 [rm -f .deps 2>/dev/null
431 mkdir .deps 2>/dev/null
432 if test -d .deps; then
435 # MS-DOS does not allow filenames that begin with a dot.
438 rmdir .deps 2>/dev/null
445 AC_DEFUN([AM_DEP_TRACK],
446 [AC_ARG_ENABLE(dependency-tracking,
447 [ --disable-dependency-tracking Speeds up one-time builds
448 --enable-dependency-tracking Do not reject slow dependency extractors])
449 if test "x$enable_dependency_tracking" != xno; then
450 am_depcomp="$ac_aux_dir/depcomp"
453 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
454 pushdef([subst], defn([AC_SUBST]))
455 subst(AMDEPBACKSLASH)
459 # Generate code to set up dependency tracking.
460 # This macro should only be invoked once -- use via AC_REQUIRE.
462 # AM_OUTPUT_DEPENDENCY_COMMANDS
465 # This code is only required when automatic dependency tracking
466 # is enabled. FIXME. This creates each `.P' file that we will
467 # need in order to bootstrap the dependency handling code.
468 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
470 test x"$AMDEP_TRUE" != x"" ||
471 for mf in $CONFIG_FILES; do
473 Makefile) dirpart=.;;
474 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
477 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
478 # Extract the definition of DEP_FILES from the Makefile without
480 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
481 test -z "$DEPDIR" && continue
482 # When using ansi2knr, U may be empty or an underscore; expand it
483 U=`sed -n -e '/^U = / s///p' < "$mf"`
484 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
485 # We invoke sed twice because it is the simplest approach to
486 # changing $(DEPDIR) to its actual value in the expansion.
487 for file in `sed -n -e '
488 /^DEP_FILES = .*\\\\$/ {
497 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
498 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
499 # Make sure the directory exists.
500 test -f "$dirpart/$file" && continue
501 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
502 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
503 # echo "creating $dirpart/$file"
504 echo '# dummy' > "$dirpart/$file"
507 ], [AMDEP_TRUE="$AMDEP_TRUE"
508 ac_aux_dir="$ac_aux_dir"])])
512 # Check to see how make treats includes.
513 AC_DEFUN([AM_MAKE_INCLUDE],
514 [am_make=${MAKE-make}
515 cat > confinc << 'END'
519 # If we don't find an include directive, just comment out the code.
520 AC_MSG_CHECKING([for style of include used by $am_make])
524 # First try GNU make style include.
525 echo "include confinc" > confmf
526 # We grep out `Entering directory' and `Leaving directory'
527 # messages which can occur if `w' ends up in MAKEFLAGS.
528 # In particular we don't look at `^make:' because GNU make might
529 # be invoked under some other name (usually "gmake"), in which
530 # case it prints its new name instead of `make'.
531 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
536 # Now try BSD make style include.
537 if test "$am__include" = "#"; then
538 echo '.include "confinc"' > confmf
539 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
545 AC_SUBST(am__include)
547 AC_MSG_RESULT($_am_result)
553 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
554 # -------------------------------------
555 # Define a conditional.
557 # FIXME: Once using 2.50, use this:
558 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
559 AC_DEFUN([AM_CONDITIONAL],
560 [ifelse([$1], [TRUE],
561 [errprint(__file__:__line__: [$0: invalid condition: $1
564 ifelse([$1], [FALSE],
565 [errprint(__file__:__line__: [$0: invalid condition: $1
578 # Like AC_CONFIG_HEADER, but automatically create stamp file.
582 # When config.status generates a header, we must update the stamp-h file.
583 # This file resides in the same directory as the config header
584 # that is generated. We must strip everything past the first ":",
585 # and everything past the last "/".
589 AC_DEFUN([AM_CONFIG_HEADER],
590 [ifdef([AC_FOREACH],dnl
591 [dnl init our file count if it isn't already
592 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
593 dnl prepare to store our destination file list for use in config.status
594 AC_FOREACH([_AM_File], [$1],
595 [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
596 m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
597 dnl and add it to the list of files AC keeps track of, along
599 AC_CONFIG_HEADERS(_AM_File,
600 dnl COMMANDS, [, INIT-CMDS]
601 [# update the timestamp
602 echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
603 ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
604 m4_popdef([_AM_Dest])])],dnl
605 [AC_CONFIG_HEADER([$1])
607 ifelse(patsubst([$1], [[^ ]], []),
609 [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
610 patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
612 for am_file in $1; do
613 case " \$CONFIG_HEADERS " in
615 am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
616 if test -n "\$am_dir"; then
617 am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
618 for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
619 am_tmpdir=\$am_tmpdir\$am_subdir/
620 if test ! -d \$am_tmpdir; then
625 echo timestamp > "\$am_dir"stamp-h\$am_indx
628 am_indx=\`expr \$am_indx + 1\`
630 ])]) # AM_CONFIG_HEADER
634 # Like AS_DIRNAME, only do it during macro expansion
635 AC_DEFUN([_AM_DIRNAME],
636 [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
637 m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
638 m4_if(m4_regexp([$1], [^/.*]), -1,
640 m4_patsubst([$1], [^\(/\).*], [\1])),
641 m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
642 m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
646 # This test replaces the one in autoconf.
647 # Currently this macro should have the same name as the autoconf macro
648 # because gettext's gettext.m4 (distributed in the automake package)
649 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
650 # give these diagnostics:
651 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
652 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
654 undefine([AC_ISC_POSIX])
656 AC_DEFUN([AC_ISC_POSIX],
658 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
659 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
666 AC_DEFUN([AM_C_PROTOTYPES],
667 [AC_REQUIRE([AM_PROG_CC_STDC])
668 AC_REQUIRE([AC_PROG_CPP])
669 AC_MSG_CHECKING([for function prototypes])
670 if test "$am_cv_prog_cc_stdc" != no; then
672 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
676 U=_ ANSI2KNR=./ansi2knr
678 # Ensure some checks needed by ansi2knr itself.
680 AC_CHECK_HEADERS(string.h)
682 AC_SUBST(ANSI2KNR)dnl
688 # @defmac AC_PROG_CC_STDC
689 # @maindex PROG_CC_STDC
691 # If the C compiler in not in ANSI C mode by default, try to add an option
692 # to output variable @code{CC} to make it so. This macro tries various
693 # options that select ANSI C on some system or another. It considers the
694 # compiler to be in ANSI C mode if it handles function prototypes correctly.
696 # If you use this macro, you should check after calling it whether the C
697 # compiler has been set to accept ANSI C; if not, the shell variable
698 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
699 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
700 # program @code{ansi2knr}, which comes with Ghostscript.
703 AC_DEFUN([AM_PROG_CC_STDC],
704 [AC_REQUIRE([AC_PROG_CC])
705 AC_BEFORE([$0], [AC_C_INLINE])
706 AC_BEFORE([$0], [AC_C_CONST])
707 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
708 dnl a magic option to avoid problems with ANSI preprocessor commands
710 dnl FIXME: can't do this because then AC_AIX won't work due to a
711 dnl circular dependency.
712 dnl AC_BEFORE([$0], [AC_PROG_CPP])
713 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
714 AC_CACHE_VAL(am_cv_prog_cc_stdc,
715 [am_cv_prog_cc_stdc=no
717 # Don't try gcc -ansi; that turns off useful extensions and
718 # breaks some systems' header files.
720 # Ultrix and OSF/1 -std1
721 # HP-UX 10.20 and later -Ae
722 # HP-UX older versions -Aa -D_HPUX_SOURCE
723 # SVR4 -Xc -D__EXTENSIONS__
724 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
726 CC="$ac_save_CC $ac_arg"
730 #include <sys/types.h>
731 #include <sys/stat.h>
732 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
733 struct buf { int x; };
734 FILE * (*rcsopen) (struct buf *, struct stat *, int);
735 static char *e (p, i)
741 static char *f (char * (*g) (char **, int), char **p, ...)
746 s = g (p, va_arg (v,int));
750 int test (int i, double x);
751 struct s1 {int (*f) (int a);};
752 struct s2 {int (*f) (double a);};
753 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
757 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
759 [am_cv_prog_cc_stdc="$ac_arg"; break])
763 if test -z "$am_cv_prog_cc_stdc"; then
764 AC_MSG_RESULT([none needed])
766 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
768 case "x$am_cv_prog_cc_stdc" in
770 *) CC="$CC $am_cv_prog_cc_stdc" ;;