Tesseract OCR

1. Get the source
Tesseract OCR's source : http://code.google.com/p/tesseract-ocr/
libtiff's source : http://www.libtiff.org/index.html
For jpeg library, check my other page "ZBar code reader cross-compilation guide"
libz sources : http://www.zlib.net/

2. Extract the files
Extract all sources in the directory of your choice.

3. Build jpeg library
Check my other page "ZBar code reader cross-compilation guide"

4. Build libz
Environement:
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS3.0.sdk
export CC=$DEVROOT/usr/bin/gcc
export LD=$DEVROOT/usr/bin/ld
export CPP=$DEVROOT/usr/bin/cpp
export CXX=$DEVROOT/usr/bin/g++
unset AR
unset AS
export NM=$DEVROOT/usr/bin/nm
export CXXCPP=$DEVROOT/usr/bin/cpp
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -L/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/lib"
export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/include"
export CXXFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/include/"

Configure:
./configure --prefix=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os

Make and make install

5. Build tiff library
I used the previous environnement variable.

Configure is :
./configure --host=arm-apple-darwin9 --prefix=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os --enable-shared=no --with-x=no

Make and make install

6. Build tesseract
I used the previous environnement variable + the following:
export LIBTIFF_CFLAGS=-I/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/include/
export LIBTIFF_LIBS="/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/lib/libtiff.a /Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/lib/libz.a"

Configure:
./configure --host=arm-apple-darwin9 --prefix=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os

make and make install !



Comments