/ChangeLog
/INSTALL
/mtr
+/version.h
+/version.h.tmp
select.c select.h \
mtr-curses.h \
mtr-gtk.h
+nodist_mtr_SOURCES = version.h
EXTRA_mtr_SOURCES = curses.c \
gtk.c
mtr_DEPENDENCIES = $(GTK_OBJ) $(CURSES_OBJ)
mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ)
+CLEANFILES = version.h
+BUILT_SOURCES = version.h
+
+version.h: version.h.tmp Makefile $(mtr_SOURCES)
+ @cat $< > $@; \
+ if [ -d .git ] && [ -n "$$(which git)" ]; then \
+ xver="+git-$$(git rev-list -n1 --abbrev=8 --abbrev-commit HEAD)"; \
+ sed \
+ -e "/#define *MTR_VERSION */{s/\"\([^\"]*\)\"/\"\1$$xver\"/;}" \
+ $< > $@; \
+ fi;
+
EXTRA_DIST = SECURITY mtr.8 Makefile Makefile.dist
distclean-local:
(sleep 3; cp Makefile.dist Makefile) &
AC_INIT(mtr.c)
AM_INIT_AUTOMAKE(mtr, 0.83)
+AC_CONFIG_FILES([version.h.tmp:version.h.in])
AC_SUBST(GTK_OBJ)
AC_SUBST(CURSES_OBJ)
#include "net.h"
#include "dns.h"
#include "asn.h"
+#include "version.h"
#include <glib.h>
#endif
move(0, 0);
attron(A_BOLD);
- pwcenter("My traceroute [v" VERSION "]");
+ pwcenter("My traceroute [v" MTR_VERSION "]");
attroff(A_BOLD);
mvprintw(1, 0, "%s (%s)", LocalHostname, net_localaddr());
#include "net.h"
#include "dns.h"
#include "mtr-gtk.h"
+#include "version.h"
#include "img/mtr_icon.xpm"
#endif
};
gtk_show_about_dialog(GTK_WINDOW(main_window)
- , "version", VERSION
+ , "version", MTR_VERSION
, "copyright", "Copyright \xc2\xa9 1997,1998 Matt Kimball"
, "website", "http://www.bitwizard.nl/mtr/"
, "authors", authors
#include "report.h"
#include "net.h"
#include "asn.h"
+#include "version.h"
#ifdef ENABLE_IPV6
}
if (PrintVersion) {
- printf ("mtr " VERSION "\n");
+ printf ("mtr " MTR_VERSION "\n");
exit(0);
}
--- /dev/null
+/*
+ mtr -- a network diagnostic tool
+ Copyright (C) 1997,1998 Matt Kimball
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2 as
+ published by the Free Software Foundation.
+
+ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#define MTR_VERSION "@VERSION@"
+