diff options
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | src/sna/Makefile.am | 7 | ||||
-rw-r--r-- | src/sna/sna_driver.c | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index fbd46a72..089fbdb0 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,14 @@ m4_ifndef([XORG_DRIVER_CHECK_EXT], LT_PREREQ([2.2]) LT_INIT([disable-static]) +# Are we in a git checkout? +dot_git=no +if test -e .git; then + AC_DEFINE(HAVE_DOT_GIT, 1, [Are we in a git checkout?]) + dot_git=yes +fi +AM_CONDITIONAL(HAVE_DOT_GIT, test x$dot_git = xyes) + PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.2], [gen4asm=yes], [gen4asm=no]) AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes) diff --git a/src/sna/Makefile.am b/src/sna/Makefile.am index daf4e98c..bacb98fa 100644 --- a/src/sna/Makefile.am +++ b/src/sna/Makefile.am @@ -99,3 +99,10 @@ libsna_la_SOURCES += \ kgem_debug_gen6.c \ $(NULL) endif + +if HAVE_DOT_GIT +git_version.h: $(top_builddir)/.git/HEAD $(shell sed -e '/ref:/!d' -e 's#ref: *#$(top_builddir)/.git/#' < $(top_builddir)/.git/HEAD) + @echo "Recording git-tree used for compilation: `git describe`" + @V=`git describe`; echo "static const char git_version[] = \"$$V\";" > git_version.h +sna_driver.c: git_version.h +endif diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 107659b8..36f40194 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -71,6 +71,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include <sys/poll.h> #include "i915_drm.h" +#if HAVE_DOT_GIT +#include "git_version.h" +#endif + #if DEBUG_DRIVER #undef DBG #define DBG(x) ErrorF x @@ -1013,6 +1017,12 @@ void sna_init_scrn(ScrnInfoPtr scrn, int entity_num) { EntityInfoPtr entity; +#if HAVE_DOT_GIT + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "SNA compiled from %s\n", + git_version); +#endif + DBG(("%s\n", __FUNCTION__)); sna_device_key = xf86AllocateEntityPrivateIndex(); |