LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}"
AM_INIT_AUTOMAKE
-AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([libusb/core.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-AC_PREREQ([2.50])
+AC_PREREQ([2.69])
AC_PROG_CC
AC_PROG_CXX
LT_INIT
backend="netbsd"
threads="posix"
;;
-*-mingw*)
+*-mingw* | *msys*)
AC_MSG_RESULT([Windows])
backend="windows"
threads="windows"
backend="haiku"
threads="posix"
;;
+*-solaris*)
+ AC_MSG_RESULT([SunOS])
+ backend="sunos"
+ threads="posix"
+ ;;
*)
- AC_MSG_ERROR([unsupported operating system])
+ AC_MSG_ERROR([unsupported operating system $host])
esac
case $backend in
linux)
AC_DEFINE(OS_LINUX, 1, [Linux backend])
AC_SUBST(OS_LINUX)
+ AC_ARG_ENABLE([deviced],
+ [AC_HELP_STRING([--enable-deviced], [Use deviced to obtain dev node fds [default=no]])],
+ [], [enable_deviced="no"])
+ if test "x$enable_deviced" = "xyes"; then
+ PKG_CHECK_MODULES([DEVICED], [deviced])
+ AC_DEFINE(USE_DEVICED, 1, [Use deviced to obtain dev node fds])
+ fi
+
+ AC_SUBST(USE_DEVICED)
+
AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread)
AC_ARG_ENABLE([udev],
[AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])],
AC_CHECK_LIB([udev], [udev_new], [], [AC_ERROR(["udev support requested but libudev not installed"])])
AC_DEFINE(USE_UDEV, 1, [Use udev for device enumeration/hotplug])
else
- AC_CHECK_HEADERS([asm/types.h sys/socket.h], [], [])
- AC_CHECK_HEADERS([linux/netlink.h linux/filter.h], [], [AC_ERROR(["Linux netlink headers not found"])], [
+ AC_CHECK_HEADERS([asm/types.h], [], [])
+ AC_CHECK_HEADERS([sys/socket.h linux/netlink.h], [], [AC_ERROR(["Linux netlink headers not found"])], [
#ifdef HAVE_ASM_TYPES_H
#include <asm/types.h>
#endif
-#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
-#endif
])
fi
AC_SUBST(USE_UDEV)
AC_CHECK_HEADERS([poll.h])
AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
;;
+sunos)
+ AC_DEFINE(OS_SUNOS, 1, [SunOS backend])
+ AC_SUBST(OS_SUNOS)
+ THREAD_CFLAGS="-pthread"
+ LIBS="-pthread -ldevinfo"
+ AC_CHECK_HEADERS([poll.h])
+ AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
+ ;;
netbsd)
AC_DEFINE(OS_NETBSD, 1, [NetBSD backend])
AC_SUBST(OS_NETBSD)
AM_CONDITIONAL(OS_LINUX, test "x$backend" = xlinux)
AM_CONDITIONAL(OS_DARWIN, test "x$backend" = xdarwin)
AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xopenbsd)
+AM_CONDITIONAL(OS_SUNOS, test "x$backend" = xsunos)
AM_CONDITIONAL(OS_NETBSD, test "x$backend" = xnetbsd)
AM_CONDITIONAL(OS_WINDOWS, test "x$backend" = xwindows)
AM_CONDITIONAL(OS_HAIKU, test "x$backend" = xhaiku)
AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = "xyes")
AM_CONDITIONAL(USE_UDEV, test "x$enable_udev" = xyes)
AM_CONDITIONAL(USE_USBDK, test "x$enable_usbdk" = xyes)
+AM_CONDITIONAL(USE_DEVICED, test "x$enable_deviced" = xyes)
if test "$threads" = posix; then
AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads])
fi