diff --git a/configure.ac b/configure.ac index a15a6d6..3a4f9da 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,8 @@ dnl> Do not add anything above N2N_VERSION=${PACKAGE_VERSION} +AC_DEFINE([PACKAGE_BUILDDATE], "[m4_esyscmd([scripts/version.sh date | tr -d '\n'])]", [Last change date]) + if test "${CC+set}" != set; then CC=gcc fi diff --git a/include/n2n.h b/include/n2n.h index 67e865f..c798722 100644 --- a/include/n2n.h +++ b/include/n2n.h @@ -51,8 +51,6 @@ -#define PACKAGE_BUILDDATE (__DATE__ " " __TIME__) - #include #include #include diff --git a/scripts/hack_fakeautoconf.sh b/scripts/hack_fakeautoconf.sh index 8849bdd..4c6d8cc 100755 --- a/scripts/hack_fakeautoconf.sh +++ b/scripts/hack_fakeautoconf.sh @@ -18,4 +18,5 @@ EOF cat <include/config.h #define PACKAGE_VERSION "FIXME" #define PACKAGE_OSNAME "FIXME" +#define PACKAGE_BUILDDATE "$(date)" EOF diff --git a/scripts/version.sh b/scripts/version.sh index e551500..7f0df58 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -4,7 +4,7 @@ # usage() { - echo "Usage: $0 [short|hash]" + echo "Usage: $0 [date|short|hash]" echo echo "Determine the correct version number for the current build" exit 0 @@ -32,6 +32,7 @@ if [ -d "$TOPDIR/.git" ]; then VER_SHORT="$VER_GIT_SHORT" VER_HASH=$(git rev-parse --short HEAD) VER=$(git describe --abbrev=7 --dirty) + DATE=$(git log -1 --format=%cd) else # If there is no .git directory in our TOPDIR, we fall back on relying on # the VERSION file @@ -39,9 +40,13 @@ else VER_SHORT="$VER_FILE_SHORT" VER_HASH="HEAD" VER="$VER_FILE_SHORT" + DATE=$(date) fi case "$1" in + date) + echo "$DATE" + ;; hash) echo "$VER_HASH" ;;