Fix missing "allheaders.h" when compiling with --enable-opencl on OS X

This commit is contained in:
James R. Barlow 2015-08-26 00:47:59 -07:00
parent 71f747f668
commit 8476d0bc6b
2 changed files with 12 additions and 2 deletions

View File

@ -219,10 +219,12 @@ case "${host_os}" in
if test $my_cv_framework_OpenCL = yes; then
have_opencl_lib=true
fi
AC_SUBST(OPENCL_OSX, [yes])
;;
*)
# default
AC_CHECK_LIB(OpenCL, clGetPlatformIDs, have_opencl_lib=true, have_opencl_lib=false)
AC_SUBST(OPENCL_OSX, [no])
;;
esac

View File

@ -1,6 +1,10 @@
AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccmain
if USE_OPENCL
AM_CPPFLAGS += -I$(OPENCL_HDR_PATH)
if OPENCL_OSX
AM_CFLAGS += -framework OpenCL
else
AM_CPPFLAGS += -I$(OPENCL_HDR_PATH)
endif
endif
noinst_HEADERS = \
openclwrapper.h oclkernels.h opencl_device_selection.h
@ -14,7 +18,11 @@ libtesseract_opencl_la_LIBADD = \
../ccutil/libtesseract_ccutil.la \
../viewer/libtesseract_viewer.la
if USE_OPENCL
libtesseract_opencl_la_LDFLAGS += $(OPENCL_LIB)
if OPENCL_OSX
libtesseract_opencl_la_LDFLAGS += -framework OpenCL
else
libtesseract_opencl_la_LDFLAGS += $(OPENCL_LIB)
endif
endif
endif