Cross compiling standalone packages for the camera

From ElphelWiki
Revision as of 09:00, 10 March 2009 by Luxigo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This procedure is intended to test software before taking time to include it in the firmware build,

or to build software that would be too big to fit into the firmware image.

First

you have to source init_env from the elphel firmware source directory, eg:

source /usr/local/src/elphel-cvs/353/elphel353/init_env

Setting environment variables

(check ./configure --help and the Makefile to see if more is needed)

# toolchain
TOOLCHAIN=/usr/local/cris
export PATH=${TOOLCHAIN}/crisv32-axis-linux-gnu/bin:$PATH 
export PATH=${TOOLCHAIN}/bin:$PATH 

# binaries
export CC=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-gcc
export CXX=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-g++
export CPP=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-cpp

# options
export CFLAGS=-I${TOOLCHAIN}/include
export CFLAGS="${CFLAGS} -I${TOOLCHAIN}/crisv32-axis-linux-gnu/sys-include"
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=${CFLAGS}
export LDFLAGS=-L${TOOLCHAIN}/lib
export LDFLAGS="${LDFLAGS} -L${TOOLCHAIN}/crisv32-axis-linux-gnu/lib/"

# user includes and libraries
export LDFLAGS="${LDFLAGS} -L/usr/local/crisv32/lib"
export CFLAGS="${CFLAGS} -I/usr/local/crisv32/include"
export CXXFLAGS=${CFLAGS}

When the software is packaged using autoconf and automake

You normally just have to run:

./configure --host=crisv32-axis-linux-gnu --prefix=/usr/local/crisv32  [ other options ]
make
make install

and mount or copy the resulting /usr/local/crisv32 to the camera (you may want to strip binaries and remove documentation before)

Then to run the software on the camera you may have to define:

export PATH=/usr/local/crisv32/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/crisv32/lib:$LD_LIBRARY_PATH

When the software is not packaged using autoconf and automake

Edit the Makefile