Compute the version number dynamically
authorJason Self <j@jxself.org>
Sun, 24 Feb 2019 17:19:20 +0000 (09:19 -0800)
committerJason Self <j@jxself.org>
Sun, 24 Feb 2019 19:01:07 +0000 (11:01 -0800)
This creates a generated version number.

configure.ac
skein_cli.c
version.sh [new file with mode: 0755]

index 87ab1863fc0174313ceec902b4c8987c51626dfd..d55b03c0f6753bd791ea7ec063ab9dd72638d21c 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
 # 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])
 AC_CONFIG_SRCDIR([skein.h])
 AC_CONFIG_HEADERS([config.h])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
index 4378da620f85a029f7f9f90f68d1591cd2a07dee..39fb01ac3087204a0fd4d005c2c9d3e5008aeb98 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 2015 Jason Self <j@jxself.org>
+/* Copyright (C) 2014 2015 2019 Jason Self <j@jxself.org>
 
 This file is part of skeinsum.
 
 
 This file is part of skeinsum.
 
@@ -377,7 +377,7 @@ void PrintStringHash(const char *s)
 
 void print_version(void)
 {
 
 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("<http://gnu.org/licenses/gpl.html>\n");
        printf("This is free software: you are free to change and redistribute it.\n");
        printf("License GPLv3+: GNU GPL version 3 or later\n");
        printf("<http://gnu.org/licenses/gpl.html>\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 (executable)
index 0000000..c7153d5
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (C) 2019 Jason Self <j@jxself.org>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+commit_count=$(git rev-list HEAD --count)
+echo "$commit_count"
\ No newline at end of file