diff --git a/NEWS b/NEWS index 2eec4333..6166bd64 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Major changes in release 2.0: * AC_CHECK_TYPE, which checks whether sys/types.h defines a given type. * AC_TRY_LINK, which obsoletes AC_COMPILE_CHECK. * AC_PREFIX_PROGRAM, which obsoletes AC_PREFIX. +* AC_HEADER_DIRENT, which obsoletes AC_DIR_HEADER. * AC_ARG_ENABLE and AC_ARG_WITH, which obsolete AC_ENABLE and AC_WITH. * AC_SUBST_FILE, to insert one file into another. @@ -30,8 +31,6 @@ Major changes in release 2.0: override the file name "config.status". * AC_PROG_INSTALL looks for install.sh in the directory specified by AC_CONFIG_AUXDIR, or srcdir or srcdir/.. or srcdir/../.. by default. -* AC_HEADER_DIRENT (formerly AC_DIR_HEADER) defines standard macro - names as well as the old ones, e.g. HAVE_DIRENT_H as well as DIRENT. ** New utilities: * autoscan to generate a preliminary configure.in for a package by diff --git a/acgeneral.m4 b/acgeneral.m4 index 466abb60..a4ca79f2 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -807,7 +807,8 @@ dnl shell variable, so we need the eval. dnl if test "${$1+set}" = set; then if eval "test \"`echo '${'$1'+set}'`\" = set"; then dnl This verbose message is just for testing the caching code. - AC_MSG_RESULT(using cached value for $1) +dnl AC_MSG_RESULT(using cached value for $1) + AC_MSG_RESULT(using cached value) else $2 fi diff --git a/acspecific.m4 b/acspecific.m4 index 4b2aa0e3..41ce7008 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -432,6 +432,7 @@ dnl define(AC_HEADER_DIRENT, [AC_PROVIDE([$0])dnl AC_MSG_CHECKING(for directory library header) +dnl We don't use AC_CHECK_HEADERS so we can stop when we get a match. AC_CACHE_VAL(ac_cv_header_dir, [ac_cv_header_dir=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do @@ -1696,7 +1697,7 @@ fi ])dnl dnl define(AC_OS_XENIX, -[AC_REQUIRE([AC_HEADER_DIRENT])dnl +[AC_REQUIRE([AC_DIR_HEADER])dnl AC_MSG_CHECKING(for Xenix) AC_EGREP_CPP(yes, [#if defined(M_XENIX) && !defined(M_UNIX) diff --git a/autoconf.texi b/autoconf.texi index b8f60f85..ea6456ea 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -1608,8 +1608,8 @@ by a signal, define @code{HAVE_RESTARTABLE_SYSCALLS}. The following macros check for certain operating systems that need special treatment for some programs, due to exceptional oddities in -their header files or libraries. These macros are kludges; they should -be replaced someday with a more systematic approach, based either on the +their header files or libraries. These macros are warts; they should +be replaced by a more systematic approach, based either on the functions they make available or the environments they provide. @defmac AC_OS_AIX @@ -1667,8 +1667,8 @@ Used to get @code{strftime}. It must be called before checking for @maindex OS_XENIX If on Xenix, add @samp{-lx} to @code{make} variable @code{LIBS}. Also, if @file{sys/ndir.h} is not being used, add @samp{-ldir} to @code{LIBS}. -Needed when using the directory reading functions. This macro must be -called after @code{AC_HEADER_DIRENT}. +Needed when using the directory reading functions. This macro calls +@code{AC_DIR_HEADER} if it has not been called already. @end defmac @node General Purpose Macros, Manual Configuration, Specific Tests, Top diff --git a/autoheader.in b/autoheader.in index 3c8f3955..9a3c6d8d 100644 --- a/autoheader.in +++ b/autoheader.in @@ -147,7 +147,10 @@ eval "`echo \"$frob\" \ test -n "$print_version" && exit 0 # Make SYMS newline-separated rather than blank-separated, and remove dups. -syms="`for sym in $syms; do echo $sym; done | sort | uniq`" +# Start each symbol with a blank (to match the blank after "#undef") +# to reduce the possibility of mistakenly matching another symbol that +# is a substring of it. +syms="`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`" if test $# -eq 0; then tmpout=autoh$$ @@ -161,7 +164,7 @@ echo "/* ${config_h}.in. Generated automatically from $infile by autoheader. * test -f ${config_h}.top && cat ${config_h}.top -# This puts each paragraph on its own line, separated by @s. +# This puts each template paragraph on its own line, separated by @s. if test -n "$syms"; then # Make sure the boundary of template files is also the boundary # of the paragraph. Extra newlines don't hurt since they will diff --git a/autoheader.sh b/autoheader.sh index 3c8f3955..9a3c6d8d 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -147,7 +147,10 @@ eval "`echo \"$frob\" \ test -n "$print_version" && exit 0 # Make SYMS newline-separated rather than blank-separated, and remove dups. -syms="`for sym in $syms; do echo $sym; done | sort | uniq`" +# Start each symbol with a blank (to match the blank after "#undef") +# to reduce the possibility of mistakenly matching another symbol that +# is a substring of it. +syms="`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`" if test $# -eq 0; then tmpout=autoh$$ @@ -161,7 +164,7 @@ echo "/* ${config_h}.in. Generated automatically from $infile by autoheader. * test -f ${config_h}.top && cat ${config_h}.top -# This puts each paragraph on its own line, separated by @s. +# This puts each template paragraph on its own line, separated by @s. if test -n "$syms"; then # Make sure the boundary of template files is also the boundary # of the paragraph. Extra newlines don't hurt since they will diff --git a/bin/autoheader.in b/bin/autoheader.in index 3c8f3955..9a3c6d8d 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -147,7 +147,10 @@ eval "`echo \"$frob\" \ test -n "$print_version" && exit 0 # Make SYMS newline-separated rather than blank-separated, and remove dups. -syms="`for sym in $syms; do echo $sym; done | sort | uniq`" +# Start each symbol with a blank (to match the blank after "#undef") +# to reduce the possibility of mistakenly matching another symbol that +# is a substring of it. +syms="`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`" if test $# -eq 0; then tmpout=autoh$$ @@ -161,7 +164,7 @@ echo "/* ${config_h}.in. Generated automatically from $infile by autoheader. * test -f ${config_h}.top && cat ${config_h}.top -# This puts each paragraph on its own line, separated by @s. +# This puts each template paragraph on its own line, separated by @s. if test -n "$syms"; then # Make sure the boundary of template files is also the boundary # of the paragraph. Extra newlines don't hurt since they will diff --git a/doc/autoconf.texi b/doc/autoconf.texi index b8f60f85..ea6456ea 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -1608,8 +1608,8 @@ by a signal, define @code{HAVE_RESTARTABLE_SYSCALLS}. The following macros check for certain operating systems that need special treatment for some programs, due to exceptional oddities in -their header files or libraries. These macros are kludges; they should -be replaced someday with a more systematic approach, based either on the +their header files or libraries. These macros are warts; they should +be replaced by a more systematic approach, based either on the functions they make available or the environments they provide. @defmac AC_OS_AIX @@ -1667,8 +1667,8 @@ Used to get @code{strftime}. It must be called before checking for @maindex OS_XENIX If on Xenix, add @samp{-lx} to @code{make} variable @code{LIBS}. Also, if @file{sys/ndir.h} is not being used, add @samp{-ldir} to @code{LIBS}. -Needed when using the directory reading functions. This macro must be -called after @code{AC_HEADER_DIRENT}. +Needed when using the directory reading functions. This macro calls +@code{AC_DIR_HEADER} if it has not been called already. @end defmac @node General Purpose Macros, Manual Configuration, Specific Tests, Top diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 466abb60..a4ca79f2 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -807,7 +807,8 @@ dnl shell variable, so we need the eval. dnl if test "${$1+set}" = set; then if eval "test \"`echo '${'$1'+set}'`\" = set"; then dnl This verbose message is just for testing the caching code. - AC_MSG_RESULT(using cached value for $1) +dnl AC_MSG_RESULT(using cached value for $1) + AC_MSG_RESULT(using cached value) else $2 fi diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 4b2aa0e3..41ce7008 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -432,6 +432,7 @@ dnl define(AC_HEADER_DIRENT, [AC_PROVIDE([$0])dnl AC_MSG_CHECKING(for directory library header) +dnl We don't use AC_CHECK_HEADERS so we can stop when we get a match. AC_CACHE_VAL(ac_cv_header_dir, [ac_cv_header_dir=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do @@ -1696,7 +1697,7 @@ fi ])dnl dnl define(AC_OS_XENIX, -[AC_REQUIRE([AC_HEADER_DIRENT])dnl +[AC_REQUIRE([AC_DIR_HEADER])dnl AC_MSG_CHECKING(for Xenix) AC_EGREP_CPP(yes, [#if defined(M_XENIX) && !defined(M_UNIX)