Created
June 12, 2011 00:08
-
-
Save cdwilson/1021107 to your computer and use it in GitHub Desktop.
clearsilver and cherokee setup for ARM linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # using DigiEL 5.2 Rev B | |
| # del_toolchain comes with python 2.5.1 (http://www.python.org/download/releases/2.5.1/) cross-compile patch, and builds for host and target..."that was easy!" | |
| export STEELYARD_TOOLCHAIN="$HOME/src/steelyard_toolchain" | |
| cd $STEELYARD_TOOLCHAIN/del_toolchain/packages/python/ | |
| make | |
| make install | |
| # Add clearsilver-0.10.5 (http://www.clearsilver.net/downloads/clearsilver-0.10.5.tar.gz) as an "extra" package under del_toolchain/extras/clearsilver | |
| cd $STEELYARD_TOOLCHAIN/del_toolchain/extras/clearsilver/ | |
| # modify Makefile.in configure to disable building language bindings: | |
| # --disable-perl \ | |
| # --disable-python \ | |
| # --disable-ruby \ | |
| # --disable-java \ | |
| # --disable-csharp \ | |
| make | |
| make install | |
| # the tests will fail, but everything should build ok | |
| # install it in the toolchain | |
| make install-del | |
| # the --disable-python line above is specified instead of --with-python=/path/to/python because I haven't figured out the correct recipe for the clearsilver make system to cross compile the python stuff...so, we'll do it by hand instead...ugh... | |
| # I found most of the helpful info from http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/ | |
| # download and install the following python packages using the newly built 2.5.1 host binary: | |
| # http://pypi.python.org/pypi/distribute | |
| # http://pypi.python.org/pypi/distutilscross | |
| tar xzvf <package>.tar.gz | |
| cd <package> | |
| $STEELYARD_TOOLCHAIN/del_toolchain/packages/python/host/_install/usr/bin/python setup.py install | |
| # now we cross compile neo_cgi.so for ARM | |
| cd /path/to/del_toolchain/extras/clearsilver/target/clearsilver-0.10.5/python | |
| export PYTHONXCPREFIX="$STEELYARD_TOOLCHAIN/del_toolchain/packages/python/target/_install/usr" | |
| export CROSS_COMPILE=arm-linux- | |
| export CC="${CROSS_COMPILE}gcc -pthread" | |
| export LDSHARED="${CC} -shared" | |
| export LDFLAGS="-L$STEELYARD_TOOLCHAIN/del_toolchain/packages/python/target/_install/usr/lib -L$STEELYARD_TOOLCHAIN/del_toolchain/packages/python/target/_install/lib" | |
| $STEELYARD_TOOLCHAIN/del_toolchain/packages/python/host/_install/usr/bin/python setup.py build -x | |
| arm-linux-strip build/lib.linux-i686-2.5/neo_cgi.so | |
| # copy neo_cgi.so into target python install | |
| scp build/lib.linux-i686-2.5/neo_cgi.so root@target:/usr/lib/python2.5/ | |
| # setup cherokee on target to serve cgi | |
| # add a /cgi-bin rule that points to /path/to/cgi-bin on target | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment