diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index 5841032..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, [9318]) +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: @@ -47,7 +51,6 @@ case $host in threads="posix" THREAD_CFLAGS="-pthread" PC_LIBS_PRIVATE="${PC_LIBS_PRIVATE} -pthread" - AM_LDFLAGS="-ludev" AC_CHECK_HEADERS([poll.h]) AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) ;; @@ -68,13 +71,6 @@ case $host in *-mingw*) AC_MSG_RESULT([Windows]) backend="windows" - threads="windows" - create_import_lib="yes" - LIBS="${LIBS} ${PC_LIBS_PRIVATE}" - # -avoid-version to avoid a naming scheme such as libusb-0.dll - AM_LDFLAGS="-no-undefined -avoid-version -Wl,--add-stdcall-alias" - AM_CFLAGS="-std=gnu99 -DWINVER=0x500" - AC_CHECK_TOOL(RC, windres, no) AC_CHECK_TOOL(DLLTOOL, dlltool, false) ;; *-cygwin*) @@ -210,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]) |