Skip to content

Commit abf0981

Browse files
committed
rework opencl requirements (fix configure: error: conditional "AMDEP" was never defined)
1 parent ffbe610 commit abf0981

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

configure.ac

100755100644
+19-16
Original file line numberDiff line numberDiff line change
@@ -160,25 +160,28 @@ AC_ARG_ENABLE([opencl],
160160
[enable_opencl=$enableval],
161161
[enable_opencl="no"])
162162
AC_MSG_RESULT($enable_opencl)
163+
# check for opencl header
164+
have_opencl=false
165+
AC_CHECK_HEADERS(CL/cl.h, have_opencl=true, [
166+
AC_CHECK_HEADERS(OpenCL/cl.h, have_opencl=true, have_opencl=false)
167+
])
168+
have_opencl_lib=false
169+
AC_CHECK_LIB(OpenCL, clGetPlatformIDs, have_opencl_lib=true, have_opencl_lib=false)
170+
have_tiff=false
171+
AC_CHECK_HEADERS(tiffio.h, have_tiff=true, have_tiff=false)
163172
if test "$enable_opencl" = "yes"; then
164-
# check for opencl header
165-
AC_CHECK_HEADERS(CL/cl.h, [], [
166-
AC_CHECK_HEADERS(OpenCL/cl.h, [], [
167-
AC_MSG_ERROR(OpenCL headers file was not found)
168-
])
169-
])
170-
# check for libtiff
171-
have_tiff=false
172-
AC_CHECK_HEADERS(tiffio.h, have_tiff=true, have_tiff=false)
173+
if !($have_opencl); then
174+
AC_MSG_ERROR(Required OpenCL headers not found!)
175+
fi
176+
if !($have_opencl_lib); then
177+
AC_MSG_ERROR(Required OpenCL library not found!)
178+
fi
173179
if !($have_tiff); then
174-
AC_MSG_WARN(OpenCL will not be used - required TIFF headers not found)
175-
AC_MSG_WARN(Try to install libtiff-dev?? package.)
176-
enable_opencl="no"
177-
else
178-
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
179-
AC_SUBST([OPENCL_HDR_PATH],[$OPENCL_INC])
180-
AC_SUBST([OPENCL_LIB],[$OPENCL_LIBS])
180+
AC_MSG_ERROR(Required TIFF headers not found! Try to install libtiff-dev?? package.)
181181
fi
182+
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
183+
AC_SUBST([OPENCL_HDR_PATH],[$OPENCL_INC])
184+
AC_SUBST([OPENCL_LIB],[$OPENCL_LIBS])
182185
fi
183186
AM_CONDITIONAL([USE_OPENCL], [test "$enable_opencl" = "yes"])
184187

0 commit comments

Comments
 (0)