mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-27 12:16:34 +00:00
Fix build on recent FreeBSD (ie. upcoming FreeBSD 8.0; FreeBSD CURRENT).
Since March 9, 2009; the FreeBSD operating system base ships with libusb. As a consequence, the devel/libusb ports that used to provide userland programs access to USB devices is useless and so marked as IGNORE for recent versions of FreeBSD. This patch detects the FreeBSD version configure is run on and conditionally ignore the libusb detection if relevant. Obtained from: Ooo vcs.
This commit is contained in:
24
configure.ac
24
configure.ac
@@ -102,11 +102,34 @@ then
|
||||
fi
|
||||
AM_CONDITIONAL(DOC_ENABLED, [test x"$enable_doc" = xyes])
|
||||
|
||||
AC_ARG_WITH([os-version], [AS_HELP_STRING([--with-os-version], [For FreeBSD users, use this option to override the detected OSVERSION.])])
|
||||
|
||||
case "$build_os" in
|
||||
freebsd*)
|
||||
AC_MSG_CHECKING([the FreeBSD operating system release])
|
||||
if test -n "$with_os_version"; then
|
||||
OSVERSION="$with_os_version"
|
||||
else
|
||||
OSVERSION=`/sbin/sysctl -n kern.osreldate`
|
||||
fi
|
||||
AC_MSG_RESULT([$OSVERSION])
|
||||
AC_MSG_CHECKING([which usb library to use])
|
||||
if test "$OSVERSION" -lt "800069"; then
|
||||
system_has_libusb="no"
|
||||
AC_MSG_RESULT([devel/libusb])
|
||||
else
|
||||
system_has_libusb="yes"
|
||||
AC_MSG_RESULT(system)
|
||||
LIBUSB_LIBS="-lusb"
|
||||
fi
|
||||
esac
|
||||
|
||||
|
||||
# Dependencies
|
||||
PKG_CONFIG_REQUIRES=""
|
||||
## libusb
|
||||
if test "x$enable_libusb" = "xyes"; then
|
||||
if test x"$system_has_libusb" != "xyes"; then
|
||||
if test x"$PKG_CONFIG" = "x"; then
|
||||
AC_PATH_PROG(LIBUSB_CONFIG,libusb-config)
|
||||
if test x"$LIBUSB_CONFIG" = "x" ; then
|
||||
@@ -127,6 +150,7 @@ if test "x$enable_libusb" = "xyes"; then
|
||||
if test x"$WITH_USB" = "x0"; then
|
||||
AC_MSG_ERROR([libusb is mandatory.])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(LIBUSB_LIBS)
|
||||
AC_SUBST(LIBUSB_CFLAGS)
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user