From: Paul Eggert Date: Sat, 5 Feb 2005 07:58:43 +0000 (+0000) Subject: * lib/autoconf/general.m4 (_AC_INIT_COPYRIGHT): Update for 2005. X-Git-Tag: AUTOCONF-2.59c~453 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c28abf84dea6ddfc5b413e8a5654a689aef1978b;p=thirdparty%2Fautoconf.git * lib/autoconf/general.m4 (_AC_INIT_COPYRIGHT): Update for 2005. (AC_COPYRIGHT): Factor header comment portion out and move into... * lib/m4sugar/m4sh.m4 (AS_COPYRIGHT): This. * lib/autotest/general.at (AT_COPYRIGHT): New macro. (AT_INIT): Add Autotest copyright notice. Display copyright notices in --version output. * tests/local.at: Add Autoconf test suite copyright notice. * doc/autoconf.texi (Writing testsuite.at): Document AT_COPYRIGHT. * NEWS: Mention AT_COPYRIGHT. --- diff --git a/NEWS b/NEWS index dd30e3794..81cbaebeb 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,9 @@ ac_cv_prog_cc_c99 or ac_cv_prog_cc_c89 (whichever is valid, in that order). +** AT_COPYRIGHT + New macro for copyright notices in testsuite files. + * Major changes in Autoconf 2.59b Released 2004-08-20, by Paul Eggert. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 4550d4acb..7af882992 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -15618,6 +15618,17 @@ the test suite always displays the package name and version. It also inherits the package bug report address. @end defmac +@defmac AT_COPYRIGHT (@var{copyright-notice}) +@atindex{COPYRIGHT} +@cindex Copyright Notice +State that, in addition to the Free Software Foundation's copyright on +the Autotest macros, parts of your test suite are covered by +@var{copyright-notice}. + +The @var{copyright-notice} will show up in both the head of +@command{testsuite} and in @samp{testsuite --version}. +@end defmac + @defmac AT_TESTED (@var{executables}) @atindex{TESTED} Log the file name and answer to @option{--version} of each program in diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index eacf86c20..430441a52 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -227,7 +227,7 @@ AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING]) # It is suggested that the macros in this section appear before # AC_INIT in `configure.ac'. Nevertheless, this is just stylistic, -# and from the implementation point of, AC_INIT *must* be expanded +# and from the implementation point of view, AC_INIT *must* be expanded # beforehand: it puts data in diversions which must appear before the # data provided by the macros of this section. @@ -262,18 +262,10 @@ m4_ifndef([AC_PACKAGE_BUGREPORT], # AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER]) # ------------------------------------------------------ -# Append Copyright information in the top of `configure'. TEXT is -# evaluated once, hence TEXT can use macros. Note that we do not -# prepend `# ' but `@%:@ ', since m4 does not evaluate the comments. -# Had we used `# ', the Copyright sent in the beginning of `configure' -# would have not been evaluated. Another solution, a bit fragile, -# would have be to use m4_quote to force an evaluation: -# -# m4_bpatsubst(m4_quote($1), [^], [# ]) +# Emit TEXT, a copyright notice, in the top of `configure' and in +# --version output. Macros in TEXT are evaluated once. m4_define([AC_COPYRIGHT], -[m4_divert_text([HEADER-COPYRIGHT], -[m4_bpatsubst([ -$1], [^], [@%:@ ])])dnl +[AS_COPYRIGHT([$1])[]dnl m4_divert_text(m4_default([$2], [VERSION_USER]), [ $1])dnl @@ -354,8 +346,8 @@ m4_ifset([AC_PACKAGE_BUGREPORT], # user copyrights, and after the setup of the --version handling. m4_define([_AC_INIT_COPYRIGHT], [AC_COPYRIGHT( -[Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, -2003, 2004, 2005 Free Software Foundation, Inc. +[Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it.], [VERSION_FSF])dnl diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 70a52b27b..64a707583 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -76,6 +76,7 @@ # cases of a case statement. # - PARSE_ARGS_END # Finish up the option processing. +# # - HELP # Start printing the help message. # - HELP_MODES @@ -88,6 +89,14 @@ # User help can be appended to this as self-contained cat'd here-docs. # - HELP_END # Finish up the help texts. +# +# - VERSION +# Head of the handling of --version. +# - VERSION_NOTICES +# Copyright notices for --version. +# - VERSION_END +# Tail of the handling of --version. +# # - PREPARE_TESTS # Like DEFAULTS but run after argument processing for purposes of # optimization. Do anything else that needs to be done to prepare for @@ -109,6 +118,9 @@ m4_define([_m4_divert(HELP_MODES)], 301) m4_define([_m4_divert(HELP_TUNING)], 302) m4_define([_m4_divert(HELP_OTHER)], 303) m4_define([_m4_divert(HELP_END)], 304) +m4_define([_m4_divert(VERSION)], 350) +m4_define([_m4_divert(VERSION_NOTICES)], 351) +m4_define([_m4_divert(VERSION_END)], 352) m4_define([_m4_divert(PREPARE_TESTS)], 400) m4_define([_m4_divert(TESTS)], 401) m4_define([_m4_divert(TESTS_END)], 402) @@ -146,6 +158,11 @@ m4_define([AT_TESTSUITE_NAME], m4_define([AT_ordinal], 0) m4_define([AT_banner_ordinal], 0) AS_INIT +AT_COPYRIGHT( +[Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software +Foundation, Inc. +This test suite is free software; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it.]) AS_PREPARE m4_divert_push([DEFAULTS])dnl @@ -190,6 +207,8 @@ at_quiet=echo at_debug_p=false # Display help message? at_help_p=false +# Display the version message? +at_version_p=false # List test groups? at_list_p=false # Test groups to run @@ -251,8 +270,7 @@ do ;; --version | -V ) - echo "$as_me (AT_PACKAGE_STRING)" - exit 0 + at_version_p=: ;; --clean | -c ) @@ -433,6 +451,16 @@ _ATEOF exit 0 fi m4_divert_pop([HELP_END])dnl +m4_divert_push([VERSION])dnl +if $at_version_p; then + echo "$as_me (AT_PACKAGE_STRING)" + cat <<\_ACEOF +m4_divert_pop([VERSION])dnl +m4_divert_push([VERSION_END])dnl +_ACEOF + exit 0 +fi +m4_divert_pop([VERSION_END])dnl m4_divert_push([PREPARE_TESTS])dnl # Don't take risks: use only absolute directories in PATH. @@ -1037,6 +1065,17 @@ m4_define([AT_TESTED], ])]) +# AT_COPYRIGHT(TEXT) +# ------------------ +# Emit TEXT, a copyright notice, in the top of the test suite and in +# --version output. Macros in TEXT are evaluated once. +m4_define([AT_COPYRIGHT], +[AS_COPYRIGHT([$1])[]dnl +m4_divert_text([VERSION_NOTICES], +[ +$1])])# AT_COPYRIGHT + + # AT_SETUP(DESCRIPTION) # --------------------- # Start a group of related tests, all to be executed in the same subshell. diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 65d7ee647..71daab370 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -301,6 +301,17 @@ AS_IF([( set x; as_func_ret_success y && test x = "[$]1" )], [], test $exitcode = 0]) +# AS_COPYRIGHT(TEXT) +# ------------------ +# Emit TEXT, a copyright notice, as a shell comment near the top of the +# script. TEXT is evaluated once; to accomplish that, we do not prepend +# `# ' but `@%:@ '. +m4_define([AS_COPYRIGHT], +[m4_divert_text([HEADER-COPYRIGHT], +[m4_bpatsubst([ +$1], [^], [@%:@ ])])]) + + # AS_SHELL_SANITIZE # ----------------- m4_defun([AS_SHELL_SANITIZE], diff --git a/tests/local.at b/tests/local.at index 0dc7f641a..5cc1b6752 100644 --- a/tests/local.at +++ b/tests/local.at @@ -459,3 +459,8 @@ AT_CLEANUP()dnl ## ----------------------- ## AT_INIT +AT_COPYRIGHT( +[Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software +Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.])