Skip to content

Commit

Permalink
use libtool
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@368 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
joregan committed May 26, 2010
1 parent 6fee7c4 commit 34d8258
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 82 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# TODO(luc) Add 'doc' to this list when ready
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = ccstruct ccutil classify cutil dict image textord viewer wordrec ccmain training tessdata testing java api

EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \
Expand Down
43 changes: 15 additions & 28 deletions api/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,22 @@ AM_CPPFLAGS = \
include_HEADERS = \
baseapi.h tesseractmain.h

lib_LIBRARIES = libtesseract_api.a
libtesseract_api_a_SOURCES = baseapi.cpp
libtesseract_api.o: baseapi.o \
../ccmain/libtesseract_main.a \
../textord/libtesseract_textord.a \
../wordrec/libtesseract_wordrec.a \
../classify/libtesseract_classify.a \
../dict/libtesseract_dict.a \
../ccstruct/libtesseract_ccstruct.a \
../image/libtesseract_image.a \
../cutil/libtesseract_cutil.a \
../viewer/libtesseract_viewer.a \
../ccutil/libtesseract_ccutil.a
ld -r -o libtesseract_api.o baseapi.o \
../ccmain/libtesseract_main.a \
../textord/libtesseract_textord.a \
../wordrec/libtesseract_wordrec.a \
../classify/libtesseract_classify.a \
../dict/libtesseract_dict.a \
../ccstruct/libtesseract_ccstruct.a \
../image/libtesseract_image.a \
../cutil/libtesseract_cutil.a \
../viewer/libtesseract_viewer.a \
../ccutil/libtesseract_ccutil.a

libtesseract_api.a : libtesseract_api.o
ar cru libtesseract_api.a libtesseract_api.o ; $(RANLIB) libtesseract_api.a
lib_LTLIBRARIES = libtesseract_api.la
libtesseract_api_la_SOURCES = baseapi.cpp
libtesseract_api_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_api_la_LIBADD = \
../ccmain/libtesseract_main.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

bin_PROGRAMS = tesseract
tesseract_SOURCES = tesseractmain.cpp
tesseract_LDADD = \
libtesseract_api.a
libtesseract_api.la
7 changes: 5 additions & 2 deletions ccmain/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ include_HEADERS = \
tessio.h tessvars.h tfacep.h tfacepp.h thresholder.h tstruct.h \
varabled.h werdit.h

lib_LIBRARIES = libtesseract_main.a
libtesseract_main_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_main.la
libtesseract_main_la_SOURCES = \
adaptions.cpp ambigsrecog.cpp applybox.cpp \
blobcmp.cpp \
callnet.cpp charcut.cpp charsample.cpp control.cpp \
Expand All @@ -30,3 +30,6 @@ libtesseract_main_a_SOURCES = \
tessbox.cpp tessedit.cpp tesseractclass.cpp tessvars.cpp \
tfacepp.cpp thresholder.cpp tstruct.cpp \
varabled.cpp werdit.cpp
libtesseract_main_la_LIBADD = \
../wordrec/libtesseract_wordrec.la
libtesseract_main_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
6 changes: 4 additions & 2 deletions ccstruct/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ include_HEADERS = \
quadlsq.h quadratc.h quspline.h ratngs.h rect.h rejctmap.h \
statistc.h stepblob.h vecfuncs.h werd.h

lib_LIBRARIES = libtesseract_ccstruct.a
libtesseract_ccstruct_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_ccstruct.la
libtesseract_ccstruct_la_SOURCES = \
blobbox.cpp blobs.cpp blread.cpp callcpp.cpp ccstruct.cpp coutln.cpp \
detlinefit.cpp genblob.cpp \
labls.cpp linlsq.cpp lmedsq.cpp mod128.cpp normalis.cpp \
Expand All @@ -26,3 +26,5 @@ libtesseract_ccstruct_a_SOURCES = \
quadlsq.cpp quadratc.cpp quspline.cpp ratngs.cpp rect.cpp rejctmap.cpp \
statistc.cpp stepblob.cpp \
vecfuncs.cpp werd.cpp

libtesseract_ccstruct_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
6 changes: 4 additions & 2 deletions ccutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ include_HEADERS = \
unichar.h unicharmap.h unicharset.h unicity_table.h \
varable.h

lib_LIBRARIES = libtesseract_ccutil.a
libtesseract_ccutil_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_ccutil.la
libtesseract_ccutil_la_SOURCES = \
ambigs.cpp basedir.cpp bits16.cpp boxread.cpp \
ccutil.cpp clst.cpp debugwin.cpp \
elst2.cpp elst.cpp errcode.cpp \
Expand All @@ -28,3 +28,5 @@ libtesseract_ccutil_a_SOURCES = \
tessdatamanager.cpp tessopt.cpp tordvars.cpp tprintf.cpp \
unichar.cpp unicharmap.cpp unicharset.cpp \
varable.cpp

libtesseract_ccutil_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
6 changes: 4 additions & 2 deletions classify/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ include_HEADERS = \
ocrfeatures.h outfeat.h picofeat.h protos.h \
speckle.h xform2d.h

lib_LIBRARIES = libtesseract_classify.a
libtesseract_classify_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_classify.la
libtesseract_classify_la_SOURCES = \
adaptive.cpp adaptmatch.cpp baseline.cpp blobclass.cpp \
chartoname.cpp classify.cpp cluster.cpp clusttool.cpp cutoffs.cpp \
extract.cpp \
Expand All @@ -28,3 +28,5 @@ libtesseract_classify_a_SOURCES = \
normfeat.cpp normmatch.cpp \
ocrfeatures.cpp outfeat.cpp picofeat.cpp protos.cpp \
speckle.cpp xform2d.cpp

libtesseract_classify_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
29 changes: 27 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# ----------------------------------------

AC_PREREQ(2.50)
AC_CONFIG_MACRO_DIR([m4])
AC_INIT(tesseract, 3.00, theraysmith@gmail.com)
AC_REVISION($Id: configure.ac,v 1.4 2007/02/02 22:38:17 theraysmith Exp $)
AC_CONFIG_AUX_DIR(config)
Expand All @@ -17,7 +18,7 @@ AC_CANONICAL_HOST
# Define date of package, etc. Could be useful in auto-generated
# documentation.
# TODO(luc) Generate good documentation using doxygen or equivalent
PACKAGE_YEAR=2009
PACKAGE_YEAR=2010
PACKAGE_DATE="05/29"

AC_DEFINE_UNQUOTED(PACKAGE_NAME,["${PACKAGE_NAME}"],[Name of package])
Expand All @@ -30,6 +31,28 @@ AC_SUBST(PACKAGE_VERSION)
AC_SUBST(PACKAGE_YEAR)
AC_SUBST(PACKAGE_DATE)

GENERIC_LIBRARY_NAME=tesseract

# Release versioning
GENERIC_MAJOR_VERSION=3
GENERIC_MINOR_VERSION=0
GENERIC_MICRO_VERSION=0

# API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
GENERIC_LIBRARY_VERSION=$GENERIC_MAJOR_VERSION:$GENERIC_MINOR_VERSION
AC_SUBST(GENERIC_API_VERSION)
AC_SUBST(GENERIC_MAJOR_VERSION)

AC_SUBST(GENERIC_LIBRARY_VERSION)
PACKAGE=$GENERIC_LIBRARY_NAME
AC_SUBST(GENERIC_LIBRARY_NAME)

GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
AC_SUBST(GENERIC_RELEASE)
AC_SUBST(GENERIC_VERSION)

includedir="${includedir}/tesseract"

AC_ARG_WITH(extra-includes,
Expand Down Expand Up @@ -83,6 +106,8 @@ AC_PROG_CXX(cl.exe g++)
# Not needed
# AC_PROG_CC

AC_PROG_LIBTOOL

# Automake configuration
# ----------------------------------------

Expand Down Expand Up @@ -113,7 +138,7 @@ AC_C_BIGENDIAN

# Check where all the following programs are and set
# variables accordingly:
AC_PROG_RANLIB
LT_INIT
# AC_PROG_LN_S
# AC_PATH_PROG(MV, mv)
# AC_PATH_PROG(CP, cp)
Expand Down
6 changes: 4 additions & 2 deletions cutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ include_HEADERS = \
emalloc.h freelist.h funcdefs.h general.h globals.h listio.h \
oldheap.h oldlist.h structures.h tessarray.h

lib_LIBRARIES = libtesseract_cutil.a
libtesseract_cutil_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_cutil.la
libtesseract_cutil_la_SOURCES = \
bitvec.cpp cutil.cpp cutil_class.cpp danerror.cpp efio.cpp \
emalloc.cpp freelist.cpp globals.cpp listio.cpp oldheap.cpp \
oldlist.cpp structures.cpp tessarray.cpp

libtesseract_cutil_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
6 changes: 4 additions & 2 deletions dict/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ include_HEADERS = \
dawg.h dict.h matchdefs.h \
permdawg.h permngram.h permute.h states.h stopper.h trie.h

lib_LIBRARIES = libtesseract_dict.a
libtesseract_dict_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_dict.la
libtesseract_dict_la_SOURCES = \
choices.cpp context.cpp conversion.cpp \
dawg.cpp dict.cpp hyphen.cpp \
permdawg.cpp permngram.cpp permute.cpp states.cpp stopper.cpp trie.cpp

libtesseract_dict_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
6 changes: 4 additions & 2 deletions image/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ include_HEADERS = \
bitstrm.h image.h img.h imgbmp.h imgerrs.h imgio.h imgs.h \
imgtiff.h imgunpk.h svshowim.h

lib_LIBRARIES = libtesseract_image.a
libtesseract_image_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_image.la
libtesseract_image_la_SOURCES = \
bitstrm.cpp image.cpp imgbmp.cpp imgio.cpp imgs.cpp imgtiff.cpp svshowim.cpp

libtesseract_image_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
2 changes: 2 additions & 0 deletions runautoconf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#
# All the rest is auto-generated.

echo "Running libtoolize"
libtoolize

# --- Step 1: Generate aclocal.m4 from:
# . acinclude.m4
Expand Down
6 changes: 4 additions & 2 deletions textord/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ include_HEADERS = \
topitch.h tordmain.h tospace.h tovars.h \
underlin.h wordseg.h workingpartset.h

lib_LIBRARIES = libtesseract_textord.a
libtesseract_textord_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_textord.la
libtesseract_textord_la_SOURCES = \
alignedblob.cpp bbgrid.cpp blkocc.cpp \
colfind.cpp colpartition.cpp colpartitionset.cpp \
drawedg.cpp drawtord.cpp edgblob.cpp edgloop.cpp \
Expand All @@ -27,3 +27,5 @@ libtesseract_textord_a_SOURCES = \
tabfind.cpp tablefind.cpp tabvector.cpp \
topitch.cpp tordmain.cpp tospace.cpp tovars.cpp \
underlin.cpp wordseg.cpp workingpartset.cpp

libtesseract_textord_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
70 changes: 38 additions & 32 deletions training/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,52 +13,58 @@ EXTRA_DIST = unicharset_extractor.vcproj wordlist2dawg.vcproj \
include_HEADERS = \
commontraining.h mergenf.h name2char.h

lib_LIBRARIES = libtesseract_training.a
libtesseract_training_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_training.la
libtesseract_training_la_SOURCES = \
name2char.cpp commontraining.cpp

libtesseract_training_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

bin_PROGRAMS = cntraining combine_tessdata mftraining unicharset_extractor wordlist2dawg
combine_tessdata_SOURCES = combine_tessdata.cpp
combine_tessdata_LDADD = \
../ccutil/libtesseract_ccutil.a
../ccutil/libtesseract_ccutil.la

cntraining_SOURCES = cntraining.cpp
cntraining_LDADD = \
libtesseract_training.a \
../textord/libtesseract_textord.a \
../classify/libtesseract_classify.a \
../dict/libtesseract_dict.a \
../ccstruct/libtesseract_ccstruct.a \
../image/libtesseract_image.a \
../cutil/libtesseract_cutil.a \
../viewer/libtesseract_viewer.a \
../ccmain/libtesseract_main.a \
../ccutil/libtesseract_ccutil.a
libtesseract_training.la \
../textord/libtesseract_textord.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 \
../ccmain/libtesseract_main.la \
../wordrec/libtesseract_wordrec.la \
../ccutil/libtesseract_ccutil.la

mftraining_SOURCES = mftraining.cpp mergenf.cpp
mftraining_LDADD = \
libtesseract_training.a \
../textord/libtesseract_textord.a \
../classify/libtesseract_classify.a \
../dict/libtesseract_dict.a \
../ccstruct/libtesseract_ccstruct.a \
../image/libtesseract_image.a \
../cutil/libtesseract_cutil.a \
../viewer/libtesseract_viewer.a \
../ccmain/libtesseract_main.a \
../ccutil/libtesseract_ccutil.a
libtesseract_training.la \
../textord/libtesseract_textord.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 \
../ccmain/libtesseract_main.la \
../wordrec/libtesseract_wordrec.la \
../ccutil/libtesseract_ccutil.la

unicharset_extractor_SOURCES = unicharset_extractor.cpp
unicharset_extractor_LDADD = \
../ccutil/libtesseract_ccutil.a
../ccutil/libtesseract_ccutil.la

wordlist2dawg_SOURCES = wordlist2dawg.cpp
wordlist2dawg_LDADD = \
../classify/libtesseract_classify.a \
../dict/libtesseract_dict.a \
../ccstruct/libtesseract_ccstruct.a \
../image/libtesseract_image.a \
../cutil/libtesseract_cutil.a \
../viewer/libtesseract_viewer.a \
../ccmain/libtesseract_main.a \
../ccutil/libtesseract_ccutil.a
../classify/libtesseract_classify.la \
../dict/libtesseract_dict.la \
../ccstruct/libtesseract_ccstruct.la \
../image/libtesseract_image.la \
../cutil/libtesseract_cutil.la \
../viewer/libtesseract_viewer.la \
../ccmain/libtesseract_main.la \
../wordrec/libtesseract_wordrec.la \
../textord/libtesseract_textord.la \
../ccutil/libtesseract_ccutil.la
6 changes: 4 additions & 2 deletions viewer/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ EXTRA_DIST = viewer.vcproj
include_HEADERS = \
scrollview.h svmnode.h svutil.h svpaint.cpp

lib_LIBRARIES = libtesseract_viewer.a
libtesseract_viewer_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_viewer.la
libtesseract_viewer_la_SOURCES = \
scrollview.cpp svmnode.cpp svutil.cpp

libtesseract_viewer_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
5 changes: 3 additions & 2 deletions wordrec/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ include_HEADERS = \
plotseg.h render.h seam.h split.h tally.h tessinit.h tface.h \
wordclass.h wordrec.h

lib_LIBRARIES = libtesseract_wordrec.a
libtesseract_wordrec_a_SOURCES = \
lib_LTLIBRARIES = libtesseract_wordrec.la
libtesseract_wordrec_la_SOURCES = \
associate.cpp badwords.cpp bestfirst.cpp chop.cpp chopper.cpp \
closed.cpp drawfx.cpp findseam.cpp gradechop.cpp \
heuristic.cpp makechop.cpp matchtab.cpp matrix.cpp metrics.cpp \
mfvars.cpp olutil.cpp outlines.cpp pieces.cpp \
plotedges.cpp plotseg.cpp render.cpp seam.cpp split.cpp \
tally.cpp tessinit.cpp tface.cpp wordclass.cpp wordrec.cpp
libtesseract_wordrec_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)

0 comments on commit 34d8258

Please sign in to comment.