From: Akim Demaille Date: Fri, 4 Feb 2000 10:23:15 +0000 (+0000) Subject: Check that the AC_DEFINEs from acspecific.m4 do have a template. X-Git-Tag: autoconf-2.50~1253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9b4dc14d8d20c6cffd7d1bf42b754f0e82b2173;p=thirdparty%2Fautoconf.git 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). --- diff --git a/ChangeLog b/ChangeLog index 9aef37e22..f668675c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +1999-11-13 Akim Demaille + + 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 Introduce a means to distinguish failures of `configure' due to diff --git a/acgeneral.m4 b/acgeneral.m4 index 1e69b9429..75b05896e 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -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 diff --git a/autoheader.m4 b/autoheader.m4 index 0712045e1..b607ec5b3 100644 --- a/autoheader.m4 +++ b/autoheader.m4 @@ -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])" @@@ ])]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 1e69b9429..75b05896e 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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 diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 2b58011cc..3424f9c69 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -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 diff --git a/tests/atgeneral.m4 b/tests/atgeneral.m4 index 2b58011cc..3424f9c69 100644 --- a/tests/atgeneral.m4 +++ b/tests/atgeneral.m4 @@ -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 diff --git a/tests/syntax.m4 b/tests/syntax.m4 index 8c8e4bdc6..6ecb75c8f 100644 --- a/tests/syntax.m4 +++ b/tests/syntax.m4 @@ -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)