@@ -160,12 +160,27 @@ AC_ARG_ENABLE([opencl],
160
160
[enable_opencl= $enableval ],
161
161
[enable_opencl= " no" ])
162
162
AC_MSG_RESULT($enable_opencl )
163
- AM_CONDITIONAL([USE_OPENCL], [test " $enable_opencl " = " yes" ])
164
163
if test " $enable_opencl " = " yes" ; then
165
- AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
166
- AC_SUBST([OPENCL_HDR_PATH],[$OPENCL_INC ])
167
- AC_SUBST([OPENCL_LIB],[$OPENCL_LIBS ])
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_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 ])
181
+ fi
168
182
fi
183
+ AM_CONDITIONAL([USE_OPENCL], [test " $enable_opencl " = " yes" ])
169
184
170
185
# check whether to build tesseract with -fvisibility=hidden -fvisibility-inlines-hidden
171
186
# http://gcc.gnu.org/wiki/Visibility
0 commit comments