Wednesday, November 10, 2010

Cross-Compile Tesseract 3.00 for iPhone SDK 3GS

The shell script below can be used to cross-compile Tesseract 3.00 for iPhone 3GS. The original script is from:

Wayne

#!/bin/sh
# build_fat.sh
#
# Created by Robert Carlsen on 15.07.2009. Updated 24.9.2010
# build an arm / i386 lib of standard linux project
#
# initially configured for tesseract-ocr v2.0.4
# updated for tesseract prerelease v3

export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS3.2.sdk
export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=2.2 -I$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.0.1/include -I$SDKROOT/usr/include/"export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L$SDKROOT/usr/lib/"
export LDFLAGS="-L$SDKROOT/usr/lib/ -Wl,-dylib_install_name,@executable_path/"
export LD="$DEVROOT/usr/bin/ld"
export CPP="$DEVROOT/usr/bin/arm-apple-darwin10-cpp-4.2.1"
export CXX="$DEVROOT/usr/bin/arm-apple-darwin10-g++-4.0.1"
export CC="$DEVROOT/usr/bin/arm-apple-darwin10-gcc-4.0.1"
./configure --host=arm-apple-darwin
make -j3

ar r libtesseract_full.a `find . -name "libtesseract_*.o"`
ranlib libtesseract_full.a

No comments:

Post a Comment