config, nv: Use xorg-macros PACKAGE_VERSION_{MAJOR, MINOR, PATCHLEVEL}

Graphics / X.Org / xf86-video-nouveau - Rhys Kidd [gmail.com] - 22 January 2019 02:29 EST

Use xorg-macros provided PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} rather than rolling our own in xf86-video-nouveau.

Macro has been available since xorg-macros 1.1.5 (we rely on >= 1.8) provided that XORG_DEFAULT_OPTIONS is called.

Fixes: b82aacd ("configure: require xorg-macros 1.8")

###

diff --git a/configure.ac b/configure.ac
index 2fb8fcd..c9b8a66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,15 +26,6 @@ AC_INIT([xf86-video-nouveau],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-nouveau])

-AC_DEFINE_UNQUOTED([NV_MAJOR_VERSION],
- [$(echo $PACKAGE_VERSION | sed -e 's/^\([[0-9]]*\)\.[[0-9]]*\.[[0-9]]*/\1/')],
- [Major version])
-AC_DEFINE_UNQUOTED([NV_MINOR_VERSION],
- [$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*/\1/')],
- [Minor version])
-AC_DEFINE_UNQUOTED([NV_PATCHLEVEL],
- [$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)/\1/')],
- [Patch version])
AC_DEFINE_UNQUOTED([NV_DRIVER_DATE],
[$(echo -n \";git log |head -3|tail -1|tr -d '\n';echo -n \")],
[Driver date])
diff --git a/src/nv_driver.c b/src/nv_driver.c
index a5d50c1..1d276cf 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -154,7 +154,7 @@ static XF86ModuleVersionInfo nouveauVersRec =
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
- NV_MAJOR_VERSION, NV_MINOR_VERSION, NV_PATCHLEVEL,
+ PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_VIDEODRV, /* This is a video driver */
ABI_VIDEODRV_VERSION,
MOD_CLASS_VIDEODRV,

9b2b008 config, nv: Use xorg-macros PACKAGE_VERSION_{MAJOR, MINOR, PATCHLEVEL}
configure.ac | 9 ---------
src/nv_driver.c | 2 +-
2 files changed, 1 insertion(+), 10 deletions(-)

Upstream: cgit.freedesktop.org


  • Share