[PATCH] automatic major, minor, and patchlevel definitions

Aaron Plattner aplattner at nvidia.com
Mon Oct 2 14:11:30 PDT 2006


On Mon, Oct 02, 2006 at 05:05:59PM -0400, Andres Salomon wrote:
> Hi,
> 
> I've noticed that there's no standard method for setting the major,
> minor, and patchlevel versions in each module.  Some hardcode the
> versions via #defines; others base them on the autoconf-defined value of
> PACKAGE_VERSION.
> 
> It would make a lot more sense to have autoconf handle defining these,
> and base it off PACKAGE_VERSION (for those who don't do much autoconf,
> PACKAGE_NAME and PACKAGE_VERSION are automatically set in config.h based
> on the values passed to AC_INIT() in configure.ac).  The variable names
> I've chosen to go w/ are PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR,
> and PACKAGE_VERSION_PATCHLEVEL.
> 
> The xf86-video-nv driver does something similar, but this is a more
> robust version of it (if PACKAGE_VERSION is 1.2.3.4, or 1.23.4, or
> similar it will still set things properly, ignoring anything past the
> 3rd dot).  I've made it such that the XORG_RELEASE_VERSION macro sets
> the variables; by patching your xorg macros and reinstalling them, each
> driver automatically gets these variables w/ a simple autoreconf.
> 
> If people have no objections, I'll file a bug to get this included.

That's a good idea.  How hard would it be to make the macros generate a
PACKAGE_VERSION_PATCHLEVEL of 0 if PACKAGE_VERSION is something like 1.2
(instead of 1.2.0)?

-- Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20061002/1ef9824d/attachment.pgp>


More information about the xorg mailing list