[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r7026 - in /trunk: libc/ libc/catgets/ libc/csu/ libc/debug/ libc/elf/ libc/iconv/ libc/locale/programs/ libc/login/programs...



Author: joseph
Date: Fri Sep 26 09:27:00 2008
New Revision: 7026

Log:
libc:
	* 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.

localedef:
	* configure.ac: Support --with-pkgversion and --with-bugurl.
	* configure, config.h.in: Regenerate.

Modified:
    trunk/libc/ChangeLog.eglibc
    trunk/libc/aclocal.m4
    trunk/libc/catgets/gencat.c
    trunk/libc/config.h.in
    trunk/libc/config.make.in
    trunk/libc/configure
    trunk/libc/configure.in
    trunk/libc/csu/version.c
    trunk/libc/debug/Makefile
    trunk/libc/debug/catchsegv.sh
    trunk/libc/debug/pcprofiledump.c
    trunk/libc/debug/xtrace.sh
    trunk/libc/elf/Makefile
    trunk/libc/elf/dl-close.c
    trunk/libc/elf/ldconfig.c
    trunk/libc/elf/ldd.bash.in
    trunk/libc/elf/sln.c
    trunk/libc/elf/sprof.c
    trunk/libc/iconv/iconv_prog.c
    trunk/libc/iconv/iconvconfig.c
    trunk/libc/locale/programs/locale.c
    trunk/libc/locale/programs/localedef.c
    trunk/libc/login/programs/pt_chown.c
    trunk/libc/malloc/Makefile
    trunk/libc/malloc/memusage.sh
    trunk/libc/malloc/memusagestat.c
    trunk/libc/malloc/mtrace.pl
    trunk/libc/manual/Makefile
    trunk/libc/manual/install.texi
    trunk/libc/manual/libc.texinfo
    trunk/libc/nscd/nscd.c
    trunk/libc/nss/getent.c
    trunk/libc/nss/makedb.c
    trunk/libc/posix/getconf.c
    trunk/libc/sunrpc/proto.h
    trunk/libc/sunrpc/rpc_main.c
    trunk/libc/sunrpc/rpcinfo.c
    trunk/libc/sysdeps/unix/sysv/linux/lddlibc4.c
    trunk/libc/timezone/Makefile
    trunk/libc/timezone/tzselect.ksh
    trunk/libc/timezone/zdump.c
    trunk/libc/timezone/zic.c
    trunk/localedef/ChangeLog.eglibc
    trunk/localedef/config.h.in
    trunk/localedef/configure
    trunk/localedef/configure.ac

Modified: trunk/libc/ChangeLog.eglibc
==============================================================================
--- trunk/libc/ChangeLog.eglibc (original)
+++ trunk/libc/ChangeLog.eglibc Fri Sep 26 09:27:00 2008
@@ -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

Modified: trunk/libc/aclocal.m4
==============================================================================
--- trunk/libc/aclocal.m4 (original)
+++ trunk/libc/aclocal.m4 Fri Sep 26 09:27:00 2008
@@ -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)
+])

Modified: trunk/libc/catgets/gencat.c
==============================================================================
--- trunk/libc/catgets/gencat.c (original)
+++ trunk/libc/catgets/gencat.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/config.h.in
==============================================================================
--- trunk/libc/config.h.in (original)
+++ trunk/libc/config.h.in Fri Sep 26 09:27:00 2008
@@ -188,6 +188,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
 
 /*
  */

Modified: trunk/libc/config.make.in
==============================================================================
--- trunk/libc/config.make.in (original)
+++ trunk/libc/config.make.in Fri Sep 26 09:27:00 2008
@@ -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.

Modified: trunk/libc/configure
==============================================================================
--- trunk/libc/configure (original)
+++ trunk/libc/configure Fri Sep 26 09:27:00 2008
@@ -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:
@@ -1690,6 +1692,66 @@
   enableval="$enable_all_warnings"
   all_warnings=$enableval
 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.
@@ -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

Modified: trunk/libc/configure.in
==============================================================================
--- trunk/libc/configure.in (original)
+++ trunk/libc/configure.in Fri Sep 26 09:27:00 2008
@@ -253,6 +253,11 @@
 	      [all_warnings=$enableval],
 	      [])
 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
 

Modified: trunk/libc/csu/version.c
==============================================================================
--- trunk/libc/csu/version.c (original)
+++ trunk/libc/csu/version.c Fri Sep 26 09:27:00 2008
@@ -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>
 

Modified: trunk/libc/debug/Makefile
==============================================================================
--- trunk/libc/debug/Makefile (original)
+++ trunk/libc/debug/Makefile Fri Sep 26 09:27:00 2008
@@ -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.

Modified: trunk/libc/debug/catchsegv.sh
==============================================================================
--- trunk/libc/debug/catchsegv.sh (original)
+++ trunk/libc/debug/catchsegv.sh Fri Sep 26 09:27:00 2008
@@ -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.

Modified: trunk/libc/debug/pcprofiledump.c
==============================================================================
--- trunk/libc/debug/pcprofiledump.c (original)
+++ trunk/libc/debug/pcprofiledump.c Fri Sep 26 09:27:00 2008
@@ -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");
+}

Modified: trunk/libc/debug/xtrace.sh
==============================================================================
--- trunk/libc/debug/xtrace.sh (original)
+++ trunk/libc/debug/xtrace.sh Fri Sep 26 09:27:00 2008
@@ -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.

Modified: trunk/libc/elf/Makefile
==============================================================================
--- trunk/libc/elf/Makefile (original)
+++ trunk/libc/elf/Makefile Fri Sep 26 09:27:00 2008
@@ -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'

Modified: trunk/libc/elf/dl-close.c
==============================================================================
--- trunk/libc/elf/dl-close.c (original)
+++ trunk/libc/elf/dl-close.c Fri Sep 26 09:27:00 2008
@@ -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;

Modified: trunk/libc/elf/ldconfig.c
==============================================================================
--- trunk/libc/elf/ldconfig.c (original)
+++ trunk/libc/elf/ldconfig.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/elf/ldd.bash.in
==============================================================================
--- trunk/libc/elf/ldd.bash.in (original)
+++ trunk/libc/elf/ldd.bash.in Fri Sep 26 09:27:00 2008
@@ -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 | \

Modified: trunk/libc/elf/sln.c
==============================================================================
--- trunk/libc/elf/sln.c (original)
+++ trunk/libc/elf/sln.c Fri Sep 26 09:27:00 2008
@@ -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,10 +59,19 @@
       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

Modified: trunk/libc/elf/sprof.c
==============================================================================
--- trunk/libc/elf/sprof.c (original)
+++ trunk/libc/elf/sprof.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/iconv/iconv_prog.c
==============================================================================
--- trunk/libc/iconv/iconv_prog.c (original)
+++ trunk/libc/iconv/iconv_prog.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/iconv/iconvconfig.c
==============================================================================
--- trunk/libc/iconv/iconvconfig.c (original)
+++ trunk/libc/iconv/iconvconfig.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/locale/programs/locale.c
==============================================================================
--- trunk/libc/locale/programs/locale.c (original)
+++ trunk/libc/locale/programs/locale.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/locale/programs/localedef.c
==============================================================================
--- trunk/libc/locale/programs/localedef.c (original)
+++ trunk/libc/locale/programs/localedef.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/login/programs/pt_chown.c
==============================================================================
--- trunk/libc/login/programs/pt_chown.c (original)
+++ trunk/libc/login/programs/pt_chown.c Fri Sep 26 09:27:00 2008
@@ -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;

Modified: trunk/libc/malloc/Makefile
==============================================================================
--- trunk/libc/malloc/Makefile (original)
+++ trunk/libc/malloc/Makefile Fri Sep 26 09:27:00 2008
@@ -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 $@
 
 

Modified: trunk/libc/malloc/memusage.sh
==============================================================================
--- trunk/libc/malloc/memusage.sh (original)
+++ trunk/libc/malloc/memusage.sh Fri Sep 26 09:27:00 2008
@@ -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.

Modified: trunk/libc/malloc/memusagestat.c
==============================================================================
--- trunk/libc/malloc/memusagestat.c (original)
+++ trunk/libc/malloc/memusagestat.c Fri Sep 26 09:27:00 2008
@@ -38,6 +38,7 @@
 #include <gdfontl.h>
 #include <gdfonts.h>
 
+#include "../version.h"
 
 /* Default size of the generated image.  */
 #define XSIZE 800
@@ -72,6 +73,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");
+}

Modified: trunk/libc/malloc/mtrace.pl
==============================================================================
--- trunk/libc/malloc/mtrace.pl (original)
+++ trunk/libc/malloc/mtrace.pl Fri Sep 26 09:27:00 2008
@@ -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";

Modified: trunk/libc/manual/Makefile
==============================================================================
--- trunk/libc/manual/Makefile (original)
+++ trunk/libc/manual/Makefile Fri Sep 26 09:27:00 2008
@@ -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.
@@ -107,6 +108,14 @@
 	pwd=`pwd`; \
 	$(PERL) $< $$pwd/.. > libm-err-tmp
 	$(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.

Modified: trunk/libc/manual/install.texi
==============================================================================
--- trunk/libc/manual/install.texi (original)
+++ trunk/libc/manual/install.texi Fri Sep 26 09:27:00 2008
@@ -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

Modified: trunk/libc/manual/libc.texinfo
==============================================================================
--- trunk/libc/manual/libc.texinfo (original)
+++ trunk/libc/manual/libc.texinfo Fri Sep 26 09:27:00 2008
@@ -10,6 +10,8 @@
 * Libc: (libc).                 C library.
 @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.
@@ -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
 

Modified: trunk/libc/nscd/nscd.c
==============================================================================
--- trunk/libc/nscd/nscd.c (original)
+++ trunk/libc/nscd/nscd.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/nss/getent.c
==============================================================================
--- trunk/libc/nss/getent.c (original)
+++ trunk/libc/nss/getent.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/nss/makedb.c
==============================================================================
--- trunk/libc/nss/makedb.c (original)
+++ trunk/libc/nss/makedb.c Fri Sep 26 09:27:00 2008
@@ -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\

Modified: trunk/libc/posix/getconf.c
==============================================================================
--- trunk/libc/posix/getconf.c (original)
+++ trunk/libc/posix/getconf.c Fri Sep 26 09:27:00 2008
@@ -1008,13 +1008,28 @@
 
   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;
     }
 

Modified: trunk/libc/sunrpc/proto.h
==============================================================================
--- trunk/libc/sunrpc/proto.h (original)
+++ trunk/libc/sunrpc/proto.h Fri Sep 26 09:27:00 2008
@@ -70,4 +70,7 @@
 #define __GNU_LIBRARY__
 #endif
 
+#define REPORT_BUGS_TO ""
+#define PKGVERSION ""
+
 #endif

Modified: trunk/libc/sunrpc/rpc_main.c
==============================================================================
--- trunk/libc/sunrpc/rpc_main.c (original)
+++ trunk/libc/sunrpc/rpc_main.c Fri Sep 26 09:27:00 2008
@@ -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)
-{
-  fprintf (stderr, _("usage: %s infile\n"), cmdname);
-  fprintf (stderr, _("\t%s [-abkCLNTM][-Dname[=value]] [-i size] \
+usage (FILE *stream, int status)
+{
+  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);
-}
-
-static void
-options_usage (void)
-{
-  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");
-
-  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 (FILE *stream, int status)
+{
+  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");
+
+  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);
+}

Modified: trunk/libc/sunrpc/rpcinfo.c
==============================================================================
--- trunk/libc/sunrpc/rpcinfo.c (original)
+++ trunk/libc/sunrpc/rpcinfo.c Fri Sep 26 09:27:00 2008
@@ -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,15 +685,24 @@
 }
 
 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

Modified: trunk/libc/sysdeps/unix/sysv/linux/lddlibc4.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/lddlibc4.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/lddlibc4.c Fri Sep 26 09:27:00 2008
@@ -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.  */

Modified: trunk/libc/timezone/Makefile
==============================================================================
--- trunk/libc/timezone/Makefile (original)
+++ trunk/libc/timezone/Makefile Fri Sep 26 09:27:00 2008
@@ -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 $@
 

Modified: trunk/libc/timezone/tzselect.ksh
==============================================================================
--- trunk/libc/timezone/tzselect.ksh (original)
+++ trunk/libc/timezone/tzselect.ksh Fri Sep 26 09:27:00 2008
@@ -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.
@@ -44,6 +46,22 @@
 	echo >&2 "$0: Sorry, your \`$AWK' program is not Posix compatible."
 	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

Modified: trunk/libc/timezone/zdump.c
==============================================================================
--- trunk/libc/timezone/zdump.c (original)
+++ trunk/libc/timezone/zdump.c Fri Sep 26 09:27:00 2008
@@ -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) {

Modified: trunk/libc/timezone/zic.c
==============================================================================
--- trunk/libc/timezone/zic.c (original)
+++ trunk/libc/timezone/zic.c Fri Sep 26 09:27:00 2008
@@ -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)
-{
-	(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);
+usage(FILE *stream, int status)
+{
+	(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)

Modified: trunk/localedef/ChangeLog.eglibc
==============================================================================
--- trunk/localedef/ChangeLog.eglibc (original)
+++ trunk/localedef/ChangeLog.eglibc Fri Sep 26 09:27:00 2008
@@ -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.

Modified: trunk/localedef/config.h.in
==============================================================================
--- trunk/localedef/config.h.in (original)
+++ trunk/localedef/config.h.in Fri Sep 26 09:27:00 2008
@@ -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

Modified: trunk/localedef/configure
==============================================================================
--- trunk/localedef/configure (original)
+++ trunk/localedef/configure Fri Sep 26 09:27:00 2008
@@ -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

Modified: trunk/localedef/configure.ac
==============================================================================
--- trunk/localedef/configure.ac (original)
+++ trunk/localedef/configure.ac Fri Sep 26 09:27:00 2008
@@ -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*)