[PATCH] Use configure.ac version to generate driver module version
![](https://seccdn.libravatar.org/avatar/9b845cae896f81bfdc08f0085b83c2cf.jpg?s=120&d=mm&r=g)
From 42daed3597d031dc4b305880f7321e0ed3db0ab0 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann
Date: Mon, 15 Oct 2007 17:23:10 +0200 Subject: [PATCH] Use configure.ac version to generate driver module version
Adapted configure.ac so that the driver module version does not change. --- configure.ac | 2 +- src/rhd.h | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 16d9251..e3a7d42 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-radeonhd], - 1.1.1, + 0.0.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-radeonhd) diff --git a/src/rhd.h b/src/rhd.h index df18e21..bac38e8 100644 --- a/src/rhd.h +++ b/src/rhd.h @@ -26,14 +26,20 @@ #ifndef _RHD_H #define _RHD_H -#define RHD_VERSION 0001 +#include "config.h" + +#define RHD_MAJOR_VERSION PACKAGE_VERSION_MAJOR +#define RHD_MINOR_VERSION PACKAGE_VERSION_MINOR +#define RHD_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL + +#define RHD_VERSION \ + ((RHD_MAJOR_VERSION << 20) | \ + (RHD_MINOR_VERSION << 10) | \ + (RHD_PATCHLEVEL)) + #define RHD_NAME "RADEONHD" #define RHD_DRIVER_NAME "radeonhd" -#define RHD_MAJOR_VERSION 0 -#define RHD_MINOR_VERSION 0 -#define RHD_PATCHLEVEL 1 - enum RHD_CHIPSETS { RHD_UNKNOWN = 0, /* R500 */ -- 1.5.3.4 -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/9b845cae896f81bfdc08f0085b83c2cf.jpg?s=120&d=mm&r=g)
Shortcut for this patch: git pull http://radeonhd.lauft.net/xf86-video-radeonhd.git ndim-driver-version I have not checked that the bit shifts I stole from the avivo drive (now in rhd.h) work as intended, but they surely looked plausible: +#define RHD_VERSION \ + ((RHD_MAJOR_VERSION << 20) | \ + (RHD_MINOR_VERSION << 10) | \ + (RHD_PATCHLEVEL)) Hans Ulrich Niedermann wrote:
From 42daed3597d031dc4b305880f7321e0ed3db0ab0 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann
Date: Mon, 15 Oct 2007 17:23:10 +0200 Subject: [PATCH] Use configure.ac version to generate driver module version Adapted configure.ac so that the driver module version does not change. --- configure.ac | 2 +- src/rhd.h | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-)
![](https://seccdn.libravatar.org/avatar/9b845cae896f81bfdc08f0085b83c2cf.jpg?s=120&d=mm&r=g)
Hans Ulrich Niedermann wrote:
From 42daed3597d031dc4b305880f7321e0ed3db0ab0 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann
Date: Mon, 15 Oct 2007 17:23:10 +0200 Subject: [PATCH] Use configure.ac version to generate driver module version Adapted configure.ac so that the driver module version does not change. --- configure.ac | 2 +- src/rhd.h | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-)
Unfortunately, this breaks the imake build :-( I see two alternatives: a) Add some rule for imake to generate a config.h with the proper three definitions. That would need some sed/cut/etc. code to extract the version number from configure.ac, and then actually add the proper make rules for imake (which I have never used before). b) Hardcode the version in both src/rhd.h and configure.ac, and have a check program (run on "make check" in automake builds) that makes sure that the two redundant definitions do match. I can do that easily. Opinions?
![](https://seccdn.libravatar.org/avatar/9b845cae896f81bfdc08f0085b83c2cf.jpg?s=120&d=mm&r=g)
From 3a4bbd6d7af8b885d3795ecc5d017707f7e10811 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann
Date: Mon, 15 Oct 2007 23:23:00 +0200 Subject: [PATCH] Check that driver versions in configure.ac and src/rhd.h match
This check is run on "make check" in automake builds, and will prevent
the creation of source dist tarballs with inconsistent versions when
created with "make distcheck".
---
Makefile.am | 2 +-
checks/Makefile.am | 6 +++++
checks/version-check.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 1 +
4 files changed, 65 insertions(+), 1 deletions(-)
create mode 100644 checks/Makefile.am
create mode 100644 checks/version-check.c
diff --git a/Makefile.am b/Makefile.am
index f83dcbb..cc9f143 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,2 @@
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src
\ No newline at end of file
+SUBDIRS = src checks
diff --git a/checks/Makefile.am b/checks/Makefile.am
new file mode 100644
index 0000000..c2957d6
--- /dev/null
+++ b/checks/Makefile.am
@@ -0,0 +1,6 @@
+TESTS = $(check_PROGRAMS)
+check_PROGRAMS =
+
+check_PROGRAMS += version-check
+version_check_SOURCES = version-check.c
+version_check_CPPFLAGS = $(AM_CPPFLAGS) @XORG_CFLAGS@ -I$(top_srcdir)/src $(CPPFLAGS)
diff --git a/checks/version-check.c b/checks/version-check.c
new file mode 100644
index 0000000..835d2bd
--- /dev/null
+++ b/checks/version-check.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2007 Hans Ulrich Niedermann
![](https://seccdn.libravatar.org/avatar/9b845cae896f81bfdc08f0085b83c2cf.jpg?s=120&d=mm&r=g)
From 9bbab2a95d7fbafbf52a63881ad8c764223b9ff6 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann
Date: Mon, 15 Oct 2007 23:24:48 +0200 Subject: [PATCH] Use driver module version as configure.ac package version
--- configure.ac | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 0476725..cb2b56e 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-radeonhd], - 1.1.1, + 0.0.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-radeonhd) -- 1.5.3.4 -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
participants (1)
-
Hans Ulrich Niedermann