|
Packit |
51230c |
AC_INIT([libusb-compat], [0.1.5])
|
|
Packit |
51230c |
AM_INIT_AUTOMAKE
|
|
Packit |
51230c |
AC_CONFIG_SRCDIR([libusb/core.c])
|
|
Packit |
51230c |
AC_CONFIG_HEADERS([config.h])
|
|
Packit |
51230c |
AC_CONFIG_MACRO_DIR([m4])
|
|
Packit |
51230c |
|
|
Packit |
51230c |
AC_PREREQ([2.50])
|
|
Packit |
51230c |
AC_PROG_CC
|
|
Packit |
51230c |
AC_PROG_LIBTOOL
|
|
Packit |
51230c |
AC_C_INLINE
|
|
Packit |
51230c |
AM_PROG_CC_C_O
|
|
Packit |
51230c |
|
|
Packit |
51230c |
# Library versioning
|
|
Packit |
51230c |
LT_MAJOR="8"
|
|
Packit |
51230c |
LT_REVISION="4"
|
|
Packit |
51230c |
LT_AGE="4"
|
|
Packit |
51230c |
AC_SUBST(LT_MAJOR)
|
|
Packit |
51230c |
AC_SUBST(LT_REVISION)
|
|
Packit |
51230c |
AC_SUBST(LT_AGE)
|
|
Packit |
51230c |
|
|
Packit |
51230c |
# The libusb-0.1 version we pretend to be
|
|
Packit |
51230c |
LIBUSB01_VERSION="0.1.12"
|
|
Packit |
51230c |
AC_SUBST(LIBUSB01_VERSION)
|
|
Packit |
51230c |
|
|
Packit |
51230c |
PKG_CHECK_MODULES([LIBUSB_1_0], libusb-1.0 >= 0.9.1)
|
|
Packit |
51230c |
AC_SUBST(LIBUSB_1_0_CFLAGS)
|
|
Packit |
51230c |
AC_SUBST(LIBUSB_1_0_LIBS)
|
|
Packit |
51230c |
|
|
Packit |
51230c |
# Message logging
|
|
Packit |
51230c |
AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],
|
|
Packit |
51230c |
[log_enabled=$enableval],
|
|
Packit |
51230c |
[log_enabled='yes'])
|
|
Packit |
51230c |
if test "x$log_enabled" != "xno"; then
|
|
Packit |
51230c |
AC_DEFINE([ENABLE_LOGGING], 1, [Message logging])
|
|
Packit |
51230c |
fi
|
|
Packit |
51230c |
|
|
Packit |
51230c |
AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
|
|
Packit |
51230c |
[enable debug logging (default n)])],
|
|
Packit |
51230c |
[debug_log_enabled=$enableval],
|
|
Packit |
51230c |
[debug_log_enabled='no'])
|
|
Packit |
51230c |
if test "x$debug_log_enabled" != "xno"; then
|
|
Packit |
51230c |
AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging])
|
|
Packit |
51230c |
fi
|
|
Packit |
51230c |
|
|
Packit |
51230c |
# Examples build
|
|
Packit |
51230c |
AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
|
|
Packit |
51230c |
[build example applications (default n)])],
|
|
Packit |
51230c |
[build_examples=$enableval],
|
|
Packit |
51230c |
[build_examples='no'])
|
|
Packit |
51230c |
AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
|
|
Packit |
51230c |
|
|
Packit |
51230c |
# Restore gnu89 inline semantics on gcc 4.3 and newer
|
|
Packit |
51230c |
saved_cflags="$CFLAGS"
|
|
Packit |
51230c |
CFLAGS="$CFLAGS -fgnu89-inline"
|
|
Packit |
51230c |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], inline_cflags="-fgnu89-inline", inline_cflags="")
|
|
Packit |
51230c |
CFLAGS="$saved_cflags"
|
|
Packit |
51230c |
|
|
Packit |
51230c |
AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
|
|
Packit |
51230c |
AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
|
|
Packit |
51230c |
AC_SUBST(AM_CFLAGS)
|
|
Packit |
51230c |
|
|
Packit |
51230c |
AC_CONFIG_FILES([libusb.pc] [libusb-config] [Makefile] [libusb/Makefile] [examples/Makefile])
|
|
Packit |
51230c |
AC_CONFIG_COMMANDS([default],[[chmod +x libusb-config]],[[]])
|
|
Packit |
51230c |
|
|
Packit |
51230c |
AC_OUTPUT
|
|
Packit |
51230c |
|