1 AC_INIT([libusb], [0.9.0])
3 AC_CONFIG_SRCDIR([libusb/core.c])
4 AM_CONFIG_HEADER([config.h])
21 AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],
22 [log_enabled=$enableval],
24 if test "x$log_enabled" != "xno"; then
25 AC_DEFINE([ENABLE_LOGGING], 1, [Message logging])
28 AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
29 [enable debug logging (default n)])],
30 [debug_log_enabled=$enableval],
31 [debug_log_enabled='no'])
32 if test "x$debug_log_enabled" != "xno"; then
33 AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging])
37 AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
38 [build example applications (default n)])],
39 [build_examples=$enableval],
40 [build_examples='no'])
41 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
43 # Restore gnu89 inline semantics on gcc 4.3 and newer
44 saved_cflags="$CFLAGS"
45 CFLAGS="$CFLAGS -fgnu89-inline"
46 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), inline_cflags="-fgnu89-inline", inline_cflags="")
47 CFLAGS="$saved_cflags"
49 AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
50 AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
53 AC_CONFIG_FILES([libusb-1.0.pc] [Makefile] [libusb/Makefile] [examples/Makefile])