]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Check that the AC_DEFINEs from acspecific.m4 do have a template.
authorAkim Demaille <akim@epita.fr>
Fri, 4 Feb 2000 10:23:15 +0000 (10:23 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 4 Feb 2000 10:23:15 +0000 (10:23 +0000)
Fix the discovered bugs.

* tests/atgeneral.m4 (AT_CHECK): Don't just exit 1 when you want
to propagate the failure of a test: exit with the same exit
status, at least to preserve 77 (=ignore).
* tests/syntax.m4 (TEST_MACRO): Run also autoheader.  Don't run
this test on all the macros, some just cannot run without
arguments.
* acgeneral.m4 (AC_OUTPUT_CONFIG_STATUS): In the if egrep/fi for
#define templates, add a `:' to prevent syntax errors in
config.status when there are no AC_DEFINE performed.
* autoheader.m4 (AH_TEMPLATE): Don't use _AC_SH_QUOTE here, use it
in...
(AH_VERBATIM): here.  Now AH_C_UNSIGNED_CHAR is no longer failing
(formerly it would produce a non backslashed backquote, which
made sh choke).

ChangeLog
acgeneral.m4
autoheader.m4
lib/autoconf/general.m4
lib/autotest/general.m4
tests/atgeneral.m4
tests/syntax.m4

index 9aef37e22dbc6689c40e8f0c6a872bf6f2c93529..f668675c8c95585c2d2c5b25cadb2503ae72006e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+1999-11-13  Akim Demaille  <akim@epita.fr>
+
+       Check that the AC_DEFINEs from acspecific.m4 do have a template.
+       Fix the discovered bugs.
+
+       * tests/atgeneral.m4 (AT_CHECK): Don't just exit 1 when you want
+       to propagate the failure of a test: exit with the same exit
+       status, at least to preserve 77 (=ignore).
+       * tests/syntax.m4 (TEST_MACRO): Run also autoheader.  Don't run
+       this test on all the macros, some just cannot run without
+       arguments.
+       * acgeneral.m4 (AC_OUTPUT_CONFIG_STATUS): In the if egrep/fi for
+       #define templates, add a `:' to prevent syntax errors in
+       config.status when there are no AC_DEFINE performed.
+       * autoheader.m4 (AH_TEMPLATE): Don't use _AC_SH_QUOTE here, use it
+       in...
+       (AH_VERBATIM): here.  Now AH_C_UNSIGNED_CHAR is no longer failing
+       (formerly it would produce a non backslashed backquote, which
+       made sh choke).
+
 1999-11-13  Akim Demaille  <akim@epita.fr>
 
        Introduce a means to distinguish failures of `configure' due to
index 1e69b9429b8f0785647a3b0642cfacfeeb8ea0ba..75b05896ea4721ec749d61727d24a359d177c922 100644 (file)
@@ -3921,6 +3921,8 @@ EOF
 # of here documents, and old seds have small limits too (100 cmds).
 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
 echo '  if egrep "^@BKL@       @BKR@*#@BKL@    @BKR@*define" $ac_cs_root.in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
 rm -f conftest.tail
 while :
 do
index 0712045e14e7c5d7728f2dee7668a969d8b6035f..b607ec5b354831fd57118651030c0411adf4de0a 100644 (file)
@@ -53,7 +53,7 @@ dnl Issue an autoheader template for KEY, i.e., a comment composed
 dnl of DESCRIPTION (properly wrapped), and then #undef KEY.
 define([AH_TEMPLATE],
 [AH_VERBATIM([$1],
-             AC_WRAP(_AC_SH_QUOTE([$2 */]), [   ], [/* ])[
+             AC_WRAP([$2 */], [   ], [/* ])[
 #undef $1])])
 
 dnl AH_VERBATIM(KEY, TEMPLATE)
@@ -67,7 +67,7 @@ define([AH_VERBATIM],
 [#
 @@@
 ac_verbatim_$1="\
-[$2]"
+_AC_SH_QUOTE([$2])"
 @@@
 ])])
 
index 1e69b9429b8f0785647a3b0642cfacfeeb8ea0ba..75b05896ea4721ec749d61727d24a359d177c922 100644 (file)
@@ -3921,6 +3921,8 @@ EOF
 # of here documents, and old seds have small limits too (100 cmds).
 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
 echo '  if egrep "^@BKL@       @BKR@*#@BKL@    @BKR@*define" $ac_cs_root.in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
 rm -f conftest.tail
 while :
 do
index 2b58011cc147815adad0389b0b25f38fff328fc5..3424f9c6900b405d53ac14f41b1d3e7e8419ad01 100644 (file)
@@ -244,10 +244,13 @@ echo AT_LINE > at-check-line
 test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
 test -n "$at_tracex" && set -x
 $1
-ifelse([$2], , , [if test $? != $2; then
-  # Maybe there was an important message to read before it died.
+ifelse([$2],,,
+[at_status=$?
+if test $at_status != $2; then
+dnl Maybe there was an important message to read before it died.
   test -n "$at_verbose" && cat stderr >&6
-  exit 1
+dnl Exit with the same code, at least to preserve 77.
+  exit $at_status
 fi
 ])dnl
 test -n "$at_tracex" && set +x
index 2b58011cc147815adad0389b0b25f38fff328fc5..3424f9c6900b405d53ac14f41b1d3e7e8419ad01 100644 (file)
@@ -244,10 +244,13 @@ echo AT_LINE > at-check-line
 test -z "$at_no_redirs" && exec 5>&1 6>&2 1>stdout 2>stderr
 test -n "$at_tracex" && set -x
 $1
-ifelse([$2], , , [if test $? != $2; then
-  # Maybe there was an important message to read before it died.
+ifelse([$2],,,
+[at_status=$?
+if test $at_status != $2; then
+dnl Maybe there was an important message to read before it died.
   test -n "$at_verbose" && cat stderr >&6
-  exit 1
+dnl Exit with the same code, at least to preserve 77.
+  exit $at_status
 fi
 ])dnl
 test -n "$at_tracex" && set +x
index 8c8e4bdc674073edc13eac0a66137e386df75833..6ecb75c8fb0b6e9bced922cf65dec841dea13fc6 100644 (file)
@@ -1,16 +1,17 @@
 #                                                      -*- autoconf -*-
 
-dnl AT_AUTOCONF_TEST(NAME-OF-THE-MACRO)
-dnl -----------------------------------
+dnl AT_TEST_MACRO(NAME-OF-THE-MACRO)
+dnl --------------------------------
 dnl Create a minimalist configure.in running the macro named
 dnl NAME-OF-THE-MACRO, check that autoconf runs on that script,
 dnl and that the shell runs correctly the configure.
-AT_DEFINE(TEST_MACRO,
+AT_DEFINE(AT_TEST_MACRO,
 [AT_SETUP($1)
 
 # An extremely simple configure.in
 AT_DATA(configure.in,
 [AC_INIT
+AC_CONFIG_HEADER(config.h)
 $1
 AC_OUTPUT
 ])
@@ -20,11 +21,37 @@ AC_OUTPUT
 # The problem is that currently some warnings are spread on several
 # lines, so grepping -v warning is not enough.
 AT_CHECK([../autoconf -m ..], 0,, ignore)
+AT_CHECK([../autoheader -m ..], 0,, ignore)
 AT_CHECK([./configure], 0, ignore, ignore)
-AT_CLEANUP(configure config.status config.log config.cache)])
+AT_CLEANUP(configure config.status config.log config.cache config.h.in config.h)dnl
+])dnl AT_TEST_MACRO
+
+dnl TEST_MACRO(NAME-OF-THE-MACRO)
+dnl -----------------------------
+dnl Run AT_TEST_MACRO(NAME-OF-THE-MACRO) on selected macros only.
+dnl There are macros which require argument.  We cannot run them without.
+dnl FIXME: AC_INIT creates an infinite loop in m4 when called twice.
+dnl I inserted the exception here, not in Makefile.am, because it seems
+dnl better to me.  I did not use m4_case, since libm4 is not ready yet.
+AT_DEFINE(TEST_MACRO,
+[ifelse([$1], [AC_CHECK_FUNCS],,
+        [$1], [AC_CHECK_HEADERS],,
+        [$1], [AC_CHECK_MEMBER],,
+        [$1], [AC_CHECK_MEMBERS],,
+        [$1], [AC_CHECK_PROGS],,
+        [$1], [AC_CONFIG_AUX_DIR],,
+        [$1], [AC_CONFIG_AUX_DIRS],,
+        [$1], [AC_INIT],,
+        [$1], [AC_LINKER_OPTION],,
+        [$1], [AC_LINK_FILES],,
+        [$1], [AC_LIST_MEMBER_OF],,
+        [$1], [AC_PATH_PROGS],,
+        [$1], [AC_REPLACE_FUNCS],,
+        [$1], [AC_SEARCH_LIBS],,
+        [AT_TEST_MACRO([$1])])])
 
 echo
-echo 'Syntax of specific macros.'
+echo 'Syntax of macros and completeness of the header templates.'
 echo
 
 AT_INCLUDE(macros.m4)