1 AC_INIT([libusb], [0.9.3])
3 AC_CONFIG_SRCDIR([libusb/core.c])
4 AM_CONFIG_HEADER([config.h])
11 AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions])
13 AC_MSG_CHECKING([operating system])
16 AC_DEFINE(OS_LINUX, [], [Linux backend])
18 AC_MSG_RESULT([Linux])
22 AC_MSG_ERROR([unsupported operating system])
25 AM_CONDITIONAL([OS_LINUX], [test "x$backend" == "xlinux"])
36 AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],
37 [log_enabled=$enableval],
39 if test "x$log_enabled" != "xno"; then
40 AC_DEFINE([ENABLE_LOGGING], 1, [Message logging])
43 AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
44 [enable debug logging (default n)])],
45 [debug_log_enabled=$enableval],
46 [debug_log_enabled='no'])
47 if test "x$debug_log_enabled" != "xno"; then
48 AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging])
52 AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
53 [build example applications (default n)])],
54 [build_examples=$enableval],
55 [build_examples='no'])
56 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
58 # Restore gnu89 inline semantics on gcc 4.3 and newer
59 saved_cflags="$CFLAGS"
60 CFLAGS="$CFLAGS -fgnu89-inline"
61 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), inline_cflags="-fgnu89-inline", inline_cflags="")
62 CFLAGS="$saved_cflags"
64 AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
65 AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
68 AC_CONFIG_FILES([libusb-1.0.pc] [Makefile] [libusb/Makefile] [examples/Makefile] [doc/Makefile])