xf86-video-intel: configure.ac src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 15 10:00:56 PDT 2011


 configure.ac         |   20 ++++++++++++++++++++
 src/sna/sna_driver.c |    8 +++++---
 2 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 72ca1fdf2fea80ff4cf003bb025424d15d8bac58
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 15 17:52:45 2011 +0100

    configure: Introduce --with-builderstring
    
    Julien Cristau disliked my broadcasting of the git tree used to build
    his distribution package as it bore little relevance to his users. As it
    is only useful for people installing their own drivers (as a means of
    sanity checking that they are running the right driver), we introduce
    the --with-builderstring idiom borrowed from the xserver. This allows
    the builder to override the use of `git describe` and either leave it
    blank or to fill it with something useful for their own purposes.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 089fbdb..e269006 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,6 +67,26 @@ if test -e .git; then
 fi
 AM_CONDITIONAL(HAVE_DOT_GIT, test x$dot_git = xyes)
 
+# If so, we include the git description in our logs for sanity checking.
+#
+# However, for people not running their own drivers this is just noise.
+# So we copy the xserver's builderstring idiom to allow for this to be
+# overridden and perhaps replaced with something more useful.
+AC_ARG_WITH(builderstring,
+	    AS_HELP_STRING([--with-builderstring=BUILDERSTRING],
+			   [Additional builder string (default: use git describe)]),
+	    [BUILDERSTRING="$withval"],
+	    [BUILDERSTRING="x-magic-git-describe"])
+
+if test "x$BUILDERSTRING" = xx-magic-git-describe -a x$dot_git = xyes; then
+	AC_DEFINE(USE_GIT_DESCRIBE, 1, [Use automagic builder description])
+else
+  if test "x$BUILDERSTRING" != x -a "x$BUILDERSTRING" != xno -a "x$BUILDERSTRING" != xx-magic-git-describe; then
+	  AC_DEFINE_UNQUOTED(BUILDER_DESCRIPTION, ["$BUILDERSTRING"], [Builder description])
+  fi
+fi
+
+
 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/sna_driver.c b/src/sna/sna_driver.c
index 36f4019..83abdb3 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -1017,10 +1017,12 @@ void sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
 {
 	EntityInfoPtr entity;
 
-#if HAVE_DOT_GIT
+#if defined(USE_GIT_DESCRIBE)
+	xf86DrvMsg(scrn->scrnIndex, X_INFO,
+		   "SNA compiled from %s\n", git_version);
+#elif BUILDER_DESCRIPTION
 	xf86DrvMsg(scrn->scrnIndex, X_INFO,
-		   "SNA compiled from %s\n",
-		   git_version);
+		   "SNA compiled: %s\n", BUILDER_DESCRIPTION);
 #endif
 
 	DBG(("%s\n", __FUNCTION__));


More information about the xorg-commit mailing list