Move SVNVERSION handling into version_info. That way, we won't have
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 16 Aug 2005 06:45:17 +0000 (06:45 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 16 Aug 2005 06:45:17 +0000 (06:45 +0000)
to recompile tethereal.o etc each time the svn version has changed,
relinking is sufficient.

I'm not sure what to do about mergecap, as it currently doesn't link
against version_info, so it's "overhead" either way.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15371 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/about_dlg.c
gtk/main.c
tethereal.c
version_info.c
version_info.h

index 498bc027bc6e01660efd0967ffe4c63efd77d3a5..9adf8ecd48a22f9ce309d3dca8a72a8641912b0e 100644 (file)
 #include "text_page.h"
 #endif
 
 #include "text_page.h"
 #endif
 
-#include "svnversion.h"
-
 #include "../image/eicon3d64.xpm"
 #include "gtkglobals.h"
 #include "../image/eicon3d64.xpm"
 #include "gtkglobals.h"
+#include "version_info.h"
 
 extern GString *comp_info_str, *runtime_info_str;
 
 
 extern GString *comp_info_str, *runtime_info_str;
 
@@ -156,10 +155,7 @@ about_ethereal_page_new(void)
 
   /* Construct the message string */
   message = g_strdup_printf(
 
   /* Construct the message string */
   message = g_strdup_printf(
-       "Version " VERSION
-#ifdef SVNVERSION
-       " (" SVNVERSION ")"
-#endif
+       "Version " VERSION "%s"
        " (C) 1998-2005 Gerald Combs <gerald@ethereal.com>\n\n"
        "%s\n\n"
        "%s\n\n"
        " (C) 1998-2005 Gerald Combs <gerald@ethereal.com>\n\n"
        "%s\n\n"
        "%s\n\n"
@@ -167,7 +163,7 @@ about_ethereal_page_new(void)
        "Ethereal is Open Source Software released under the GNU General Public License.\n\n"
 
        "Check the man page and http://www.ethereal.com for more information.",
        "Ethereal is Open Source Software released under the GNU General Public License.\n\n"
 
        "Check the man page and http://www.ethereal.com for more information.",
-       comp_info_str->str, runtime_info_str->str);
+       svnversion, comp_info_str->str, runtime_info_str->str);
 
   msg_label = gtk_label_new(message);
   g_free(message);
 
   msg_label = gtk_label_new(message);
   g_free(message);
index 30150bfa129471a3f49b509def1df8f36665cdc4..e33d622717dd2a8c76c117d06df3df82dd8b58b4 100644 (file)
@@ -67,7 +67,6 @@
 #include <epan/addr_resolv.h>
 
 /* general (not GTK specific) */
 #include <epan/addr_resolv.h>
 
 /* general (not GTK specific) */
-#include "svnversion.h"
 #include "file.h"
 #include "summary.h"
 #include "filters.h"
 #include "file.h"
 #include "summary.h"
 #include "filters.h"
@@ -1082,13 +1081,10 @@ print_usage(gboolean print_ver) {
 
   if (print_ver) {
     output = stdout;
 
   if (print_ver) {
     output = stdout;
-    fprintf(output, "This is "PACKAGE " " VERSION
-#ifdef SVNVERSION
-       " (" SVNVERSION ")"
-#endif
+    fprintf(output, "This is "PACKAGE " " VERSION "%s"
         "\n (C) 1998-2005 Gerald Combs <gerald@ethereal.com>"
        "\n\n%s\n\n%s\n",
         "\n (C) 1998-2005 Gerald Combs <gerald@ethereal.com>"
        "\n\n%s\n\n%s\n",
-       comp_info_str->str, runtime_info_str->str);
+       svnversion, comp_info_str->str, runtime_info_str->str);
   } else {
     output = stderr;
   }
   } else {
     output = stderr;
   }
index bb8c60880032604229fee393a7d0c803c7d5b270..92595f32751262f322751c70dc12c1c438f705a8 100644 (file)
@@ -59,8 +59,6 @@
 #include "getopt.h"
 #endif
 
 #include "getopt.h"
 #endif
 
-#include "svnversion.h"
-
 #include <glib.h>
 #include <epan/epan.h>
 #include <epan/filesystem.h>
 #include <glib.h>
 #include <epan/epan.h>
 #include <epan/filesystem.h>
@@ -220,14 +218,11 @@ print_usage(gboolean print_ver)
 
   if (print_ver) {
     output = stdout;
 
   if (print_ver) {
     output = stdout;
-    fprintf(output, "This is GNU t" PACKAGE " " VERSION
-#ifdef SVNVERSION
-       " (" SVNVERSION ")"
-#endif
+    fprintf(output, "This is GNU t" PACKAGE " " VERSION "%s"
         "\n (C) 1998-2005 Gerald Combs <gerald@ethereal.com>"
        "\n%s\n%s\n",
 
         "\n (C) 1998-2005 Gerald Combs <gerald@ethereal.com>"
        "\n%s\n%s\n",
 
-       comp_info_str->str, runtime_info_str->str);
+       svnversion, comp_info_str->str, runtime_info_str->str);
   } else {
     output = stderr;
   }
   } else {
     output = stderr;
   }
@@ -1000,12 +995,8 @@ main(int argc, char *argv[])
        }
        break;
       case 'v':        /* Show version and exit */
        }
        break;
       case 'v':        /* Show version and exit */
-        printf("t" PACKAGE " " VERSION
-#ifdef SVNVERSION
-           " (" SVNVERSION ")"
-#endif
-           "\n%s\n%s\n",
-           comp_info_str->str, runtime_info_str->str);
+        printf("t" PACKAGE " " VERSION "%s\n%s\n%s\n",
+           svnversion, comp_info_str->str, runtime_info_str->str);
         exit(0);
         break;
       case 'w':        /* Write to capture file xxx */
         exit(0);
         break;
       case 'w':        /* Write to capture file xxx */
index 0e6af95fe5b57fb895005dcbda9e6c0850017696..11a069113c3e94b30d5ed98184ee857b9cfb74bb 100644 (file)
 #include "version_info.h"
 #include "pcap-util.h"
 
 #include "version_info.h"
 #include "pcap-util.h"
 
+#include "svnversion.h"
+
+#ifdef SVNVERSION
+       const char *svnversion = " (" SVNVERSION ")";
+#else
+       const char *svnversion = "";
+#endif
+
+
 /*
  * See whether the last line in the string goes past column 80; if so,
  * replace the blank at the specified point with a newline.
 /*
  * See whether the last line in the string goes past column 80; if so,
  * replace the blank at the specified point with a newline.
index bcba136d2c829022bba018d7be79884b13331089..ada86b586333cf2f0c2a3cc58b20e7db19671d08 100644 (file)
 extern "C" {
 #endif /* __cplusplus */
 
 extern "C" {
 #endif /* __cplusplus */
 
+/*
+ * The svn version string or ""
+ */
+const gchar *svnversion;
+
 /*
  * Get various library compile-time versions and append them to
  * the specified GString.
 /*
  * Get various library compile-time versions and append them to
  * the specified GString.