Browse Source

build: don't allow disabling OpenCL (it is mandatory).

Closes https://github.com/veox/sgminer/issues/76
nfactor-troky
Noel Maersk 11 years ago
parent
commit
f5c51b7771
  1. 44
      configure.ac

44
configure.ac

@ -135,20 +135,13 @@ if test -n "$SGMINER_SDK"; then
LDFLAGS="-L$SGMINER_SDK/lib/$target $LDFLAGS" LDFLAGS="-L$SGMINER_SDK/lib/$target $LDFLAGS"
fi fi
opencl="yes" # Check for OpenCL (the long way needed on mingw32 due to calling conventions)
AC_MSG_CHECKING([for OpenCL])
AC_ARG_ENABLE([opencl], SAVED_LIBS=$LIBS
[AC_HELP_STRING([--enable-opencl],[Enable support for GPU mining with opencl])], SAVED_CFLAGS=$CFLAGS
[opencl=$enableval] LIBS="$LIBS $OPENCL_LIBS"
) CFLAGS="$CFLAGS $OPENCL_FLAGS"
if test "x$opencl" != xno; then AC_LINK_IFELSE(
# Check for OpenCL (the long way needed on mingw32 due to calling conventions)
AC_MSG_CHECKING([for OpenCL])
SAVED_LIBS=$LIBS
SAVED_CFLAGS=$CFLAGS
LIBS="$LIBS $OPENCL_LIBS"
CFLAGS="$CFLAGS $OPENCL_FLAGS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[ [AC_LANG_PROGRAM([[
#ifdef __APPLE_CC__ #ifdef __APPLE_CC__
#include <OpenCL/opencl.h> #include <OpenCL/opencl.h>
@ -158,19 +151,13 @@ if test "x$opencl" != xno; then
]], ]],
[[return clSetKernelArg(0, 0, 0, 0); ]])], [[return clSetKernelArg(0, 0, 0, 0); ]])],
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(yes)
found_opencl=1 found_opencl=1],
],
[AC_MSG_RESULT(no) [AC_MSG_RESULT(no)
OPENCL_FLAGS= OPENCL_FLAGS=
OPENCL_LIBS= OPENCL_LIBS=
found_opencl=0]) found_opencl=0])
LIBS=$SAVED_LIBS LIBS=$SAVED_LIBS
CFLAGS=$SAVED_CFLAGS CFLAGS=$SAVED_CFLAGS
else
OPENCL_FLAGS=""
OPENCL_LIBS=""
fi
AM_CONDITIONAL([HAS_OPENCL], [test x$opencl = xyes])
has_winpthread=false has_winpthread=false
if test "x$have_win32" = xtrue; then if test "x$have_win32" = xtrue; then
@ -403,16 +390,11 @@ fi
echo " curses.TUI...........: $cursesmsg" echo " curses.TUI...........: $cursesmsg"
if test "x$opencl" != xno; then if test $found_opencl = 1; then
if test $found_opencl = 1; then
echo " OpenCL...............: FOUND. GPU mining support enabled" echo " OpenCL...............: FOUND. GPU mining support enabled"
else
echo " OpenCL...............: NOT FOUND. GPU mining support DISABLED"
AC_MSG_ERROR([No mining configured in])
fi
else else
echo " OpenCL...............: Detection overrided. GPU mining support DISABLED" echo " OpenCL...............: NOT FOUND. GPU mining support DISABLED"
AC_MSG_ERROR([No mining configured in]) AC_MSG_ERROR([OpenCL not found])
fi fi
if test "x$adl" != xno; then if test "x$adl" != xno; then

Loading…
Cancel
Save