Make libudev optional.
This commit is contained in:
parent
6c8716e9da
commit
397d89de3a
|
@ -86,10 +86,15 @@ SP_PKGLIBS=""
|
|||
|
||||
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"
|
||||
|
|
|
@ -47,7 +47,9 @@
|
|||
#include <sys/syslimits.h>
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
#ifdef HAVE_LIBUDEV
|
||||
#include "libudev.h"
|
||||
#endif
|
||||
#include "linux/serial.h"
|
||||
#include "linux_termios.h"
|
||||
|
||||
|
@ -460,7 +462,7 @@ out_release:
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue