diff --git a/config/config.h.in b/config/config.h.in
index 3a3b496..4001630 100644
--- a/config/config.h.in
+++ b/config/config.h.in
@@ -122,7 +122,7 @@
/* Define to 1 if you have the `closedir' function. */
#undef HAVE_CLOSEDIR
-/* Define to 1 if you have the <CL/OpenCL.h> header file. */
+/* Define to 1 if you have the <CL/opencl.h> header file. */
#undef HAVE_CL_OPENCL_H
/* Define to 1 if you have the <complex.h> header file. */
diff --git a/configure b/configure
index 3b57a8e..3a71e8c 100755
--- a/configure
+++ b/configure
Binary files differ
diff --git a/configure.ac b/configure.ac
index 11670f0..fbc6712 100755
--- a/configure.ac
+++ b/configure.ac
@@ -388,6 +388,8 @@
# Enable support for OpenCL
AX_CHECK_CL
+CFLAGS="$CL_CFLAGS $CFLAGS"
+LIBS="$CL_LIBS $LIBS"
########
#
diff --git a/m4/ax_check_cl.m4 b/m4/ax_check_cl.m4
index 1c310ff..a6a3fa7 100644
--- a/m4/ax_check_cl.m4
+++ b/m4/ax_check_cl.m4
@@ -36,7 +36,6 @@
#
AC_DEFUN([AX_CHECK_CL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PATH_X])dnl
AC_REQUIRE([AC_PROG_SED])dnl
AC_REQUIRE([ACX_PTHREAD])dnl
@@ -45,19 +44,9 @@
AS_IF([test X$ax_compiler_ms = Xno],
[CL_CFLAGS="${PTHREAD_CFLAGS}"; CL_LIBS="${PTHREAD_LIBS} -lm"])
-#
-# Use x_includes and x_libraries if they have been set (presumably by
-# AC_PATH_X).
-#
-AS_IF([test X$no_x != Xyes],
- [AS_IF([test -n "$x_includes"],
- [CL_CFLAGS="-I$x_includes $CL_CFLAGS"])]
- AS_IF([test -n "$x_libraries"],
- [CL_LIBS="-L$x_libraries -lX11 $CL_LIBS"]))
-
ax_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
-AC_CHECK_HEADERS([CL/OpenCL.h OpenCL/OpenCL.h])
+AC_CHECK_HEADERS([CL/opencl.h OpenCL/OpenCL.h])
CPPFLAGS=$ax_save_CPPFLAGS
AC_CHECK_HEADERS([windows.h])
@@ -68,7 +57,7 @@
# include <windows.h>
# endif
# ifdef HAVE_CL_OPENCL_H
-# include <CL/cl.h>
+# include <CL/opencl.h>
# elif defined(HAVE_OPENCL_OPENCL_H)
# include <OpenCL/OpenCL.h>
# else
diff --git a/magick/magick-config.h b/magick/magick-config.h
index 093b7d4..f7a08b2 100644
--- a/magick/magick-config.h
+++ b/magick/magick-config.h
@@ -187,7 +187,7 @@
#define MAGICKCORE_HAVE_CLOSEDIR 1
#endif
-/* Define to 1 if you have the <CL/OpenCL.h> header file. */
+/* Define to 1 if you have the <CL/opencl.h> header file. */
/* #undef HAVE_CL_OPENCL_H */
/* Define to 1 if you have the <complex.h> header file. */