case $target_os in
*linux*)
- # On Linux libudev is currently a hard requirement.
+ # On Linux libudev is currently required for enumeration.
+ AC_ARG_WITH([libudev],
+ [AS_HELP_STRING([--with-libudev],
+ [use libudev for serial port enumeration @<:@default=check@:>@])],
+ [], [with_libudev=check])
+ AS_IF([test "x$with_libudev" != xno], [
PKG_CHECK_MODULES([libudev], [libudev >= 0],
[CFLAGS="$CFLAGS $libudev_CFLAGS"; LIBS="$LIBS $libudev_LIBS";
- SP_PKGLIBS="$SP_PKGLIBS libudev"])
+ SP_PKGLIBS="$SP_PKGLIBS libudev"; AC_DEFINE(HAVE_LIBUDEV)])], [])
;;
*darwin*)
LDFLAGS="$LDFLAGS -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation"
#include <sys/syslimits.h>
#endif
#ifdef __linux__
+#ifdef HAVE_LIBUDEV
#include "libudev.h"
+#endif
#include "linux/serial.h"
#include "linux_termios.h"
IOObjectRelease(iter);
out_done:
#endif
-#ifdef __linux__
+#if defined(__linux__) && defined(HAVE_LIBUDEV)
struct udev *ud;
struct udev_enumerate *ud_enumerate;
struct udev_list_entry *ud_list;