mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Require pkg-config to find libusb-1.0, and fix libusb.h #includes
This commit is contained in:
parent
cffc21db28
commit
318ef85a9f
@ -15,7 +15,7 @@ EXTRA_DIST = example.conf m4/gnulib-cache.m4 linux-usb-cgminer \
|
|||||||
|
|
||||||
SUBDIRS = lib compat ccan
|
SUBDIRS = lib compat ccan
|
||||||
|
|
||||||
INCLUDES = $(PTHREAD_FLAGS) -fno-strict-aliasing $(JANSSON_INCLUDES) $(USB_FLAGS)
|
INCLUDES = $(PTHREAD_FLAGS) -fno-strict-aliasing $(JANSSON_INCLUDES)
|
||||||
|
|
||||||
bin_PROGRAMS = cgminer
|
bin_PROGRAMS = cgminer
|
||||||
|
|
||||||
@ -24,13 +24,13 @@ bin_SCRIPTS = *.cl
|
|||||||
cgminer_LDFLAGS = $(PTHREAD_FLAGS)
|
cgminer_LDFLAGS = $(PTHREAD_FLAGS)
|
||||||
cgminer_LDADD = $(DLOPEN_FLAGS) @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ \
|
cgminer_LDADD = $(DLOPEN_FLAGS) @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ \
|
||||||
@OPENCL_LIBS@ @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ \
|
@OPENCL_LIBS@ @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ \
|
||||||
@UDEV_LIBS@ @USB_LIBS@ \
|
@UDEV_LIBS@ @LIBUSB_LIBS@ \
|
||||||
@MATH_LIBS@ lib/libgnu.a ccan/libccan.a
|
@MATH_LIBS@ lib/libgnu.a ccan/libccan.a
|
||||||
|
|
||||||
if HAVE_WINDOWS
|
if HAVE_WINDOWS
|
||||||
cgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @OPENCL_FLAGS@
|
cgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @OPENCL_FLAGS@ @LIBUSB_CFLAGS@
|
||||||
else
|
else
|
||||||
cgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @OPENCL_FLAGS@ @LIBCURL_CFLAGS@
|
cgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @OPENCL_FLAGS@ @LIBUSB_CFLAGS@ @LIBCURL_CFLAGS@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# common sources
|
# common sources
|
||||||
|
28
configure.ac
28
configure.ac
@ -62,8 +62,6 @@ AC_FUNC_ALLOCA
|
|||||||
|
|
||||||
have_win32=false
|
have_win32=false
|
||||||
PTHREAD_FLAGS="-lpthread"
|
PTHREAD_FLAGS="-lpthread"
|
||||||
USB_LIBS=""
|
|
||||||
USB_FLAGS=""
|
|
||||||
DLOPEN_FLAGS="-ldl"
|
DLOPEN_FLAGS="-ldl"
|
||||||
OPENCL_LIBS="-lOpenCL"
|
OPENCL_LIBS="-lOpenCL"
|
||||||
WS2_LIBS=""
|
WS2_LIBS=""
|
||||||
@ -343,16 +341,18 @@ if test "x$bitforce$modminer" != xnono; then
|
|||||||
fi
|
fi
|
||||||
AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
|
AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
|
||||||
|
|
||||||
if test "x$ztex" != xno; then
|
|
||||||
AC_CHECK_LIB(usb-1.0, libusb_init, ,
|
|
||||||
AC_MSG_ERROR([Could not find usb library - please install libusb]))
|
|
||||||
AC_DEFINE([HAVE_LIBUSB], [1], [Defined to 1 if libusb is wanted])
|
|
||||||
USB_LIBS="-lusb-1.0"
|
|
||||||
USB_FLAGS=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
PKG_PROG_PKG_CONFIG()
|
PKG_PROG_PKG_CONFIG()
|
||||||
|
|
||||||
|
if test "x$ztex" != xno; then
|
||||||
|
case $target in
|
||||||
|
*)
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
AC_SUBST(LIBUSB_LIBS)
|
||||||
|
AC_SUBST(LIBUSB_CFLAGS)
|
||||||
|
|
||||||
PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
|
PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
|
||||||
AC_SUBST(LIBCURL_LIBS)
|
AC_SUBST(LIBCURL_LIBS)
|
||||||
|
|
||||||
@ -412,8 +412,6 @@ AC_SUBST(PDCURSES_LIBS)
|
|||||||
AC_SUBST(WS2_LIBS)
|
AC_SUBST(WS2_LIBS)
|
||||||
AC_SUBST(MATH_LIBS)
|
AC_SUBST(MATH_LIBS)
|
||||||
AC_SUBST(UDEV_LIBS)
|
AC_SUBST(UDEV_LIBS)
|
||||||
AC_SUBST(USB_LIBS)
|
|
||||||
AC_SUBST(USB_FLAGS)
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
@ -512,9 +510,9 @@ fi
|
|||||||
echo
|
echo
|
||||||
echo "Compilation............: make (or gmake)"
|
echo "Compilation............: make (or gmake)"
|
||||||
echo " CPPFLAGS.............: $CPPFLAGS"
|
echo " CPPFLAGS.............: $CPPFLAGS"
|
||||||
echo " CFLAGS...............: $CFLAGS"
|
echo " CFLAGS...............: $CFLAGS $LIBUSB_CFLAGS"
|
||||||
echo " LDFLAGS..............: $LDFLAGS $PTHREAD_FLAGS $USB_FLAGS"
|
echo " LDFLAGS..............: $LDFLAGS $PTHREAD_FLAGS"
|
||||||
echo " LDADD................: $DLOPEN_FLAGS $LIBCURL_LIBS $JANSSON_LIBS $PTHREAD_LIBS $OPENCL_LIBS $NCURSES_LIBS $PDCURSES_LIBS $WS2_LIBS $MATH_LIBS $UDEV_LIBS $USB_LIBS"
|
echo " LDADD................: $DLOPEN_FLAGS $LIBCURL_LIBS $JANSSON_LIBS $PTHREAD_LIBS $OPENCL_LIBS $NCURSES_LIBS $PDCURSES_LIBS $WS2_LIBS $MATH_LIBS $UDEV_LIBS $LIBUSB_LIBS"
|
||||||
echo
|
echo
|
||||||
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
|
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
|
||||||
echo " prefix...............: $prefix"
|
echo " prefix...............: $prefix"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#ifndef __LIBZTEX_H__
|
#ifndef __LIBZTEX_H__
|
||||||
#define __LIBZTEX_H__
|
#define __LIBZTEX_H__
|
||||||
|
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb.h>
|
||||||
|
|
||||||
#define LIBZTEX_MAX_DESCRIPTORS 512
|
#define LIBZTEX_MAX_DESCRIPTORS 512
|
||||||
#define LIBZTEX_SNSTRING_LEN 10
|
#define LIBZTEX_SNSTRING_LEN 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user