# Makefile.am
# Automake file for Ethereal
#
-# $Id: Makefile.am,v 1.691 2004/01/16 04:37:54 gerald Exp $
+# $Id: Makefile.am,v 1.692 2004/01/16 20:03:10 jmayer Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
xmlstub.h
BUILT_SOURCES = \
+ cvsversion.h \
x11-declarations.h \
x11-register-info.h
text2pcap_LDADD = $(text2pcap_optional_objects) \
@GLIB_LIBS@ -lm
-mergecap_SOURCES = mergecap.c
+mergecap_SOURCES = mergecap.c cvsversion.h
mergecap_DEPENDENCIES = wiretap/libwiretap.a
editcap_SOURCES = editcap.c
# Common headers
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap
+#
+# Build the version string
+#
+cvsversion.h:
+ $(PERL) make-version.pl `find . -name "Entries"`
+
#
# Build various header files for the X11 dissector.
#
/* main.c
*
- * $Id: main.c,v 1.353 2004/01/11 22:17:43 guy Exp $
+ * $Id: main.c,v 1.354 2004/01/16 20:04:21 jmayer Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <epan/filesystem.h>
#include <epan/epan_dissect.h>
+#include "cvsversion.h"
#include "main.h"
#include <epan/timestamp.h>
#include <epan/packet.h>
snprintf(message, MAX_ABOUT_MSG_LEN,
"Ethereal - Network Protocol Analyzer\n\n"
- "Version " VERSION " (C) 1998-2003 Gerald Combs <gerald@ethereal.com>\n\n"
+ "Version " VERSION CVSVERSION " (C) 1998-2003 Gerald Combs <gerald@ethereal.com>\n\n"
"%s\n"
"%s\n\n"
print_usage(gboolean print_ver) {
if (print_ver) {
- fprintf(stderr, "This is GNU " PACKAGE " " VERSION "\n%s\n%s\n",
+ fprintf(stderr, "This is GNU " PACKAGE " " VERSION CVSVERSION "\n%s\n%s\n",
comp_info_str->str, runtime_info_str->str);
}
#ifdef HAVE_LIBPCAP
create_console();
#endif
- printf("%s %s\n%s\n%s\n", PACKAGE, VERSION, comp_info_str->str,
+ printf("%s %s%s\n%s\n%s\n", PACKAGE, VERSION, CVSVERSION, comp_info_str->str,
runtime_info_str->str);
}
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright 2004 Jörg Mayer (see AUTHORS file)
+#
+# $Id: make-version.pl,v 1.1 2004/01/16 20:03:10 jmayer Exp $
+#
+# Ethereal - Network traffic analyzer
+# By Gerald Combs <gerald@ethereal.com>
+# Copyright 1998 Gerald Combs
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# usage: ./make-version.pl `find . -name "Entries"`
+
+use strict;
+
+my ($d1,$d2,$d3,$date,$drest);
+my ($wdayascii, $monthascii, $day, $time, $year);
+
+my %asctonum = ( "Jan" => "01", "Feb" => "02", "Mar" => "03", "Apr" => "04",
+ "May" => "05", "Jun" => "06", "Jul" => "07", "Aug" => "08",
+ "Sep" => "09", "Oct" => "10", "Nov" => "11", "Dec" => "12" );
+
+my $current;
+my $last = "";
+
+if ($#ARGV >= 0) {
+ while (<>) {
+ chomp;
+ # Regular lines look like this: /ethereal_be.py/1.6/Fri Aug 2 22:55:19 2002//
+ next if (/^D/);
+ ($d1,$d2,$d2,$date,$drest) = split(/\//, $_, 5);
+ next if ($date !~ /\d:\d\d:\d\d/);
+ ($wdayascii, $monthascii, $day, $time, $year) = split(/\s+/, $date);
+ $day = substr("0".$day, 0, 2);
+ $time =~ s/://g;
+ $current = "$year$asctonum{$monthascii}$day$time";
+ if ($current gt $last) {
+ $last = $current;
+ }
+ }
+} elsif (-f "cvsversion") {
+ $last = `cat cvsversion`;
+}
+if ( $last ne "" ) {
+ $last = "#define CVSVERSION \"cvs$last\"\n";
+} else {
+ $last = "#define CVSVERSION \"\"\n";
+}
+
+my $needsupdate=0;
+
+if (! open(OLDVER, "<cvsversion.h")) {
+ $needsupdate = 1;
+} else {
+ if (<OLDVER> ne $last) {
+ $needsupdate = 1;
+ }
+ close OLDVER;
+}
+
+if ($needsupdate == 1) {
+ open(VER, ">cvsversion.h") || die ("Cannot write to cvsversion.h ($!)\n");
+ print VER "$last";
+ close VER;
+}
+
+__END__
+
+
/* Combine two dump files, either by appending or by merging by timestamp
*
- * $Id: mergecap.c,v 1.11 2002/08/28 21:00:06 jmayer Exp $
+ * $Id: mergecap.c,v 1.12 2004/01/16 20:03:10 jmayer Exp $
*
* Written by Scott Renfro <scott@renfro.org> based on
* editcap by Richard Sharpe and Guy Harris
#include "getopt.h"
#endif
+#include "cvsversion.h"
/*
* Global variables
break;
case 'h':
- fprintf(stderr, "mergecap version %s\n", VERSION);
+ fprintf(stderr, "mergecap version %s%s\n", VERSION, CVSVERSION);
usage();
exit(1);
break;
/* tethereal.c
*
- * $Id: tethereal.c,v 1.217 2004/01/11 22:17:42 guy Exp $
+ * $Id: tethereal.c,v 1.218 2004/01/16 20:03:10 jmayer Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "getopt.h"
#endif
+#include "cvsversion.h"
+
#include <glib.h>
#include <epan/epan.h>
#include <epan/filesystem.h>
int i;
if (print_ver) {
- fprintf(stderr, "This is GNU t%s %s\n%s\n%s\n", PACKAGE, VERSION,
+ fprintf(stderr, "This is GNU t%s %s%s\n%s\n%s\n", PACKAGE, VERSION, CVSVERSION,
comp_info_str->str, runtime_info_str->str);
}
#ifdef HAVE_LIBPCAP
}
break;
case 'v': /* Show version and exit */
- printf("t%s %s\n%s\n%s\n", PACKAGE, VERSION, comp_info_str->str,
+ printf("t%s %s%s\n%s\n%s\n", PACKAGE, VERSION, CVSVERSION, comp_info_str->str,
runtime_info_str->str);
exit(0);
break;