From 2acd62d3af56cf00fae62a86dda8bbca0f0b1913 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Tue, 16 Apr 2024 17:44:32 +0200 Subject: Update configure.ac with some m4 magic to add a git commit id and a reference of the last tag, the changes since then and the dirty flag from `git describe` --- configure.ac | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0a90ca48..81836e8e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,12 +1,20 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. +# ---------------------------------------------------------------------- +# Build version string. +# ---------------------------------------------------------------------- + +m4_define([htop_git_version], + m4_normalize(m4_esyscmd([git describe --abbrev=7 --dirty --always --tags 2> /dev/null || echo '']))) +m4_define([htop_release_version], [3.4.0-dev]) + # ---------------------------------------------------------------------- # Autoconf initialization. # ---------------------------------------------------------------------- AC_PREREQ([2.69]) -AC_INIT([htop], [3.4.0-dev], [htop@groups.io], [], [https://htop.dev/]) +AC_INIT([htop], [m4_join([-],m4_defn([htop_release_version]),m4_defn([htop_git_version]))], [htop@groups.io], [], [https://htop.dev/]) AC_CONFIG_SRCDIR([htop.c]) AC_CONFIG_AUX_DIR([build-aux]) -- cgit v1.2.3