Module: Mesa
Branch: master
Commit: 65fc16c97413edeef508e0bfc4b0ceb4e430c1fe
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=65fc16c97413edeef508e0bfc4b0ceb4e430c1fe

Author: Dylan Baker <[email protected]>
Date:   Mon Oct 30 16:52:29 2017 -0700

autotools: set XA versions in configure.ac and configure header file

Currently the versions are set in the header, and then sed is used to
extract them, so that autotools can use them elsewhere.

This is odd. Autotools is perfectly capable of configuring the header
with the versions, and then they don't need to be extracted from the
the header. This is cleaner and more obvious.

Tested with make distcheck.

v2: - Split tiny -> patch change
    - Drop temporary variables
    - change XA_VERSION_* -> XA_*
v3: - Finish splitting the tiny -> patch change

Signed-off-by: Dylan Baker <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Matt Turner <[email protected]> (v2)

---

 configure.ac                                                 | 12 ++++--------
 .../state_trackers/xa/{xa_tracker.h => xa_tracker.h.in}      |  6 +++---
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index a7ae920ab9..300ee1a89e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2864,14 +2864,9 @@ AM_CONDITIONAL(HAVE_VULKAN_COMMON, test 
"x$VULKAN_DRIVERS" != "x")
 AC_SUBST([XVMC_MAJOR], 1)
 AC_SUBST([XVMC_MINOR], 0)
 
-XA_HEADER="$srcdir/src/gallium/state_trackers/xa/xa_tracker.h"
-XA_MAJOR=`grep "#define XA_TRACKER_VERSION_MAJOR" $XA_HEADER | $SED 
's/^#define XA_TRACKER_VERSION_MAJOR //'`
-XA_MINOR=`grep "#define XA_TRACKER_VERSION_MINOR" $XA_HEADER | $SED 
's/^#define XA_TRACKER_VERSION_MINOR //'`
-XA_TINY=`grep "#define XA_TRACKER_VERSION_PATCH" $XA_HEADER | $SED 's/^#define 
XA_TRACKER_VERSION_PATCH //'`
-
-AC_SUBST([XA_MAJOR], $XA_MAJOR)
-AC_SUBST([XA_MINOR], $XA_MINOR)
-AC_SUBST([XA_TINY], $XA_TINY)
+AC_SUBST([XA_MAJOR], 2)
+AC_SUBST([XA_MINOR], 3)
+AC_SUBST([XA_TINY], 0)
 AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
 
 AC_ARG_ENABLE(valgrind,
@@ -2954,6 +2949,7 @@ AC_CONFIG_FILES([Makefile
                  src/gallium/state_trackers/va/Makefile
                  src/gallium/state_trackers/vdpau/Makefile
                  src/gallium/state_trackers/xa/Makefile
+                 src/gallium/state_trackers/xa/xa_tracker.h
                  src/gallium/state_trackers/xvmc/Makefile
                  src/gallium/targets/d3dadapter9/Makefile
                  src/gallium/targets/d3dadapter9/d3d.pc
diff --git a/src/gallium/state_trackers/xa/xa_tracker.h 
b/src/gallium/state_trackers/xa/xa_tracker.h.in
similarity index 98%
rename from src/gallium/state_trackers/xa/xa_tracker.h
rename to src/gallium/state_trackers/xa/xa_tracker.h.in
index 44b3eb5cbe..26c4f21d0f 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.h
+++ b/src/gallium/state_trackers/xa/xa_tracker.h.in
@@ -36,9 +36,9 @@
 
 #include <stdint.h>
 
-#define XA_TRACKER_VERSION_MAJOR 2
-#define XA_TRACKER_VERSION_MINOR 3
-#define XA_TRACKER_VERSION_PATCH 0
+#define XA_TRACKER_VERSION_MAJOR @XA_MAJOR@
+#define XA_TRACKER_VERSION_MINOR @XA_MINOR@
+#define XA_TRACKER_VERSION_PATCH @XA_TINY@
 
 #define XA_FLAG_SHARED         (1 << 0)
 #define XA_FLAG_RENDER_TARGET  (1 << 1)

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to