This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Support --with-pkgversion and --with-bugurl
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Wed, 7 Nov 2012 22:24:50 +0000
- Subject: Support --with-pkgversion and --with-bugurl
GCC, GDB and Binutils support configure options --with-pkgversion and
--with-bugurl. These allow distributors to specify their own version
information for --version output, and their own bug-reporting URL for
--help output, so that users reporting bugs in the distributor's
modified versions can be directed first to the distributor and the
distributor can then forward bug reports upstream if desired after
establishing that they are not bugs in the distributor's
modifications. Having configure options for this avoids each
distributor needing to make similar changes to the source code and
makes it easier to include the distributor's build number in the
--version output than if the source had to be modified for each build
number.
This patch adds support for these configure options to glibc. Tested
x86_64 and x86.
Comments? As with the cross-testing code, if changes are needed I'll
probably try to extract bits that can go in separately.
2012-11-07 Joseph Myers <joseph@codesourcery.com>
* aclocal.m4 (ACX_PKGVERSION): New macro.
(ACX_BUGURL): Likewise.
* configure.in: Use ACX_PKGVERSION and ACX_BUGURL.
(PKGVERSION): New AC_DEFINE_UNQUOTED.
(REPORT_BUGS_TO): Likewise.
* configure: Regenerated.
* config.h.in (PKGVERSION): New macro.
(REPORT_BUGS_TO): Likewise.
* config.make.in (PKGVERSION): New variable.
(PKGVERSION_TEXI): Likewise.
(REPORT_BUGS_TO): Likewise.
(REPORT_BUGS_TEXI): Likewise.
* catgets/gencat.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* csu/version.c (banner): Use PKGVERSION and REPORT_BUGS_TO.
* debug/Makefile ($(objpfx)catchsegv): Also substitute PKGVERSION
and REPORT_BUGS_TO.
($(objpfx)xtrace): Likewise.
* debug/catchsegv.sh: Use PKGVERSION and REPORT_BUGS_TO.
* debug/pcprofiledump.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* debug/xtrace.sh (do_help): Use REPORT_BUGS_TO.
(do_version): Use PKGVERSION.
* elf/Makefile ($(objpfx)sotruss): Also substitute PKGVERSION and
REPORT_BUGS_TO.
(common-ldd-rewrite): Likewise.
* elf/dl-close.c (_dl_close_worker): Use REPORT_BUGS_TO.
* elf/ldconfig.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* elf/ldd.bash.in: Use PKGVERSION and REPORT_BUGS_TO.
* elf/pldd.c (argp_program_bug_address): Remove variable.
(more_help): New function.
(argp): Use more_help.
(print_version): Use PKGVERSION.
* elf/sln.c (main): Use PKGVERSION.
(usage): Use REPORT_BUGS_TO.
* elf/sotruss.ksh (do_help): Use REPORT_BUGS_TO.
(top level): Use PKGVERSION.
* elf/sprof.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* iconv/iconv_prog.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* iconv/iconvconfig.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* locale/programs/locale.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* locale/programs/localedef.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* login/programs/pt_chown.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* malloc/Makefile ($(objpfx)mtrace): Also substitute PKGVERSION
and BUGURL.
($(objpfx)memusage): Likewise.
* malloc/memusage.sh (do_help): Use REPORT_BUGS_TO.
(do_version): Use PKGVERSION.
* malloc/memusagestat.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* malloc/mtrace.pl ($PACKAGE): Remove variable.
($PKGVERSION): New variable.
($REPORT_BUGS_TO): Likewise.
(usage): Use $REPORT_BUGS_TO.
(top level): Use $PKGVERSION.
* manual/Makefile (libc-texi-generated): Add pkgvers.texi.
($(objpfx)pkgvers.texi): New rule.
($(objpfx)stamp-pkgvers): Likewise.
* manual/install.texi (REPORT_BUGS_TO): Define if not already
defined.
(--with-pkgversion): Document new configure option.
(--with-bugurl): Likewise.
(Reporting Bugs): Describe Bugzilla as upstream tracker rather
than necessarily for this particular distribution. Use
REPORT_BUGS_TO for where to report bugs.
* INSTALL: Regenerated.
* manual/libc.texinfo: Include pkgvers.texi. Include PKGVERSION
in version information.
* nscd/nscd.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* nss/getent.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* nss/makedb.c (more_help): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* posix/getconf.c (main): Use PKGVERSION and REPORT_BUGS_TO.
* sunrpc/proto.h [IS_IN_build] (_libc_intl_domainname): Remove
macro.
* sunrpc/rpc_main.c (options_usage): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* sunrpc/rpcinfo.c (usage): Use REPORT_BUGS_TO.
(print_version): Use PKGVERSION.
* sysdeps/unix/sysv/linux/lddlibc4.c (main): Use REPORT_BUGS_TO
and PKGVERSION.
* timezone/Makefile ($(objpfx)tzselect): Also substitute
PKGVERSION and REPORT_BUGS_TO.
* timezone/tzselect.ksh (PKGVERSION): New variable.
(REPORT_BUGS_TO): Likewise.
(top level): Use REPORT_BUGS_TO and PKGVERSION.
* timezone/zdump.c: Include config.h.
(usage): Use REPORT_BUGS_TO.
(main): Use PKGVERSION.
* timezone/zic.c: Include config.h.
(usage): Use REPORT_BUGS_TO.
(main): Use PKGVERSION.
diff --git a/INSTALL b/INSTALL
index d700198..89d8408 100644
--- a/INSTALL
+++ b/INSTALL
@@ -148,6 +148,19 @@ will be used, and CFLAGS sets optimization options for the compiler.
If you specify just `--build', `configure' will get confused.
+`--with-pkgversion=VERSION'
+ Specify a description, possibly including a build number or build
+ date, of the binaries being built, to be included in `--version'
+ output from programs installed with the GNU C Library. For
+ example, `--with-pkgversion='FooBar GNU/Linux glibc build 123''.
+ The default value is `GNU libc'.
+
+`--with-bugurl=URL'
+ Specify the URL that users should visit if they wish to report a
+ bug, to be included in `--help' output from programs installed with
+ the GNU C Library. The default value refers to the main
+ bug-reporting information for the GNU C Library.
+
To build the library and related programs, type `make'. This will
produce a lot of output, some of which may look like errors from `make'
but isn't. Look for error messages from `make' containing `***'.
@@ -404,10 +417,10 @@ remain unfixed for all eternity, if not longer.
It is a good idea to verify that the problem has not already been
reported. Bugs are documented in two places: The file `BUGS' describes
-a number of well known bugs and the bug tracking system has a WWW
-interface at `http://sourceware.org/bugzilla/'. The WWW interface
-gives you access to open and closed reports. A closed report normally
-includes a patch or a hint on solving the problem.
+a number of well known bugs and the upstream GNU C Library bug tracking
+system has a WWW interface at `http://sourceware.org/bugzilla/'. The
+WWW interface gives you access to open and closed reports. A closed
+report normally includes a patch or a hint on solving the problem.
To report a bug, first you must find it. With any luck, this will
be the hard part. Once you've found a bug, make sure it's really a
@@ -428,7 +441,7 @@ library, you really only need to narrow it down to one library function
call, if possible. This should not be too difficult.
The final step when you have a simple test case is to report the bug.
-Do this using the WWW interface to the bug database.
+Do this at `http://www.gnu.org/software/libc/bugs.html'.
If you are not sure how a function should behave, and this manual
doesn't tell you, that's a bug in the manual. Report that too! If the
diff --git a/aclocal.m4 b/aclocal.m4
index 3e61dc8..b173e9e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -165,3 +165,51 @@ then
done
AC_MSG_RESULT()
fi])
+
+# These two macros are taken from GCC's config/acx.m4.
+dnl Support the --with-pkgversion configure option.
+dnl ACX_PKGVERSION(default-pkgversion)
+AC_DEFUN([ACX_PKGVERSION],[
+ AC_ARG_WITH(pkgversion,
+ AS_HELP_STRING([--with-pkgversion=PKG],
+ [Use PKG in the version string in place of "$1"]),
+ [case "$withval" in
+ yes) AC_MSG_ERROR([package version not specified]) ;;
+ no) PKGVERSION= ;;
+ *) PKGVERSION="($withval) " ;;
+ esac],
+ PKGVERSION="($1) "
+ )
+ PKGVERSION_TEXI=`echo "$PKGVERSION" | sed 's/@/@@/g'`
+ AC_SUBST(PKGVERSION)
+ AC_SUBST(PKGVERSION_TEXI)
+])
+
+dnl Support the --with-bugurl configure option.
+dnl ACX_BUGURL(default-bugurl)
+AC_DEFUN([ACX_BUGURL],[
+ AC_ARG_WITH(bugurl,
+ AS_HELP_STRING([--with-bugurl=URL],
+ [Direct users to URL to report a bug]),
+ [case "$withval" in
+ yes) AC_MSG_ERROR([bug URL not specified]) ;;
+ no) BUGURL=
+ ;;
+ *) BUGURL="$withval"
+ ;;
+ esac],
+ BUGURL="$1"
+ )
+ case ${BUGURL} in
+ "")
+ REPORT_BUGS_TO=
+ REPORT_BUGS_TEXI=
+ ;;
+ *)
+ REPORT_BUGS_TO="<$BUGURL>"
+ REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`}
+ ;;
+ esac;
+ AC_SUBST(REPORT_BUGS_TO)
+ AC_SUBST(REPORT_BUGS_TEXI)
+])
diff --git a/catgets/gencat.c b/catgets/gencat.c
index 26bb91d..5078e3c 100644
--- a/catgets/gencat.c
+++ b/catgets/gencat.c
@@ -227,13 +227,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -244,7 +247,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "gencat (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "gencat %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/config.h.in b/config.h.in
index 653df54..19776a6 100644
--- a/config.h.in
+++ b/config.h.in
@@ -161,6 +161,12 @@
/* Define if __stack_chk_guard canary should be randomized at program startup. */
#undef ENABLE_STACKGUARD_RANDOMIZE
+/* Additional package description. */
+#undef PKGVERSION
+
+/* Bug reporting address. */
+#undef REPORT_BUGS_TO
+
/* Define if multi-arch DSOs should be generated. */
#undef USE_MULTIARCH
diff --git a/config.make.in b/config.make.in
index c22acf4..7f1bbb5 100644
--- a/config.make.in
+++ b/config.make.in
@@ -139,4 +139,10 @@ PERL = @PERL@
# Additional libraries.
LIBGD = @LIBGD@
+# Package versions and bug reporting configuration.
+PKGVERSION = @PKGVERSION@
+PKGVERSION_TEXI = @PKGVERSION_TEXI@
+REPORT_BUGS_TO = @REPORT_BUGS_TO@
+REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@
+
# More variables may be inserted below by configure.
diff --git a/configure b/configure
index 35b06c1..62c1bd7 100755
--- a/configure
+++ b/configure
@@ -656,6 +656,10 @@ add_ons
build_nscd
link_obsolete_rpc
libc_cv_nss_crypt
+REPORT_BUGS_TEXI
+REPORT_BUGS_TO
+PKGVERSION_TEXI
+PKGVERSION
all_warnings
force_install
bindnow
@@ -747,6 +751,8 @@ enable_static_nss
enable_force_install
enable_kernel
enable_all_warnings
+with_pkgversion
+with_bugurl
enable_multi_arch
enable_nss_crypt
enable_obsolete_rpc
@@ -1426,6 +1432,8 @@ Optional Packages:
--with-headers=PATH location of system headers to use (for example
/usr/src/linux/include) [default=compiler default]
--with-default-link do not use explicit linker scripts
+ --with-pkgversion=PKG Use PKG in the version string in place of "GNU libc"
+ --with-bugurl=URL Direct users to URL to report a bug
--with-cpu=CPU select code for CPU variant
Some influential environment variables:
@@ -3716,6 +3724,64 @@ fi
+
+
+# Check whether --with-pkgversion was given.
+if test "${with_pkgversion+set}" = set; then :
+ withval=$with_pkgversion; case "$withval" in
+ yes) as_fn_error $? "package version not specified" "$LINENO" 5 ;;
+ no) PKGVERSION= ;;
+ *) PKGVERSION="($withval) " ;;
+ esac
+else
+ PKGVERSION="(GNU libc) "
+
+fi
+
+ PKGVERSION_TEXI=`echo "$PKGVERSION" | sed 's/@/@@/g'`
+
+
+
+
+
+# Check whether --with-bugurl was given.
+if test "${with_bugurl+set}" = set; then :
+ withval=$with_bugurl; case "$withval" in
+ yes) as_fn_error $? "bug URL not specified" "$LINENO" 5 ;;
+ no) BUGURL=
+ ;;
+ *) BUGURL="$withval"
+ ;;
+ esac
+else
+ BUGURL="http://www.gnu.org/software/libc/bugs.html"
+
+fi
+
+ case ${BUGURL} in
+ "")
+ REPORT_BUGS_TO=
+ REPORT_BUGS_TEXI=
+ ;;
+ *)
+ REPORT_BUGS_TO="<$BUGURL>"
+ REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`}
+ ;;
+ esac;
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PKGVERSION "$PKGVERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define REPORT_BUGS_TO "$REPORT_BUGS_TO"
+_ACEOF
+
+
# Check whether --enable-multi-arch was given.
if test "${enable_multi_arch+set}" = set; then :
enableval=$enable_multi_arch; multi_arch=$enableval
diff --git a/configure.in b/configure.in
index 5e35b98..151035e 100644
--- a/configure.in
+++ b/configure.in
@@ -218,6 +218,13 @@ AC_ARG_ENABLE([all-warnings],
[])
AC_SUBST(all_warnings)
+ACX_PKGVERSION([GNU libc])
+ACX_BUGURL([http://www.gnu.org/software/libc/bugs.html])
+AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"],
+ [Additional package description])
+AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"],
+ [Bug reporting address])
+
AC_ARG_ENABLE([multi-arch],
AC_HELP_STRING([--enable-multi-arch],
[enable single DSO with optimizations for multiple architectures]),
diff --git a/csu/version.c b/csu/version.c
index 7803938..9fe9fef 100644
--- a/csu/version.c
+++ b/csu/version.c
@@ -24,7 +24,7 @@ static const char __libc_release[] = RELEASE;
static const char __libc_version[] = VERSION;
static const char banner[] =
-"GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
+"GNU C Library "PKGVERSION RELEASE" release version "VERSION", by Roland McGrath et al.\n\
Copyright (C) 2012 Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
@@ -38,7 +38,7 @@ LIBC_ABIS_STRING
"The oldest ABI supported: " GLIBC_OLDEST_ABI ".\n"
#endif
"For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n";
+"REPORT_BUGS_TO".\n";
#include <unistd.h>
diff --git a/debug/Makefile b/debug/Makefile
index 04dd799..0d0e002 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -156,7 +156,9 @@ sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,')
$(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
$(common-objpfx)config.make
slibpfx=`echo $(slibdir)|sed 's/lib\(64\|\)$$/\\\\\\\\$$LIB/'`; \
- sed -e 's|@VERSION@|$(version)|' -e "s|@SLIB@|$$slibpfx|" $< > $@.new
+ sed -e 's|@VERSION@|$(version)|' -e "s|@SLIB@|$$slibpfx|" \
+ -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+ -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $< > $@.new
chmod 555 $@.new
mv -f $@.new $@
@@ -165,7 +167,9 @@ $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o
$(objpfx)xtrace: xtrace.sh
rm -f $@.new
sed -e 's|@BASH@|$(BASH)|' -e 's|@VERSION@|$(version)|' \
- -e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' $^ > $@.new \
+ -e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' \
+ -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+ -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
&& rm -f $@ && mv $@.new $@ && chmod +x $@
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
diff --git a/debug/catchsegv.sh b/debug/catchsegv.sh
index 9bbcfc0..ad91097 100755
--- a/debug/catchsegv.sh
+++ b/debug/catchsegv.sh
@@ -34,11 +34,11 @@ if test $# -eq 0; then
echo ' --help print this help, then exit'
echo ' --version print version number, then exit'
echo "For bug reporting instructions, please see:"
- echo "<http://www.gnu.org/software/libc/bugs.html>."
+ echo "@REPORT_BUGS_TO@."
exit 0
;;
--v | --ve | --ver | --vers | --versi | --versio | --version)
- echo 'catchsegv (GNU libc) @VERSION@'
+ echo 'catchsegv @PKGVERSION@@VERSION@'
echo 'Copyright (C) 2012 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.
diff --git a/debug/pcprofiledump.c b/debug/pcprofiledump.c
index fe6f3b4..fd5ab51 100644
--- a/debug/pcprofiledump.c
+++ b/debug/pcprofiledump.c
@@ -1,5 +1,5 @@
/* Dump information generated by PC profiling.
- Copyright (C) 1999, 2002, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@@ -200,13 +200,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -217,7 +220,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "pcprofiledump (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "pcprofiledump %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/debug/xtrace.sh b/debug/xtrace.sh
index ea4d254..f3312b6 100755
--- a/debug/xtrace.sh
+++ b/debug/xtrace.sh
@@ -54,14 +54,14 @@ Mandatory arguments to long options are also mandatory for any corresponding
short options.
"
- echo $"For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>.
-"
+ printf $"For bug reporting instructions, please see:
+%s.
+" "@REPORT_BUGS_TO@"
exit 0
}
do_version() {
- echo 'xtrace (GNU libc) @VERSION@'
+ echo 'xtrace @PKGVERSION@@VERSION@'
printf $"Copyright (C) %s 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.
diff --git a/elf/Makefile b/elf/Makefile
index 42b792b..7513fa0 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -108,7 +108,10 @@ $(objpfx)sotruss: sotruss.ksh $(common-objpfx)config.make
sed -e 's%@KSH@%$(KSH)%g' \
-e 's%@VERSION@%$(version)%g' \
-e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' \
- -e 's%@PREFIX@%$(prefix)%g' < $< > $@.new
+ -e 's%@PREFIX@%$(prefix)%g' \
+ -e 's%@PKGVERSION@%$(PKGVERSION)%g' \
+ -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' \
+ < $< > $@.new
chmod 555 $@.new
mv -f $@.new $@
$(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force)
@@ -381,7 +384,9 @@ endif
common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
- -e 's%@VERSION@%$(version)%g'
+ -e 's%@VERSION@%$(version)%g' \
+ -e 's%@PKGVERSION@%$(PKGVERSION)%g' \
+ -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g'
sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g'
bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \
-e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g'
diff --git a/elf/dl-close.c b/elf/dl-close.c
index e6ff7e7..cda0e71 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -702,7 +702,7 @@ _dl_close_worker (struct link_map *map)
if (any_tls)
{
if (__builtin_expect (++GL(dl_tls_generation) == 0, 0))
- _dl_fatal_printf ("TLS generation counter wrapped! Please report as described in <http://www.gnu.org/software/libc/bugs.html>.\n");
+ _dl_fatal_printf ("TLS generation counter wrapped! Please report as described in "REPORT_BUGS_TO".\n");
if (tls_free_end == GL(dl_tls_static_used))
GL(dl_tls_static_used) = tls_free_start;
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 8d6e77f..453cd62 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -294,13 +294,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -311,7 +314,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "ldconfig (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index fc3f63e..fbcfe0d 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -34,7 +34,7 @@ verbose=
while test $# -gt 0; do
case "$1" in
--vers | --versi | --versio | --version)
- echo 'ldd (GNU libc) @VERSION@'
+ echo 'ldd @PKGVERSION@@VERSION@'
printf $"Copyright (C) %s 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.
@@ -52,9 +52,9 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-u, --unused print unused direct dependencies
-v, --verbose print all information
"
- echo $"For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>.
-"
+ printf $"For bug reporting instructions, please see:
+%s.
+" "@REPORT_BUGS_TO@"
exit 0
;;
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
diff --git a/elf/pldd.c b/elf/pldd.c
index 39095c9..a8e2e5c 100644
--- a/elf/pldd.c
+++ b/elf/pldd.c
@@ -52,10 +52,8 @@ extern void *xrealloc (void *o, size_t n)
static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
-/* Bug report address. */
-const char *argp_program_bug_address = N_("\
-For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n");
+/* Function to print some extra text in the help message. */
+static char *more_help (int key, const char *text, void *input);
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
@@ -76,7 +74,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
- options, parse_opt, args_doc, doc, NULL, NULL, NULL
+ options, parse_opt, args_doc, doc, NULL, more_help, NULL
};
// File descriptor of /proc/*/mem file.
@@ -212,11 +210,31 @@ parse_opt (int key, char *arg, struct argp_state *state)
}
+/* Print bug-reporting information in the help message. */
+static char *
+more_help (int key, const char *text, void *input)
+{
+ char *tp = NULL;
+ switch (key)
+ {
+ case ARGP_KEY_HELP_EXTRA:
+ /* We print some extra information. */
+ if (asprintf (&tp, gettext ("\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
+ default:
+ break;
+ }
+ return (char *) text;
+}
+
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "pldd (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "pldd %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/elf/sln.c b/elf/sln.c
index 547a818..1bad21f 100644
--- a/elf/sln.c
+++ b/elf/sln.c
@@ -58,7 +58,7 @@ main (int argc, char **argv)
{
case 2:
if (strcmp (argv[1], "--version") == 0) {
- printf ("sln (GNU libc) %s\n", VERSION);
+ printf ("sln %s%s\n", PKGVERSION, VERSION);
return 0;
} else if (strcmp (argv[1], "--help") == 0) {
usage ();
@@ -82,8 +82,8 @@ static void
usage (void)
{
printf (_("Usage: sln src dest|file\n\n"));
- fputs (_("For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"), stdout);
+ printf (_("For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO);
}
static int
diff --git a/elf/sotruss.ksh b/elf/sotruss.ksh
index ff77f7f..88d59d8 100755
--- a/elf/sotruss.ksh
+++ b/elf/sotruss.ksh
@@ -47,8 +47,8 @@ function do_help {
echo
printf $"For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>.
-"
+%s.
+" "@REPORT_BUGS_TO@"
exit 0
}
@@ -72,7 +72,7 @@ function do_ambiguous {
while test $# -gt 0; do
case "$1" in
--v | --ve | --ver | --vers | --versi | --versio | --version)
- echo "sotruss (GNU libc) @VERSION@"
+ echo "sotruss @PKGVERSION@@VERSION@"
printf $"Copyright (C) %s 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.
diff --git a/elf/sprof.c b/elf/sprof.c
index 2097d31..9f5d0ec 100644
--- a/elf/sprof.c
+++ b/elf/sprof.c
@@ -363,13 +363,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -381,7 +384,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "sprof (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "sprof %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index 36168a1..62c6794 100644
--- a/iconv/iconv_prog.c
+++ b/iconv/iconv_prog.c
@@ -400,13 +400,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -418,7 +421,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "iconv (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "iconv %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/iconv/iconvconfig.c b/iconv/iconvconfig.c
index 0379ec3..d70b013 100644
--- a/iconv/iconvconfig.c
+++ b/iconv/iconvconfig.c
@@ -375,13 +375,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -393,7 +396,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "iconvconfig (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "iconvconfig %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 247265e..6bbd9d6 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -271,13 +271,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -289,7 +292,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "locale (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "locale %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
index 5dc35ca..68a2377 100644
--- a/locale/programs/localedef.c
+++ b/locale/programs/localedef.c
@@ -354,19 +354,22 @@ static char *
more_help (int key, const char *text, void *input)
{
char *cp;
+ char *tp;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
+ if (asprintf (&tp, gettext ("\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
if (asprintf (&cp, gettext ("\
System's directory for character maps : %s\n\
repertoire maps: %s\n\
locale path : %s\n\
%s"),
- CHARMAP_PATH, REPERTOIREMAP_PATH, LOCALE_PATH, gettext ("\
-For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n")) < 0)
+ CHARMAP_PATH, REPERTOIREMAP_PATH, LOCALE_PATH, tp) < 0)
return NULL;
return cp;
default:
@@ -379,7 +382,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "localedef (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "localedef %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/login/programs/pt_chown.c b/login/programs/pt_chown.c
index fe98964..b65a3c0 100644
--- a/login/programs/pt_chown.c
+++ b/login/programs/pt_chown.c
@@ -58,7 +58,7 @@ static struct argp argp =
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "pt_chown (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "pt_chown %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
@@ -70,6 +70,7 @@ static char *
more_help (int key, const char *text, void *input)
{
char *cp;
+ char *tp;
switch (key)
{
@@ -84,13 +85,15 @@ Set the owner, group and access permission of the slave pseudo\
return cp;
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
+ if (asprintf (&tp, gettext ("\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
asprintf (&cp, gettext ("\
The owner is set to the current user, the group is set to `%s',\
and the access permission is set to `%o'.\n\n\
%s"),
- TTY_GROUP, S_IRUSR|S_IWUSR|S_IWGRP, gettext ("\
-For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+ TTY_GROUP, S_IRUSR|S_IWUSR|S_IWGRP, tp);
return cp;
default:
break;
diff --git a/malloc/Makefile b/malloc/Makefile
index 1e0281f..e193899 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -126,13 +126,17 @@ sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,')
$(objpfx)mtrace: mtrace.pl
rm -f $@.new
sed -e 's|@PERL@|$(PERL)|' -e 's|@XXX@|$(address-width)|' \
- -e 's|@VERSION@|$(version)|' $^ > $@.new \
+ -e 's|@VERSION@|$(version)|' \
+ -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+ -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
&& rm -f $@ && mv $@.new $@ && chmod +x $@
$(objpfx)memusage: memusage.sh
rm -f $@.new
sed -e 's|@BASH@|$(BASH)|' -e 's|@VERSION@|$(version)|' \
- -e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' $^ > $@.new \
+ -e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' \
+ -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+ -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
&& rm -f $@ && mv $@.new $@ && chmod +x $@
diff --git a/malloc/memusage.sh b/malloc/memusage.sh
index 7ed68c0..8cb2e9c 100755
--- a/malloc/memusage.sh
+++ b/malloc/memusage.sh
@@ -61,14 +61,14 @@ Mandatory arguments to long options are also mandatory for any corresponding
short options.
"
- echo $"For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>.
-"
+ printf $"For bug reporting instructions, please see:
+%s.
+" "@REPORT_BUGS_TO@"
exit 0
}
do_version() {
- echo 'memusage (GNU libc) @VERSION@'
+ echo 'memusage @PKGVERSION@@VERSION@'
printf $"Copyright (C) %s 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.
diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c
index af8f991..a609a9b 100644
--- a/malloc/memusagestat.c
+++ b/malloc/memusagestat.c
@@ -528,20 +528,17 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
- char *orig;
- char *cp;
+ char *tp;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- orig = gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n");
- cp = strdup (orig);
- if (cp == NULL)
- cp = orig;
- return cp;
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -552,7 +549,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "memusagestat (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "memusagestat %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/malloc/mtrace.pl b/malloc/mtrace.pl
index a212500..adf61c7 100644
--- a/malloc/mtrace.pl
+++ b/malloc/mtrace.pl
@@ -21,7 +21,8 @@ eval "exec @PERL@ -S $0 $@"
# <http://www.gnu.org/licenses/>.
$VERSION = "@VERSION@";
-$PACKAGE = "libc";
+$PKGVERSION = "@PKGVERSION@";
+$REPORT_BUGS_TO = '@REPORT_BUGS_TO@';
$progname = $0;
sub usage {
@@ -30,7 +31,7 @@ sub usage {
print " --version print version number, then exit\n";
print "\n";
print "For bug reporting instructions, please see:\n";
- print "<http://www.gnu.org/software/libc/bugs.html>.\n";
+ print "$REPORT_BUGS_TO.\n";
exit 0;
}
@@ -43,7 +44,7 @@ arglist: while (@ARGV) {
if ($ARGV[0] eq "--v" || $ARGV[0] eq "--ve" || $ARGV[0] eq "--ver" ||
$ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" ||
$ARGV[0] eq "--versio" || $ARGV[0] eq "--version") {
- print "mtrace (GNU $PACKAGE) $VERSION\n";
+ print "mtrace $PKGVERSION$VERSION\n";
print "Copyright (C) 2012 Free Software Foundation, Inc.\n";
print "This is free software; see the source for copying conditions. There is NO\n";
print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
diff --git a/manual/Makefile b/manual/Makefile
index 67e1390..6fddff0 100644
--- a/manual/Makefile
+++ b/manual/Makefile
@@ -61,7 +61,7 @@ examples = $(filter-out $(foreach d, $(add-ons), ../$d/%.c.texi), \
# Generated files directly included from libc.texinfo.
libc-texi-generated = chapters.texi top-menu.texi dir-add.texi \
- libm-err.texi version.texi
+ libm-err.texi version.texi pkgvers.texi
# Add path to build dir for generated files
texis-path := $(filter-out $(libc-texi-generated) summary.texi $(examples), \
@@ -113,6 +113,14 @@ $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
$(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
touch $@
+# Package version and bug reporting URL.
+$(objpfx)pkgvers.texi: $(objpfx)stamp-pkgvers
+$(objpfx)stamp-pkgvers:
+ echo "@set PKGVERSION $(PKGVERSION_TEXI)" > $(objpfx)pkgvers-tmp
+ echo "@set REPORT_BUGS_TO $(REPORT_BUGS_TEXI)" >> $(objpfx)pkgvers-tmp
+ $(move-if-change) $(objpfx)pkgvers-tmp $(objpfx)pkgvers.texi
+ touch $@
+
# Generate a file with the version number.
$(objpfx)version.texi: $(objpfx)stamp-version ;
$(objpfx)stamp-version: $(common-objpfx)config.make
diff --git a/manual/install.texi b/manual/install.texi
index 4802e69..d7e852e 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -2,6 +2,9 @@
@c Makeinfo ignores it when processing the file from the include.
@setfilename INSTALL
@include macros.texi
+@ifclear REPORT_BUGS_TO
+@set REPORT_BUGS_TO @uref{http://www.gnu.org/software/libc/bugs.html}
+@end ifclear
@node Installation, Maintenance, Library Summary, Top
@c %MENU% How to install the GNU C Library
@@ -173,6 +176,19 @@ the appropriate compiler flags (@samp{-mcpu=i386} will do the trick) to
@var{CFLAGS}.
If you specify just @samp{--build}, @code{configure} will get confused.
+
+@item --with-pkgversion=@var{version}
+Specify a description, possibly including a build number or build
+date, of the binaries being built, to be included in
+@option{--version} output from programs installed with @theglibc{}.
+For example, @option{--with-pkgversion='FooBar GNU/Linux glibc build
+123'}. The default value is @samp{GNU libc}.
+
+@item --with-bugurl=@var{url}
+Specify the URL that users should visit if they wish to report a bug,
+to be included in @option{--help} output from programs installed with
+@theglibc{}. The default value refers to the main bug-reporting
+information for @theglibc{}.
@end table
To build the library and related programs, type @code{make}. This will
@@ -458,7 +474,8 @@ remain unfixed for all eternity, if not longer.
It is a good idea to verify that the problem has not already been
reported. Bugs are documented in two places: The file @file{BUGS}
-describes a number of well known bugs and the bug tracking system has a
+describes a number of well known bugs and the upstream @glibcadj{}
+bug tracking system has a
WWW interface at
@url{http://sourceware.org/bugzilla/}. The WWW
interface gives you access to open and closed reports. A closed report
@@ -483,7 +500,7 @@ library, you really only need to narrow it down to one library
function call, if possible. This should not be too difficult.
The final step when you have a simple test case is to report the bug.
-Do this using the WWW interface to the bug database.
+Do this at @value{REPORT_BUGS_TO}.
If you are not sure how a function should behave, and this manual
doesn't tell you, that's a bug in the manual. Report that too! If the
diff --git a/manual/libc.texinfo b/manual/libc.texinfo
index 2c1344a..7bf5550 100644
--- a/manual/libc.texinfo
+++ b/manual/libc.texinfo
@@ -13,6 +13,8 @@
@end direntry
@include dir-add.texi
+@include pkgvers.texi
+
@c This tells texinfo.tex to use the real section titles in xrefs in
@c place of the node name, when no section title is explicitly given.
@set xref-automatic-section-title
@@ -36,7 +38,8 @@ This file documents @theglibc{}.
This is
@c Disabled (printed editions, see above).
@c Edition @value{EDITION} of
-@cite{The GNU C Library Reference Manual}, for version @value{VERSION}.
+@cite{The GNU C Library Reference Manual}, for version @value{VERSION}
+@value{PKGVERSION}.
Copyright @copyright{} 1993--2012 Free Software Foundation, Inc.
@@ -70,6 +73,8 @@ supports it in developing GNU and promoting software freedom.''
@c @center Edition @value{EDITION}
@c @sp 1
@center for version @value{VERSION}
+@sp 1
+@center @value{PKGVERSION}
@page
@vskip 0pt plus 1filll
@insertcopying
@@ -96,6 +101,7 @@ This is
@c Disabled (printed editions, see above).
@c Edition @value{EDITION} of
@cite{The GNU C Library Reference Manual}, for Version @value{VERSION}
+@value{PKGVERSION}
of @theglibc{}.
@end ifnottex
diff --git a/nscd/nscd.c b/nscd/nscd.c
index bee9ed4..6adb3d8 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -451,13 +451,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -468,7 +471,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "nscd (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "nscd %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/nss/getent.c b/nss/getent.c
index e88356d..5f8278a 100644
--- a/nss/getent.c
+++ b/nss/getent.c
@@ -82,7 +82,7 @@ static int idn_flags = AI_IDN | AI_CANONIDN;
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "getent (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "getent %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
@@ -962,9 +962,9 @@ more_help (int key, const char *text, void *input)
fputs ("\n\n", fp);
- fputs (gettext ("\
+ fprintf (fp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"), fp);
+%s.\n"), REPORT_BUGS_TO);
if (fclose (fp) == 0)
return doc;
diff --git a/nss/makedb.c b/nss/makedb.c
index ccaabdf..8d7d027 100644
--- a/nss/makedb.c
+++ b/nss/makedb.c
@@ -363,13 +363,16 @@ parse_opt (int key, char *arg, struct argp_state *state)
static char *
more_help (int key, const char *text, void *input)
{
+ char *tp = NULL;
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
- return strdup (gettext ("\
+ if (asprintf (&tp, gettext ("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n"), REPORT_BUGS_TO) < 0)
+ return NULL;
+ return tp;
default:
break;
}
@@ -380,7 +383,7 @@ For bug reporting instructions, please see:\n\
static void
print_version (FILE *stream, struct argp_state *state)
{
- fprintf (stream, "makedb (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, "makedb %s%s\n", PKGVERSION, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/posix/getconf.c b/posix/getconf.c
index 985e252..aa0dd86 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -1099,7 +1099,7 @@ main (int argc, char *argv[])
if (argc > 1 && strcmp (argv[1], "--version") == 0)
{
- printf ("getconf (GNU %s) %s\n", PACKAGE, VERSION);
+ printf ("getconf %s%s\n", PKGVERSION, VERSION);
printf (gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
@@ -1118,8 +1118,8 @@ Usage: getconf [-v SPEC] VAR\n\
Get the configuration value for variable VAR, or for variable PATH_VAR\n\
for path PATH. If SPEC is given, give values for compilation\n\
environment SPEC.\n\n"));
- fputs (gettext ("For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"), stdout);
+ printf (gettext ("For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO);
return 0;
}
diff --git a/sunrpc/proto.h b/sunrpc/proto.h
index 0ba9cd6..ea28565 100644
--- a/sunrpc/proto.h
+++ b/sunrpc/proto.h
@@ -62,7 +62,4 @@ void add_type(int len, const char *type);
#define _(X) (X)
#define textdomain(X) ((void) 0)
-/* This is used in the definition of PACKAGE for --version output. */
-#define _libc_intl_domainname "libc"
-
#endif
diff --git a/sunrpc/rpc_main.c b/sunrpc/rpc_main.c
index 2103b10..0eb8686 100644
--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -1439,15 +1439,15 @@ options_usage (FILE *stream, int status)
f_print (stream, _("-T\t\tgenerate code to support RPC dispatch tables\n"));
f_print (stream, _("-Y path\t\tdirectory name to find C preprocessor (cpp)\n"));
- f_print (stream, "\n%s", _("\
+ f_print (stream, "\n\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"));
+%s.\n", REPORT_BUGS_TO);
exit (status);
}
static void
print_version (void)
{
- printf ("rpcgen (GNU %s) %s\n", PACKAGE, VERSION);
+ printf ("rpcgen %s%s\n", PKGVERSION, VERSION);
exit (0);
}
diff --git a/sunrpc/rpcinfo.c b/sunrpc/rpcinfo.c
index 16c0354..e490a7e 100644
--- a/sunrpc/rpcinfo.c
+++ b/sunrpc/rpcinfo.c
@@ -688,15 +688,15 @@ usage (FILE *stream)
fputs (_(" rpcinfo -b prognum versnum\n"), stream);
fputs (_(" rpcinfo -d prognum versnum\n"), stream);
fputc ('\n', stream);
- fputs (_("\
+ fprintf (stream, _("\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"), stream);
+%s.\n"), REPORT_BUGS_TO);
}
static void
print_version (void)
{
- printf ("rpcinfo (GNU %s) %s\n", PACKAGE, VERSION);
+ printf ("rpcinfo %s%s\n", PKGVERSION, VERSION);
}
static u_long
diff --git a/sysdeps/unix/sysv/linux/lddlibc4.c b/sysdeps/unix/sysv/linux/lddlibc4.c
index f441a9e..c251be8 100644
--- a/sysdeps/unix/sysv/linux/lddlibc4.c
+++ b/sysdeps/unix/sysv/linux/lddlibc4.c
@@ -58,13 +58,13 @@ main (int argc, char *argv[])
if (strcmp (argv[1], "--help") == 0)
{
printf (gettext ("Usage: lddlibc4 FILE\n\n"));
- fputs (gettext ("For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n"), stdout);
+ printf (gettext ("For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO);
return 0;
}
else if (strcmp (argv[1], "--version") == 0)
{
- printf ("lddlibc4 (GNU %s) %s\n", PACKAGE, VERSION);
+ printf ("lddlibc4 %s%s\n", PKGVERSION, VERSION);
printf (gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/timezone/Makefile b/timezone/Makefile
index 9e55a6a..5272c55 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -107,6 +107,8 @@ $(testdata)/Asia/Tokyo: asia $(zic-deps)
$(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
sed -e 's%@KSH@%$(KSH)%g' \
- -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
+ -e 's%@TZDIR@%$(zonedir)%g' \
+ -e 's%@PKGVERSION@%$(PKGVERSION)%g' \
+ -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' < $< > $@.new
chmod 555 $@.new
mv -f $@.new $@
diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
index 57bf707..9146d37 100644
--- a/timezone/tzselect.ksh
+++ b/timezone/tzselect.ksh
@@ -1,6 +1,8 @@
#! @KSH@
VERSION='@(#)tzselect.ksh 8.2'
+PKGVERSION='@PKGVERSION@'
+REPORT_BUGS_TO='@REPORT_BUGS_TO@'
# Ask the user about the time zone, and output the resulting TZ value to stdout.
# Interact with the user via stderr and stdin.
@@ -50,12 +52,13 @@ if [ "$1" = "--help" ]; then
Usage: tzselect
Select a time zone interactively.
-Report bugs to tz@elsie.nci.nih.gov.
+For bug reporting instructions, please see:
+$REPORT_BUGS_TO.
EOF
exit 0
elif [ "$1" = "--version" ]; then
cat <<EOF
-tzselect $VERSION
+tzselect $PKGVERSION$VERSION
EOF
exit 0
fi
diff --git a/timezone/zdump.c b/timezone/zdump.c
index 67bed06..da16a24 100644
--- a/timezone/zdump.c
+++ b/timezone/zdump.c
@@ -11,6 +11,7 @@ static char elsieid[] = "@(#)zdump.c 8.10";
** You can use this code to help in verifying other implementations.
*/
+#include "config.h"
#include "stdio.h" /* for stdout, stderr, perror */
#include "string.h" /* for strcpy */
#include "sys/types.h" /* for time_t */
@@ -243,8 +244,9 @@ const int status;
(void) fprintf(stream,
_("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\
\n\
-Report bugs to tz@elsie.nci.nih.gov.\n"),
- progname, progname);
+For bug reporting instructions, please see:\n\
+%s.\n"),
+ progname, progname, REPORT_BUGS_TO);
exit(status);
}
@@ -282,7 +284,7 @@ char * argv[];
progname = argv[0];
for (i = 1; i < argc; ++i)
if (strcmp(argv[i], "--version") == 0) {
- (void) printf("%s\n", elsieid);
+ (void) printf("zdump %s%s\n", PKGVERSION, elsieid);
exit(EXIT_SUCCESS);
} else if (strcmp(argv[i], "--help") == 0) {
usage(stdout, EXIT_SUCCESS);
diff --git a/timezone/zic.c b/timezone/zic.c
index 1ea7b18..60bfa1b 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -5,6 +5,7 @@
static char elsieid[] = "@(#)zic.c 8.25";
+#include "config.h"
#include "private.h"
#include "locale.h"
#include "tzfile.h"
@@ -460,8 +461,9 @@ usage(FILE *stream, int status)
[ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\
\n\
-Report bugs to tz@elsie.nci.nih.gov.\n"),
- progname, progname);
+For bug reporting instructions, please see:\n\
+%s.\n"),
+ progname, progname, REPORT_BUGS_TO);
exit(status);
}
@@ -498,7 +500,7 @@ char * argv[];
}
for (i = 1; i < argc; ++i)
if (strcmp(argv[i], "--version") == 0) {
- (void) printf("%s\n", elsieid);
+ (void) printf("zic %s%s\n", PKGVERSION, elsieid);
exit(EXIT_SUCCESS);
} else if (strcmp(argv[i], "--help") == 0) {
usage(stdout, EXIT_SUCCESS);
--
Joseph S. Myers
joseph@codesourcery.com