From 54ce8af6e0dbf41d9463ca38a5fdc33bd6ed913f Mon Sep 17 00:00:00 2001 From: Stephen Hutchinson Date: Fri, 23 Nov 2012 18:16:50 -0500 Subject: build: identify the build time of the binary in the versioning output Based on a patch by qyot27. Add export LC_ALL=C on top of version.sh to make the output locale independent. Note that the build time will not be updated on every "make" invocation, but only when the git revision is updated. This is a good thing, as repeated make invocations should not rebuild the binary. (This would break "sudo make install" too.) --- version.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'version.sh') diff --git a/version.sh b/version.sh index 3b0c319c83..a907dd26ad 100755 --- a/version.sh +++ b/version.sh @@ -1,5 +1,7 @@ #!/bin/sh +export LC_ALL=C + test "$1" && extra="-$1" # Extract revision number from file used by daily tarball snapshots @@ -15,10 +17,12 @@ test $version || version=git-$git_revision NEW_REVISION="#define VERSION \"${version}${extra}\"" OLD_REVISION=$(head -n 1 version.h 2> /dev/null) +BUILDDATE="#define BUILDDATE \"$(date)\"" # Update version.h only on revision changes to avoid spurious rebuilds if test "$NEW_REVISION" != "$OLD_REVISION"; then cat < version.h $NEW_REVISION +$BUILDDATE EOF fi -- cgit v1.2.3