If you want to use a program, currently not contained in the OpenWrt repository, you probably won't find a binary compiled for your CPU. Provided that it is released as open source, you can download the code and compile it using the OpenWrt Buildroot.
Note that not every code is compilable for every CPU architecture. Also performance on embedded systems is limited compared to ordinary computers.
- Follow the build instructions outlined in OpenWrt Buildroot – Usage
- Locate the toolchain binaries in the
- Add the toolchain directory to the
PATH=$PATH:(your toolchain directory here)
- Set the
STAGING_DIRenvironment variable to the toolchain dir and export it:
STAGING_DIR=(your staging directory here)
- Download and unpack the code to be compiled, change into the unpacked directory
- Pass the target to the build system of the package to compile
- For GNU configure, use
- For GNU make, override the
- If compilation aborts due to missing header files or shared objects, you might need to override
LDFLAGSto point to the
- Debugging requires gdb in the toolchain. Default config does not include it. Include using
make menuconfig. [Advanced configuration options→Toolchain Options→Build gdb]
- Remote debugging can be done using script
When compilation is finished, copy the resulting binary and realted libraries to the target device to test it. It might be necessary to set
LD_LIBRARY_PATH on the target to point the binary to libraries in nonstandard locations.
If the program works well enough, you maybe want to build a real package for the opkg package manager and make it easily accessible for everyone out there. See Creating your own packages and Using Dependencies for further information on that.
doc/devel/crosscompile.txt · Last modified: 2012/12/18 18:13 by uvray313