[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patches] pkgversion/bugurl support
- To: patches@xxxxxxxxxx
- Subject: [patches] pkgversion/bugurl support
- From: "Joseph S. Myers" <joseph@xxxxxxxxxxxxxxxx>
- Date: Fri, 26 Sep 2008 16:30:39 +0000 (UTC)
I've applied this patch to add --with-pkgversion and --with-bugurl support
for EGLIBC. These options, also supported by GCC, Binutils and GDB, allow
distributors to ensure that --version output gives information about the
version of their distributed package and that --help directs bug reports
to the distributor in the first instance rather than upstream.
Various existing --version/--help issues (not including the information
specified by the GNU Coding Standards, using stderr instead of stdout as
required by the GCS, some programs not supporting the options) are fixed.
I'll send such fixes to upstream glibc, or to the tz list in the case of
zic/zdump/tzselect taken more or less unmodified from upstream tzcode.
Index: libc/debug/pcprofiledump.c
===================================================================
--- libc/debug/pcprofiledump.c (revision 7025)
+++ libc/debug/pcprofiledump.c (working copy)
@@ -66,6 +66,10 @@
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
+/* Name and version of program. */
+static void print_version (FILE *stream, struct argp_state *state);
+void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
@@ -197,15 +201,31 @@
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;
}
return (char *) text;
}
+
+/* Print the version information. */
+static void
+print_version (FILE *stream, struct argp_state *state)
+{
+ 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\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+"), "2008");
+ fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
+}
Index: libc/debug/Makefile
===================================================================
--- libc/debug/Makefile (revision 7025)
+++ libc/debug/Makefile (working copy)
@@ -159,7 +159,9 @@
$(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 $@
@@ -168,7 +170,9 @@
$(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.
Index: libc/debug/catchsegv.sh
===================================================================
--- libc/debug/catchsegv.sh (revision 7025)
+++ libc/debug/catchsegv.sh (working copy)
@@ -35,11 +35,11 @@
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) 2008 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.
Index: libc/debug/xtrace.sh
===================================================================
--- libc/debug/xtrace.sh (revision 7025)
+++ libc/debug/xtrace.sh (working copy)
@@ -55,12 +55,12 @@
short options.
For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>.\n"
+%s.\n" "@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.
Index: libc/nscd/nscd.c
===================================================================
--- libc/nscd/nscd.c (revision 7025)
+++ libc/nscd/nscd.c (working copy)
@@ -109,7 +109,9 @@
};
/* Short description of program. */
-static const char doc[] = N_("Name Service Cache Daemon.");
+static const char doc[] = N_("Name Service Cache Daemon.\v\
+For bug reporting instructions, please see:\n\
+"REPORT_BUGS_TO".\n");
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
@@ -402,7 +404,7 @@
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\
Index: libc/config.make.in
===================================================================
--- libc/config.make.in (revision 7025)
+++ libc/config.make.in (working copy)
@@ -127,4 +127,8 @@
# Additional libraries.
LIBGD = @LIBGD@
+# Package versions and bug reporting configuration.
+PKGVERSION = @PKGVERSION@
+REPORT_BUGS_TO = @REPORT_BUGS_TO@
+
# More variables may be inserted below by configure.
Index: libc/configure.in
===================================================================
--- libc/configure.in (revision 7025)
+++ libc/configure.in (working copy)
@@ -254,6 +254,11 @@
[])
AC_SUBST(all_warnings)
+ACX_PKGVERSION([EGLIBC])
+ACX_BUGURL([http://www.eglibc.org/issues/])
+AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
+AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
+
AC_CANONICAL_HOST
# The way shlib-versions is used to generate soversions.mk uses a
Index: libc/catgets/gencat.c
===================================================================
--- libc/catgets/gencat.c (revision 7025)
+++ libc/catgets/gencat.c (working copy)
@@ -225,13 +225,16 @@
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;
}
@@ -242,7 +245,7 @@
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\
Index: libc/sysdeps/unix/sysv/linux/lddlibc4.c
===================================================================
--- libc/sysdeps/unix/sysv/linux/lddlibc4.c (revision 7025)
+++ libc/sysdeps/unix/sysv/linux/lddlibc4.c (working copy)
@@ -56,6 +56,25 @@
if (argc != 2)
return 1;
+ if (!strcmp (argv[1], "--help"))
+ {
+ printf (gettext ("Usage: lddlibc4 FILE\n\
+\n\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO);
+ return 0;
+ }
+ else if (!strcmp (argv[1], "--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\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+"), "2008");
+ return 0;
+ }
+
filename = argv[1];
/* First see whether this is really an a.out binary. */
Index: libc/nss/makedb.c
===================================================================
--- libc/nss/makedb.c (revision 7025)
+++ libc/nss/makedb.c (working copy)
@@ -224,13 +224,16 @@
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;
}
@@ -241,7 +244,7 @@
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\
Index: libc/nss/getent.c
===================================================================
--- libc/nss/getent.c (revision 7025)
+++ libc/nss/getent.c (working copy)
@@ -62,7 +62,7 @@
/* Short description of program. */
static const char doc[] = N_("Get entries from administrative database.\v\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n");
+"REPORT_BUGS_TO".\n");
/* Prototype for option handler. */
static error_t parse_option (int key, char *arg, struct argp_state *state);
@@ -80,7 +80,7 @@
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\
Index: libc/iconv/iconvconfig.c
===================================================================
--- libc/iconv/iconvconfig.c (revision 7025)
+++ libc/iconv/iconvconfig.c (working copy)
@@ -373,13 +373,16 @@
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;
}
@@ -391,7 +394,7 @@
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\
Index: libc/iconv/iconv_prog.c
===================================================================
--- libc/iconv/iconv_prog.c (revision 7025)
+++ libc/iconv/iconv_prog.c (working copy)
@@ -409,13 +409,16 @@
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;
}
@@ -427,7 +430,7 @@
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\
Index: libc/locale/programs/locale.c
===================================================================
--- libc/locale/programs/locale.c (revision 7025)
+++ libc/locale/programs/locale.c (working copy)
@@ -86,7 +86,7 @@
/* Short description of program. */
static const char doc[] = N_("Get locale-specific information.\v\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n");
+"REPORT_BUGS_TO".\n");
/* Strings for arguments in help texts. */
static const char args_doc[] = N_("NAME\n[-a|-m]");
@@ -271,7 +271,7 @@
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\
Index: libc/locale/programs/localedef.c
===================================================================
--- libc/locale/programs/localedef.c (revision 7025)
+++ libc/locale/programs/localedef.c (working copy)
@@ -389,7 +389,7 @@
%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)
+"REPORT_BUGS_TO".\n")) < 0)
return NULL;
return cp;
default:
@@ -402,7 +402,7 @@
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\
Index: libc/csu/version.c
===================================================================
--- libc/csu/version.c (revision 7025)
+++ libc/csu/version.c (working copy)
@@ -24,7 +24,7 @@
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) 2008 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\
@@ -35,7 +35,7 @@
"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>
Index: libc/malloc/mtrace.pl
===================================================================
--- libc/malloc/mtrace.pl (revision 7025)
+++ libc/malloc/mtrace.pl (working copy)
@@ -22,7 +22,8 @@
# 02111-1307 USA.
$VERSION = "@VERSION@";
-$PACKAGE = "libc";
+$PKGVERSION = "@PKGVERSION@";
+$REPORT_BUGS_TO = '@REPORT_BUGS_TO@';
$progname = $0;
sub usage {
@@ -31,7 +32,7 @@
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;
}
@@ -44,7 +45,7 @@
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) 2008 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";
Index: libc/malloc/Makefile
===================================================================
--- libc/malloc/Makefile (revision 7025)
+++ libc/malloc/Makefile (working copy)
@@ -132,13 +132,17 @@
$(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 $@
Index: libc/malloc/memusagestat.c
===================================================================
--- libc/malloc/memusagestat.c (revision 7025)
+++ libc/malloc/memusagestat.c (working copy)
@@ -38,6 +38,7 @@
#include <gdfontl.h>
#include <gdfonts.h>
+#include "../version.h"
/* Default size of the generated image. */
#define XSIZE 800
@@ -73,6 +74,10 @@
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
+/* Name and version of program. */
+static void print_version (FILE *stream, struct argp_state *state);
+void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
@@ -516,22 +521,32 @@
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;
}
return (char *) text;
}
+
+/* Print the version information. */
+static void
+print_version (FILE *stream, struct argp_state *state)
+{
+ 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\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+"), "2008");
+ fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
+}
Index: libc/malloc/memusage.sh
===================================================================
--- libc/malloc/memusage.sh (revision 7025)
+++ libc/malloc/memusage.sh (working copy)
@@ -36,7 +36,7 @@
# Print help message
do_help() {
- echo $"Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]...
+ printf $"Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]...
Profile memory usage of PROGRAM.
-n,--progname=NAME Name of the program file to profile
@@ -62,12 +62,13 @@
short options.
For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>."
+%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.
Index: libc/aclocal.m4
===================================================================
--- libc/aclocal.m4 (revision 7025)
+++ libc/aclocal.m4 (working copy)
@@ -123,3 +123,49 @@
[LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
gnu_ld=$libc_cv_prog_ld_gnu
])
+
+# 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) "
+ )
+ AC_SUBST(PKGVERSION)
+])
+
+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)
+])
Index: libc/timezone/tzselect.ksh
===================================================================
--- libc/timezone/tzselect.ksh (revision 7025)
+++ libc/timezone/tzselect.ksh (working copy)
@@ -1,6 +1,8 @@
#! @KSH@
-# '@(#)tzselect.ksh 8.1'
+VERSION='@(#)tzselect.ksh 8.1'
+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.
@@ -45,6 +47,22 @@
exit 1
}
+if [ "$1" = "--help" ]; then
+ cat <<EOF
+Usage: tzselect
+Select a time zone interactively.
+
+For bug reporting instructions, please see:
+$REPORT_BUGS_TO.
+EOF
+ exit 0
+elif [ "$1" = "--version" ]; then
+ cat <<EOF
+tzselect $PKGVERSION$VERSION
+EOF
+ exit 0
+fi
+
# Make sure the tables are readable.
TZ_COUNTRY_TABLE=$TZDIR/iso3166.tab
TZ_ZONE_TABLE=$TZDIR/zone.tab
Index: libc/timezone/Makefile
===================================================================
--- libc/timezone/Makefile (revision 7025)
+++ libc/timezone/Makefile (working copy)
@@ -182,7 +182,7 @@
$(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
gcc $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
- $(compile-mkdep-flags)
+ -DCROSS_ZIC $(compile-mkdep-flags)
$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
@@ -244,7 +244,9 @@
$(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 $@
Index: libc/timezone/zdump.c
===================================================================
--- libc/timezone/zdump.c (revision 7025)
+++ libc/timezone/zdump.c (working copy)
@@ -6,6 +6,7 @@
** 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 */
@@ -230,6 +231,18 @@
warned = TRUE;
}
+static void
+usage(const char *progname, FILE *stream, int status)
+{
+ (void) fprintf(stream,
+_("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\
+\n\
+For bug reporting instructions, please see:\n\
+%s.\n"),
+ progname, progname, REPORT_BUGS_TO);
+ exit(status);
+}
+
int
main(argc, argv)
int argc;
@@ -264,8 +277,10 @@
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(progname, stdout, EXIT_SUCCESS);
}
vflag = 0;
cutarg = NULL;
@@ -275,10 +290,7 @@
else cutarg = optarg;
if ((c != EOF && c != -1) ||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
- (void) fprintf(stderr,
-_("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
- progname, progname);
- exit(EXIT_FAILURE);
+ usage(progname, stderr, EXIT_FAILURE);
}
if (vflag) {
if (cutarg != NULL) {
Index: libc/timezone/zic.c
===================================================================
--- libc/timezone/zic.c (revision 7025)
+++ libc/timezone/zic.c (working copy)
@@ -5,6 +5,12 @@
static char elsieid[] = "@(#)zic.c 8.17";
+#ifdef CROSS_ZIC
+#define REPORT_BUGS_TO ""
+#define PKGVERSION ""
+#else
+#include "config.h"
+#endif
#include "private.h"
#include "locale.h"
#include "tzfile.h"
@@ -156,7 +162,7 @@
const struct zone * zp, int ntzones);
static void setboundaries(void);
static zic_t tadd(zic_t t1, long t2);
-static void usage(void);
+static void usage(FILE *stream, int status);
static void writezone(const char * name, const char * string);
static int yearistype(int year, const char * type);
@@ -454,13 +460,16 @@
}
static void
-usage(void)
+usage(FILE *stream, int status)
{
- (void) fprintf(stderr, _("%s: usage is %s \
-[ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
-\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"),
- progname, progname);
- exit(EXIT_FAILURE);
+ (void) fprintf(stream, _("%s: usage is %s \
+[ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
+\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\
+\n\
+For bug reporting instructions, please see:\n\
+%s.\n"),
+ progname, progname, REPORT_BUGS_TO);
+ exit(status);
}
static const char * psxrules;
@@ -496,13 +505,15 @@
}
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);
}
while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF && c != -1)
switch (c) {
default:
- usage();
+ usage(stderr, EXIT_FAILURE);
case 'd':
if (directory == NULL)
directory = optarg;
@@ -561,7 +572,7 @@
break;
}
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
- usage(); /* usage message by request */
+ usage(stderr, EXIT_FAILURE); /* usage message by request */
if (directory == NULL)
directory = TZDIR;
if (yitcommand == NULL)
Index: libc/login/programs/pt_chown.c
===================================================================
--- libc/login/programs/pt_chown.c (revision 7025)
+++ libc/login/programs/pt_chown.c (working copy)
@@ -55,7 +55,7 @@
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\
@@ -87,7 +87,7 @@
%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"));
+"REPORT_BUGS_TO".\n"));
return cp;
default:
break;
Index: libc/config.h.in
===================================================================
--- libc/config.h.in (revision 7025)
+++ libc/config.h.in (working copy)
@@ -189,6 +189,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
+
/*
*/
Index: libc/posix/getconf.c
===================================================================
--- libc/posix/getconf.c (revision 7025)
+++ libc/posix/getconf.c (working copy)
@@ -1008,16 +1008,31 @@
if (argc > 1 && strcmp (argv[1], "--version") == 0)
{
- fprintf (stderr, "getconf (GNU %s) %s\n", PACKAGE, VERSION);
- fprintf (stderr, gettext ("\
+ 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\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "2008");
- fprintf (stderr, gettext ("Written by %s.\n"), "Roland McGrath");
+ printf (gettext ("Written by %s.\n"), "Roland McGrath");
return 0;
}
+ if (argc > 1 && strcmp (argv[1], "--help") == 0)
+ {
+ printf (gettext ("\
+Usage: getconf [-v SPEC] VAR\n\
+ or: getconf [-v SPEC] PATH_VAR PATH\n\
+\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\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO);
+ return 0;
+ }
+
const char *getconf_dir = getenv ("GETCONF_DIR") ?: GETCONF_DIR;
size_t getconf_dirlen = strlen (getconf_dir);
Index: libc/sunrpc/proto.h
===================================================================
--- libc/sunrpc/proto.h (revision 7025)
+++ libc/sunrpc/proto.h (working copy)
@@ -70,4 +70,7 @@
#define __GNU_LIBRARY__
#endif
+#define REPORT_BUGS_TO ""
+#define PKGVERSION ""
+
#endif
Index: libc/sunrpc/rpcinfo.c
===================================================================
--- libc/sunrpc/rpcinfo.c (revision 7025)
+++ libc/sunrpc/rpcinfo.c (working copy)
@@ -58,6 +58,8 @@
#include <locale.h>
#include <libintl.h>
+#include "../version.h"
+
#define MAXHOSTLEN 256
#define MIN_VERS ((u_long) 0)
@@ -70,7 +72,8 @@
static bool_t reply_proc (void *res, struct sockaddr_in *who);
static void brdcst (int argc, char **argv) __attribute__ ((noreturn));
static void deletereg (int argc, char **argv);
-static void usage (void);
+static void usage (FILE *stream);
+static void print_version (void);
static u_long getprognum (char *arg);
static u_long getvers (char *arg);
static void get_inet_address (struct sockaddr_in *addr, char *host);
@@ -92,6 +95,11 @@
int errflg;
int function;
u_short portnum;
+ static const struct option long_options[] = {
+ { "help", no_argument, NULL, 'H' },
+ { "version", no_argument, NULL, 'V' },
+ { NULL, 0, NULL, 0 }
+ };
setlocale (LC_ALL, "");
textdomain (_libc_intl_domainname);
@@ -99,7 +107,7 @@
function = NONE;
portnum = 0;
errflg = 0;
- while ((c = getopt (argc, argv, "ptubdn:")) != -1)
+ while ((c = getopt_long (argc, argv, "ptubdn:", long_options, NULL)) != -1)
{
switch (c)
{
@@ -143,6 +151,14 @@
function = DELETES;
break;
+ case 'H':
+ usage (stdout);
+ return 0;
+
+ case 'V':
+ print_version ();
+ return 0;
+
case '?':
errflg = 1;
}
@@ -150,7 +166,7 @@
if (errflg || function == NONE)
{
- usage ();
+ usage (stderr);
return 1;
}
@@ -160,7 +176,7 @@
case PMAPDUMP:
if (portnum != 0)
{
- usage ();
+ usage (stderr);
return 1;
}
pmapdump (argc - optind, argv + optind);
@@ -177,7 +193,7 @@
case BRDCST:
if (portnum != 0)
{
- usage ();
+ usage (stderr);
return 1;
}
brdcst (argc - optind, argv + optind);
@@ -208,7 +224,7 @@
if (argc < 2 || argc > 3)
{
- usage ();
+ usage (stderr);
exit (1);
}
prognum = getprognum (argv[1]);
@@ -363,7 +379,7 @@
if (argc < 2 || argc > 3)
{
- usage ();
+ usage (stderr);
exit (1);
}
prognum = getprognum (argv[1]);
@@ -532,7 +548,7 @@
if (argc > 1)
{
- usage ();
+ usage (stderr);
exit (1);
}
if (argc == 1)
@@ -624,7 +640,7 @@
if (argc != 2)
{
- usage ();
+ usage (stderr);
exit (1);
}
prognum = getprognum (argv[0]);
@@ -650,7 +666,7 @@
if (argc != 2)
{
- usage ();
+ usage (stderr);
exit (1);
}
if (getuid ())
@@ -669,17 +685,26 @@
}
static void
-usage ()
+usage (FILE *stream)
{
fputs (_("Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"),
- stderr);
+ stream);
fputs (_(" rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"),
- stderr);
- fputs (_(" rpcinfo -p [ host ]\n"), stderr);
- fputs (_(" rpcinfo -b prognum versnum\n"), stderr);
- fputs (_(" rpcinfo -d prognum versnum\n"), stderr);
+ stream);
+ fputs (_(" rpcinfo -p [ host ]\n"), stream);
+ fputs (_(" rpcinfo -b prognum versnum\n"), stream);
+ fputs (_(" rpcinfo -d prognum versnum\n"), stream);
+ fprintf (stream, _("\n\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO);
}
+static void
+print_version (void)
+{
+ printf ("rpcinfo %s%s\n", PKGVERSION, VERSION);
+}
+
static u_long
getprognum (arg)
char *arg;
Index: libc/sunrpc/rpc_main.c
===================================================================
--- libc/sunrpc/rpc_main.c (revision 7025)
+++ libc/sunrpc/rpc_main.c (working copy)
@@ -52,6 +52,8 @@
#include "rpc_scan.h"
#include "proto.h"
+#include "../version.h"
+
#define EXTEND 1 /* alias for TRUE */
#define DONT_EXTEND 0 /* alias for FALSE */
@@ -132,8 +134,9 @@
static void putarg (int whereto, const char *cp);
static void checkfiles (const char *infile, const char *outfile);
static int parseargs (int argc, const char *argv[], struct commandline *cmd);
-static void usage (void) __attribute__ ((noreturn));
-static void options_usage (void) __attribute__ ((noreturn));
+static void usage (FILE *stream, int status) __attribute__ ((noreturn));
+static void options_usage (FILE *stream, int status) __attribute__ ((noreturn));
+static void print_version (void);
static void c_initialize (void);
static char *generate_guard (const char *pathname);
@@ -185,7 +188,7 @@
(void) memset ((char *) &cmd, 0, sizeof (struct commandline));
clear_args ();
if (!parseargs (argc, argv, &cmd))
- usage ();
+ usage (stderr, 1);
if (cmd.cflag || cmd.hflag || cmd.lflag || cmd.tflag || cmd.sflag ||
cmd.mflag || cmd.nflag || cmd.Ssflag || cmd.Scflag)
@@ -787,7 +790,7 @@
{
if (outfilename)
unlink (outfilename);
- usage ();
+ usage (stderr, 1);
}
write_rest ();
}
@@ -1214,6 +1217,10 @@
}
cmd->infile = argv[i];
}
+ else if (!strcmp (argv[i], "--help"))
+ usage (stdout, 0);
+ else if (!strcmp (argv[i], "--version"))
+ print_version ();
else
{
for (j = 1; argv[i][j] != 0; j++)
@@ -1438,46 +1445,56 @@
}
static void
-usage (void)
+usage (FILE *stream, int status)
{
- fprintf (stderr, _("usage: %s infile\n"), cmdname);
- fprintf (stderr, _("\t%s [-abkCLNTM][-Dname[=value]] [-i size] \
+ fprintf (stream, _("usage: %s infile\n"), cmdname);
+ fprintf (stream, _("\t%s [-abkCLNTM][-Dname[=value]] [-i size] \
[-I [-K seconds]] [-Y path] infile\n"), cmdname);
- fprintf (stderr, _("\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] \
+ fprintf (stream, _("\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] \
[-o outfile] [infile]\n"), cmdname);
- fprintf (stderr, _("\t%s [-s nettype]* [-o outfile] [infile]\n"), cmdname);
- fprintf (stderr, _("\t%s [-n netid]* [-o outfile] [infile]\n"), cmdname);
- options_usage ();
- exit (1);
+ fprintf (stream, _("\t%s [-s nettype]* [-o outfile] [infile]\n"), cmdname);
+ fprintf (stream, _("\t%s [-n netid]* [-o outfile] [infile]\n"), cmdname);
+ options_usage (stream, status);
+ exit (status);
}
static void
-options_usage (void)
+options_usage (FILE *stream, int status)
{
- f_print (stderr, "options:\n");
- f_print (stderr, "-a\t\tgenerate all files, including samples\n");
- f_print (stderr, "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n");
- f_print (stderr, "-c\t\tgenerate XDR routines\n");
- f_print (stderr, "-C\t\tANSI C mode\n");
- f_print (stderr, "-Dname[=value]\tdefine a symbol (same as #define)\n");
- f_print (stderr, "-h\t\tgenerate header file\n");
- f_print (stderr, "-i size\t\tsize at which to start generating inline code\n");
- f_print (stderr, "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n");
- f_print (stderr, "-K seconds\tserver exits after K seconds of inactivity\n");
- f_print (stderr, "-l\t\tgenerate client side stubs\n");
- f_print (stderr, "-L\t\tserver errors will be printed to syslog\n");
- f_print (stderr, "-m\t\tgenerate server side stubs\n");
- f_print (stderr, "-M\t\tgenerate MT-safe code\n");
- f_print (stderr, "-n netid\tgenerate server code that supports named netid\n");
- f_print (stderr, "-N\t\tsupports multiple arguments and call-by-value\n");
- f_print (stderr, "-o outfile\tname of the output file\n");
- f_print (stderr, "-s nettype\tgenerate server code that supports named nettype\n");
- f_print (stderr, "-Sc\t\tgenerate sample client code that uses remote procedures\n");
- f_print (stderr, "-Ss\t\tgenerate sample server code that defines remote procedures\n");
- f_print (stderr, "-Sm \t\tgenerate makefile template \n");
- f_print (stderr, "-t\t\tgenerate RPC dispatch table\n");
- f_print (stderr, "-T\t\tgenerate code to support RPC dispatch tables\n");
- f_print (stderr, "-Y path\t\tdirectory name to find C preprocessor (cpp)\n");
+ f_print (stream, "options:\n");
+ f_print (stream, "-a\t\tgenerate all files, including samples\n");
+ f_print (stream, "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n");
+ f_print (stream, "-c\t\tgenerate XDR routines\n");
+ f_print (stream, "-C\t\tANSI C mode\n");
+ f_print (stream, "-Dname[=value]\tdefine a symbol (same as #define)\n");
+ f_print (stream, "-h\t\tgenerate header file\n");
+ f_print (stream, "-i size\t\tsize at which to start generating inline code\n");
+ f_print (stream, "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n");
+ f_print (stream, "-K seconds\tserver exits after K seconds of inactivity\n");
+ f_print (stream, "-l\t\tgenerate client side stubs\n");
+ f_print (stream, "-L\t\tserver errors will be printed to syslog\n");
+ f_print (stream, "-m\t\tgenerate server side stubs\n");
+ f_print (stream, "-M\t\tgenerate MT-safe code\n");
+ f_print (stream, "-n netid\tgenerate server code that supports named netid\n");
+ f_print (stream, "-N\t\tsupports multiple arguments and call-by-value\n");
+ f_print (stream, "-o outfile\tname of the output file\n");
+ f_print (stream, "-s nettype\tgenerate server code that supports named nettype\n");
+ f_print (stream, "-Sc\t\tgenerate sample client code that uses remote procedures\n");
+ f_print (stream, "-Ss\t\tgenerate sample server code that defines remote procedures\n");
+ f_print (stream, "-Sm \t\tgenerate makefile template \n");
+ f_print (stream, "-t\t\tgenerate RPC dispatch table\n");
+ 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");
- exit (1);
+ f_print (stream, "\n\
+For bug reporting instructions, please see:\n\
+%s.\n", REPORT_BUGS_TO);
+ exit (status);
}
+
+static void
+print_version (void)
+{
+ printf ("rpcgen %s%s\n", PKGVERSION, VERSION);
+ exit (0);
+}
Index: libc/manual/libc.texinfo
===================================================================
--- libc/manual/libc.texinfo (revision 7025)
+++ libc/manual/libc.texinfo (working copy)
@@ -11,6 +11,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
@@ -27,7 +29,8 @@
This file documents the GNU C library.
This is Edition @value{EDITION}, last updated @value{UPDATED},
-of @cite{The GNU C Library Reference Manual}, for version @value{VERSION}.
+of @cite{The GNU C Library Reference Manual}, for version
+@value{VERSION} @value{PKGVERSION}.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
2003, 2007, 2008 Free Software Foundation, Inc.
@@ -63,6 +66,8 @@
@center last updated @value{UPDATED}
@sp 1
@center for version @value{VERSION}
+@sp 1
+@center @value{PKGVERSION}
@page
@vskip 0pt plus 1filll
@insertcopying
@@ -87,6 +92,7 @@
@top Main Menu
This is Edition @value{EDITION}, last updated @value{UPDATED}, of
@cite{The GNU C Library Reference Manual}, for Version @value{VERSION}
+@value{PKGVERSION}
of the GNU C Library.
@end ifnottex
Index: libc/manual/Makefile
===================================================================
--- libc/manual/Makefile (revision 7025)
+++ libc/manual/Makefile (working copy)
@@ -76,11 +76,12 @@
AWK=$(AWK) $(SHELL) $< '$(chapters)' '$(add-chapters)' '$(appendices)'
libc.dvi libc.pdf libc.info: chapters.texi top-menu.texi dir-add.texi \
- libm-err.texi
+ libm-err.texi pkgvers.texi
libc.dvi libc.pdf: texinfo.tex
html: libc/index.html
-libc/index.html: chapters.texi top-menu.texi dir-add.texi libm-err.texi
+libc/index.html: chapters.texi top-menu.texi dir-add.texi libm-err.texi \
+ pkgvers.texi
$(MAKEINFO) --html libc.texinfo
# Generate the summary from the Texinfo source files for each chapter.
@@ -109,6 +110,14 @@
$(move-if-change) libm-err-tmp libm-err.texi
touch $@
+# Package version and bug reporting URL.
+pkgvers.texi: stamp-pkgvers
+stamp-pkgvers:
+ echo "@set PKGVERSION $(PKGVERSION)" > pkgvers-tmp
+ echo "@set REPORT_BUGS_TO $(REPORT_BUGS_TO)" >> pkgvers-tmp
+ $(move-if-change) pkgvers-tmp pkgvers.texi
+ touch $@
+
# Generate Texinfo files from the C source for the example programs.
%.c.texi: examples/%.c
sed -e 's,[{}],@&,g' \
Index: libc/manual/install.texi
===================================================================
--- libc/manual/install.texi (revision 7025)
+++ libc/manual/install.texi (working copy)
@@ -476,7 +476,8 @@
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 GNU C library
+bug tracking system has a
WWW interface at
@url{http://sources.redhat.com/bugzilla/}. The WWW
interface gives you access to open and closed reports. A closed report
@@ -501,7 +502,7 @@
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
Index: libc/configure
===================================================================
--- libc/configure (revision 7025)
+++ libc/configure (working copy)
@@ -313,7 +313,7 @@
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR NM OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH_SHELL libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_gnu89_inline libc_cv_have_initfini no_whole_archive exceptions libc_cv_cc_submachine LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR NM OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH_SHELL libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_gnu89_inline libc_cv_have_initfini no_whole_archive exceptions libc_cv_cc_submachine LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -905,6 +905,8 @@
default]
--with-tls enable support for TLS
--without-__thread do not use TLS features even when supporting them
+ --with-pkgversion=PKG Use PKG in the version string in place of "EGLIBC"
+ --with-bugurl=URL Direct users to URL to report a bug
--with-cpu=CPU select code for CPU variant
Some influential environment variables:
@@ -1692,6 +1694,66 @@
fi;
+
+
+# Check whether --with-pkgversion or --without-pkgversion was given.
+if test "${with_pkgversion+set}" = set; then
+ withval="$with_pkgversion"
+ case "$withval" in
+ yes) { { echo "$as_me:$LINENO: error: package version not specified" >&5
+echo "$as_me: error: package version not specified" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ no) PKGVERSION= ;;
+ *) PKGVERSION="($withval) " ;;
+ esac
+else
+ PKGVERSION="(EGLIBC) "
+
+fi;
+
+
+
+
+# Check whether --with-bugurl or --without-bugurl was given.
+if test "${with_bugurl+set}" = set; then
+ withval="$with_bugurl"
+ case "$withval" in
+ yes) { { echo "$as_me:$LINENO: error: bug URL not specified" >&5
+echo "$as_me: error: bug URL not specified" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ no) BUGURL=
+ ;;
+ *) BUGURL="$withval"
+ ;;
+ esac
+else
+ BUGURL="http://www.eglibc.org/issues/"
+
+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
+
+
# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
{ { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
@@ -8499,6 +8561,9 @@
s,@bindnow@,$bindnow,;t t
s,@force_install@,$force_install,;t t
s,@all_warnings@,$all_warnings,;t t
+s,@PKGVERSION@,$PKGVERSION,;t t
+s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t
+s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t
s,@build@,$build,;t t
s,@build_cpu@,$build_cpu,;t t
s,@build_vendor@,$build_vendor,;t t
Index: libc/ChangeLog.eglibc
===================================================================
--- libc/ChangeLog.eglibc (revision 7025)
+++ libc/ChangeLog.eglibc (working copy)
@@ -1,3 +1,84 @@
+2008-09-26 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * aclocal.m4 (ACX_PKGVERSION, ACX_BUGURL): Define.
+ * configure.in: Use ACX_PKGVERSION and ACX_BUGURL.
+ * configure: Regenerate.
+ * config.h.in (PKGVERSION, REPORT_BUGS_TO): Undefine.
+ * config.make.in (PKGVERSION, REPORT_BUGS_TO): Define.
+ * 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, $(objpfx)xtrace): Also
+ substitute PKGVERSION and REPORT_BUGS_TO.
+ * debug/catchsegv.sh: Use PKGVERSION and REPORT_BUGS_TO.
+ * debug/pcprofiledump.c (print_version,
+ argp_program_version_hook): New.
+ (more_help): Use REPORT_BUGS_TO.
+ * debug/xtrace.sh: Use PKGVERSION and REPORT_BUGS_TO.
+ * elf/Makefile (common-ldd-rewrite): Also substitute PKGVERSION
+ and REPORT_BUGS_TO.
+ * elf/dl-close.c (_dl_close_worker): Use REPORT_BUGS_TO.
+ * elf/ldconfig.c (doc): Use REPORT_BUGS_TO.
+ (print_version): Use PKGVERSION.
+ * elf/ldd.bash.in: Use PKGVERSION and REPORT_BUGS_TO.
+ * elf/sln.c (usage): New.
+ (main): Support --help and --version.
+ * elf/sprof.c (doc): 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 (doc): 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
+ * malloc/Makefile ($(objpfx)mtrace, $(objpfx)memusage): Also
+ substitute PKGVERSION and REPORT_BUGS_TO.
+ * malloc/memusage.sh: Use PKGVERSION and REPORT_BUGS_TO.
+ * malloc/memusagestat.c (print_version,
+ argp_program_version_hook): New.
+ (more_help): Use REPORT_BUGS_TO.
+ * malloc/mtrace.pl: Use PKGVERSION and REPORT_BUGS_TO.
+ * manual/Makefile (libc.dvi, libc.pdf, libc.info,
+ libc/index.html): Depend on pkgvers.texi.
+ (pkgvers.texi, stamp-pkgvers): New.
+ * manual/install.texi: Adjust bug database description. Use
+ REPORT_BUGS_TO.
+ * manual/libc.texinfo: Include pkgvers.texi. Use PKGVERSION.
+ * nscd/nscd.c (doc): Use REPORT_BUGS_TO.
+ (print_version): Use PKGVERSION.
+ * nss/getent.c (doc): 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): Send --version output to stdout. Use
+ PKGVERSION. Support --help.
+ * sunrpc/proto.h (REPORT_BUGS_TO, PKGVERSION): Define for
+ cross-rpcgen.
+ * sunrpc/rpc_main.c (usage, options_usage): Take STREAM and STATUS
+ arguments. All callers changed. Use REPORT_BUGS_TO
+ (print_version): New.
+ (parseargs): Support --help and --version.
+ * sunrpc/rpcinfo.c (usage): Take STREAM argument. All callers
+ changed. Use REPORT_BUGS_TO.
+ (print_version): New.
+ (main): Use getopt_long. Support --help and --version.
+ * sysdeps/unix/sysv/linux/lddlibc4.c (main): Support --help and
+ --version.
+ * timezone/Makefile: Use -DCROSS_ZIC for cross-zic.
+ ($(objpfx)tzselect): Also substitute PKGVERSION and
+ REPORT_BUGS_TO.
+ * timezone/tzselect.ksh: Support --help and --version.
+ * timezone/zdump.c (usage): New.
+ (main): Use it. Support --help. Print program name and
+ PKGVERSION in --version output.
+ * timezone/zic.c (usage): Take STREAM and STATUS arguments. All
+ callers changed. Use REPORT_BUGS_TO.
+ (main): Support --help. Print program name and PKGVERSION in
+ --version output.
+
2008-09-24 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
* csu/Makefile ($(objpfx)crti.S, $(objpfx)crtn.S): Remove .file
Index: libc/elf/Makefile
===================================================================
--- libc/elf/Makefile (revision 7025)
+++ libc/elf/Makefile (working copy)
@@ -355,7 +355,9 @@
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'
Index: libc/elf/sprof.c
===================================================================
--- libc/elf/sprof.c (revision 7025)
+++ libc/elf/sprof.c (working copy)
@@ -88,7 +88,7 @@
/* Short description of program. */
static const char doc[] = N_("Read and display shared object profiling data.\v\
For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n");
+"REPORT_BUGS_TO".\n");
/* Strings for arguments in help texts. */
static const char args_doc[] = N_("SHOBJ [PROFDATA]");
@@ -351,7 +351,7 @@
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\
Index: libc/elf/dl-close.c
===================================================================
--- libc/elf/dl-close.c (revision 7025)
+++ libc/elf/dl-close.c (working copy)
@@ -669,7 +669,7 @@
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;
Index: libc/elf/ldd.bash.in
===================================================================
--- libc/elf/ldd.bash.in (revision 7025)
+++ libc/elf/ldd.bash.in (working copy)
@@ -35,7 +35,7 @@
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.
@@ -45,7 +45,7 @@
exit 0
;;
--h | --he | --hel | --help)
- echo $"Usage: ldd [OPTION]... FILE...
+ printf $"Usage: ldd [OPTION]... FILE...
--help print this help and exit
--version print version information and exit
-d, --data-relocs process data relocations
@@ -53,7 +53,8 @@
-u, --unused print unused direct dependencies
-v, --verbose print all information
For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>."
+%s.
+" "@REPORT_BUGS_TO@"
exit 0
;;
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
Index: libc/elf/sln.c
===================================================================
--- libc/elf/sln.c (revision 7025)
+++ libc/elf/sln.c (working copy)
@@ -28,12 +28,15 @@
#include <string.h>
#include <limits.h>
+#include "../version.h"
+
#if !defined S_ISDIR && defined S_IFDIR
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
static int makesymlink (const char *src, const char *dest);
static int makesymlinks (const char *file);
+static void usage (void);
int
main (int argc, char **argv)
@@ -41,6 +44,13 @@
switch (argc)
{
case 2:
+ if (!strcmp (argv[1], "--version")) {
+ printf ("sln %s%s\n", PKGVERSION, VERSION);
+ return 0;
+ } else if (!strcmp (argv[1], "--help")) {
+ usage ();
+ return 0;
+ }
return makesymlinks (argv [1]);
break;
@@ -49,12 +59,21 @@
break;
default:
- printf ("Usage: %s src dest|file\n", argv [0]);
+ usage ();
return 1;
break;
}
}
+static void
+usage (void)
+{
+ printf ("Usage: sln src dest|file\n\
+\n\
+For bug reporting instructions, please see:\n\
+%s.\n", REPORT_BUGS_TO);
+}
+
static int
makesymlinks (file)
const char *file;
Index: libc/elf/ldconfig.c
===================================================================
--- libc/elf/ldconfig.c (revision 7025)
+++ libc/elf/ldconfig.c (working copy)
@@ -153,7 +153,9 @@
#include <dl-procinfo.c>
/* Short description of program. */
-static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
+static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.\v\
+For bug reporting instructions, please see:\n\
+"REPORT_BUGS_TO".\n");
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
@@ -292,7 +294,7 @@
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\
Index: localedef/config.h.in
===================================================================
--- localedef/config.h.in (revision 7025)
+++ localedef/config.h.in (working copy)
@@ -174,5 +174,11 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* Additional package description */
+#undef PKGVERSION
+
+/* Bug reporting address */
+#undef REPORT_BUGS_TO
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
Index: localedef/configure
===================================================================
--- localedef/configure (revision 7025)
+++ localedef/configure (working copy)
@@ -308,7 +308,7 @@
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S CPP EGREP LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S CPP EGREP PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -845,6 +845,8 @@
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-glibc=PATH specify location of glibc sources
+ --with-pkgversion=PKG Use PKG in the version string in place of "EGLIBC"
+ --with-bugurl=URL Direct users to URL to report a bug
Some influential environment variables:
CC C compiler command
@@ -4920,6 +4922,70 @@
fi
+# These two macros are taken from GCC's config/acx.m4.
+
+
+
+
+
+# Check whether --with-pkgversion or --without-pkgversion was given.
+if test "${with_pkgversion+set}" = set; then
+ withval="$with_pkgversion"
+ case "$withval" in
+ yes) { { echo "$as_me:$LINENO: error: package version not specified" >&5
+echo "$as_me: error: package version not specified" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ no) PKGVERSION= ;;
+ *) PKGVERSION="($withval) " ;;
+ esac
+else
+ PKGVERSION="(EGLIBC) "
+
+fi;
+
+
+
+
+# Check whether --with-bugurl or --without-bugurl was given.
+if test "${with_bugurl+set}" = set; then
+ withval="$with_bugurl"
+ case "$withval" in
+ yes) { { echo "$as_me:$LINENO: error: bug URL not specified" >&5
+echo "$as_me: error: bug URL not specified" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ no) BUGURL=
+ ;;
+ *) BUGURL="$withval"
+ ;;
+ esac
+else
+ BUGURL="http://www.eglibc.org/issues/"
+
+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
+
+
rm -f glibc && $LN_S $with_glibc glibc
case $build_os in
solaris*)
@@ -5552,6 +5618,9 @@
s,@LN_S@,$LN_S,;t t
s,@CPP@,$CPP,;t t
s,@EGREP@,$EGREP,;t t
+s,@PKGVERSION@,$PKGVERSION,;t t
+s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t
+s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
Index: localedef/configure.ac
===================================================================
--- localedef/configure.ac (revision 7025)
+++ localedef/configure.ac (working copy)
@@ -59,6 +59,56 @@
AC_CHECK_LIB([intl], [gettext])
AC_CHECK_LIB([posix4], [nanosleep])
+# 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) "
+ )
+ AC_SUBST(PKGVERSION)
+])
+
+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)
+])
+ACX_PKGVERSION([EGLIBC])
+ACX_BUGURL([http://www.eglibc.org/issues/])
+AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
+AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
+
rm -f glibc && $LN_S $with_glibc glibc
case $build_os in
solaris*)
Index: localedef/ChangeLog.eglibc
===================================================================
--- localedef/ChangeLog.eglibc (revision 7025)
+++ localedef/ChangeLog.eglibc (working copy)
@@ -1,3 +1,8 @@
+2008-09-26 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * configure.ac: Support --with-pkgversion and --with-bugurl.
+ * configure, config.h.in: Regenerate.
+
2007-11-07 Daniel Jacobowitz <dan@xxxxxxxxxxxxxxxx>
* include/gnu/option-groups.h: New file.
--
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx