diff --git a/Makefile.am b/Makefile.am index 0a4faef3..9c245616 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,14 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = COPYING.README README.android +# If git describe works, force autoconf to run in order to make sure we have the +# current version number from git in the resulting configure script. +configure-version: + -git describe && autoconf --force + +# Triggering the README target means we are building a distribution (make dist). +README: configure-version + ChangeLog: git log > ChangeLog diff --git a/configure.ac b/configure.ac index 9a9bf019..2672e1c5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([tinc], [1.1pre11]) +AC_INIT([tinc], m4_esyscmd([echo -n "`git describe || echo UNKNOWN | sed 's/release-//'`"])) AC_CONFIG_SRCDIR([src/tincd.c]) AC_GNU_SOURCE -AM_INIT_AUTOMAKE([check-news std-options subdir-objects -Wall]) +AM_INIT_AUTOMAKE([std-options subdir-objects -Wall]) AC_CONFIG_HEADERS([config.h]) # Enable GNU extensions.