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:
rajesh.katikam@gmail.com 2013-11-12 10:40:40 +00:00
parent 983aaabaae
commit bf0a83907b
7 changed files with 52 additions and 16 deletions

View File

@ -14,7 +14,7 @@ endif
.PHONY: install-langs ScrollView.jar install-jars $(TRAINING_SUBDIR) .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 \ EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \
aclocal.m4 config configure.ac autogen.sh tesseract.spec contrib \ aclocal.m4 config configure.ac autogen.sh tesseract.spec contrib \

View File

@ -4,7 +4,10 @@ AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"\
-I$(top_srcdir)/textord -I$(top_srcdir)/dict \ -I$(top_srcdir)/textord -I$(top_srcdir)/dict \
-I$(top_srcdir)/classify -I$(top_srcdir)/ccmain \ -I$(top_srcdir)/classify -I$(top_srcdir)/ccmain \
-I$(top_srcdir)/wordrec -I$(top_srcdir)/cutil \ -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 if VISIBILITY
AM_CPPFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden AM_CPPFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
endif endif
@ -30,7 +33,8 @@ libtesseract_api_la_LIBADD = \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../viewer/libtesseract_viewer.la \ ../viewer/libtesseract_viewer.la \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
#../opencl/libtesseract_opencl.la ../opencl/libtesseract_opencl.la
endif endif
libtesseract_api_la_CPPFLAGS = $(AM_CPPFLAGS) libtesseract_api_la_CPPFLAGS = $(AM_CPPFLAGS)
if VISIBILITY if VISIBILITY
@ -58,7 +62,7 @@ libtesseract_la_LIBADD = \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../viewer/libtesseract_viewer.la \ ../viewer/libtesseract_viewer.la \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
#../opencl/libtesseract_opencl.la ../opencl/libtesseract_opencl.la
libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION)
@ -66,7 +70,9 @@ bin_PROGRAMS = tesseract
tesseract_SOURCES = $(top_srcdir)/api/tesseractmain.cpp tesseract_SOURCES = $(top_srcdir)/api/tesseractmain.cpp
tesseract_LDADD = libtesseract.la tesseract_LDADD = libtesseract.la
tesseract_CPPFLAGS = $(AM_CPPFLAGS) tesseract_CPPFLAGS = $(AM_CPPFLAGS)
if USE_OPENCL
tesseract_LDADD += $(OPENCL_LIB)
endif
if MINGW if MINGW
tesseract_LDADD += -lws2_32 tesseract_LDADD += -lws2_32
libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32 libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32

View File

@ -5,8 +5,10 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/classify -I$(top_srcdir)/dict \ -I$(top_srcdir)/classify -I$(top_srcdir)/dict \
-I$(top_srcdir)/wordrec -I$(top_srcdir)/cutil \ -I$(top_srcdir)/wordrec -I$(top_srcdir)/cutil \
-I$(top_srcdir)/neural_networks/runtime -I$(top_srcdir)/cube \ -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 if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \ AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden -fvisibility=hidden -fvisibility-inlines-hidden
@ -37,7 +39,7 @@ libtesseract_main_la_LIBADD = \
../classify/libtesseract_classify.la \ ../classify/libtesseract_classify.la \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../cube/libtesseract_cube.la \ ../cube/libtesseract_cube.la \
#../opencl/libtesseract_opencl.la ../opencl/libtesseract_opencl.la
endif endif

View File

@ -1,6 +1,10 @@
AM_CPPFLAGS += \ AM_CPPFLAGS += \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \ -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 if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \ AM_CPPFLAGS += -DTESS_EXPORTS \
@ -28,7 +32,7 @@ libtesseract_ccstruct_la_LIBADD = \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../image/libtesseract_image.la \ ../image/libtesseract_image.la \
../viewer/libtesseract_viewer.la \ ../viewer/libtesseract_viewer.la \
#../opencl/libtesseract_opencl.la ../opencl/libtesseract_opencl.la
endif endif
libtesseract_ccstruct_la_SOURCES = \ libtesseract_ccstruct_la_SOURCES = \

View File

@ -57,6 +57,8 @@ AC_SUBST(GENERIC_VERSION)
AM_CONDITIONAL(MINGW, false) AM_CONDITIONAL(MINGW, false)
AM_CONDITIONAL(GRAPHICS_DISABLED, false) AM_CONDITIONAL(GRAPHICS_DISABLED, false)
OPENCL_HDR_PATH=""
OPENCL_LIB=""
############################# #############################
# #
# Platform specific setup # Platform specific setup
@ -121,6 +123,20 @@ if test "$enable_embedded" = "yes"; then
AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED]) AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
fi 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 # check whether to build tesseract with -fvisibility=hidden -fvisibility-inlines-hidden
# http://gcc.gnu.org/wiki/Visibility # http://gcc.gnu.org/wiki/Visibility
# http://groups.google.com/group/tesseract-dev/browse_thread/thread/976645ae98189127 # 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 # Final Tasks and Output
# ---------------------------------------- # ----------------------------------------
#CPPFLAGS="$CPPFLAGS -DUSE_OPENCL -I/opt/AMDAPP/include -I../opencl"
#LIBS="$LIBS -lOpenCL"
# Output files # Output files
AC_CONFIG_FILES([Makefile tesseract.pc]) AC_CONFIG_FILES([Makefile tesseract.pc])
AC_CONFIG_FILES(api/Makefile) AC_CONFIG_FILES(api/Makefile)
AC_CONFIG_FILES(ccmain/Makefile) AC_CONFIG_FILES(ccmain/Makefile)
#AC_CONFIG_FILES(opencl/Makefile) AC_CONFIG_FILES(opencl/Makefile)
AC_CONFIG_FILES(ccstruct/Makefile) AC_CONFIG_FILES(ccstruct/Makefile)
AC_CONFIG_FILES(ccutil/Makefile) AC_CONFIG_FILES(ccutil/Makefile)
AC_CONFIG_FILES(classify/Makefile) AC_CONFIG_FILES(classify/Makefile)

View File

@ -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 = \ noinst_HEADERS = \
openclwrapper.h oclkernels.h opencl_device_selection.h 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 = \ libtesseract_opencl_la_LIBADD = \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../viewer/libtesseract_viewer.la ../viewer/libtesseract_viewer.la
if USE_OPENCL
libtesseract_opencl_la_LDFLAGS += $(OPENCL_LIB)
endif
endif endif
libtesseract_opencl_la_SOURCES = \ libtesseract_opencl_la_SOURCES = \

View File

@ -3,7 +3,11 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer \ -I$(top_srcdir)/image -I$(top_srcdir)/viewer \
-I$(top_srcdir)/ccmain -I$(top_srcdir)/wordrec -I$(top_srcdir)/api \ -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 if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \ AM_CPPFLAGS += -DTESS_EXPORTS \
@ -38,7 +42,7 @@ libtesseract_textord_la_LIBADD = \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../classify/libtesseract_classify.la \ ../classify/libtesseract_classify.la \
../dict/libtesseract_dict.la \ ../dict/libtesseract_dict.la \
#../opencl/libtesseract_opencl.la ../opencl/libtesseract_opencl.la
endif endif
libtesseract_textord_la_SOURCES = \ libtesseract_textord_la_SOURCES = \