API-FDX Linux Getting Started Manual
39
GmbH
Appendix B – Cross-Compilation
B. CROSS-COMPILATION
When the BSP is installed, it is compiled for the host’s environment. But module, library and
example programs can be manually cross-compiled by setting these few environment variables.
KERNEL_DIR=/targets/tmp/linux-2.4.21-ppc/
export KERNEL_INC_PATH=${KERNEL_DIR}/include/
export EXTRA_CFLAGS="-DDONT_USE_HIGH_PERF_COUNTER"
export EXTRA_KERNEL_CFLAGS=-I${KERNEL_DIR}/arch/ppc
export MAKEFLAGS=LOCAL_LIBRARY=y
•
KERNEL_DIR tells what kernel to use instead for cross-compilation.
•
EXTRA_CFLAGS=”-DDONT_USE_HIGH_PERF_COUNTER” is used in library and
applications to not use the x86 high performance counter for timing measures kernel to
use
•
EXTRA_KERNEL_CFLAGS is used by the module, e.g. for additional kernel includes
•
MAKEFLAGS=LOCAL_LIBRARY=y uses the library built in the BSP directory and not
/usr/local/lib/libaim_fdx.so
To build the BSP manually with these settings, run
make –C modules/linux-2.4
make –C library/obj tests
make –C samples/obj
The resulting binary files can then be used on the target.