So this email prompted me to try something a little crazy, but it
worked; I just built a statically linked tesseract binary :)
A long time ago I wrote some plain makefiles which didn't rely on
any automake / cmake stuff. The main devs weren't interested,
understandably, but it was useful and fun for me. This was before
the code was in git, and when lots of training stuff was in the
repository, so sharing my changes wasn't easy and I never bothered.
I decided to dig out those makefiles and update them to track the
current codebase, in part because it seemed like a nice idea, and
also because I thought it might be an easy way to see if static
linking was easy. I added a directory called 'simplemake' to the
root of the tesseract repository, which contains a Makefile and a
config.mk file (as well as several files that just list where source
files are and what to do with them). It worked well, so I pushed it
to a branch called 'simplemake-integrated'; see:
https://github.com/nickjwhite/tesseract/tree/simplemake-integrated
To enable static linking just edit 'simplemake/
config.mk' to
uncomment the two lines underneath the line:
# Needed for static linking (uncomment lines to enable static linking)
Note that you'll need the dev packages of various image decoding
libraries installed, providing the .a (static) libraries. Hopefully
your distribution provides these easily. My distribution (Debian
stable) does for everything except for openjp2, which I had to build
myself to get the appropriate .a file.
This make infrastructure is something I quite like, and it is
completely self-contained; it can happily co-exist alongside the
existing build infrastructure, as cmake is doing now. Whether
anybody else is interested in it I don't know, but it is a very
simple, fast, and customisable way of building, and definitely works
correctly with -j12 or whatever I have thrown at it. Any feedback
would be very welcome indeed.
Nick