machinekit/machinekit — pull request #142 by mhaberler (2014-04-20 10:40:41+00:00)
Title: improve detecting common build errors when changing branches

when checking out a new branch, it's easy to trip over old binaries and make artefacts

this patch helps detecting this situation by comparing the git SHA seen during ./configure, and the git SHA present when running make

a compile-time warning is issued in this case like so:

***********************************************************
WARNING: configure was last run at Sun Apr 20 12:12:40 CEST 2014 at git version c99d9dd
WARNING: now the git version is: 144ec1e
WARNING: consider executing 'make clean; sh autogen.sh; ./configure ' before running make
***********************************************************

Also, msgd startup compares those SHA's and logs a warning:

Apr 20 12:34:10 wheezy msgd:0: startup instance=inst0 pid=18048 flavor=rt-preempt rtlevel=5 usrlevel=5 halsize=512000 shm=Posix gcc=4.8.2 version=v2.6.0~pre~make-clean-check~c99d9dd
Apr 20 12:34:10 wheezy msgd:0: configured: Apr 20 2014 12:12:38 sha=c99d9dd
Apr 20 12:34:10 wheezy msgd:0: built: Apr 20 2014 12:33:49 sha=144ec1e
Apr 20 12:34:10 wheezy msgd:0: WARNING: git SHA's for configure and build do not match!

This patch is not perfect yet - it doesnt work too well if not building from git (i.e. a tar file), but it should cover a common situation when testing branches