[PATCH] gprofng: use gprofng- prefix for gprofng binaries

vladimir.mezentsev@oracle.com vladimir.mezentsev@oracle.com
Thu Oct 31 04:20:14 GMT 2024


From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

gprofng application names have a gp- prefix (gp-display-text, gp-archive, etc.).
But our man pages use the gprofng- prefix (gprofng-display-text,
gprofng-archive, etc.).
I renamed the gprofng binaries and temporarily created links for gp-display-text
and gp-collect-app for compatibility with the old gprofng-gui.
We plan to remove these links in version 2.46.

gprofng/ChangeLog
2024-10-30  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* doc/gprofng-archive.texi: Rename gprofng application names.
	* doc/gprofng-collect-app.texi: Likewise.
	* doc/gprofng-display-html.texi: Likewise.
	* doc/gprofng-display-src.texi: Likewise.
	* doc/gprofng-display-text.texi: Likewise.
	* doc/gprofng.texi: Likewise.
	* doc/gprofng_ug.texi: Likewise.
	* libcollector/collector.c: Likewise.
	* src/Application.cc: Likewise.
	* src/Experiment.cc: Likewise.
	* src/Makefile.am: Likewise.
	* src/gp-archive.cc: Likewise.
	* src/gp-collect-app.cc: Likewise.
	* src/gp-display-src.cc: Likewise.
	* src/gp-display-text.cc: Likewise.
	* src/gprofng.cc: Likewise.
	* src/Makefile.in: Rebuild.
---
 gprofng/doc/gprofng-archive.texi      |   2 +-
 gprofng/doc/gprofng-collect-app.texi  |   2 +-
 gprofng/doc/gprofng-display-html.texi |   2 +-
 gprofng/doc/gprofng-display-src.texi  |   2 +-
 gprofng/doc/gprofng-display-text.texi |   2 +-
 gprofng/doc/gprofng.texi              |   2 +-
 gprofng/doc/gprofng_ug.texi           |   4 +-
 gprofng/libcollector/collector.c      |   4 +-
 gprofng/src/Application.cc            |   5 -
 gprofng/src/Experiment.cc             |  52 +++++------
 gprofng/src/Makefile.am               |  29 ++++--
 gprofng/src/Makefile.in               | 130 ++++++++++++++------------
 gprofng/src/gp-archive.cc             |  11 +--
 gprofng/src/gp-collect-app.cc         |  18 +---
 gprofng/src/gp-display-src.cc         |   7 +-
 gprofng/src/gp-display-text.cc        |   3 +-
 gprofng/src/gprofng.cc                |  33 +++++--
 17 files changed, 155 insertions(+), 153 deletions(-)

diff --git a/gprofng/doc/gprofng-archive.texi b/gprofng/doc/gprofng-archive.texi
index 5356501ea37..a513cca39d4 100644
--- a/gprofng/doc/gprofng-archive.texi
+++ b/gprofng/doc/gprofng-archive.texi
@@ -54,7 +54,7 @@
 @ManPageStart{NAME}
 @c man begin NAME
 
-gp-archive - Archive the associated application binaries and sources for a
+gprofng-archive - Archive the associated application binaries and sources for a
 gprofng experiment
 
 @c man end
diff --git a/gprofng/doc/gprofng-collect-app.texi b/gprofng/doc/gprofng-collect-app.texi
index 50196f362d6..bef25f91d48 100644
--- a/gprofng/doc/gprofng-collect-app.texi
+++ b/gprofng/doc/gprofng-collect-app.texi
@@ -54,7 +54,7 @@
 @ManPageStart{NAME}
 @c man begin NAME
 
-gp-collect-app - Collect performance data for the target program
+gprofng-collect-app - Collect performance data for the target program
 
 @c man end
 @ManPageEnd{}
diff --git a/gprofng/doc/gprofng-display-html.texi b/gprofng/doc/gprofng-display-html.texi
index 8f8906ffdd0..125babb1eb3 100644
--- a/gprofng/doc/gprofng-display-html.texi
+++ b/gprofng/doc/gprofng-display-html.texi
@@ -54,7 +54,7 @@
 @ManPageStart{NAME}
 @c man begin NAME
 
-gp-display-html - Generate an HTML based directory structure to browse the
+gprofng-display-html - Generate an HTML based directory structure to browse the
 profiles
 
 @c man end
diff --git a/gprofng/doc/gprofng-display-src.texi b/gprofng/doc/gprofng-display-src.texi
index afff961addf..104efc4e4d3 100644
--- a/gprofng/doc/gprofng-display-src.texi
+++ b/gprofng/doc/gprofng-display-src.texi
@@ -54,7 +54,7 @@
 @ManPageStart{NAME}
 @c man begin NAME
 
-gp-display-src - Display the source code, optionally interleaved with the
+gprofng-display-src - Display the source code, optionally interleaved with the
 disassembly of the target object
 
 @c man end
diff --git a/gprofng/doc/gprofng-display-text.texi b/gprofng/doc/gprofng-display-text.texi
index 9612ee9d7dc..b6b69cdba85 100644
--- a/gprofng/doc/gprofng-display-text.texi
+++ b/gprofng/doc/gprofng-display-text.texi
@@ -54,7 +54,7 @@
 @ManPageStart{NAME}
 @c man begin NAME
 
-gp-display-text - Display the performance data in plain text format
+gprofng-display-text - Display the performance data in plain text format
 
 @c man end
 @ManPageEnd{}
diff --git a/gprofng/doc/gprofng.texi b/gprofng/doc/gprofng.texi
index 92ec3b4e66a..3600acc3d08 100644
--- a/gprofng/doc/gprofng.texi
+++ b/gprofng/doc/gprofng.texi
@@ -323,7 +323,7 @@ recommend to search for @code{gprofng-gui} how to obtain, install and use it.
 @ManPageStart{SEE ALSO}
 @c man begin SEEALSO
 
-gp-archive(1),
+gprofng-archive(1),
 gprofng-collect-app(1),
 @c -- gprofng-display-gui(1),
 gprofng-display-html(1),
diff --git a/gprofng/doc/gprofng_ug.texi b/gprofng/doc/gprofng_ug.texi
index dc985d3993f..2854e051615 100644
--- a/gprofng/doc/gprofng_ug.texi
+++ b/gprofng/doc/gprofng_ug.texi
@@ -518,7 +518,7 @@ is illustrated below:
 @verbatim
 $ gprofng display text test.1.er
 Warning: History and command editing is not supported on this system.
-(gp-display-text) quit
+(gprofng-display-text) quit
 $
 @end verbatim
 @end smallexample
@@ -1367,7 +1367,7 @@ marked with the @samp{<} and @samp{>} symbols.
 Experiment: mxv.1.thr.er
 No errors
 No warnings
-Archive command ` /usr/bin/gp-archive -n -a on --outfile
+Archive command ` /usr/bin/gprofng-archive -n -a on --outfile
                      <apath>/archive.log <apath>/mxv.1.thr.er'
 
 Target command (64-bit): './mxv-pthreads -m 8000 -n 4000 -t 1'
diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
index 2ff95e58fde..eb192647007 100644
--- a/gprofng/libcollector/collector.c
+++ b/gprofng/libcollector/collector.c
@@ -1152,7 +1152,7 @@ __collector_SIGCHLD_signal_handler (int sig, siginfo_t *si, void *context)
    * before the handler knows the value of mychild_pid.
    */
   if (calling_pid == mychild_pid)
-    // er_archive has exited; so restore the user handler
+    // gprofng_archive has exited; so restore the user handler
     __collector_sigaction (SIGCHLD, &original_sigchld_sigaction, NULL);
   else
     {
@@ -1269,7 +1269,7 @@ __collector_close_experiment ()
   if (project_home && archive_mode && __collector_strcmp (archive_mode, "off"))
     {
       /* construct a command to launch it */
-      char *er_archive_name = "/bin/gp-archive";
+      char *er_archive_name = "/bin/gprofng-archive";
       size_t cmdlen = CALL_UTIL (strlen)(project_home) + CALL_UTIL (strlen)(er_archive_name) + 1;
       char *command = (char*) alloca (cmdlen);
       CALL_UTIL (snprintf)(command, cmdlen, "%s%s", project_home, er_archive_name);
diff --git a/gprofng/src/Application.cc b/gprofng/src/Application.cc
index ee461b3109b..d88e3581918 100644
--- a/gprofng/src/Application.cc
+++ b/gprofng/src/Application.cc
@@ -202,11 +202,7 @@ Application::check_args (int argc, char *argv[])
     switch (opt)
       {
       case 'V':
-// Ruud
 	Application::print_version_info ();
-/*
-	printf (NTXT ("GNU %s version %s\n"), get_basename (prog_name), VERSION);
-*/
 	exit (0);
       default:
 	usage ();
@@ -246,7 +242,6 @@ Application::set_progress (int percentage, const char *proc_str)
   return 0;
 }
 
-// Ruud
 void
 Application::print_version_info ()
 {
diff --git a/gprofng/src/Experiment.cc b/gprofng/src/Experiment.cc
index 3c63f9f018f..c1e12522918 100644
--- a/gprofng/src/Experiment.cc
+++ b/gprofng/src/Experiment.cc
@@ -659,7 +659,7 @@ Experiment::ExperimentHandler::startElement (char*, char*, char *qName, Attribut
 	  else if (strcmp (str, SP_JCMD_ARCHIVE) == 0)
 	    {
 	      StringBuilder sb;
-	      sb.sprintf (GTXT ("gp-archive run: XXXXXXX"));
+	      sb.sprintf (GTXT ("gprofng-archive run: XXXXXXX"));
 	      exp->pprocq->append (new Emsg (CMSG_WARN, sb));
 	    }
 	  else if (strcmp (str, SP_JCMD_SAMPLE) == 0)
@@ -6481,14 +6481,14 @@ Experiment::copy_file_to_archive (const char *name, const char *aname, int hide_
     {
       if (errno == EEXIST)
 	return 0;
-      fprintf (stderr, GTXT ("gp-archive: unable to copy `%s': %s\n"),
+      fprintf (stderr, GTXT ("gprofng-archive: unable to copy `%s': %s\n"),
 	       name, STR (strerror (errno)));
       return 1;
     }
 
   if (dbe_stat_file (name, NULL) != 0)
     {
-      fprintf (stderr, GTXT ("gp-archive: cannot access file `%s': %s\n"),
+      fprintf (stderr, GTXT ("gprofng-archive: cannot access file `%s': %s\n"),
 	       name, STR (strerror (errno)));
       close (fd_w);
       return 1;
@@ -6497,7 +6497,7 @@ Experiment::copy_file_to_archive (const char *name, const char *aname, int hide_
   int fd_r = ::open64 (name, O_RDONLY);
   if (fd_r == -1)
     {
-      fprintf (stderr, GTXT ("gp-archive: unable to open `%s': %s\n"),
+      fprintf (stderr, GTXT ("gprofng-archive: unable to open `%s': %s\n"),
 	       name, strerror (errno));
       close (fd_w);
       unlink (aname);
@@ -6517,7 +6517,7 @@ Experiment::copy_file_to_archive (const char *name, const char *aname, int hide_
       n1 = (int) write (fd_w, buf, n);
       if (n != n1)
 	{
-	  fprintf (stderr, GTXT ("gp-archive: unable to write %d bytes to `%s': %s\n"),
+	  fprintf (stderr, GTXT ("gprofng-archive: unable to write %d bytes to `%s': %s\n"),
 		   n, aname, STR (strerror (errno)));
 	  do_unlink = true;
 	  break;
@@ -6537,7 +6537,7 @@ Experiment::copy_file_to_archive (const char *name, const char *aname, int hide_
   if (do_unlink)
     {
       if (!hide_msg)
-	fprintf (stderr, GTXT ("gp-archive: remove %s\n"), aname);
+	fprintf (stderr, GTXT ("gprofng-archive: remove %s\n"), aname);
       unlink (aname);
       return 1;
     }
@@ -6566,11 +6566,11 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
   if (!name || !aname || !common_archive)
     {
       if (!name)
-	fprintf (stderr, GTXT ("gp-archive: Internal error: file name is NULL\n"));
+	fprintf (stderr, GTXT ("gprofng-archive: Internal error: file name is NULL\n"));
       if (!aname)
-	fprintf (stderr, GTXT ("gp-archive: Internal error: file name in archive is NULL\n"));
+	fprintf (stderr, GTXT ("gprofng-archive: Internal error: file name in archive is NULL\n"));
       if (!common_archive)
-	fprintf (stderr, GTXT ("gp-archive: Internal error: path to common archive is NULL\n"));
+	fprintf (stderr, GTXT ("gprofng-archive: Internal error: path to common archive is NULL\n"));
       return 1;
     }
   // Check if file is already archived
@@ -6584,14 +6584,14 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
       long size = pathconf (NTXT ("."), _PC_PATH_MAX);
       if (size < 0)
 	{
-	  fprintf (stderr, GTXT ("gp-archive: Fatal error: pathconf(\".\", _PC_PATH_MAX) failed\n"));
+	  fprintf (stderr, GTXT ("gprofng-archive: Fatal error: pathconf(\".\", _PC_PATH_MAX) failed\n"));
 	  return 1;
 	}
       char *buf = (char *) xmalloc ((size_t) size);
       char *ptr = getcwd (buf, (size_t) size);
       if (ptr == NULL)
 	{
-	  fprintf (stderr, GTXT ("gp-archive: Fatal error: cannot determine current directory\n"));
+	  fprintf (stderr, GTXT ("gprofng-archive: Fatal error: cannot determine current directory\n"));
 	  free (buf);
 	  return 1;
 	}
@@ -6619,12 +6619,12 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
       free (abs_aname);
       if (NULL != errmsg)
 	{
-	  fprintf (stderr, GTXT ("gp-archive: Fatal error: %s\n"), errmsg);
+	  fprintf (stderr, GTXT ("gprofng-archive: Fatal error: %s\n"), errmsg);
 	  free (errmsg);
 	  return 1;
 	}
       fprintf (stderr,
-	       GTXT ("gp-archive: Fatal error: get_cksum(%s) returned %d\n"),
+	       GTXT ("gprofng-archive: Fatal error: get_cksum(%s) returned %d\n"),
 	       name, crcval);
       return 1;
     }
@@ -6636,7 +6636,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
       free (cad);
       free (abs_aname);
       fprintf (stderr,
-	       GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
+	       GTXT ("gprofng-archive: Fatal error: unable to allocate memory\n"));
       return 1;
     }
   // Check if full name is not too long
@@ -6644,7 +6644,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
   long max = pathconf (cad, _PC_PATH_MAX);
   if ((max < 0) || (len <= 0))
     { // unknown error
-      fprintf (stderr, GTXT ("gp-archive: Fatal error: pathconf(%s, _PC_PATH_MAX) failed\n"),
+      fprintf (stderr, GTXT ("gprofng-archive: Fatal error: pathconf(%s, _PC_PATH_MAX) failed\n"),
 	       cad);
       free (abs_caname);
       free (cad);
@@ -6659,7 +6659,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
 	  // Yes, we can do it
 	  abs_caname[max - 1] = 0;
 	  if (!hide_msg)
-	    fprintf (stderr, GTXT ("gp-gp-archive: file path is too long - truncated:%s\n"),
+	    fprintf (stderr, GTXT ("gprofng-archive: file path is too long - truncated:%s\n"),
 		     abs_caname);
 	}
     }
@@ -6669,7 +6669,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
   max = pathconf (cad, _PC_NAME_MAX);
   if ((max < 0) || (len <= 0))
     { // unknown error
-      fprintf (stderr, GTXT ("gp-archive: Fatal error: pathconf(%s, _PC_NAME_MAX) failed\n"),
+      fprintf (stderr, GTXT ("gprofng-archive: Fatal error: pathconf(%s, _PC_NAME_MAX) failed\n"),
 	       cad);
       free (abs_caname);
       free (cad);
@@ -6684,7 +6684,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
 	  // Yes, we can do it
 	  cafname[max - 1] = 0;
 	  if (!hide_msg)
-	    fprintf (stderr, GTXT ("gp-archive: file name is too long - truncated:%s\n"),
+	    fprintf (stderr, GTXT ("gprofng-archive: file name is too long - truncated:%s\n"),
 		     abs_caname);
 	}
     }
@@ -6699,7 +6699,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
       res = copy_file_to_archive (name, t, hide_msg); // hide messages
       if (res != 0)
 	{
-	  fprintf (stderr, GTXT ("gp-archive: Fatal error: cannot copy file %s to temporary file: %s\n"),
+	  fprintf (stderr, GTXT ("gprofng-archive: Fatal error: cannot copy file %s to temporary file: %s\n"),
 		   name, t);
 	  unlink (t);
 	  free (t);
@@ -6722,7 +6722,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
 	{
 	  if (errno != EEXIST)
 	    {
-	      fprintf (stderr, GTXT ("gp-archive: Fatal error: rename(%s, %s) returned error: %d\n"),
+	      fprintf (stderr, GTXT ("gprofng-archive: Fatal error: rename(%s, %s) returned error: %d\n"),
 		       t, abs_caname, res);
 	      unlink (t);
 	      free (t);
@@ -6746,7 +6746,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
 	  char *rel_caname = dbe_sprintf ("%s/%s", common_archive, cafname);
 	  if (rel_caname == NULL)
 	    {
-	      fprintf (stderr, GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
+	      fprintf (stderr, GTXT ("gprofng-archive: Fatal error: unable to allocate memory\n"));
 	      return 1;
 	    }
 	  lname = get_relative_link (rel_caname, aname);
@@ -6756,7 +6756,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
 	{
 	  if (abs_aname == NULL)
 	    {
-	      fprintf (stderr, GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
+	      fprintf (stderr, GTXT ("gprofng-archive: Fatal error: unable to allocate memory\n"));
 	      return 1;
 	    }
 	  lname = get_relative_link (abs_caname, abs_aname);
@@ -6767,7 +6767,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
   free (abs_aname);
   if (lname == NULL)
     {
-      fprintf (stderr, GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
+      fprintf (stderr, GTXT ("gprofng-archive: Fatal error: unable to allocate memory\n"));
       return 1;
     }
   // Create symbolic link: aname -> lname
@@ -6776,7 +6776,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
       res = symlink (lname, aname);
       if (res != 0)
 	{
-	  fprintf (stderr, GTXT ("gp-archive: Fatal error: symlink(%s, %s) returned error: %d (errno=%s)\n"),
+	  fprintf (stderr, GTXT ("gprofng-archive: Fatal error: symlink(%s, %s) returned error: %d (errno=%s)\n"),
 		   lname, aname, res, strerror (errno));
 	  free (abs_caname);
 	  free (lname);
@@ -6788,7 +6788,7 @@ Experiment::copy_file_to_common_archive (const char *name, const char *aname,
     }
   else
     {
-      fprintf (stderr, GTXT ("gp-archive: Internal error: file does not exist in common archive: %s\n"),
+      fprintf (stderr, GTXT ("gprofng-archive: Internal error: file does not exist in common archive: %s\n"),
 	       abs_caname);
       res = 1;
     }
@@ -6814,7 +6814,7 @@ Experiment::copy_file (char *name, char *aname, int hide_msg, char *common_archi
 					    common_archive, relative_path))
 	return 0;
       // Error. For now - fatal error. Message is already printed.
-      fprintf (stderr, GTXT ("gp-archive: Fatal error: cannot copy file %s to common archive %s\n"),
+      fprintf (stderr, GTXT ("gprofng-archive: Fatal error: cannot copy file %s to common archive %s\n"),
 	       name, common_archive);
       return 1;
     }
diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
index 41795071185..84b80afa663 100644
--- a/gprofng/src/Makefile.am
+++ b/gprofng/src/Makefile.am
@@ -111,7 +111,7 @@ AM_CPPFLAGS = $(GPROFNG_CPPFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" \
 	-I.. -I$(srcdir) \
 	-I$(srcdir)/../common \
 	-I$(srcdir)/../../include -I$(srcdir)/../../opcodes \
-	-I../../bfd -I$(srcdir)/../../bfd $(ZLIBINC)
+	-I../../bfd -I$(srcdir)/../../bfd $(ZLIgp-C)
 AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_CFLAGS) \
 	$(GPROFNG_NO_SWITCH_CFLAGS)
 AM_CXXFLAGS = $(AM_CFLAGS)
@@ -152,25 +152,34 @@ dbedir = $(SYSCONFDIR)
 dbe_DATA = $(srcdir)/gprofng.rc
 
 
-bin_PROGRAMS = gp-archive gp-collect-app gprofng gp-display-text gp-display-src
+bin_PROGRAMS = gprofng-archive gprofng-collect-app gprofng \
+	gprofng-display-text gprofng-display-src
 
-gp_archive_SOURCES = gp-archive.cc ArchiveExp.cc
-gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_archive_SOURCES = gp-archive.cc ArchiveExp.cc
+gprofng_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
-gp_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
-gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
+gprofng_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 gprofng_SOURCES = gprofng.cc
 gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
-gp_display_src_SOURCES = gp-display-src.cc
-gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_display_src_SOURCES = gp-display-src.cc
+gprofng_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
-gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
-gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
+gprofng_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 # Distribution involves building the binaries to generate the manpage,
 # so ensure that the necessary libraries are built at dist time.
 dist-hook: $(LIBGPROFNG)
 
 $(srcdir)/DbeSession.cc: QLParser.tab.hh
+
+.PHONY: install-exec-local
+install-exec-local:
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	rm -f $(DESTDIR)$(bindir)/gp-{collect-app,display-text}
+	ln -s gprofng-collect-app $(DESTDIR)$(bindir)/gp-collect-app
+	ln -s gprofng-display-text $(DESTDIR)$(bindir)/gp-display-text
+
diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
index 4c25d017d0e..e9dc44101a3 100644
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -108,9 +108,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-bin_PROGRAMS = gp-archive$(EXEEXT) gp-collect-app$(EXEEXT) \
-	gprofng$(EXEEXT) gp-display-text$(EXEEXT) \
-	gp-display-src$(EXEEXT)
+bin_PROGRAMS = gprofng-archive$(EXEEXT) gprofng-collect-app$(EXEEXT) \
+	gprofng$(EXEEXT) gprofng-display-text$(EXEEXT) \
+	gprofng-display-src$(EXEEXT)
 subdir = src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
@@ -190,28 +190,28 @@ libgprofng_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
 	$(AM_CXXFLAGS) $(CXXFLAGS) $(libgprofng_la_LDFLAGS) $(LDFLAGS) \
 	-o $@
 PROGRAMS = $(bin_PROGRAMS)
-am_gp_archive_OBJECTS = gp-archive.$(OBJEXT) ArchiveExp.$(OBJEXT)
-gp_archive_OBJECTS = $(am_gp_archive_OBJECTS)
-gp_archive_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-am_gp_collect_app_OBJECTS = gp-collect-app.$(OBJEXT) checks.$(OBJEXT) \
-	envsets.$(OBJEXT) count.$(OBJEXT)
-gp_collect_app_OBJECTS = $(am_gp_collect_app_OBJECTS)
-gp_collect_app_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-am_gp_display_src_OBJECTS = gp-display-src.$(OBJEXT)
-gp_display_src_OBJECTS = $(am_gp_display_src_OBJECTS)
-gp_display_src_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
-am_gp_display_text_OBJECTS = gp-display-text.$(OBJEXT) ipc.$(OBJEXT) \
-	ipcio.$(OBJEXT)
-gp_display_text_OBJECTS = $(am_gp_display_text_OBJECTS)
-gp_display_text_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
 am_gprofng_OBJECTS = gprofng.$(OBJEXT)
 gprofng_OBJECTS = $(am_gprofng_OBJECTS)
 gprofng_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1)
+am_gprofng_archive_OBJECTS = gp-archive.$(OBJEXT) ArchiveExp.$(OBJEXT)
+gprofng_archive_OBJECTS = $(am_gprofng_archive_OBJECTS)
+gprofng_archive_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_gprofng_collect_app_OBJECTS = gp-collect-app.$(OBJEXT) \
+	checks.$(OBJEXT) envsets.$(OBJEXT) count.$(OBJEXT)
+gprofng_collect_app_OBJECTS = $(am_gprofng_collect_app_OBJECTS)
+gprofng_collect_app_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_gprofng_display_src_OBJECTS = gp-display-src.$(OBJEXT)
+gprofng_display_src_OBJECTS = $(am_gprofng_display_src_OBJECTS)
+gprofng_display_src_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_gprofng_display_text_OBJECTS = gp-display-text.$(OBJEXT) \
+	ipc.$(OBJEXT) ipcio.$(OBJEXT)
+gprofng_display_text_OBJECTS = $(am_gprofng_display_text_OBJECTS)
+gprofng_display_text_DEPENDENCIES = $(LIBGPROFNG) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -264,12 +264,12 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
 am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
 am__v_CXXLD_0 = @echo "  CXXLD   " $@;
 am__v_CXXLD_1 = 
-SOURCES = $(libgprofng_la_SOURCES) $(gp_archive_SOURCES) \
-	$(gp_collect_app_SOURCES) $(gp_display_src_SOURCES) \
-	$(gp_display_text_SOURCES) $(gprofng_SOURCES)
-DIST_SOURCES = $(libgprofng_la_SOURCES) $(gp_archive_SOURCES) \
-	$(gp_collect_app_SOURCES) $(gp_display_src_SOURCES) \
-	$(gp_display_text_SOURCES) $(gprofng_SOURCES)
+SOURCES = $(libgprofng_la_SOURCES) $(gprofng_SOURCES) \
+	$(gprofng_archive_SOURCES) $(gprofng_collect_app_SOURCES) \
+	$(gprofng_display_src_SOURCES) $(gprofng_display_text_SOURCES)
+DIST_SOURCES = $(libgprofng_la_SOURCES) $(gprofng_SOURCES) \
+	$(gprofng_archive_SOURCES) $(gprofng_collect_app_SOURCES) \
+	$(gprofng_display_src_SOURCES) $(gprofng_display_text_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -536,7 +536,7 @@ AM_CPPFLAGS = $(GPROFNG_CPPFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" \
 	-I.. -I$(srcdir) \
 	-I$(srcdir)/../common \
 	-I$(srcdir)/../../include -I$(srcdir)/../../opcodes \
-	-I../../bfd -I$(srcdir)/../../bfd $(ZLIBINC)
+	-I../../bfd -I$(srcdir)/../../bfd $(ZLIgp-C)
 
 AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_CFLAGS) \
 	$(GPROFNG_NO_SWITCH_CFLAGS)
@@ -558,16 +558,16 @@ libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \
 
 dbedir = $(SYSCONFDIR)
 dbe_DATA = $(srcdir)/gprofng.rc
-gp_archive_SOURCES = gp-archive.cc ArchiveExp.cc
-gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
-gp_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
-gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_archive_SOURCES = gp-archive.cc ArchiveExp.cc
+gprofng_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
+gprofng_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 gprofng_SOURCES = gprofng.cc
 gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
-gp_display_src_SOURCES = gp-display-src.cc
-gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
-gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
-gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_display_src_SOURCES = gp-display-src.cc
+gprofng_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
+gprofng_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
+gprofng_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 all: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -690,25 +690,25 @@ clean-binPROGRAMS:
 	echo " rm -f" $$list; \
 	rm -f $$list
 
-gp-archive$(EXEEXT): $(gp_archive_OBJECTS) $(gp_archive_DEPENDENCIES) $(EXTRA_gp_archive_DEPENDENCIES) 
-	@rm -f gp-archive$(EXEEXT)
-	$(AM_V_CXXLD)$(CXXLINK) $(gp_archive_OBJECTS) $(gp_archive_LDADD) $(LIBS)
+gprofng$(EXEEXT): $(gprofng_OBJECTS) $(gprofng_DEPENDENCIES) $(EXTRA_gprofng_DEPENDENCIES) 
+	@rm -f gprofng$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(gprofng_OBJECTS) $(gprofng_LDADD) $(LIBS)
 
-gp-collect-app$(EXEEXT): $(gp_collect_app_OBJECTS) $(gp_collect_app_DEPENDENCIES) $(EXTRA_gp_collect_app_DEPENDENCIES) 
-	@rm -f gp-collect-app$(EXEEXT)
-	$(AM_V_CXXLD)$(CXXLINK) $(gp_collect_app_OBJECTS) $(gp_collect_app_LDADD) $(LIBS)
+gprofng-archive$(EXEEXT): $(gprofng_archive_OBJECTS) $(gprofng_archive_DEPENDENCIES) $(EXTRA_gprofng_archive_DEPENDENCIES) 
+	@rm -f gprofng-archive$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(gprofng_archive_OBJECTS) $(gprofng_archive_LDADD) $(LIBS)
 
-gp-display-src$(EXEEXT): $(gp_display_src_OBJECTS) $(gp_display_src_DEPENDENCIES) $(EXTRA_gp_display_src_DEPENDENCIES) 
-	@rm -f gp-display-src$(EXEEXT)
-	$(AM_V_CXXLD)$(CXXLINK) $(gp_display_src_OBJECTS) $(gp_display_src_LDADD) $(LIBS)
+gprofng-collect-app$(EXEEXT): $(gprofng_collect_app_OBJECTS) $(gprofng_collect_app_DEPENDENCIES) $(EXTRA_gprofng_collect_app_DEPENDENCIES) 
+	@rm -f gprofng-collect-app$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(gprofng_collect_app_OBJECTS) $(gprofng_collect_app_LDADD) $(LIBS)
 
-gp-display-text$(EXEEXT): $(gp_display_text_OBJECTS) $(gp_display_text_DEPENDENCIES) $(EXTRA_gp_display_text_DEPENDENCIES) 
-	@rm -f gp-display-text$(EXEEXT)
-	$(AM_V_CXXLD)$(CXXLINK) $(gp_display_text_OBJECTS) $(gp_display_text_LDADD) $(LIBS)
+gprofng-display-src$(EXEEXT): $(gprofng_display_src_OBJECTS) $(gprofng_display_src_DEPENDENCIES) $(EXTRA_gprofng_display_src_DEPENDENCIES) 
+	@rm -f gprofng-display-src$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(gprofng_display_src_OBJECTS) $(gprofng_display_src_LDADD) $(LIBS)
 
-gprofng$(EXEEXT): $(gprofng_OBJECTS) $(gprofng_DEPENDENCIES) $(EXTRA_gprofng_DEPENDENCIES) 
-	@rm -f gprofng$(EXEEXT)
-	$(AM_V_CXXLD)$(CXXLINK) $(gprofng_OBJECTS) $(gprofng_LDADD) $(LIBS)
+gprofng-display-text$(EXEEXT): $(gprofng_display_text_OBJECTS) $(gprofng_display_text_DEPENDENCIES) $(EXTRA_gprofng_display_text_DEPENDENCIES) 
+	@rm -f gprofng-display-text$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(gprofng_display_text_OBJECTS) $(gprofng_display_text_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -1027,7 +1027,8 @@ install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
+install-exec-am: install-binPROGRAMS install-exec-local \
+	install-libLTLIBRARIES
 
 install-html: install-html-am
 
@@ -1079,15 +1080,15 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dbeDATA \
 	distclean-tags distdir dvi dvi-am html html-am info info-am \
 	install install-am install-binPROGRAMS install-data \
 	install-data-am install-dbeDATA install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-libLTLIBRARIES \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
-	uninstall-am uninstall-binPROGRAMS uninstall-dbeDATA \
-	uninstall-libLTLIBRARIES
+	install-exec install-exec-am install-exec-local install-html \
+	install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
+	uninstall-dbeDATA uninstall-libLTLIBRARIES
 
 .PRECIOUS: Makefile
 
@@ -1115,6 +1116,13 @@ dist-hook: $(LIBGPROFNG)
 
 $(srcdir)/DbeSession.cc: QLParser.tab.hh
 
+.PHONY: install-exec-local
+install-exec-local:
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	rm -f $(DESTDIR)$(bindir)/gp-{collect-app,display-text}
+	ln -s gprofng-collect-app $(DESTDIR)$(bindir)/gp-collect-app
+	ln -s gprofng-display-text $(DESTDIR)$(bindir)/gp-display-text
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/gprofng/src/gp-archive.cc b/gprofng/src/gp-archive.cc
index 00a44509f8e..85e833fc3cc 100644
--- a/gprofng/src/gp-archive.cc
+++ b/gprofng/src/gp-archive.cc
@@ -139,11 +139,8 @@ er_archive::usage ()
     "\n"
     "See also:\n"
     "\n"
-    "gprofng(1), gp-collect-app(1), gp-display-html(1), gp-display-src(1), gp-display-text(1)\n"));
-// Ruud
-/*
-  fprintf (stderr, GTXT ("GNU %s version %s\n"), get_basename (prog_name), VERSION);
-*/
+    "gprofng(1), gprofng-collect-app(1), gprofng-display-html(1), "
+    "gprofng-display-src(1), gprofng-display-text(1)\n"));
   exit (1);
 }
 
@@ -617,11 +614,7 @@ er_archive::check_args (int argc, char *argv[])
 	    break;
 	  }
 	case 'V':
-// Ruud
 	  Application::print_version_info ();
-/*
-	  printf (GTXT ("GNU %s version %s\n"), get_basename (prog_name), VERSION);
-*/
 	  exit (0);
 	case 'w':
 	  whoami = optarg;
diff --git a/gprofng/src/gp-collect-app.cc b/gprofng/src/gp-collect-app.cc
index 4bf9f077df9..1e4e7e570ba 100644
--- a/gprofng/src/gp-collect-app.cc
+++ b/gprofng/src/gp-collect-app.cc
@@ -1231,12 +1231,7 @@ collect::do_flag (const char *flags)
 	  disabled = 1;
 	  if (verbose != 1)
 	    {
-// Ruud
 	      Application::print_version_info ();
-/*
-	      dbe_write (2, NTXT ("GNU %s version %s\n"),
-			 get_basename (prog_name), VERSION);
-*/
 	      verbose = 1;
 	    }
 	  break;
@@ -1251,22 +1246,12 @@ collect::do_flag (const char *flags)
 	case 'v':
 	  if (verbose != 1)
 	    {
-// Ruud
 	      Application::print_version_info ();
-/*
-	      dbe_write (2, NTXT ("GNU %s version %s\n"),
-			 get_basename (prog_name), VERSION);
-*/
 	      verbose = 1;
 	    }
 	  break;
 	case 'V':
-// Ruud
 	  Application::print_version_info ();
-/*
-	  dbe_write (2, NTXT ("GNU %s version %s\n"),
-		     get_basename (prog_name), VERSION);
-*/
 	  /* no further processing.... */
 	  exit (0);
 	}
@@ -1495,7 +1480,8 @@ collect::usage ()
     "\n"
     "See also:\n"
     "\n"
-    "gprofng(1), gp-archive(1), gp-display-html(1), gp-display-src(1), gp-display-text(1)\n"));
+    "gprofng(1), gprofng-archive(1), gprofng-display-html(1), "
+    "gpgprofng-display-src(1), gprofng-display-text(1)\n"));
 }
 
 void
diff --git a/gprofng/src/gp-display-src.cc b/gprofng/src/gp-display-src.cc
index 5d885b5b607..11898d670bc 100644
--- a/gprofng/src/gp-display-src.cc
+++ b/gprofng/src/gp-display-src.cc
@@ -171,7 +171,8 @@ er_src::usage ()
     "\n"
     "See also:\n"
     "\n"
-    "gprofng(1), gp-archive(1), gp-collect-app(1), gp-display-html(1), gp-display-text(1)\n"));
+    "gprofng(1), gprofng-archive(1), gprofng-collect-app(1), "
+    "gprofng-display-html(1), gprofng-display-text(1)\n"));
 /*
   printf (GTXT ("Usage: %s [OPTION] a.out/.so/.o/.class\n\n"), whoami);
   printf (GTXT ("    -func                     List all the functions from the given object\n"
@@ -312,11 +313,7 @@ er_src::proc_cmd (CmdType cmd_type, bool first, char *arg1,
       break;
     case VERSION_cmd:
       if (out_file != stdout)
-// Ruud
 	Application::print_version_info ();
-/*
-	fprintf (out_file, "GNU %s version %s\n", get_basename (prog_name), VERSION);
-*/
       break;
     default:
       fprintf (stderr, GTXT ("Invalid option"));
diff --git a/gprofng/src/gp-display-text.cc b/gprofng/src/gp-display-text.cc
index ad60e76f381..7c943842285 100644
--- a/gprofng/src/gp-display-text.cc
+++ b/gprofng/src/gp-display-text.cc
@@ -253,7 +253,8 @@ er_print::usage ()
     "\n"
     "See also:\n"
     "\n"
-    "gprofng(1), gp-archive(1), gp-collect-app(1), gp-display-html(1), gp-display-src(1)\n"));
+    "gprofng(1), gprofng-archive(1), gprofng-collect-app(1), "
+    "gprofng-display-html(1), gprofng-display-src(1)\n"));
 }
 
 int // returns count of experiments read
diff --git a/gprofng/src/gprofng.cc b/gprofng/src/gprofng.cc
index 385b0977154..887c2567761 100644
--- a/gprofng/src/gprofng.cc
+++ b/gprofng/src/gprofng.cc
@@ -94,7 +94,7 @@ Gprofng::usage ()
     "\n"
     "The man pages for the commands below can be viewed using the command name with\n"
     "\"gprofng\" replaced by \"gp\" and the spaces replaced by a dash (\"-\"). For\n"
-    "example the man page name for \"gprofng collect app\" is \"gp-collect-app\".\n"
+    "example the man page name for \"gprofng collect app\" is \"gprofng-collect-app\".\n"
     "\n"
     "The following combination of commands and keywords are supported:\n"
     "\n"
@@ -154,7 +154,8 @@ Gprofng::usage ()
     "\n"
     "See also:\n"
     "\n"
-    "gp-archive(1), gp-collect-app(1), gp-display-html(1), gp-display-src(1), gp-display-text(1)\n"));
+    "gprofng-archive(1), gprofng-collect-app(1), gprofng-display-html(1), "
+    "gprofng-display-src(1), gprofng-display-text(1)\n"));
 
 /*
   printf ( GTXT (
@@ -181,13 +182,13 @@ Gprofng::exec_cmd (char *tool_name, int argc, char **argv)
     const char *keyword;
     const char *app_name;
   } app_names [] = {
-    { "archive", NULL, "gp-archive"},
-    { "collect", "app", "gp-collect-app"},
-    { "collect", "kernel", "gp-collect-kernel"},
-    { "display", "text", "gp-display-text"},
-    { "display", "gui", "gp-display-gui"},
-    { "display", "html", "gp-display-html"},
-    { "display", "src", "gp-display-src"},
+    { "archive", NULL, "gprofng-archive"},
+    { "collect", "app", "gprofng-collect-app"},
+    { "collect", "kernel", "gprofng-collect-kernel"},
+    { "display", "text", "gprofng-display-text"},
+    { "display", "gui", "gprofng-display-gui"},
+    { "display", "html", "gprofng-display-html"},
+    { "display", "src", "gprofng-display-src"},
     { NULL, NULL}
   };
 
@@ -239,7 +240,7 @@ Gprofng::exec_cmd (char *tool_name, int argc, char **argv)
 			    app_names[first].keyword);
   else
     arr[n++] = dbe_sprintf ("--whoami=%s %s", whoami, tool_name);
-  if (strcmp (aname, "gp-display-gui") == 0)
+  if (strcmp (aname, "gprofng-display-gui") == 0)
     {
       if (access (exe_name, X_OK | F_OK) != 0)
         { // gprofng GUI can be installed to the other directory.
@@ -247,6 +248,18 @@ Gprofng::exec_cmd (char *tool_name, int argc, char **argv)
 	    printf ("gprofng: Cannot find '%s'\n", exe_name);
 	  free (exe_name);
 	  exe_name = get_realpath (aname);  // Use $PATH to find gprofng GUI
+	  if (*exe_name != '/')
+	    { // New gprofng-gui is not installed. Try to find the old one.
+	      char *nm = get_realpath ("gp-display-gui");
+	      if (*nm == '/')
+		{
+		  if (verbose)
+		    printf ("gprofng: New gprofng GUI is not installed.\n"
+			    "Use the old one '%s'\n", nm);
+		  free (exe_name);
+		  exe_name = nm;
+		}
+	    }
 	}
       arr[n++] = dbe_sprintf ("--gprofngdir=%.*s",
 			      (int) (get_basename (pname) - pname), pname);
-- 
2.43.5



More information about the Binutils mailing list