Skip to content

Commit

Permalink
make single/multiple libraries optional -- this needs testing!!!
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@623 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
joregan@gmail.com committed Aug 29, 2011
1 parent fbab153 commit bf4a09d
Show file tree
Hide file tree
Showing 16 changed files with 149 additions and 20 deletions.
18 changes: 18 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \

#EXTRA_DIST = doc/html doc/@PACKAGE_NAME@_@PACKAGE_VERSION@.pdf doc/@PACKAGE_NAME@_@PACKAGE_VERSION@.ps.gz

lib_LTLIBRARIES = libtesseract.la
libtesseract_la_LIBADD = \
api/libtesseract_api.la \
ccmain/libtesseract_main.la \
cube/libtesseract_cube.la \
neural_networks/runtime/libtesseract_neural.la \
textord/libtesseract_textord.la \
wordrec/libtesseract_wordrec.la \
classify/libtesseract_classify.la \
dict/libtesseract_dict.la \
ccstruct/libtesseract_ccstruct.la \
image/libtesseract_image.la \
cutil/libtesseract_cutil.la \
viewer/libtesseract_viewer.la \
ccutil/libtesseract_ccutil.la

libtesseract_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

dist-hook:
# Need to remove .svn directories from directories
# added using EXTRA_DIST. $(distdir)/tessdata would in
Expand Down
12 changes: 11 additions & 1 deletion api/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"\
include_HEADERS = \
apitypes.h baseapi.h pageiterator.h resultiterator.h tesseractmain.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_api.la
else
lib_LTLIBRARIES = libtesseract_api.la
libtesseract_api_la_SOURCES = baseapi.cpp pageiterator.cpp resultiterator.cpp
libtesseract_api_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_api_la_SOURCES = baseapi.cpp pageiterator.cpp resultiterator.cpp
libtesseract_api_la_LIBADD = \
../ccmain/libtesseract_main.la \
../cube/libtesseract_cube.la \
Expand All @@ -29,6 +34,7 @@ libtesseract_api_la_LIBADD = \

bin_PROGRAMS = tesseract
tesseract_SOURCES = tesseractmain.cpp
if USING_MULTIPLELIBS
tesseract_LDADD = \
libtesseract_api.la \
../ccmain/libtesseract_main.la \
Expand All @@ -41,4 +47,8 @@ tesseract_LDADD = \
../cutil/libtesseract_cutil.la \
../viewer/libtesseract_viewer.la \
../ccutil/libtesseract_ccutil.la
else
tesseract_LDADD = \
libtesseract.la
endif

7 changes: 6 additions & 1 deletion ccmain/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ include_HEADERS = \
tessvars.h tfacep.h tfacepp.h thresholder.h \
werdit.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_main.la
else
lib_LTLIBRARIES = libtesseract_main.la
libtesseract_main_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_main_la_SOURCES = \
adaptions.cpp applybox.cpp \
control.cpp cube_control.cpp cube_reco_context.cpp \
Expand All @@ -32,4 +38,3 @@ libtesseract_main_la_SOURCES = \
werdit.cpp
libtesseract_main_la_LIBADD = \
../wordrec/libtesseract_wordrec.la
libtesseract_main_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
8 changes: 6 additions & 2 deletions ccstruct/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ include_HEADERS = \
quadlsq.h quadratc.h quspline.h ratngs.h rect.h rejctmap.h \
seam.h split.h statistc.h stepblob.h vecfuncs.h werd.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_ccstruct.la
else
lib_LTLIBRARIES = libtesseract_ccstruct.la
libtesseract_ccstruct_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_ccstruct_la_SOURCES = \
blobbox.cpp blobs.cpp blread.cpp boxword.cpp ccstruct.cpp coutln.cpp \
detlinefit.cpp dppoint.cpp genblob.cpp \
Expand All @@ -24,5 +30,3 @@ libtesseract_ccstruct_la_SOURCES = \
quadlsq.cpp quadratc.cpp quspline.cpp ratngs.cpp rect.cpp rejctmap.cpp \
seam.cpp split.cpp statistc.cpp stepblob.cpp \
vecfuncs.cpp werd.cpp

libtesseract_ccstruct_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
8 changes: 7 additions & 1 deletion ccutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ include_HEADERS = \
unichar.h unicharmap.h unicharset.h unicity_table.h \
params.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_ccutil.la
else
lib_LTLIBRARIES = libtesseract_ccutil.la
libtesseract_ccutil_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_ccutil_la_SOURCES = \
ambigs.cpp basedir.cpp bits16.cpp boxread.cpp \
ccutil.cpp clst.cpp \
Expand All @@ -29,4 +35,4 @@ libtesseract_ccutil_la_SOURCES = \
unichar.cpp unicharmap.cpp unicharset.cpp \
params.cpp

libtesseract_ccutil_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

8 changes: 7 additions & 1 deletion classify/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ include_HEADERS = \
ocrfeatures.h outfeat.h picofeat.h protos.h \
speckle.h xform2d.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_classify.la
else
lib_LTLIBRARIES = libtesseract_classify.la
libtesseract_classify_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_classify_la_SOURCES = \
adaptive.cpp adaptmatch.cpp blobclass.cpp \
chartoname.cpp classify.cpp cluster.cpp clusttool.cpp cutoffs.cpp \
Expand All @@ -27,4 +33,4 @@ libtesseract_classify_la_SOURCES = \
ocrfeatures.cpp outfeat.cpp picofeat.cpp protos.cpp \
speckle.cpp xform2d.cpp

libtesseract_classify_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ localedir='${prefix}/share/locale'
#fi
#AM_CONDITIONAL([USING_GETTEXT], [test "$enable_gettext" = "yes"])

AC_ARG_ENABLE([multiple-libraries],
[ --enable-multiple-libraries Enable multiple libraries (default).],
[enable_mlibs=$enableeval],
[enable_mlibs="yes"])
AC_MSG_RESULT($enable_mlibs)
AM_CONDITIONAL([USING_MULTIPLELIBS], [test "$enable_mlibs" = "yes"])

# Always look into a "gnu" directory.
curwd=`pwd`
if test -d $curwd/gnu/include ; then
Expand Down
8 changes: 6 additions & 2 deletions cube/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ include_HEADERS = \
tuning_params.h word_altlist.h word_list_lang_model.h word_size_model.h \
word_unigrams.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_cube.la
else
lib_LTLIBRARIES = libtesseract_cube.la
libtesseract_cube_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_cube_la_SOURCES = \
altlist.cpp beam_search.cpp bmp_8.cpp cached_file.cpp \
char_altlist.cpp char_bigrams.cpp char_samp.cpp char_samp_enum.cpp \
Expand All @@ -34,5 +40,3 @@ libtesseract_cube_la_SOURCES = \
tess_lang_mod_edge.cpp tess_lang_model.cpp \
word_altlist.cpp word_list_lang_model.cpp word_size_model.cpp \
word_unigrams.cpp

libtesseract_cube_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
8 changes: 7 additions & 1 deletion cutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ include_HEADERS = \
emalloc.h freelist.h globals.h listio.h \
oldheap.h oldlist.h structures.h tessarray.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_cutil.la
else
lib_LTLIBRARIES = libtesseract_cutil.la
libtesseract_cutil_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_cutil_la_SOURCES = \
bitvec.cpp callcpp.cpp cutil.cpp cutil_class.cpp danerror.cpp efio.cpp \
emalloc.cpp freelist.cpp listio.cpp oldheap.cpp \
oldlist.cpp structures.cpp tessarray.cpp

libtesseract_cutil_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

8 changes: 7 additions & 1 deletion dict/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ include_HEADERS = \
dawg.h dict.h matchdefs.h \
permute.h states.h stopper.h trie.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_dict.la
else
lib_LTLIBRARIES = libtesseract_dict.la
libtesseract_dict_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_dict_la_SOURCES = \
context.cpp \
dawg.cpp dict.cpp hyphen.cpp \
permdawg.cpp permute.cpp states.cpp stopper.cpp trie.cpp

libtesseract_dict_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

7 changes: 6 additions & 1 deletion image/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ include_HEADERS = \
image.h img.h imgerrs.h imgs.h \
imgtiff.h imgunpk.h svshowim.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_image.la
else
lib_LTLIBRARIES = libtesseract_image.la
libtesseract_image_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_image_la_SOURCES = \
image.cpp imgs.cpp imgtiff.cpp svshowim.cpp

libtesseract_image_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
8 changes: 7 additions & 1 deletion neural_networks/runtime/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ AM_CPPFLAGS = \
include_HEADERS = \
input_file_buffer.h neural_net.h neuron.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_neural.la
else
lib_LTLIBRARIES = libtesseract_neural.la
libtesseract_neural_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_neural_la_SOURCES = \
input_file_buffer.cpp neural_net.cpp neuron.cpp sigmoid_table.cpp

libtesseract_neural_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

8 changes: 6 additions & 2 deletions textord/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ include_HEADERS = \
topitch.h tordmain.h tovars.h \
underlin.h wordseg.h workingpartset.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_textord.la
else
lib_LTLIBRARIES = libtesseract_textord.la
libtesseract_textord_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_textord_la_SOURCES = \
alignedblob.cpp bbgrid.cpp blkocc.cpp \
colfind.cpp colpartition.cpp colpartitionset.cpp \
Expand All @@ -29,5 +35,3 @@ libtesseract_textord_la_SOURCES = \
tablerecog.cpp textord.cpp \
topitch.cpp tordmain.cpp tospace.cpp tovars.cpp \
underlin.cpp wordseg.cpp workingpartset.cpp

libtesseract_textord_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
37 changes: 33 additions & 4 deletions training/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,31 @@ AM_CPPFLAGS = \
include_HEADERS = \
commontraining.h mergenf.h tessopt.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_training.la libtesseract_tessopt.la
else
lib_LTLIBRARIES = libtesseract_training.la libtesseract_tessopt.la
libtesseract_training_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_tessopt_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_training_la_SOURCES = \
commontraining.cpp
libtesseract_tessopt_la_SOURCES = \
tessopt.cpp

libtesseract_training_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

libtesseract_tessopt_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

bin_PROGRAMS = cntraining combine_tessdata mftraining unicharset_extractor wordlist2dawg
combine_tessdata_SOURCES = combine_tessdata.cpp
if USING_MULTIPLELIBS
combine_tessdata_LDADD = \
../ccutil/libtesseract_ccutil.la
else
combine_tessdata_LDADD = \
../libtesseract.la
endif

cntraining_SOURCES = cntraining.cpp
if USING_MULTIPLELIBS
cntraining_LDADD = \
libtesseract_training.la \
libtesseract_tessopt.la \
Expand All @@ -41,8 +50,13 @@ cntraining_LDADD = \
../neural_networks/runtime/libtesseract_neural.la \
../wordrec/libtesseract_wordrec.la \
../ccutil/libtesseract_ccutil.la
else
cntraining_LDADD = \
../libtesseract.la
endif

mftraining_SOURCES = mftraining.cpp mergenf.cpp
if USING_MULTIPLELIBS
mftraining_LDADD = \
libtesseract_training.la \
libtesseract_tessopt.la \
Expand All @@ -58,13 +72,23 @@ mftraining_LDADD = \
../neural_networks/runtime/libtesseract_neural.la \
../wordrec/libtesseract_wordrec.la \
../ccutil/libtesseract_ccutil.la
else
mftraining_LDADD = \
../libtesseract.la
endif

unicharset_extractor_SOURCES = unicharset_extractor.cpp
if USING_MULTIPLELIBS
unicharset_extractor_LDADD = \
libtesseract_tessopt.la \
../ccutil/libtesseract_ccutil.la
else
unicharset_extractor_LDADD = \
../libtesseract.la
endif

wordlist2dawg_SOURCES = wordlist2dawg.cpp
if USING_MULTIPLELIBS
wordlist2dawg_LDADD = \
libtesseract_tessopt.la \
../classify/libtesseract_classify.la \
Expand All @@ -79,3 +103,8 @@ wordlist2dawg_LDADD = \
../wordrec/libtesseract_wordrec.la \
../textord/libtesseract_textord.la \
../ccutil/libtesseract_ccutil.la
else
wordlist2dawg_LDADD = \
../libtesseract.la
endif

8 changes: 7 additions & 1 deletion viewer/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ AM_CPPFLAGS =
include_HEADERS = \
scrollview.h svmnode.h svutil.h svpaint.cpp

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_viewer.la
else
lib_LTLIBRARIES = libtesseract_viewer.la
libtesseract_viewer_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_viewer_la_SOURCES = \
scrollview.cpp svmnode.cpp svutil.cpp

libtesseract_viewer_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

9 changes: 8 additions & 1 deletion wordrec/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ include_HEADERS = \
plotseg.h render.h tally.h \
wordclass.h wordrec.h

if !USING_MULTIPLELIBS
noinst_LTLIBRARIES = libtesseract_wordrec.la
else
lib_LTLIBRARIES = libtesseract_wordrec.la
libtesseract_wordrec_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
endif

libtesseract_wordrec_la_SOURCES = \
associate.cpp bestfirst.cpp chop.cpp chopper.cpp \
closed.cpp drawfx.cpp findseam.cpp gradechop.cpp \
heuristic.cpp language_model.cpp makechop.cpp matchtab.cpp \
olutil.cpp outlines.cpp pieces.cpp \
plotedges.cpp plotseg.cpp render.cpp segsearch.cpp \
tally.cpp tface.cpp wordclass.cpp wordrec.cpp
libtesseract_wordrec_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)


0 comments on commit bf4a09d

Please sign in to comment.