about summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-11-09 22:13:45 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-11-09 22:13:45 +0000
commit8b748aed2a9ab4b964faa5722f7a182a060e475c (patch)
tree61bc3fd494c9230f44c3c84a4ac51a32711223ed /malloc
parent92e4b6a92716f8b2457376291171a6330d072b0d (diff)
downloadglibc-8b748aed2a9ab4b964faa5722f7a182a060e475c.tar.gz
glibc-8b748aed2a9ab4b964faa5722f7a182a060e475c.tar.xz
glibc-8b748aed2a9ab4b964faa5722f7a182a060e475c.zip
Support --with-pkgversion and --with-bugurl.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/Makefile8
-rwxr-xr-xmalloc/memusage.sh7
-rw-r--r--malloc/memusagestat.c15
-rw-r--r--malloc/mtrace.pl7
4 files changed, 19 insertions, 18 deletions
diff --git a/malloc/Makefile b/malloc/Makefile
index 1e0281f9fa..e1938998e6 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -126,13 +126,17 @@ sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,')
 $(objpfx)mtrace: mtrace.pl
 	rm -f $@.new
 	sed -e 's|@PERL@|$(PERL)|' -e 's|@XXX@|$(address-width)|' \
-	    -e 's|@VERSION@|$(version)|' $^ > $@.new \
+	    -e 's|@VERSION@|$(version)|' \
+	    -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+	    -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
 	&& rm -f $@ && mv $@.new $@ && chmod +x $@
 
 $(objpfx)memusage: memusage.sh
 	rm -f $@.new
 	sed -e 's|@BASH@|$(BASH)|' -e 's|@VERSION@|$(version)|' \
-	    -e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' $^ > $@.new \
+	    -e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' \
+	    -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+	    -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
 	&& rm -f $@ && mv $@.new $@ && chmod +x $@
 
 
diff --git a/malloc/memusage.sh b/malloc/memusage.sh
index 7ed68c0773..50b92d51bd 100755
--- a/malloc/memusage.sh
+++ b/malloc/memusage.sh
@@ -61,14 +61,13 @@ Mandatory arguments to long options are also mandatory for any corresponding
 short options.
 
 "
-  echo $"For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>.
-"
+  printf $"For bug reporting instructions, please see:\\n%s.\\n" \
+    "@REPORT_BUGS_TO@"
   exit 0
 }
 
 do_version() {
-  echo 'memusage (GNU libc) @VERSION@'
+  echo 'memusage @PKGVERSION@@VERSION@'
   printf $"Copyright (C) %s Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c
index af8f991003..a609a9b7c8 100644
--- a/malloc/memusagestat.c
+++ b/malloc/memusagestat.c
@@ -528,20 +528,17 @@ parse_opt (int key, char *arg, struct argp_state *state)
 static char *
 more_help (int key, const char *text, void *input)
 {
-  char *orig;
-  char *cp;
+  char *tp;
 
   switch (key)
     {
     case ARGP_KEY_HELP_EXTRA:
       /* We print some extra information.  */
-      orig = gettext ("\
+      if (asprintf (&tp, gettext ("\
 For bug reporting instructions, please see:\n\
-<http://www.gnu.org/software/libc/bugs.html>.\n");
-      cp = strdup (orig);
-      if (cp == NULL)
-	cp = orig;
-      return cp;
+%s.\n"), REPORT_BUGS_TO) < 0)
+	return NULL;
+      return tp;
     default:
       break;
     }
@@ -552,7 +549,7 @@ For bug reporting instructions, please see:\n\
 static void
 print_version (FILE *stream, struct argp_state *state)
 {
-  fprintf (stream, "memusagestat (GNU %s) %s\n", PACKAGE, VERSION);
+  fprintf (stream, "memusagestat %s%s\n", PKGVERSION, VERSION);
   fprintf (stream, gettext ("\
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
diff --git a/malloc/mtrace.pl b/malloc/mtrace.pl
index a2125003cb..adf61c7373 100644
--- a/malloc/mtrace.pl
+++ b/malloc/mtrace.pl
@@ -21,7 +21,8 @@ eval "exec @PERL@ -S $0 $@"
 # <http://www.gnu.org/licenses/>.
 
 $VERSION = "@VERSION@";
-$PACKAGE = "libc";
+$PKGVERSION = "@PKGVERSION@";
+$REPORT_BUGS_TO = '@REPORT_BUGS_TO@';
 $progname = $0;
 
 sub usage {
@@ -30,7 +31,7 @@ sub usage {
     print "  --version    print version number, then exit\n";
     print "\n";
     print "For bug reporting instructions, please see:\n";
-    print "<http://www.gnu.org/software/libc/bugs.html>.\n";
+    print "$REPORT_BUGS_TO.\n";
     exit 0;
 }
 
@@ -43,7 +44,7 @@ arglist: while (@ARGV) {
     if ($ARGV[0] eq "--v" || $ARGV[0] eq "--ve" || $ARGV[0] eq "--ver" ||
 	$ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" ||
 	$ARGV[0] eq "--versio" || $ARGV[0] eq "--version") {
-	print "mtrace (GNU $PACKAGE) $VERSION\n";
+	print "mtrace $PKGVERSION$VERSION\n";
 	print "Copyright (C) 2012 Free Software Foundation, Inc.\n";
 	print "This is free software; see the source for copying conditions.  There is NO\n";
 	print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";