summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2011-05-09 21:39:14 +0100
committerPete Batard <pbatard@gmail.com>2011-05-09 21:39:14 +0100
commitfb7c03b1c7b08e0c4061e420ac637962e2ba837c (patch)
treebc9871bcc0f63efdd053e18ba0339d358d39796c /configure.ac
parentd2858ef6f6cca239d470fe1f88b80fc6661becd8 (diff)
downloadlibusb-fb7c03b1c7b08e0c4061e420ac637962e2ba837c.tar.gz
Move library release version number from configure.ac to libusb/version.h
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 13 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index fcf32fd..1aa606b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,14 +1,18 @@
-m4_define(LIBUSB_MAJOR, [1])
-m4_define(LIBUSB_MINOR, [0])
-m4_define(LIBUSB_MICRO, [8])
-m4_define(LIBUSB_NANO, [10336])
+dnl These m4 macros are whitespace sensitive and break if moved around much.
+m4_define([LU_VERSION_H], m4_include([libusb/version.h]))
+m4_define([LU_DEFINE_VERSION_ATOM],
+ [m4_define([$1], m4_bregexp(LU_VERSION_H,
+ [^#define\s*$1\s*\([0-9]*\).*], [\1]))])
+dnl The m4_bregexp() returns (only) the numbers following the #define named
+dnl in the first macro parameter. m4_define() then defines the name for use
+dnl in AC_INIT().
-AC_INIT([libusb], LIBUSB_MAJOR.LIBUSB_MINOR.LIBUSB_MICRO, [libusb-devel@lists.sourceforge.net], [libusb], [http://www.libusb.org/])
-AC_SUBST([LIBUSB_VERSION_MAJOR], [LIBUSB_MAJOR])
-AC_SUBST([LIBUSB_VERSION_MINOR], [LIBUSB_MINOR])
-AC_SUBST([LIBUSB_VERSION_MICRO], [LIBUSB_MICRO])
-AC_SUBST([LIBUSB_VERSION_NANO], [LIBUSB_NANO])
+LU_DEFINE_VERSION_ATOM([LIBUSB_MAJOR])
+LU_DEFINE_VERSION_ATOM([LIBUSB_MINOR])
+LU_DEFINE_VERSION_ATOM([LIBUSB_MICRO])
+
+AC_INIT([libusb], LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO, [libusb-devel@lists.sourceforge.net], [libusb], [http://www.libusb.org/])
# Library versioning
# These numbers should be tweaked on every release. Read carefully:
@@ -202,7 +206,6 @@ AC_SUBST(LTLDFLAGS)
AC_CONFIG_FILES([libusb-1.0.pc])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([libusb/Makefile])
-AC_CONFIG_FILES([libusb/libusb_version.h])
AC_CONFIG_FILES([examples/Makefile])
AC_CONFIG_FILES([doc/Makefile])
AC_CONFIG_FILES([doc/doxygen.cfg])