mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-09 14:28:12 +00:00
Enable dynamic linking against system libusb --with-system-libusb
This commit is contained in:
parent
9fa8e920c7
commit
ed16f32d8f
35
configure.ac
35
configure.ac
@ -333,16 +333,35 @@ AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
|
|||||||
AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
|
AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
|
||||||
AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
|
AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
|
||||||
|
|
||||||
AC_CONFIG_SUBDIRS([compat/libusb-1.0])
|
|
||||||
if test "x$want_usbutils" != xfalse; then
|
if test "x$want_usbutils" != xfalse; then
|
||||||
|
dlibusb="no"
|
||||||
AC_DEFINE([USE_USBUTILS], [1], [Defined to 1 if usbutils support required])
|
AC_DEFINE([USE_USBUTILS], [1], [Defined to 1 if usbutils support required])
|
||||||
LIBUSB_LIBS="compat/libusb-1.0/libusb/.libs/libusb-1.0.a"
|
AC_ARG_WITH([system-libusb],
|
||||||
if test "x$have_linux" = "xtrue"; then
|
[AC_HELP_STRING([--with-system-libusb],[Compile against dynamic system libusb (default use included static libusb)])],
|
||||||
PKG_CHECK_MODULES([UDEV], [libudev], LIBUSB_LIBS+=" -ludev", [AC_MSG_ERROR([Missing required libudev dev])])
|
[dlibusb=$withval]
|
||||||
fi
|
)
|
||||||
if test "x$have_darwin" = "xtrue"; then
|
|
||||||
LIBUSB_LIBS+=" -lobjc"
|
if test "x$dlibusb" != xno; then
|
||||||
LDFLAGS+=" -framework CoreFoundation -framework IOKit"
|
case $target in
|
||||||
|
*-*-freebsd*)
|
||||||
|
LIBUSB_LIBS="-lusb"
|
||||||
|
LIBUSB_CFLAGS=""
|
||||||
|
AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have libusb-1.0])
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
PKG_CHECK_MODULES(LIBUSB, libusb-1.0, [AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have libusb-1.0])], [AC_MSG_ERROR([Could not find usb library - please install libusb-1.0])])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
AC_CONFIG_SUBDIRS([compat/libusb-1.0])
|
||||||
|
LIBUSB_LIBS="compat/libusb-1.0/libusb/.libs/libusb-1.0.a"
|
||||||
|
if test "x$have_linux" = "xtrue"; then
|
||||||
|
LIBUSB_LIBS+=" -ludev"
|
||||||
|
fi
|
||||||
|
if test "x$have_darwin" = "xtrue"; then
|
||||||
|
LIBUSB_LIBS+=" -lobjc"
|
||||||
|
LDFLAGS+=" -framework CoreFoundation -framework IOKit"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LIBUSB_LIBS=""
|
LIBUSB_LIBS=""
|
||||||
|
Loading…
Reference in New Issue
Block a user