[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-dev
Subject:    [Mesa3d-dev] [PATCH] autoconf: Scrape the version from
From:       Dan Nicholson <dbn.lists () gmail ! com>
Date:       2008-04-30 23:04:29
Message-ID: 1209596669-6796-1-git-send-email-dbn.lists () gmail ! com
[Download RAW message or body]

Added the make script version.mk to print the various version numbers
from configs/default. This is used to substitute the version in autoconf
rather than duplicating it in both places.
---
Dan

 Does anyone have any problems with this? If not, I'll probably commit
 it tomorrow.

 bin/version.mk    |   17 +++++++++++++++++
 configs/default   |    1 +
 configure.ac      |   14 ++++++++++----
 docs/devinfo.html |    4 ++--
 4 files changed, 30 insertions(+), 6 deletions(-)
 create mode 100755 bin/version.mk

diff --git a/bin/version.mk b/bin/version.mk
new file mode 100755
index 0000000..ab20d79
--- /dev/null
+++ b/bin/version.mk
@@ -0,0 +1,17 @@
+#!/usr/bin/make -sf
+# Print the various Mesa version fields. This is mostly used to add the
+# version to configure.
+
+# This reflects that this script is usually called from the toplevel
+TOP = .
+
+include $(TOP)/configs/default
+
+version:
+	@echo $(MESA_VERSION)
+major:
+	@echo $(MESA_MAJOR)
+minor:
+	@echo $(MESA_MINOR)
+tiny:
+	@echo $(MESA_TINY)
diff --git a/configs/default b/configs/default
index 9705d6b..337c619 100644
--- a/configs/default
+++ b/configs/default
@@ -11,6 +11,7 @@ CONFIG_NAME = default
 MESA_MAJOR=7
 MESA_MINOR=1
 MESA_TINY=0
+MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 
 # external projects.  This should be useless now that we use libdrm.
 DRM_SOURCE_PATH=$(TOP)/../drm
diff --git a/configure.ac b/configure.ac
index 672bab8..4d93eaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,11 +2,17 @@ dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.59)
 
-dnl Versioning
-dnl Make version number available to autoconf and configure
-m4_define([mesa_version],[7.1.0])
+dnl Versioning - scrape the version from configs/default
+m4_define([mesa_version],
+    [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])])
+m4_ifval(mesa_version,[],[
+    m4_errprint([Error: Failed to get the Mesa version from the output of
+       running `make -f bin/version.mk version'
+])
+    m4_exit([1])
+])
 
-AC_INIT([Mesa],[mesa_version()],
+AC_INIT([Mesa],[mesa_version],
     [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
 AC_CONFIG_AUX_DIR(bin)
 AC_CANONICAL_HOST
diff --git a/docs/devinfo.html b/docs/devinfo.html
index 1f54a92..3cebf5f 100644
--- a/docs/devinfo.html
+++ b/docs/devinfo.html
@@ -136,11 +136,11 @@ Update the docs/VERSIONS file too.
 
 <p>
 Edit the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
-configs/default and configure.ac.
+configs/default.
 </p>
 
 <p>
-Make sure the values in src/mesa/main/version.h is correct.
+Make sure the values in src/mesa/main/version.h are correct.
 </p>
 
 <p>
-- 
1.5.3.2


-------------------------------------------------------------------------
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
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic