From 28de312cd6c2d32822e2b2ce793abbdf2ae640dc Mon Sep 17 00:00:00 2001 From: Jason Self Date: Sun, 24 Feb 2019 09:19:20 -0800 Subject: [PATCH] Compute the version number dynamically This creates a generated version number. --- configure.ac | 2 +- skein_cli.c | 4 ++-- version.sh | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 version.sh diff --git a/configure.ac b/configure.ac index 87ab186..d55b03c 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([skeinsum], [1.0], [j@jxself.org]) +AC_INIT([skeinsum], m4_esyscmd_s([./version.sh]), [j@jxself.org]) AC_CONFIG_SRCDIR([skein.h]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) diff --git a/skein_cli.c b/skein_cli.c index 4378da6..39fb01a 100644 --- a/skein_cli.c +++ b/skein_cli.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 2015 Jason Self +/* Copyright (C) 2014 2015 2019 Jason Self This file is part of skeinsum. @@ -377,7 +377,7 @@ void PrintStringHash(const char *s) void print_version(void) { - printf("skein%dsum 1.0\n", hashbitlen); + printf("skein%dsum %s\n", hashbitlen, VERSION); printf("License GPLv3+: GNU GPL version 3 or later\n"); printf("\n"); printf("This is free software: you are free to change and redistribute it.\n"); diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..c7153d5 --- /dev/null +++ b/version.sh @@ -0,0 +1,19 @@ +# Copyright (C) 2019 Jason Self +# +# This file is part of skeinsum. +# +# skeinsum 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 3 of the License, or +# (at your option) any later version. +# +# skeinsum 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 skeinsum. If not, see . + +commit_count=$(git rev-list HEAD --count) +echo "$commit_count" \ No newline at end of file -- 2.31.1