mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-23 18:49:08 +08:00
Cleaned up configure.ac and Makefile.am in multiple folder to use OPENCL paths
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@910 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
983aaabaae
commit
bf0a83907b
@ -14,7 +14,7 @@ endif
|
||||
|
||||
.PHONY: install-langs ScrollView.jar install-jars $(TRAINING_SUBDIR)
|
||||
|
||||
SUBDIRS = ccutil viewer cutil image ccstruct dict classify wordrec neural_networks/runtime textord cube ccmain api . tessdata
|
||||
SUBDIRS = ccutil viewer cutil image opencl ccstruct dict classify wordrec neural_networks/runtime textord cube ccmain api . tessdata
|
||||
|
||||
EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \
|
||||
aclocal.m4 config configure.ac autogen.sh tesseract.spec contrib \
|
||||
|
@ -4,7 +4,10 @@ AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"\
|
||||
-I$(top_srcdir)/textord -I$(top_srcdir)/dict \
|
||||
-I$(top_srcdir)/classify -I$(top_srcdir)/ccmain \
|
||||
-I$(top_srcdir)/wordrec -I$(top_srcdir)/cutil \
|
||||
#-I$(top_srcdir)/opencl
|
||||
-I$(top_srcdir)/opencl
|
||||
if USE_OPENCL
|
||||
AM_CPPFLAGS += -I$(OPENCL_HDR_PATH)
|
||||
endif
|
||||
if VISIBILITY
|
||||
AM_CPPFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
endif
|
||||
@ -30,7 +33,8 @@ libtesseract_api_la_LIBADD = \
|
||||
../cutil/libtesseract_cutil.la \
|
||||
../viewer/libtesseract_viewer.la \
|
||||
../ccutil/libtesseract_ccutil.la \
|
||||
#../opencl/libtesseract_opencl.la
|
||||
../opencl/libtesseract_opencl.la
|
||||
|
||||
endif
|
||||
libtesseract_api_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
if VISIBILITY
|
||||
@ -58,7 +62,7 @@ libtesseract_la_LIBADD = \
|
||||
../cutil/libtesseract_cutil.la \
|
||||
../viewer/libtesseract_viewer.la \
|
||||
../ccutil/libtesseract_ccutil.la \
|
||||
#../opencl/libtesseract_opencl.la
|
||||
../opencl/libtesseract_opencl.la
|
||||
|
||||
libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION)
|
||||
|
||||
@ -66,7 +70,9 @@ bin_PROGRAMS = tesseract
|
||||
tesseract_SOURCES = $(top_srcdir)/api/tesseractmain.cpp
|
||||
tesseract_LDADD = libtesseract.la
|
||||
tesseract_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
if USE_OPENCL
|
||||
tesseract_LDADD += $(OPENCL_LIB)
|
||||
endif
|
||||
if MINGW
|
||||
tesseract_LDADD += -lws2_32
|
||||
libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32
|
||||
|
@ -5,8 +5,10 @@ AM_CPPFLAGS += \
|
||||
-I$(top_srcdir)/classify -I$(top_srcdir)/dict \
|
||||
-I$(top_srcdir)/wordrec -I$(top_srcdir)/cutil \
|
||||
-I$(top_srcdir)/neural_networks/runtime -I$(top_srcdir)/cube \
|
||||
-I$(top_srcdir)/textord
|
||||
|
||||
-I$(top_srcdir)/textord -I$(top_srcdir)/opencl
|
||||
if USE_OPENCL
|
||||
AM_CPPFLAGS += -I$(OPENCL_HDR_PATH)
|
||||
endif
|
||||
if VISIBILITY
|
||||
AM_CPPFLAGS += -DTESS_EXPORTS \
|
||||
-fvisibility=hidden -fvisibility-inlines-hidden
|
||||
@ -37,7 +39,7 @@ libtesseract_main_la_LIBADD = \
|
||||
../classify/libtesseract_classify.la \
|
||||
../cutil/libtesseract_cutil.la \
|
||||
../cube/libtesseract_cube.la \
|
||||
#../opencl/libtesseract_opencl.la
|
||||
../opencl/libtesseract_opencl.la
|
||||
|
||||
endif
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
AM_CPPFLAGS += \
|
||||
-I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \
|
||||
-I$(top_srcdir)/image -I$(top_srcdir)/viewer
|
||||
-I$(top_srcdir)/image -I$(top_srcdir)/viewer \
|
||||
-I$(top_srcdir)/opencl
|
||||
if USE_OPENCL
|
||||
AM_CPPFLAGS += -I$(OPENCL_HDR_PATH)
|
||||
endif
|
||||
|
||||
if VISIBILITY
|
||||
AM_CPPFLAGS += -DTESS_EXPORTS \
|
||||
@ -28,7 +32,7 @@ libtesseract_ccstruct_la_LIBADD = \
|
||||
../cutil/libtesseract_cutil.la \
|
||||
../image/libtesseract_image.la \
|
||||
../viewer/libtesseract_viewer.la \
|
||||
#../opencl/libtesseract_opencl.la
|
||||
../opencl/libtesseract_opencl.la
|
||||
endif
|
||||
|
||||
libtesseract_ccstruct_la_SOURCES = \
|
||||
|
20
configure.ac
20
configure.ac
@ -57,6 +57,8 @@ AC_SUBST(GENERIC_VERSION)
|
||||
AM_CONDITIONAL(MINGW, false)
|
||||
AM_CONDITIONAL(GRAPHICS_DISABLED, false)
|
||||
|
||||
OPENCL_HDR_PATH=""
|
||||
OPENCL_LIB=""
|
||||
#############################
|
||||
#
|
||||
# Platform specific setup
|
||||
@ -121,6 +123,20 @@ if test "$enable_embedded" = "yes"; then
|
||||
AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
|
||||
fi
|
||||
|
||||
# check whether to build opencl version
|
||||
AC_MSG_CHECKING(--enable-opencl argument)
|
||||
AC_ARG_ENABLE([opencl],
|
||||
[ --enable-opencl enable opencl build (default=no)],
|
||||
[enable_opencl=$enableval],
|
||||
[enable_opencl="no"])
|
||||
AC_MSG_RESULT($enable_opencl)
|
||||
AM_CONDITIONAL([USE_OPENCL], [test "$enable_opencl" = "yes"])
|
||||
if test "$enable_opencl" = "yes"; then
|
||||
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
|
||||
AC_SUBST([OPENCL_HDR_PATH],["/opt/AMDAPP/include"])
|
||||
AC_SUBST([OPENCL_LIB],["-lOpenCL"])
|
||||
fi
|
||||
|
||||
# check whether to build tesseract with -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
# http://gcc.gnu.org/wiki/Visibility
|
||||
# http://groups.google.com/group/tesseract-dev/browse_thread/thread/976645ae98189127
|
||||
@ -336,13 +352,11 @@ AM_CONDITIONAL(ENABLE_TRAINING, $have_icu)
|
||||
# Final Tasks and Output
|
||||
# ----------------------------------------
|
||||
|
||||
#CPPFLAGS="$CPPFLAGS -DUSE_OPENCL -I/opt/AMDAPP/include -I../opencl"
|
||||
#LIBS="$LIBS -lOpenCL"
|
||||
# Output files
|
||||
AC_CONFIG_FILES([Makefile tesseract.pc])
|
||||
AC_CONFIG_FILES(api/Makefile)
|
||||
AC_CONFIG_FILES(ccmain/Makefile)
|
||||
#AC_CONFIG_FILES(opencl/Makefile)
|
||||
AC_CONFIG_FILES(opencl/Makefile)
|
||||
AC_CONFIG_FILES(ccstruct/Makefile)
|
||||
AC_CONFIG_FILES(ccutil/Makefile)
|
||||
AC_CONFIG_FILES(classify/Makefile)
|
||||
|
@ -1,4 +1,7 @@
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccmain
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccmain
|
||||
if USE_OPENCL
|
||||
AM_CPPFLAGS += -I$(OPENCL_HDR_PATH)
|
||||
endif
|
||||
noinst_HEADERS = \
|
||||
openclwrapper.h oclkernels.h opencl_device_selection.h
|
||||
|
||||
@ -10,6 +13,9 @@ libtesseract_opencl_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
|
||||
libtesseract_opencl_la_LIBADD = \
|
||||
../ccutil/libtesseract_ccutil.la \
|
||||
../viewer/libtesseract_viewer.la
|
||||
if USE_OPENCL
|
||||
libtesseract_opencl_la_LDFLAGS += $(OPENCL_LIB)
|
||||
endif
|
||||
endif
|
||||
|
||||
libtesseract_opencl_la_SOURCES = \
|
||||
|
@ -3,7 +3,11 @@ AM_CPPFLAGS += \
|
||||
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
|
||||
-I$(top_srcdir)/image -I$(top_srcdir)/viewer \
|
||||
-I$(top_srcdir)/ccmain -I$(top_srcdir)/wordrec -I$(top_srcdir)/api \
|
||||
-I$(top_srcdir)/cutil -I$(top_srcdir)/classify -I$(top_srcdir)/dict
|
||||
-I$(top_srcdir)/cutil -I$(top_srcdir)/classify -I$(top_srcdir)/dict \
|
||||
-I$(top_srcdir)/opencl
|
||||
if USE_OPENCL
|
||||
AM_CPPFLAGS += -I$(OPENCL_HDR_PATH)
|
||||
endif
|
||||
|
||||
if VISIBILITY
|
||||
AM_CPPFLAGS += -DTESS_EXPORTS \
|
||||
@ -38,7 +42,7 @@ libtesseract_textord_la_LIBADD = \
|
||||
../cutil/libtesseract_cutil.la \
|
||||
../classify/libtesseract_classify.la \
|
||||
../dict/libtesseract_dict.la \
|
||||
#../opencl/libtesseract_opencl.la
|
||||
../opencl/libtesseract_opencl.la
|
||||
endif
|
||||
|
||||
libtesseract_textord_la_SOURCES = \
|
||||
|
Loading…
Reference in New Issue
Block a user