Move library version number from configure.ac to libusb/version.h
authorPeter Stuge <peter@stuge.se>
Mon, 9 May 2011 06:12:24 +0000 (08:12 +0200)
committerPeter Stuge <peter@stuge.se>
Mon, 13 Jun 2011 20:06:30 +0000 (22:06 +0200)
commit85a14f43e0ce27cd47f84fdaeacbaa81cebdb886
treeef39f336c38dc9c82e432d20572ec02fbd65a6f1
parent3481f52b014110f6c291e5a15e79ba774dcdfacf
Move library version number from configure.ac to libusb/version.h

This is neccessary to support native MS builds. The Windows resource
file libusb/libusb-1.0.rc must include the release version, which was
previously only available after configure had run and had substituted
the numbers into a generated libusb/libusb-1.0.rc file.

The version atoms are now stored as CPP style #defines in libusb/version.h
so that the .rc no longer needs to be generated but can simply include the
header file and access the version information directly.

The m4 macro LU_DEFINE_VERSION_ATOM() was added to configure.ac to get
version atoms from libusb/version.h for use in AC_INIT(). The macro
handles C and C++ style comments in version.h, but can easily be made
to fail by obscuring the file. Please don't do that.

Tested with MinGW using autoconf, and manual compile of libusb-1.0.rc
using RC.EXE Version 5.2.3690.0 from Visual C++ 2005 Express Edition.
configure.ac
libusb/libusb-1.0.rc [new file with mode: 0644]
libusb/libusb-1.0.rc.in [deleted file]
libusb/version.h [new file with mode: 0644]