>From ee7e21c2cd96ce8b1a31f9013d606ab0ea3699e6 Mon Sep 17 00:00:00 2001
From: Pekka Paalanen <[EMAIL PROTECTED]>
Date: Sun, 20 Apr 2008 20:47:38 +0300
Subject: [PATCH] linux-core Makefile: add GIT_REVISION
This tries to automatically fetch a git revision string and if succeeds,
it #defines GIT_REVISION string macro. Packagers can override it by
'make GIT_REVISION=foo'.
Update Nouveau to use GIT_REVISION, if defined, instead of DRIVER_DATE
in struct drm_driver.
Signed-off-by: Pekka Paalanen <[EMAIL PROTECTED]>
---
Hi,
may I push this to DRM?
Marcheu ok'd it already.
linux-core/Makefile | 5 +++++
linux-core/nouveau_drv.c | 4 ++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/linux-core/Makefile b/linux-core/Makefile
index 7f6b123..3af6f37 100644
--- a/linux-core/Makefile
+++ b/linux-core/Makefile
@@ -335,6 +335,11 @@ ifneq (,$(findstring i915,$(DRM_MODULES)))
CONFIG_DRM_I915 := m
endif
+GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git-describe --abbrev=17)
+ifneq ($(GIT_REVISION),)
+EXTRA_CFLAGS+=-D"GIT_REVISION=\"$(GIT_REVISION)\""
+endif
+
include $(DRMSRCDIR)/Makefile.kernel
# Depencencies
diff --git a/linux-core/nouveau_drv.c b/linux-core/nouveau_drv.c
index e9623eb..c8f57df 100644
--- a/linux-core/nouveau_drv.c
+++ b/linux-core/nouveau_drv.c
@@ -86,7 +86,11 @@ static struct drm_driver driver = {
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
+#ifdef GIT_REVISION
+ .date = GIT_REVISION,
+#else
.date = DRIVER_DATE,
+#endif
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
--
1.5.3.7
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel