Hello,
Could you add this to the FAQ on the website please ?
I'm sure i'm not the only one that did waste time on it yet.
And I do remember it is not the first time i did :/
Thanks for all !
------------------------------
How to build a standalone package for freewrt or
compile a source file using the freewrt toolchain :
1. Set some environment variables
(modify FREEWRT according to your install)
# toolchain
FREEWRT=/usr/local/src/freewrt_1_0_3
TOOLCHAIN=${FREEWRT}/staging_dir_mipsel
export PATH=${TOOLCHAIN}/bin:$PATH
# binaries
export CC=${TOOLCHAIN}/bin/mipsel-linux-gcc
export CXX=${TOOLCHAIN}/bin/mipsel-linux-g++
export CPP=${TOOLCHAIN}/bin/mipsel-linux-cpp
# options
export CFLAGS=-I${TOOLCHAIN}/include
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=${CFLAGS}
export LDFLAGS=-L${TOOLCHAIN}/staging_dir_mipsel/lib
2a. Configure and build a package :
./configure --host=mipsel-linux
make
2b. Compile a single source file :
mipsel-linux-gcc $CFLAGS $LDFLAGS test.c -o test-mips
NOTES:
- Add extra includes to CFLAGS with -I
- Add extra libraries to LDFLAGS with -L
- Check for additional variables at bottom of "./configure --help"
- Check resulting executables with the "file" command
- Libraries are usually found with "find . -name .libs"
- Strip binaries and libraries with "make strip" or "mipsel-linux-strip"
_______________________________________________
freewrt-users mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-users