Add git commit version info

This commit is contained in:
john hood
2015-05-18 18:56:40 -04:00
committed by John Hood
parent e0138bdb2b
commit f3073bbe5d
5 changed files with 32 additions and 7 deletions
+21
View File
@@ -1,3 +1,24 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src scripts man conf
EXTRA_DIST = autogen.sh ocb-license.html README.md COPYING.iOS
nodist_noinst_HEADERS = version.h
BUILT_SOURCES = version.h
.PHONY: VERSION
VERSION:
@-[ -f VERSION ] || echo @PACKAGE_STRING@ > VERSION
@-git status > /dev/null 2>&1 && \
git describe --dirty > VERSION.new && \
! diff -q VERSION VERSION.new > /dev/null && \
mv VERSION.new VERSION
@rm -f VERSION.new
version.h: VERSION
@printf '#define BUILD_VERSION "%s"\n' "$$(cat VERSION)" > version.h.new
@-! diff -q version.h version.h.new > /dev/null && \
mv version.h.new version.h
@rm -f version.h.new
clean-local:
@rm -f version.h VERSION
+6 -2
View File
@@ -1,4 +1,8 @@
EXTRA_DIST = wrap-compiler-for-flag-check
EXTRA_DIST = wrap-compiler-for-flag-check mosh.pl
if BUILD_CLIENT
dist_bin_SCRIPTS = mosh
bin_SCRIPTS = mosh
endif
CLEANFILES = $(bin_SCRIPTS)
mosh: mosh.pl ../VERSION Makefile
@sed -e "s/\@VERSION\@/`cat ../VERSION`/" -e "s/\@PACKAGE_STRING\@/@PACKAGE_STRING@/" $(srcdir)/mosh.pl > mosh
+1 -3
View File
@@ -30,8 +30,6 @@
# this exception statement from all source files in the program, then
# also delete it here.
my $MOSH_VERSION = '1.2.4a';
use warnings;
use strict;
use Getopt::Long;
@@ -89,7 +87,7 @@ qq{Usage: $0 [options] [--] [user@]host [command...]
Please report bugs to mosh-devel\@mit.edu.
Mosh home page: http://mosh.mit.edu\n};
my $version_message = qq{mosh $MOSH_VERSION
my $version_message = qq{@PACKAGE_STRING@ [build @VERSION@]
Copyright 2012 Keith Winstein <mosh-devel\@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
+2 -1
View File
@@ -31,6 +31,7 @@
*/
#include "config.h"
#include "version.h"
#include <stdlib.h>
#include <string.h>
@@ -71,7 +72,7 @@
#endif
void usage( const char *argv0 ) {
fprintf( stderr, "mosh-client (%s)\n", PACKAGE_STRING );
fprintf( stderr, "mosh-client (%s) [build %s]\n", PACKAGE_STRING, BUILD_VERSION );
fprintf( stderr, "Copyright 2012 Keith Winstein <mosh-devel@mit.edu>\n" );
fprintf( stderr, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n" );
+2 -1
View File
@@ -31,6 +31,7 @@
*/
#include "config.h"
#include "version.h"
#include <errno.h>
#include <locale.h>
@@ -368,7 +369,7 @@ int run_server( const char *desired_ip, const char *desired_port,
_exit( 0 );
}
fprintf( stderr, "\nmosh-server (%s)\n", PACKAGE_STRING );
fprintf( stderr, "\nmosh-server (%s) [build %s]\n", PACKAGE_STRING, BUILD_VERSION );
fprintf( stderr, "Copyright 2012 Keith Winstein <mosh-devel@mit.edu>\n" );
fprintf( stderr, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n" );