From 8313606b5f339495664f4bd84572b0e7c8b5b02b Mon Sep 17 00:00:00 2001 From: Ycros Date: Sat, 25 Jun 2011 15:46:15 +1000 Subject: [PATCH] Fixed configure.ac to properly detect OpenCL on windows/mingw. --- README | 2 +- configure.ac | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README b/README index 1b0aa056..139f437c 100644 --- a/README +++ b/README @@ -25,7 +25,7 @@ Native WIN32 build instructions (on mingw32, on windows): Install mingw32 Install libcurl, copy libcurl.m4 into /mingw/share/aclocal Run: - ./autogen.sh + autoreconf -fvi CFLAGS="-O3 -Wall -msse2 -I" LDFLAGS="-L" ./configure make diff --git a/configure.ac b/configure.ac index 49da9503..60859ae2 100644 --- a/configure.ac +++ b/configure.ac @@ -43,8 +43,20 @@ case $target in ;; esac -#AC_CHECK_LIB(OpenCL, clSetKernelArg, OPENCL_LIBS=-lOpenCL) -OPENCL_LIBS=-lOpenCL +# Check for OpenCL (the long way needed on mingw32 due to calling conventions) +AC_MSG_CHECKING([for OpenCL]) +SAVED_LIBS=$LIBS +LIBS="$LIBS -lOpenCL" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[return clSetKernelArg(0, 0, 0, 0); ]])], + [AC_MSG_RESULT(yes) + AM_CONDITIONAL(HAVE_OPENCL, true) + OPENCL_LIBS=-lOpenCL], + [AC_MSG_RESULT(no) + AM_CONDITIONAL(HAVE_OPENCL, false)]) +LIBS=$SAVED_LIBS + AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true) AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS=-lpthread)