2009-01-27 Eric Blake <ebb9@byu.net>
+ 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) <AC_INIT>: 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.
** 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
@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.
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
@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}
@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
# 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
-# _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])])
[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]]))])
])
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
[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],
cat <<\_ACEOF
m4_divert_pop([HELP_ENABLE])dnl
m4_divert_push([HELP_END])dnl
-m4_ifset([AC_PACKAGE_BUGREPORT], [
-Report bugs to <AC_PACKAGE_BUGREPORT>.])
+
+Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
+ [the package provider]).dnl
+m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
+AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
+m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
+General help using GNU software: <http://www.gnu.org/gethelp/>.])])
_ACEOF
ac_status=$?
fi
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
])
-# 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],
# 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
$config_commands
])dnl
-Report bugs to <bug-autoconf@gnu.org>."
+Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
+ [the package provider]).dnl
+m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
+AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
+m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
+General help using GNU software: <http://www.gnu.org/gethelp/>.])])"
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
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."
/* 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
]])
/* 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
# -*- 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
# 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
/* 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,