From: Eric Blake Date: Mon, 26 Jan 2009 23:43:20 +0000 (-0700) Subject: Use URLs in --help output, part 2: configure. X-Git-Tag: v2.63b~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7cc80491def26037c9e8b91d3f3aa9afd85492a;p=thirdparty%2Fautoconf.git Use URLs in --help output, part 2: configure. * lib/autoconf/general.m4 (_AC_INIT_COPYRIGHT): Bump copyright date. (_AC_INIT_PACKAGE): Support optional URL parameter, mapped to AC_PACKAGE_URL. (_AC_INIT_DEFAULTS, _AC_INIT_PREPARE): Substitute it. (_AC_INIT_HELP): Use it in './configure --help' output. * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Likewise, for './config.status --help'. Bump copyright date. * doc/autoconf.texi (Initializing configure) : Document new parameter. * NEWS: Likewise. * tests/tools.at (autoheader): Adjust test. * tests/torture.at (@%:@define header templates) (Torturing config.status): Likewise. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index e676fbdf5..a521e0c0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,21 @@ 2009-01-27 Eric Blake + Use URLs in --help output, part 2: configure. + * lib/autoconf/general.m4 (_AC_INIT_COPYRIGHT): Bump copyright + date. + (_AC_INIT_PACKAGE): Support optional URL parameter, mapped to + AC_PACKAGE_URL. + (_AC_INIT_DEFAULTS, _AC_INIT_PREPARE): Substitute it. + (_AC_INIT_HELP): Use it in './configure --help' output. + * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Likewise, for + './config.status --help'. Bump copyright date. + * doc/autoconf.texi (Initializing configure) : Document + new parameter. + * NEWS: Likewise. + * tests/tools.at (autoheader): Adjust test. + * tests/torture.at (@%:@define header templates) + (Torturing config.status): Likewise. + Use URLs in --help output, part 1: autoconf executables. * bin/autoconf.as (usage): Make output consistent with recent change in gnulib version-etc module. diff --git a/NEWS b/NEWS index d5c7ed286..ba006cd8f 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,10 @@ GNU Autoconf NEWS - User visible changes. ** AC_HEADER_ASSERT is fixed so that './configure --enable-assert' no longer mistakenly disables assertions. +** AC_INIT now takes an optional fifth parameter that can be used to + set AC_PACKAGE_URL, a URL for the package's home page; the URL is + used in `configure --help' and is also available via AC_DEFINE. + ** Autotest testsuites accept an option --jobs[=N] for parallel testing. ** Autotest testsuites do not attempt to write startup error messages diff --git a/doc/autoconf.texi b/doc/autoconf.texi index fc7d42b20..8a5dc2ed9 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -1756,7 +1756,7 @@ anything else. The only other required macro is @code{AC_OUTPUT} @anchor{AC_INIT} @defmac AC_INIT (@var{package}, @var{version}, @ovar{bug-report}, @ - @ovar{tarname}) + @ovar{tarname}, @ovar{url}) @acindex{INIT} Process any command-line arguments and perform various initializations and verifications. @@ -1769,7 +1769,8 @@ the email to which users should send bug reports. The package package name (e.g., @samp{GNU Autoconf}), while the former is meant for distribution tar ball names (e.g., @samp{autoconf}). It defaults to @var{package} with @samp{GNU } stripped, lower-cased, and all characters -other than alphanumerics and underscores are changed to @samp{-}. +other than alphanumerics and underscores are changed to @samp{-}. If +provided, @var{url} should be the home page for the package. It is preferable that the arguments of @code{AC_INIT} be static, i.e., there should not be any shell computation, but they can be computed by @@ -1790,7 +1791,7 @@ Exactly @var{package}. @acindex{PACKAGE_TARNAME} @ovindex PACKAGE_TARNAME @cvindex PACKAGE_TARNAME -Exactly @var{tarname}. +Exactly @var{tarname}, possibly generated from @var{package}. @item @code{AC_PACKAGE_VERSION}, @code{PACKAGE_VERSION} @acindex{PACKAGE_VERSION} @@ -1808,7 +1809,16 @@ Exactly @samp{@var{package} @var{version}}. @acindex{PACKAGE_BUGREPORT} @ovindex PACKAGE_BUGREPORT @cvindex PACKAGE_BUGREPORT -Exactly @var{bug-report}. +Exactly @var{bug-report}, if one was provided. + +@item @code{AC_PACKAGE_URL}, @code{PACKAGE_URL} +@acindex{PACKAGE_URL} +@ovindex PACKAGE_URL +@cvindex PACKAGE_URL +Exactly @var{url}, if one was provided. If @var{url} was empty, but +@var{package} begins with @samp{GNU }, then this defaults to +@samp{http://@/www.gnu.org/@/software/@/@var{tarname}/}, otherwise, no URL is +assumed. @end table @end defmac diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index bcf87206c..b1c41ba03 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1,7 +1,8 @@ # This file is part of Autoconf. -*- Autoconf -*- # Parameterized macros. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 @@ -245,8 +246,8 @@ AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING]) -# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME]) -# -------------------------------------------------------------- +# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL]) +# --------------------------------------------------------------------- m4_define([_AC_INIT_PACKAGE], [AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])]) AS_LITERAL_IF([$2], [], [m4_warn([syntax], [AC_INIT: not a literal: $2])]) @@ -266,6 +267,11 @@ m4_ifndef([AC_PACKAGE_STRING], [m4_define([AC_PACKAGE_STRING], [$1 $2])]) m4_ifndef([AC_PACKAGE_BUGREPORT], [m4_define([AC_PACKAGE_BUGREPORT], [$3])]) +m4_ifndef([AC_PACKAGE_URL], + [m4_define([AC_PACKAGE_URL], + m4_if([$5], [], [m4_if(m4_index([$1], [GNU ]), [0], + [[http://www.gnu.org/software/]m4_defn([AC_PACKAGE_TARNAME])[/]])], + [[$5]]))]) ]) @@ -364,7 +370,8 @@ m4_ifset([AC_PACKAGE_BUGREPORT], m4_define([_AC_INIT_COPYRIGHT], [AC_COPYRIGHT( [Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 @@ -431,6 +438,8 @@ AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])dnl AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl +AC_SUBST([PACKAGE_URL], + [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])dnl m4_divert_pop([DEFAULTS])dnl m4_wrap_lifo([m4_divert_text([DEFAULTS], @@ -1117,8 +1126,13 @@ m4_ifset([AC_PACKAGE_STRING], cat <<\_ACEOF m4_divert_pop([HELP_ENABLE])dnl m4_divert_push([HELP_END])dnl -m4_ifset([AC_PACKAGE_BUGREPORT], [ -Report bugs to .]) + +Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [], + [the package provider]).dnl +m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [ +AC_PACKAGE_NAME home page: .])dnl +m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [ +General help using GNU software: .])]) _ACEOF ac_status=$? fi @@ -1343,6 +1357,8 @@ AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"], AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"], [Define to the address where bug reports for this package should be sent.])dnl +AC_DEFINE_UNQUOTED([PACKAGE_URL], ["$PACKAGE_URL"], + [Define to the home page for this package.]) # Let the site file select an alternate cache file if it wants to. AC_SITE_LOAD @@ -1362,10 +1378,17 @@ AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl ]) -# AC_INIT([PACKAGE, VERSION, [BUG-REPORT]) -# ---------------------------------------- +# AC_INIT([PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL]) +# ---------------------------------------------------------- # Include the user macro files, prepare the diversions, and output the # preamble of the `configure' script. +# +# If BUG-REPORT is omitted, do without (unless the user previously +# defined the m4 macro AC_PACKAGE_BUGREPORT). If TARNAME is omitted, +# use PACKAGE to seed it. If URL is omitted, use +# `http://www.gnu.org/software/TARNAME/' if PACKAGE begins with `GNU', +# otherwise, do without. +# # Note that the order is important: first initialize, then set the # AC_CONFIG_SRCDIR. m4_define([AC_INIT], diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index bfd7a7966..6ed33a0ae 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -1,7 +1,8 @@ # This file is part of Autoconf. -*- Autoconf -*- # Parameterizing and creating config.status. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 @@ -1428,7 +1429,12 @@ m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], $config_commands ])dnl -Report bugs to ." +Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [], + [the package provider]).dnl +m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [ +AC_PACKAGE_NAME home page: .])dnl +m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [ +General help using GNU software: .])])" _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -1438,7 +1444,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING, with options \\"`AS_ECHO(["$ac_configure_args"]) | sed 's/^ //; s/[[\\""\`\$]]/\\\\&/g'`\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." diff --git a/tests/tools.at b/tests/tools.at index 9282e88f9..871d26719 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -604,6 +604,9 @@ AT_CHECK([cat config.hin], 0, /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION ]]) @@ -682,6 +685,9 @@ The Mouse in a h@t. /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff --git a/tests/torture.at b/tests/torture.at index 4779e2155..9d58e51f6 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -1,7 +1,7 @@ # -*- Autotest -*- -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +# 2009 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 @@ -560,7 +560,7 @@ AT_CHECK([cat config.h], 0, expout) # Check the value of DEFS. AT_DATA([expout], -[[-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA -Dmultiline=line1line2line3\ line4 -Dmultiline_args\(ARG1,\ ARG2\)=ARG2\ ARG1 -Dpaste\(a,b\)=a\#\#b +[[-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA -Dmultiline=line1line2line3\ line4 -Dmultiline_args\(ARG1,\ ARG2\)=ARG2\ ARG1 -Dpaste\(a,b\)=a\#\#b ]]) # Because we strip trailing spaces in `testsuite' we can't leave one in @@ -684,6 +684,9 @@ for awk_arg in FOO= AWK=awk; do /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + /* Define to the version of this package. */ #define PACKAGE_VERSION "" m4_for(AT_Count, 1, 100, 1,