@dircategory Individual utilities
@direntry
* autoscan: (autoconf)autoscan Invocation.
- Semi-automatic @file{configure.ac} writing
+ Semi-automatic @file{configure.ac} writing
* ifnames: (autoconf)ifnames Invocation. Listing conditionals in source.
* autoconf: (autoconf)autoconf Invocation.
- How to create configuration scripts
+ How to create configuration scripts
* autoreconf: (autoconf)autoreconf Invocation.
- Remaking multiple @command{configure} scripts
+ Remaking multiple @command{configure} scripts
* autoheader: (autoconf)autoheader Invocation.
- How to create configuration templates
+ How to create configuration templates
* autom4te: (autoconf)autom4te Invocation.
- The Autoconf executables backbone
+ The Autoconf executables backbone
* configure: (autoconf)configure Invocation. Configuring a package.
* autoupdate: (autoconf)autoupdate Invocation.
- Automatic update of @file{configure.ac}
+ Automatic update of @file{configure.ac}
* config.status: (autoconf)config.status Invocation. Recreating configurations.
* testsuite: (autoconf)testsuite Invocation. Running an Autotest test suite.
@end direntry
@group
configure.ac --.
- | .------> autoconf* -----> configure
+ | .------> autoconf* -----> configure
[aclocal.m4] --+---+
- | `-----> [autoheader*] --> [config.h.in]
+ | `-----> [autoheader*] --> [config.h.in]
[acsite.m4] ---'
@end group
Files used in configuring a software package:
@example
@group
- .-------------> [config.cache]
+ .-------------> [config.cache]
configure* ------------+-------------> config.log
- |
+ |
[config.h.in] -. v .-> [config.h] -.
- +--> config.status* -+ +--> make*
+ +--> config.status* -+ +--> make*
Makefile.in ---' `-> Makefile ---'
@end group
@end example
@example
AC_CHECK_HEADER([stdio.h],
- [AC_DEFINE([HAVE_STDIO_H])],
- [AC_MSG_ERROR([Sorry, can't do anything for you])])
+ [AC_DEFINE([HAVE_STDIO_H])],
+ [AC_MSG_ERROR([Sorry, can't do anything for you])])
@end example
@noindent
@example
AC_CHECK_HEADER(stdio.h,
- [AC_DEFINE(HAVE_STDIO_H)],
- [AC_MSG_ERROR([Sorry, can't do anything for you])])
+ [AC_DEFINE(HAVE_STDIO_H)],
+ [AC_MSG_ERROR([Sorry, can't do anything for you])])
@end example
@noindent
@example
AC_CHECK_HEADER(stdio.h,
- AC_DEFINE(HAVE_STDIO_H),
- AC_MSG_ERROR([Sorry, can't do anything for you]))
+ AC_DEFINE(HAVE_STDIO_H),
+ AC_MSG_ERROR([Sorry, can't do anything for you]))
@end example
In other cases, you may have to use text that also resembles a macro
@example
AC_CONFIG_FILES([Makefile:boiler/top.mk:boiler/bot.mk]
- [lib/Makefile:boiler/lib.mk])
+ [lib/Makefile:boiler/lib.mk])
@end example
@noindent
@example
@group
edit = sed \
- -e 's,@@datadir\@@,$(pkgdatadir),g' \
- -e 's,@@prefix\@@,$(prefix),g'
+ -e 's,@@datadir\@@,$(pkgdatadir),g' \
+ -e 's,@@prefix\@@,$(prefix),g'
@end group
@group
autoconf: Makefile $(srcdir)/autoconf.in
- rm -f autoconf autoconf.tmp
- $(edit) $(srcdir)/autoconf.in >autoconf.tmp
- chmod +x autoconf.tmp
- mv autoconf.tmp autoconf
+ rm -f autoconf autoconf.tmp
+ $(edit) $(srcdir)/autoconf.in >autoconf.tmp
+ chmod +x autoconf.tmp
+ mv autoconf.tmp autoconf
@end group
@group
autoheader: Makefile $(srcdir)/autoheader.in
- rm -f autoheader autoheader.tmp
- $(edit) $(srcdir)/autoconf.in >autoheader.tmp
- chmod +x autoheader.tmp
- mv autoheader.tmp autoheader
+ rm -f autoheader autoheader.tmp
+ $(edit) $(srcdir)/autoconf.in >autoheader.tmp
+ chmod +x autoheader.tmp
+ mv autoheader.tmp autoheader
@end group
@end example
autoconf autoheader: Makefile
@group
.in:
- rm -f $@@ $@@.tmp
- $(edit) $< >$@@.tmp
- chmod +x $@@.tmp
- mv $@@.tmp $@@
+ rm -f $@@ $@@.tmp
+ $(edit) $< >$@@.tmp
+ chmod +x $@@.tmp
+ mv $@@.tmp $@@
@end group
@end example
@example
time.info: time.texinfo
- $(MAKEINFO) $(srcdir)/time.texinfo
+ $(MAKEINFO) $(srcdir)/time.texinfo
@end example
@node Automatic Remaking
@example
@group
$(srcdir)/configure: configure.ac aclocal.m4
- cd $(srcdir) && autoconf
+ cd $(srcdir) && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
$(srcdir)/config.h.in: stamp-h.in
$(srcdir)/stamp-h.in: configure.ac aclocal.m4
- cd $(srcdir) && autoheader
- echo timestamp > $(srcdir)/stamp-h.in
+ cd $(srcdir) && autoheader
+ echo timestamp > $(srcdir)/stamp-h.in
config.h: stamp-h
stamp-h: config.h.in config.status
- ./config.status
+ ./config.status
Makefile: Makefile.in config.status
- ./config.status
+ ./config.status
config.status: configure
- ./config.status --recheck
+ ./config.status --recheck
@end group
@end example
@example
AH_TEMPLATE([CRAY_STACKSEG_END],
- [Define to one of _getb67, GETB67, getb67
- for Cray-2 and Cray-YMP systems. This
- function is required for alloca.c support
- on those systems.])
+ [Define to one of _getb67, GETB67, getb67
+ for Cray-2 and Cray-YMP systems. This
+ function is required for alloca.c support
+ on those systems.])
@end example
@noindent
@example
fubar=42
AC_CONFIG_COMMANDS([fubar],
- [echo this is extra $fubar, and so on.],
- [fubar=$fubar])
+ [echo this is extra $fubar, and so on.],
+ [fubar=$fubar])
@end example
Here is a better one:
@example
AC_CONFIG_LINKS(host.h:config/$machine.h
- object.h:config/$obj_format.h)
+ object.h:config/$obj_format.h)
@end example
@noindent
unconditional includes, and check the existence of the headers you
include beforehand (@pxref{Header Files}).
-Most generic macros provide the following default set of includes:
+Most generic macros use the following macro to provide the default set
+of includes:
+
+@defmac AC_DEFAULT_INCLUDES (@ovar{include-directives})
+@acindex{DEFAULT_INCLUDES}
+Expand to @var{include-directives} if defined, otherwise to:
@example
@group
@end group
@end example
-If the default includes are used, then Autoconf will automatically check
-for the presence of these headers and their compatibility, i.e., you
-don't need to run @code{AC_HEADERS_STDC}, nor check for @file{stdlib.h}
-etc.
+If the default includes are used, then check for the presence of these
+headers and their compatibility, i.e., you don't need to run
+@code{AC_HEADERS_STDC}, nor check for @file{stdlib.h} etc.
These headers are checked for in the same order as they are included.
For instance, on some systems @file{string.h} and @file{strings.h} both
exist, but conflict. Then @code{HAVE_STRING_H} will be defined, but
@code{HAVE_STRINGS_H} won't.
+@end defmac
@node Alternative Programs
@section Alternative Programs
@example
AC_PATH_PROG([INETD], [inetd], [/usr/libexec/inetd],
- [$PATH:/usr/libexec:/usr/sbin:/usr/etc:etc])
+ [$PATH:/usr/libexec:/usr/sbin:/usr/etc:etc])
@end example
You are strongly encouraged to declare the @var{variable} passed to
@example
AC_CHECK_MEMBER(struct passwd.pw_gecos,,
- [AC_MSG_ERROR([We need `passwd.pw_gecos'!])],
- [#include <pwd.h>])
+ [AC_MSG_ERROR([We need `passwd.pw_gecos'!])],
+ [#include <pwd.h>])
@end example
You can use this macro for sub-members:
AC_DEFINE([HELLO_WORLD], ["Hello, World\n"])
AC_LANG_CONFTEST(
[AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]],
- [[fputs (hw, stdout);]])])
+ [[fputs (hw, stdout);]])])
gcc -E -dD conftest.c -o -
@end example
AC_DEFINE([HELLO_WORLD], ["Hello, World\n"])
AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]],
- [[fputs (hw, stdout);]])],
+ [[fputs (hw, stdout);]])],
[AC_MSG_RESULT([OK])],
[AC_MSG_FAILURE([unexpected preprocessor failure])])
@end example
# The order of these tests is important.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statvfs.h>
#include <sys/fstyp.h>]])],
- [AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4])
+ [AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4])
if test $fstype = no; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statfs.h>
#include <sys/fstyp.h>]])],
- [AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3])
+ [AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3])
fi
if test $fstype = no; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statfs.h>
#include <sys/vmount.h>]])]),
- [AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX])
+ [AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX])
fi
# (more cases omitted here)
AC_MSG_RESULT([$fstype])
@group
AC_DEFUN([AC_SHELL_TRUE],
[AC_CACHE_CHECK([whether true(1) works], [ac_cv_shell_true_works],
- [ac_cv_shell_true_works=no
- true && ac_cv_shell_true_works=yes
- if test $ac_cv_shell_true_works = yes; then
- AC_DEFINE([TRUE_WORKS], 1
- [Define if `true(1)' works properly.])
- fi])
+ [ac_cv_shell_true_works=no
+ true && ac_cv_shell_true_works=yes
+ if test $ac_cv_shell_true_works = yes; then
+ AC_DEFINE([TRUE_WORKS], 1
+ [Define if `true(1)' works properly.])
+ fi])
])
@end group
@end example
@group
AC_DEFUN([AC_SHELL_TRUE],
[AC_CACHE_CHECK([whether true(1) works], [ac_cv_shell_true_works],
- [ac_cv_shell_true_works=no
- true && ac_cv_shell_true_works=yes])
+ [ac_cv_shell_true_works=no
+ true && ac_cv_shell_true_works=yes])
if test $ac_cv_shell_true_works = yes; then
AC_DEFINE([TRUE_WORKS], 1
- [Define if `true(1)' works properly.])
+ [Define if `true(1)' works properly.])
fi
])
@end group
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif],
- [atoi (*tzname);],
- [ac_cv_var_tzname=yes],
- [ac_cv_var_tzname=no])
+ [atoi (*tzname);],
+ [ac_cv_var_tzname=yes],
+ [ac_cv_var_tzname=no])
@end example
@noindent
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif]],
- [atoi (*tzname);])],
- [ac_cv_var_tzname=yes],
- [ac_cv_var_tzname=no])
+ [atoi (*tzname);])],
+ [ac_cv_var_tzname=yes],
+ [ac_cv_var_tzname=no])
@end example
@xref{Quadrigraphs}, for what to do if you run into a hopeless case
@example
AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],
- [ac_cv_emxos2=yes],
- [ac_cv_emxos2=no])])
+ [ac_cv_emxos2=yes],
+ [ac_cv_emxos2=no])])
@end example
@noindent
@example
AC_CACHE_CHECK([for EMX OS/2 environment],
- [ac_cv_emxos2],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
- [return __EMX__;])],
- [ac_cv_emxos2=yes],
- [ac_cv_emxos2=no])])
+ [ac_cv_emxos2],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
+ [return __EMX__;])],
+ [ac_cv_emxos2=yes],
+ [ac_cv_emxos2=no])])
@end example
When using @code{AC_RUN_IFELSE} or any macro that cannot work when
m4_define([_AC_EMXOS2],
[AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],
- [ac_cv_emxos2=yes],
- [ac_cv_emxos2=no])])
+ [ac_cv_emxos2=yes],
+ [ac_cv_emxos2=no])])
test "$ac_cv_emxos2" = yes && EMXOS2=yes[]dnl
])# _AC_EMXOS2
@end example
@example
$ @kbd{gawk 'function die () @{ print "Aaaaarg!" @}
- BEGIN @{ die () @}'}
+ BEGIN @{ die () @}'}
gawk: cmd. line:2: BEGIN @{ die () @}
gawk: cmd. line:2: ^ parse error
$ @kbd{gawk 'function die () @{ print "Aaaaarg!" @}
- BEGIN @{ die() @}'}
+ BEGIN @{ die() @}'}
Aaaaarg!
@end example
BAR = two
test:
- : FOO is "$(FOO)"
- : BAR is "$(BAR)"
+ : FOO is "$(FOO)"
+ : BAR is "$(BAR)"
@end example
@noindent
baz
all:
- @@echo ok
+ @@echo ok
% @kbd{make} # GNU make
ok
@end example
% @kbd{cat Makefile}
foo = foo
one:
- @@echo $(foo)
- $(MAKE) two
+ @@echo $(foo)
+ $(MAKE) two
two:
- @@echo $(foo)
+ @@echo $(foo)
% @kbd{make foo=bar} # GNU make 3.79.1
bar
make two
@example
foo = foo
one:
- @@echo $(foo)
- $(MAKE) foo=$(foo) two
+ @@echo $(foo)
+ $(MAKE) foo=$(foo) two
two:
- @@echo $(foo)
+ @@echo $(foo)
@end example
You need to foresee all macros that a user might want to override if
SHELL = /bin/sh
FOO = foo
all:
- @@echo $(SHELL)
- @@echo $(FOO)
+ @@echo $(SHELL)
+ @@echo $(FOO)
% @kbd{env SHELL=/bin/tcsh FOO=bar make -e} # OSF1 V4.0 Make
/bin/tcsh
bar
@example
all:
- # foo
+ # foo
@end example
@item The @file{obj/} subdirectory.
@example
% @kbd{cat Makefile}
all:
- echo Hello
+ echo Hello
% @kbd{cat obj/Makefile}
all:
- echo World
+ echo World
% @kbd{make} # GNU make
echo Hello
Hello
@example
% @kbd{cat Makefile}
all:
- false
+ false
% @kbd{make -k; echo exit status: $?} # GNU make
false
make: *** [all] Error 1
@example
VPATH = ../src
foo.o: foo.c
- cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o
+ cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o
@end example
@item Automatic rule rewriting
@example
VPATH = ../src
foo.o: foo.c
- cc -c foo.c -o foo.o
+ cc -c foo.c -o foo.o
@end example
@noindent
@example
VPATH = ../src
foo.o: foo.c
- cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o
+ cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o
@end example
@noindent
@example
VPATH = ../src
foo.o: foo.c
- cc -c `test -f ./foo.c || echo ../src/`foo.c -o foo.o
+ cc -c `test -f ./foo.c || echo ../src/`foo.c -o foo.o
foo2.o: foo2.c
- cc -c `test -f 'foo2.c' || echo ../src/`foo2.c -o foo2.o
+ cc -c `test -f 'foo2.c' || echo ../src/`foo2.c -o foo2.o
foo3.o: foo3.c
- cc -c `test -f "foo3.c" || echo ../src/`foo3.c -o foo3.o
+ cc -c `test -f "foo3.c" || echo ../src/`foo3.c -o foo3.o
@end example
Things get worse when your prerequisites are in a macro.
VPATH = ../src
HEADERS = foo.h foo2.h foo3.h
install-HEADERS: $(HEADERS)
- for i in $(HEADERS); do \
- $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
- $(DESTDIR)$(includedir)/$$i; \
- done
+ for i in $(HEADERS); do \
+ $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
+ $(DESTDIR)$(includedir)/$$i; \
+ done
@end example
The above @code{install-HEADERS} rule is not SunOS-proof because @code{for
@example
install-HEADERS: $(HEADERS)
- headers='$(HEADERS)'; for i in $$headers; do \
- $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
- $(DESTDIR)$(includedir)/$$i; \
- done
+ headers='$(HEADERS)'; for i in $$headers; do \
+ $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
+ $(DESTDIR)$(includedir)/$$i; \
+ done
@end example
Indeed, @code{headers='$(HEADERS)'} expands to @code{headers='foo.h
VPATH = ../src
HEADERS = foo.h foo2.h foo3.h
install-HEADERS: $(HEADERS)
- headers='$(HEADERS)'; for i in $$headers; do \
- i=`expr "$$i" : '../src/\(.*\)'`;
- $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
- $(DESTDIR)$(includedir)/$$i; \
- done
+ headers='$(HEADERS)'; for i in $$headers; do \
+ i=`expr "$$i" : '../src/\(.*\)'`;
+ $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
+ $(DESTDIR)$(includedir)/$$i; \
+ done
@end example
Automake does something similar.
@example
VPATH = ..
all : foo/bar
- command `test -d foo/bar || echo ../`foo/bar
+ command `test -d foo/bar || echo ../`foo/bar
@end example
The above @command{command} will be run on the empty @file{foo/bar}
VPATH = ..
all: foo.x bar.x
foo.x bar.x: newer.x
- @@echo Building $@@
+ @@echo Building $@@
% @kbd{touch ../bar.x}
% @kbd{touch ../newer.x}
% @kbd{make} # GNU make
VPATH = ..
all: bar.y
bar.x: newer.x
- @@echo Building $@@
+ @@echo Building $@@
.SUFFIXES: .x .y
.x.y:
- cp $< $@@
+ cp $< $@@
% @kbd{touch ../bar.x}
% @kbd{touch ../newer.x}
% @kbd{make} # GNU make
bar.x: newer.x
.SUFFIXES: .x .y
.x.y:
- cp $< $@@
+ cp $< $@@
% @kbd{touch ../bar.x}
% @kbd{touch ../newer.x}
% @kbd{make} # GNU make
.SUFFIXES: .in
foo: foo.in
.in:
- cp $< $@
+ cp $< $@
$ @kbd{touch foo.in}
$ @kbd{make}
$ @kbd{ls}
$ @kbd{cat Makefile}
.SUFFIXES: .in
.in:
- cp $< $@
+ cp $< $@
$ @kbd{make foo}
cp foo.in foo
@end example
foo.out: foo.in
.SUFFIXES: .in .out
.in.out:
- cp $< $@
+ cp $< $@
$ @kbd{make}
cp foo.in foo.out
@end example
@example
case $target in
i386-*-mach* | i386-*-gnu*)
- obj_format=aout emulation=mach bfd_gas=yes ;;
+ obj_format=aout emulation=mach bfd_gas=yes ;;
i960-*-bout) obj_format=bout ;;
esac
@end example
@example
AC_CONFIG_LINKS(host.h:config/$machine.h
- object.h:config/$obj_format.h)
+ object.h:config/$obj_format.h)
@end example
Note that the above example uses @code{$target} because it's taken from
@example
AC_DEFUN([TEST_MACRO],
[AC_ARG_WITH([foo],
- AC_HELP_STRING([--with-foo],
- [use foo (default is NO)]),
- [ac_cv_use_foo=$withval], [ac_cv_use_foo=no])
+ AC_HELP_STRING([--with-foo],
+ [use foo (default is NO)]),
+ [ac_cv_use_foo=$withval], [ac_cv_use_foo=no])
AC_CACHE_CHECK([whether to use foo],
- [ac_cv_use_foo], [ac_cv_use_foo=no])])
+ [ac_cv_use_foo], [ac_cv_use_foo=no])])
@end example
Please note that the call to @code{AC_HELP_STRING} is @strong{unquoted}.
@example
AC_DEFUN(MY_ARG_WITH,
[AC_ARG_WITH([$1],
- AC_HELP_STRING([--with-$1], [use $1 (default is $2)]),
- ac_cv_use_$1=$withval, ac_cv_use_$1=no),
+ AC_HELP_STRING([--with-$1], [use $1 (default is $2)]),
+ ac_cv_use_$1=$withval, ac_cv_use_$1=no),
AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)])
@end example
@end defmac
PROGRAMS = cp ls rm
transform = @@program_transform_name@@
install:
- for p in $(PROGRAMS); do \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | \
- sed '$(transform)'`; \
- done
+ for p in $(PROGRAMS); do \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | \
+ sed '$(transform)'`; \
+ done
uninstall:
- for p in $(PROGRAMS); do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; \
- done
+ for p in $(PROGRAMS); do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; \
+ done
@end example
It is guaranteed that @code{program_transform_name} is never empty, and
@group
config.h: stamp-h
stamp-h: config.h.in config.status
- ./config.status config.h
- echo > stamp-h
+ ./config.status config.h
+ echo > stamp-h
Makefile: Makefile.in config.status
- ./config.status Makefile
+ ./config.status Makefile
@end group
@end example
@group
config.h: stamp-h
stamp-h: config.h.in config.status
- CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_FILES= \
- CONFIG_HEADERS=config.h ./config.status
- echo > stamp-h
+ CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_FILES= \
+ CONFIG_HEADERS=config.h ./config.status
+ echo > stamp-h
Makefile: Makefile.in config.status
- CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_HEADERS= \
- CONFIG_FILES=Makefile ./config.status
+ CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_HEADERS= \
+ CONFIG_FILES=Makefile ./config.status
@end group
@end example
@example
@group
configure.ac --. .------> autoconf* -----> configure
- +---+
+ +---+
[aclocal.m4] --+ `---.
[acsite.m4] ---' |
- +--> [autoheader*] -> [config.h.in]
+ +--> [autoheader*] -> [config.h.in]
[acconfig.h] ----. |
- +-----'
+ +-----'
[config.h.top] --+
[config.h.bot] --'
@end group
@example
AC_CHECK_TYPE([@var{type}],,
- [AC_DEFINE_UNQUOTED([@var{type}], [@var{default}],
- [Define to `@var{default}' if
- <sys/types.h> does not define.])])
+ [AC_DEFINE_UNQUOTED([@var{type}], [@var{default}],
+ [Define to `@var{default}' if
+ <sys/types.h> does not define.])])
@end example
In order to keep backward compatibility, the two versions of
AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
case $host_os in
*cygwin* ) CYGWIN=yes;;
- * ) CYGWIN=no;;
+ * ) CYGWIN=no;;
esac
@end example
@example
AC_LINK_FILES(config/$machine.h config/$obj_format.h,
- host.h object.h)
+ host.h object.h)
@end example
@noindent
@example
AC_CONFIG_LINKS(host.h:config/$machine.h
- object.h:config/$obj_format.h)
+ object.h:config/$obj_format.h)
@end example
@end defmac
@group
AC_CONFIG_FILES(@var{file}@dots{})
AC_CONFIG_COMMANDS([default],
- @var{extra-cmds}, @var{init-cmds})
+ @var{extra-cmds}, @var{init-cmds})
AC_OUTPUT
@end group
@end example
@example
fubar=27
AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.],
- [fubar=$fubar])
+ [fubar=$fubar])
AC_OUTPUT_COMMANDS([echo this is another, extra, bit],
- [echo init bit])
+ [echo init bit])
@end example
Aside from the fact that @code{AC_CONFIG_COMMANDS} requires an
@defmac AC_TEST_CPP
@acindex{TEST_CPP}
-@code{AC_TRY_CPP}, replaced with @code{AC_PREPROC_IFELSE}.
+@code{AC_TRY_CPP}, replaced by @code{AC_PREPROC_IFELSE}.
@end defmac
@defmac AC_TEST_PROGRAM
@acindex{TEST_PROGRAM}
-@code{AC_TRY_RUN}, replaced with @code{AC_RUN_IFELSE}.
+@code{AC_TRY_RUN}, replaced by @code{AC_RUN_IFELSE}.
@end defmac
@defmac AC_TIMEZONE
[#if defined M_XENIX && !defined M_UNIX
yes
#endif],
- [AC_MSG_RESULT([yes]); XENIX=yes],
- [AC_MSG_RESULT([no]); XENIX=])
+ [AC_MSG_RESULT([yes]); XENIX=yes],
+ [AC_MSG_RESULT([no]); XENIX=])
@end example
@end defmac
@example
AC_INIT
AC_CHECK_HEADERS(foo.h,,
- [AC_MSG_ERROR([cannot find foo.h, bailing out])])
+ [AC_MSG_ERROR([cannot find foo.h, bailing out])])
AC_OUTPUT
@end example
# This is necessary so that .o files in LIBOBJS are also built via
# the ANSI2KNR-filtering rules.
LIB@@&t@@OBJS=`echo "$LIB@@&t@@OBJS" |
- sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
+ sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
LTLIBOBJS=`echo "$LIB@@&t@@OBJS" |
- sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
+ sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)
@end example
# error _AIX not defined
#endif
]])],
- [is_aix=yes],
- [is_aix=no])
+ [is_aix=yes],
+ [is_aix=no])
@end group
@end example
subfile-i.at ---->-- testsuite.at -->.
... / \
subfile-n.at ->' >-- autom4te* -->testsuite
- /
- [package.m4] ->'
+ /
+ [package.m4] ->'
@end example
@noindent
Files used in configuring a software package:
@example
- .--> atconfig
- /
+ .--> atconfig
+ /
[atlocal.in] --> config.status* --<
- \
- `--> [atlocal]
+ \
+ `--> [atlocal]
@end example
@noindent
@example
atconfig -->. .--> testsuite.log
- \ /
- >-- testsuite* --<
- / \
+ \ /
+ >-- testsuite* --<
+ / \
[atlocal] ->' `--> [testsuite.@var{nn}*]
@end example
@smallexample
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
- @{ \
- echo '# Signature of the current package.'; \
- echo 'm4_define([AT_PACKAGE_NAME], [@@PACKAGE_NAME@@])'; \
- echo 'm4_define([AT_PACKAGE_TARNAME], [@@PACKAGE_TARNAME@@])'; \
- echo 'm4_define([AT_PACKAGE_VERSION], [@@PACKAGE_VERSION@@])'; \
- echo 'm4_define([AT_PACKAGE_STRING], [@@PACKAGE_STRING@@])'; \
- echo 'm4_define([AT_PACKAGE_BUGREPORT], [@@PACKAGE_BUGREPORT@@])'; \
- @} >$(srcdir)/package.m4
+ @{ \
+ echo '# Signature of the current package.'; \
+ echo 'm4_define([AT_PACKAGE_NAME], [@@PACKAGE_NAME@@])'; \
+ echo 'm4_define([AT_PACKAGE_TARNAME], [@@PACKAGE_TARNAME@@])'; \
+ echo 'm4_define([AT_PACKAGE_VERSION], [@@PACKAGE_VERSION@@])'; \
+ echo 'm4_define([AT_PACKAGE_STRING], [@@PACKAGE_STRING@@])'; \
+ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@@PACKAGE_BUGREPORT@@])'; \
+ @} >$(srcdir)/package.m4
@end smallexample
@noindent
EXTRA_DIST = testsuite.at testsuite
TESTSUITE = $(srcdir)/testsuite
check-local: atconfig atlocal $(TESTSUITE)
- $(SHELL) $(TESTSUITE)
+ $(SHELL) $(TESTSUITE)
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): $(srcdir)/testsuite.at
- $(AUTOTEST) -I $(srcdir) $@@.at -o $@@.tmp
- mv $@@.tmp $@@
+ $(AUTOTEST) -I $(srcdir) $@@.at -o $@@.tmp
+ mv $@@.tmp $@@
@end example
You might want to list explicitly the dependencies, i.e., the list of
subdir = tests
atconfig: $(top_builddir)/config.status
- cd $(top_builddir) && \
- $(SHELL) ./config.status $(subdir)/$@@
+ cd $(top_builddir) && \
+ $(SHELL) ./config.status $(subdir)/$@@
atlocal: $(srcdir)/atlocal.in $(top_builddir)/config.status
- cd $(top_builddir) && \
- $(SHELL) ./config.status $(subdir)/$@@
+ cd $(top_builddir) && \
+ $(SHELL) ./config.status $(subdir)/$@@
@end example
@noindent
@example
AC_DEFINE_UNQUOTED([DATADIR], [$datadir],
- [Define to the read-only architecture-independent
- data directory.])
+ [Define to the read-only architecture-independent
+ data directory.])
@end example
@noindent
@example
DISTCLEANFILES = datadir.h
datadir.h: Makefile
- echo '#define DATADIR "$(datadir)"' >$@@
+ echo '#define DATADIR "$(datadir)"' >$@@
@end example
@item
# This file is part of Autoconf. -*- Autoconf -*-
# Checking for functions.
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
AC_CACHE_CHECK([for $1], ac_var,
[AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
- [AS_VAR_SET(ac_var, yes)],
- [AS_VAR_SET(ac_var, no)])])
+ [AS_VAR_SET(ac_var, yes)],
+ [AS_VAR_SET(ac_var, no)])])
AS_IF([test AS_VAR_GET(ac_var) = yes], [$2], [$3])dnl
AS_VAR_POPDEF([ac_var])dnl
])# AC_CHECK_FUNC
AC_DEFUN([AC_CHECK_FUNCS],
[AC_FOREACH([AC_Func], [$1],
[AH_TEMPLATE(AS_TR_CPP(HAVE_[]AC_Func),
- [Define to 1 if you have the `]AC_Func[' function.])])dnl
+ [Define to 1 if you have the `]AC_Func[' function.])])dnl
for ac_func in $1
do
AC_CHECK_FUNC($ac_func,
- [AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$ac_func])]) $2],
- [$3])dnl
+ [AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$ac_func])]) $2],
+ [$3])dnl
done
])
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
AC_CHECK_FUNC($ac_func,
- [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
- [Define to one of `_getb67', `GETB67',
- `getb67' for Cray-2 and Cray-YMP
- systems. This function is required for
- `alloca.c' support on those systems.])
+ [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+ [Define to one of `_getb67', `GETB67',
+ `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for
+ `alloca.c' support on those systems.])
break])
done
fi
AC_CACHE_CHECK([stack direction for C alloca],
- [ac_cv_c_stack_direction],
+ [ac_cv_c_stack_direction],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[int
find_stack_direction ()
{
exit (find_stack_direction () < 0);
}])],
- [ac_cv_c_stack_direction=1],
- [ac_cv_c_stack_direction=-1],
- [ac_cv_c_stack_direction=0])])
+ [ac_cv_c_stack_direction=1],
+ [ac_cv_c_stack_direction=-1],
+ [ac_cv_c_stack_direction=0])])
AH_VERBATIM([STACK_DIRECTION],
[/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
@%:@undef STACK_DIRECTION])dnl
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
])# _AC_LIBOBJ_ALLOCA
AC_CACHE_CHECK([for working alloca.h], ac_cv_working_alloca_h,
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[@%:@include <alloca.h>]],
- [[char *p = (char *) alloca (2 * sizeof (int));]])],
- [ac_cv_working_alloca_h=yes],
- [ac_cv_working_alloca_h=no])])
+ [[char *p = (char *) alloca (2 * sizeof (int));]])],
+ [ac_cv_working_alloca_h=yes],
+ [ac_cv_working_alloca_h=no])])
if test $ac_cv_working_alloca_h = yes; then
AC_DEFINE(HAVE_ALLOCA_H, 1,
- [Define to 1 if you have <alloca.h> and it should be used
- (not on Ultrix).])
+ [Define to 1 if you have <alloca.h> and it should be used
+ (not on Ultrix).])
fi
AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
# endif
#endif
]], [[char *p = (char *) alloca (1);]])],
- [ac_cv_func_alloca_works=yes],
- [ac_cv_func_alloca_works=no])])
+ [ac_cv_func_alloca_works=yes],
+ [ac_cv_func_alloca_works=no])])
if test $ac_cv_func_alloca_works = yes; then
AC_DEFINE(HAVE_ALLOCA, 1,
- [Define to 1 if you have `alloca', as a function or macro.])
+ [Define to 1 if you have `alloca', as a function or macro.])
else
_AC_LIBOBJ_ALLOCA
fi
if (stat (f, &after) < 0)
exit (1);
exit ((before.st_uid == after.st_uid
- && before.st_gid == after.st_gid) ? 0 : 1);
+ && before.st_gid == after.st_gid) ? 0 : 1);
]])],
- [ac_cv_func_chown_works=yes],
- [ac_cv_func_chown_works=no],
- [ac_cv_func_chown_works=no])
+ [ac_cv_func_chown_works=yes],
+ [ac_cv_func_chown_works=no],
+ [ac_cv_func_chown_works=no])
rm -f conftest.chown
])
if test $ac_cv_func_chown_works = yes; then
AC_DEFINE(HAVE_CHOWN, 1,
- [Define to 1 if your system has a working `chown' function.])
+ [Define to 1 if your system has a working `chown' function.])
fi
])# AC_FUNC_CHOWN
AC_DEFUN([AC_FUNC_CLOSEDIR_VOID],
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_CACHE_CHECK([whether closedir returns void],
- [ac_cv_func_closedir_void],
+ [ac_cv_func_closedir_void],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
#include <$ac_header_dirent>
#ifndef __cplusplus
int closedir ();
#endif
],
- [[exit (closedir (opendir (".")) != 0);]])],
- [ac_cv_func_closedir_void=no],
- [ac_cv_func_closedir_void=yes],
- [ac_cv_func_closedir_void=yes])])
+ [[exit (closedir (opendir (".")) != 0);]])],
+ [ac_cv_func_closedir_void=no],
+ [ac_cv_func_closedir_void=yes],
+ [ac_cv_func_closedir_void=yes])])
if test $ac_cv_func_closedir_void = yes; then
AC_DEFINE(CLOSEDIR_VOID, 1,
- [Define to 1 if the `closedir' function returns void instead
- of `int'.])
+ [Define to 1 if the `closedir' function returns void instead
+ of `int'.])
fi
])
AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
[AC_LIBSOURCES([error.h, error.c])dnl
AC_CACHE_CHECK([for error_at_line], ac_cv_lib_error_at_line,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([],[error_at_line (0, 0, "", 0, "");])],
- [ac_cv_lib_error_at_line=yes],
- [ac_cv_lib_error_at_line=no])])
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+ [error_at_line (0, 0, "", 0, "");])],
+ [ac_cv_lib_error_at_line=yes],
+ [ac_cv_lib_error_at_line=no])])
if test $ac_cv_lib_error_at_line = no; then
AC_LIBOBJ(error)
fi
[#include <fnmatch.h>
# define y(a, b, c) (fnmatch (a, b, c) == 0)
# define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
- ],
+ ],
[exit
(!(y ("a*", "abc", 0)
&& n ("d*/*1", "d/s/1", FNM_PATHNAME)
# ---------------
AC_DEFUN([AC_FUNC_FNMATCH],
[_AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_works],
- [AC_DEFINE([HAVE_FNMATCH], 1,
- [Define to 1 if your system has a working POSIX `fnmatch'
- function.])])
+ [AC_DEFINE([HAVE_FNMATCH], 1,
+ [Define to 1 if your system has a working POSIX `fnmatch'
+ function.])])
])# AC_FUNC_FNMATCH
AC_LIBOBJ([fnmatch])
AC_CONFIG_LINKS([$ac_config_libobj_dir/fnmatch.h:$ac_config_libobj_dir/fnmatch_.h])
AC_DEFINE(fnmatch, rpl_fnmatch,
- [Define to rpl_fnmatch if the replacement function should be used.])
+ [Define to rpl_fnmatch if the replacement function should be used.])
])# _AC_LIBOBJ_FNMATCH
AN_FUNCTION([fnmatch], [AC_REPLACE_FNMATCH])
AC_DEFUN([AC_REPLACE_FNMATCH],
[_AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_works],
- [rm -f $ac_config_libobj_dir/fnmatch.h],
- [_AC_LIBOBJ_FNMATCH])
+ [rm -f $ac_config_libobj_dir/fnmatch.h],
+ [_AC_LIBOBJ_FNMATCH])
])# AC_REPLACE_FNMATCH
AC_DEFUN([AC_FUNC_FNMATCH_GNU],
[AC_REQUIRE([AC_GNU_SOURCE])
_AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
- [rm -f $ac_config_libobj_dir/fnmatch.h],
- [_AC_LIBOBJ_FNMATCH])
+ [rm -f $ac_config_libobj_dir/fnmatch.h],
+ [_AC_LIBOBJ_FNMATCH])
])# AC_FUNC_FNMATCH_GNU
# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
AC_CACHE_CHECK([for fseeko], [ac_cv_func_fseeko],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <stdio.h>],
- [[return fseeko && fseeko (stdin, 0, 0);]])],
- [ac_cv_func_fseeko=yes],
- [ac_cv_func_fseeko=no])])
+ [[return fseeko && fseeko (stdin, 0, 0);]])],
+ [ac_cv_func_fseeko=yes],
+ [ac_cv_func_fseeko=no])])
if test $ac_cv_func_fseeko = yes; then
AC_DEFINE(HAVE_FSEEKO, 1,
[Define to 1 if fseeko (and presumably ftello) exists and is declared.])
# getgroups function only if there is such a function.
if test $ac_cv_func_getgroups = yes; then
AC_CACHE_CHECK([for working getgroups], ac_cv_func_getgroups_works,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[/* On Ultrix 4.3, getgroups (0, 0) always fails. */
exit (getgroups (0, 0) == -1 ? 1 : 0);]])],
- [ac_cv_func_getgroups_works=yes],
- [ac_cv_func_getgroups_works=no],
- [ac_cv_func_getgroups_works=no])
+ [ac_cv_func_getgroups_works=yes],
+ [ac_cv_func_getgroups_works=no],
+ [ac_cv_func_getgroups_works=no])
])
if test $ac_cv_func_getgroups_works = yes; then
AC_DEFINE(HAVE_GETGROUPS, 1,
- [Define to 1 if your system has a working `getgroups' function.])
+ [Define to 1 if your system has a working `getgroups' function.])
fi
fi
LIBS=$ac_save_LIBS
[ac_have_func=yes
AC_DEFINE(UMAX, 1, [Define to 1 for Encore UMAX.])
AC_DEFINE(UMAX4_3, 1,
- [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
- instead of <sys/cpustats.h>.])])
+ [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
+ instead of <sys/cpustats.h>.])])
fi
if test $ac_have_func = no; then
AC_CHECK_HEADERS(nlist.h,
[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
- [AC_DEFINE(NLIST_NAME_UNION, 1,
- [Define to 1 if your `struct nlist' has an
- `n_un' member. Obsolete, depend on
- `HAVE_STRUCT_NLIST_N_UN_N_NAME])], [],
- [@%:@include <nlist.h>])
+ [AC_DEFINE(NLIST_NAME_UNION, 1,
+ [Define to 1 if your `struct nlist' has an
+ `n_un' member. Obsolete, depend on
+ `HAVE_STRUCT_NLIST_N_UN_N_NAME])], [],
+ [@%:@include <nlist.h>])
])dnl
])# _AC_LIBOBJ_GETLOADAVG
ac_getloadavg_LIBS=$LIBS
LIBS="-L/usr/local/lib $LIBS"
AC_CHECK_LIB(getloadavg, getloadavg,
- [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS])
+ [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS])
fi
# Make sure it is really in the library, if we think we found it,
# otherwise set up the replacement function.
AC_CHECK_FUNCS(getloadavg, [],
- [_AC_LIBOBJ_GETLOADAVG])
+ [_AC_LIBOBJ_GETLOADAVG])
# Some definitions of getloadavg require that the program be installed setgid.
AC_CACHE_CHECK(whether getloadavg requires setgid,
- ac_cv_func_getloadavg_setgid,
+ ac_cv_func_getloadavg_setgid,
[AC_EGREP_CPP([Yowza Am I SETGID yet],
[#include "$srcdir/$ac_config_libobj_dir/getloadavg.c"
#ifdef LDAV_PRIVILEGED
Yowza Am I SETGID yet
@%:@endif],
- ac_cv_func_getloadavg_setgid=yes,
- ac_cv_func_getloadavg_setgid=no)])
+ ac_cv_func_getloadavg_setgid=yes,
+ ac_cv_func_getloadavg_setgid=no)])
if test $ac_cv_func_getloadavg_setgid = yes; then
NEED_SETGID=true
AC_DEFINE(GETLOADAVG_PRIVILEGED, 1,
- [Define to 1 if the `getloadavg' function needs to be run setuid
- or setgid.])
+ [Define to 1 if the `getloadavg' function needs to be run setuid
+ or setgid.])
else
NEED_SETGID=false
fi
# If we got an error (system does not support symlinks), try without -L.
test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
ac_cv_group_kmem=`echo $ac_ls_output \
- | sed -ne ['s/[ ][ ]*/ /g;
+ | sed -ne ['s/[ ][ ]*/ /g;
s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
/ /s/.* //;p;']`
])
ac_cv_func_getpgrp_void,
[# Use it with a single arg.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [getpgrp (0);])],
- [ac_cv_func_getpgrp_void=no],
- [ac_cv_func_getpgrp_void=yes])
+ [ac_cv_func_getpgrp_void=no],
+ [ac_cv_func_getpgrp_void=yes])
])
if test $ac_cv_func_getpgrp_void = yes; then
AC_DEFINE(GETPGRP_VOID, 1,
- [Define to 1 if the `getpgrp' function requires zero arguments.])
+ [Define to 1 if the `getpgrp' function requires zero arguments.])
fi
])# AC_FUNC_GETPGRP
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[struct stat sbuf;
/* Linux will dereference the symlink and fail.
- That is better in the sense that it means we will not
- have to compile and use the lstat wrapper. */
+ That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1);])],
- [ac_cv_func_lstat_dereferences_slashed_symlink=yes],
- [ac_cv_func_lstat_dereferences_slashed_symlink=no],
- [ac_cv_func_lstat_dereferences_slashed_symlink=no])
+ [ac_cv_func_lstat_dereferences_slashed_symlink=yes],
+ [ac_cv_func_lstat_dereferences_slashed_symlink=no],
+ [ac_cv_func_lstat_dereferences_slashed_symlink=no])
else
# If the `ln -s' command failed, then we probably don't even
# have an lstat function.
test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
AC_DEFINE_UNQUOTED(LSTAT_FOLLOWS_SLASHED_SYMLINK, 1,
- [Define to 1 if `lstat' dereferences a symlink specified
- with a trailing slash.])
+ [Define to 1 if `lstat' dereferences a symlink specified
+ with a trailing slash.])
if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
AC_LIBOBJ(lstat)
char *malloc ();
#endif
]],
- [exit (malloc (0) ? 0 : 1);])],
- [ac_cv_func_malloc_0_nonnull=yes],
- [ac_cv_func_malloc_0_nonnull=no],
- [ac_cv_func_malloc_0_nonnull=no])])
+ [exit (malloc (0) ? 0 : 1);])],
+ [ac_cv_func_malloc_0_nonnull=yes],
+ [ac_cv_func_malloc_0_nonnull=no],
+ [ac_cv_func_malloc_0_nonnull=no])])
AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
])# AC_FUNC_MALLOC
AC_DEFUN([AC_FUNC_MALLOC],
[_AC_FUNC_MALLOC_IF(
[AC_DEFINE([HAVE_MALLOC], 1,
- [Define to 1 if your system has a GNU libc compatible `malloc'
- function, and to 0 otherwise.])],
+ [Define to 1 if your system has a GNU libc compatible `malloc'
+ function, and to 0 otherwise.])],
[AC_DEFINE([HAVE_MALLOC], 0)
AC_LIBOBJ(malloc)
AC_DEFINE([malloc], [rpl_malloc],
ac_cv_func_mbrtowc,
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
- [[@%:@include <wchar.h>]],
- [[mbstate_t state; return ! (sizeof state && mbrtowc);]])],
+ [[@%:@include <wchar.h>]],
+ [[mbstate_t state; return ! (sizeof state && mbrtowc);]])],
ac_cv_func_mbrtowc=yes,
ac_cv_func_mbrtowc=no)])
if test $ac_cv_func_mbrtowc = yes; then
AN_FUNCTION([memcmp], [AC_FUNC_MEMCMP])
AC_DEFUN([AC_FUNC_MEMCMP],
[AC_CACHE_CHECK([for working memcmp], ac_cv_func_memcmp_working,
-[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
+[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[
/* Some versions of memcmp are not 8-bit clean. */
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
int i;
for (i = 0; i < 4; i++)
{
- char *a = foo + i;
- char *b = bar + i;
- strcpy (a, "--------01111111");
- strcpy (b, "--------10000000");
- if (memcmp (a, b, 16) >= 0)
- exit (1);
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ exit (1);
}
exit (0);
}
]])],
- [ac_cv_func_memcmp_working=yes],
- [ac_cv_func_memcmp_working=no],
- [ac_cv_func_memcmp_working=no])])
+ [ac_cv_func_memcmp_working=yes],
+ [ac_cv_func_memcmp_working=no],
+ [ac_cv_func_memcmp_working=no])])
test $ac_cv_func_memcmp_working = no && AC_LIBOBJ([memcmp])
])# AC_FUNC_MEMCMP
mktime_test ((time_t) 60 * 60 * 24);
for (j = 1; 0 < j; j *= 2)
- bigtime_test (j);
+ bigtime_test (j);
bigtime_test (j - 1);
}
irix_6_4_bug ();
spring_forward_gap ();
exit (0);
}]])],
- [ac_cv_func_working_mktime=yes],
- [ac_cv_func_working_mktime=no],
- [ac_cv_func_working_mktime=no])])
+ [ac_cv_func_working_mktime=yes],
+ [ac_cv_func_working_mktime=no],
+ [ac_cv_func_working_mktime=no])])
if test $ac_cv_func_working_mktime = no; then
AC_LIBOBJ([mktime])
fi
exit (1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
exit (1);
for (i = 0; i < pagesize; ++i)
if (*(data + i) != *(data2 + i))
close (fd);
exit (0);
}]])],
- [ac_cv_func_mmap_fixed_mapped=yes],
- [ac_cv_func_mmap_fixed_mapped=no],
- [ac_cv_func_mmap_fixed_mapped=no])])
+ [ac_cv_func_mmap_fixed_mapped=yes],
+ [ac_cv_func_mmap_fixed_mapped=no],
+ [ac_cv_func_mmap_fixed_mapped=no])])
if test $ac_cv_func_mmap_fixed_mapped = yes; then
AC_DEFINE(HAVE_MMAP, 1,
- [Define to 1 if you have a working `mmap' system call.])
+ [Define to 1 if you have a working `mmap' system call.])
fi
rm -f conftest.mmap
])# AC_FUNC_MMAP
AC_CACHE_CHECK([for obstacks], ac_cv_func_obstack,
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[@%:@include "obstack.h"]],
- [[struct obstack *mem; obstack_free(mem,(char *) 0)]])],
- [ac_cv_func_obstack=yes],
- [ac_cv_func_obstack=no])])
+ [[struct obstack *mem; obstack_free(mem,(char *) 0)]])],
+ [ac_cv_func_obstack=yes],
+ [ac_cv_func_obstack=no])])
if test $ac_cv_func_obstack = yes; then
AC_DEFINE(HAVE_OBSTACK, 1, [Define to 1 if libc includes obstacks.])
else
char *realloc ();
#endif
]],
- [exit (realloc (0, 0) ? 0 : 1);])],
- [ac_cv_func_realloc_0_nonnull=yes],
- [ac_cv_func_realloc_0_nonnull=no],
- [ac_cv_func_realloc_0_nonnull=no])])
+ [exit (realloc (0, 0) ? 0 : 1);])],
+ [ac_cv_func_realloc_0_nonnull=yes],
+ [ac_cv_func_realloc_0_nonnull=no],
+ [ac_cv_func_realloc_0_nonnull=no])])
AS_IF([test $ac_cv_func_realloc_0_nonnull = yes], [$1], [$2])
])# AC_FUNC_REALLOC
AC_DEFUN([AC_FUNC_REALLOC],
[_AC_FUNC_REALLOC_IF(
[AC_DEFINE([HAVE_REALLOC], 1,
- [Define to 1 if your system has a GNU libc compatible `realloc'
- function, and to 0 otherwise.])],
+ [Define to 1 if your system has a GNU libc compatible `realloc'
+ function, and to 0 otherwise.])],
[AC_DEFINE([HAVE_REALLOC], 0)
AC_LIBOBJ([realloc])
AC_DEFINE([realloc], [rpl_realloc],
# include <sys/socket.h>
#endif
],
- [extern int select ($ac_arg1,
- $ac_arg234, $ac_arg234, $ac_arg234,
- $ac_arg5);])],
- [ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3])
+ [extern int select ($ac_arg1,
+ $ac_arg234, $ac_arg234, $ac_arg234,
+ $ac_arg5);])],
+ [ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3])
done
done
done
IFS=$ac_save_IFS
shift
AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $[1],
- [Define to the type of arg 1 for `select'.])
+ [Define to the type of arg 1 for `select'.])
AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, ($[2]),
- [Define to the type of args 2, 3 and 4 for `select'.])
+ [Define to the type of args 2, 3 and 4 for `select'.])
AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, ($[3]),
- [Define to the type of arg 5 for `select'.])
+ [Define to the type of arg 5 for `select'.])
rm -f conftest*
])# AC_FUNC_SELECT_ARGTYPES
setpgrp(1, 1) will fail with ESRCH and return -1, in that case
exit successfully. */
exit (setpgrp (1,1) == -1 ? 0 : 1);])],
- [ac_cv_func_setpgrp_void=no],
- [ac_cv_func_setpgrp_void=yes],
- [AC_MSG_ERROR([cannot check setpgrp when cross compiling])])])
+ [ac_cv_func_setpgrp_void=no],
+ [ac_cv_func_setpgrp_void=yes],
+ [AC_MSG_ERROR([cannot check setpgrp when cross compiling])])])
if test $ac_cv_func_setpgrp_void = yes; then
AC_DEFINE(SETPGRP_VOID, 1,
- [Define to 1 if the `setpgrp' function takes no argument.])
+ [Define to 1 if the `setpgrp' function takes no argument.])
fi
])# AC_FUNC_SETPGRP
m4_define([_AC_FUNC_STAT],
[AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])dnl
AC_CACHE_CHECK([whether $1 accepts an empty string],
- [ac_cv_func_$1_empty_string_bug],
+ [ac_cv_func_$1_empty_string_bug],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[struct stat sbuf;
exit ($1 ("", &sbuf) ? 1 : 0);]])],
- [ac_cv_func_$1_empty_string_bug=yes],
- [ac_cv_func_$1_empty_string_bug=no],
- [ac_cv_func_$1_empty_string_bug=yes])])
+ [ac_cv_func_$1_empty_string_bug=yes],
+ [ac_cv_func_$1_empty_string_bug=no],
+ [ac_cv_func_$1_empty_string_bug=yes])])
if test $ac_cv_func_$1_empty_string_bug = yes; then
AC_LIBOBJ([$1])
AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1_EMPTY_STRING_BUG]), 1,
- [Define to 1 if `$1' has the bug that it succeeds when
- given the zero-length file name argument.])
+ [Define to 1 if `$1' has the bug that it succeeds when
+ given the zero-length file name argument.])
fi
])# _AC_FUNC_STAT
AC_CHECK_FUNC(pow)
if test $ac_cv_func_pow = no; then
AC_CHECK_LIB(m, pow,
- [POW_LIB=-lm],
- [AC_MSG_WARN([cannot find library containing definition of pow])])
+ [POW_LIB=-lm],
+ [AC_MSG_WARN([cannot find library containing definition of pow])])
fi
])# _AC_LIBOBJ_STRTOD
exit (0);
}
]])],
- ac_cv_func_strtod=yes,
- ac_cv_func_strtod=no,
- ac_cv_func_strtod=no)])
+ ac_cv_func_strtod=yes,
+ ac_cv_func_strtod=no,
+ ac_cv_func_strtod=no)])
if test $ac_cv_func_strtod = no; then
_AC_LIBOBJ_STRTOD
fi
[AC_CHECK_DECLS([strerror_r])
AC_CHECK_FUNCS([strerror_r])
AC_CACHE_CHECK([whether strerror_r returns char *],
- ac_cv_func_strerror_r_char_p,
+ ac_cv_func_strerror_r_char_p,
[
ac_cv_func_strerror_r_char_p=no
if test $ac_cv_have_decl_strerror_r = yes; then
[[char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
exit (!isalpha (x));]])],
- ac_cv_func_strerror_r_char_p=yes, , :)
+ ac_cv_func_strerror_r_char_p=yes, , :)
fi
])
if test $ac_cv_func_strerror_r_char_p = yes; then
[AC_CHECK_FUNCS(strftime, [],
[# strftime is in -lintl on SCO UNIX.
AC_CHECK_LIB(intl, strftime,
- [AC_DEFINE(HAVE_STRFTIME)
+ [AC_DEFINE(HAVE_STRFTIME)
LIBS="-lintl $LIBS"])])dnl
])# AC_FUNC_STRFTIME
AN_FUNCTION([strnlen], [AC_FUNC_STRNLEN])
AC_DEFUN([AC_FUNC_STRNLEN],
[AC_CACHE_CHECK([for working strnlen], ac_cv_func_strnlen_working,
-[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
+[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[
#define S "foobar"
#define S_LEN (sizeof S - 1)
}
exit (0);
]])],
- [ac_cv_func_strnlen_working=yes],
- [ac_cv_func_strnlen_working=no],
- [ac_cv_func_strnlen_working=no])])
+ [ac_cv_func_strnlen_working=yes],
+ [ac_cv_func_strnlen_working=no],
+ [ac_cv_func_strnlen_working=no])])
test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen])
])# AC_FUNC_STRNLEN
ac_cv_func_setvbuf_reversed=yes)])])
if test $ac_cv_func_setvbuf_reversed = yes; then
AC_DEFINE(SETVBUF_REVERSED, 1,
- [Define to 1 if the `setvbuf' function takes the buffering type as
- its second argument and the buffer pointer as the third, as on
- System V before release 3.])
+ [Define to 1 if the `setvbuf' function takes the buffering type as
+ its second argument and the buffer pointer as the third, as on
+ System V before release 3.])
fi
])# AC_FUNC_SETVBUF_REVERSED
[[exit (strcoll ("abc", "def") >= 0 ||
strcoll ("ABC", "DEF") >= 0 ||
strcoll ("123", "456") >= 0)]])],
- ac_cv_func_strcoll_works=yes,
- ac_cv_func_strcoll_works=no,
- ac_cv_func_strcoll_works=no)])
+ ac_cv_func_strcoll_works=yes,
+ ac_cv_func_strcoll_works=no,
+ ac_cv_func_strcoll_works=no)])
if test $ac_cv_func_strcoll_works = yes; then
AC_DEFINE(HAVE_STRCOLL, 1,
- [Define to 1 if you have the `strcoll' function and it is properly
- defined.])
+ [Define to 1 if you have the `strcoll' function and it is properly
+ defined.])
fi
])# AC_FUNC_STRCOLL
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[struct stat s, t;
exit (!(stat ("conftest.data", &s) == 0
- && utime ("conftest.data", (long *)0) == 0
- && stat ("conftest.data", &t) == 0
- && t.st_mtime >= s.st_mtime
- && t.st_mtime - s.st_mtime < 120));]])],
- ac_cv_func_utime_null=yes,
- ac_cv_func_utime_null=no,
- ac_cv_func_utime_null=no)
+ && utime ("conftest.data", (long *)0) == 0
+ && stat ("conftest.data", &t) == 0
+ && t.st_mtime >= s.st_mtime
+ && t.st_mtime - s.st_mtime < 120));]])],
+ ac_cv_func_utime_null=yes,
+ ac_cv_func_utime_null=no,
+ ac_cv_func_utime_null=no)
rm -f core core.* *.core])
if test $ac_cv_func_utime_null = yes; then
AC_DEFINE(HAVE_UTIME_NULL, 1,
- [Define to 1 if `utime(file, NULL)' sets file's timestamp to the
- present.])
+ [Define to 1 if `utime(file, NULL)' sets file's timestamp to the
+ present.])
fi
rm -f conftest.data
])# AC_FUNC_UTIME_NULL
/* Some systems only have a dummy stub for fork() */
int main ()
{
- if (fork() < 0)
- exit (1);
- exit (0);
+ if (fork() < 0)
+ exit (1);
+ exit (0);
}],
[ac_cv_func_fork_works=yes],
[ac_cv_func_fork_works=no],
);
}
}]])],
- [ac_cv_func_vfork_works=yes],
- [ac_cv_func_vfork_works=no],
- [ac_cv_func_vfork_works=cross])])
+ [ac_cv_func_vfork_works=yes],
+ [ac_cv_func_vfork_works=no],
+ [ac_cv_func_vfork_works=cross])])
])# _AC_FUNC_VFORK
AC_DEFUN([AC_FUNC_VPRINTF],
[AC_CHECK_FUNCS(vprintf, []
[AC_CHECK_FUNC(_doprnt,
- [AC_DEFINE(HAVE_DOPRNT, 1,
- [Define to 1 if you don't have `vprintf' but do have
- `_doprnt.'])])])
+ [AC_DEFINE(HAVE_DOPRNT, 1,
+ [Define to 1 if you don't have `vprintf' but do have
+ `_doprnt.'])])])
])
[$0: `wait3' is being removed from the Open Group standards.
Remove this `AC_FUNC_WAIT3' and adjust your code to use `waitpid' instead.])dnl
AC_CACHE_CHECK([for wait3 that fills in rusage],
- [ac_cv_func_wait3_rusage],
+ [ac_cv_func_wait3_rusage],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[#include <sys/types.h>
#include <sys/time.h>
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}]])],
- [ac_cv_func_wait3_rusage=yes],
- [ac_cv_func_wait3_rusage=no],
- [ac_cv_func_wait3_rusage=no])])
+ [ac_cv_func_wait3_rusage=yes],
+ [ac_cv_func_wait3_rusage=no],
+ [ac_cv_func_wait3_rusage=no])])
if test $ac_cv_func_wait3_rusage = yes; then
AC_DEFINE(HAVE_WAIT3, 1,
- [Define to 1 if you have the `wait3' system call.
- Deprecated, you should no longer depend upon `wait3'.])
+ [Define to 1 if you have the `wait3' system call.
+ Deprecated, you should no longer depend upon `wait3'.])
fi
])# AC_FUNC_WAIT3