Hello,
I don't have an OpenWRT toolchain yet. You could try the following, if
it doesn't work for you, then I'll download and compile the toolchain so
I can test it. Cross-compiling should be the same, no matter which
platform you're targetting.
I've just tried compiling for ARM, using an ARM toolchain I already
have, and it worked. Let's suppose you've got your toolchain in this
path(examples using my ARM toolchain):
/opt/arm_linux_toolchain/
Let's assume that directory is called TOOLCHAIN_DIR. That directory
contains the following subdirectories:
arm-linux bin distributed info libexec tmp
arm-linux.crosstoolconfig.txt COPYING include lib man
Inside the "bin" subdirectory, you've got the compilers, linkers,
debuggers and other utilities:
arm-linux-addr2line arm-linux-g++ arm-linux-ld arm-linux-size
arm-linux-gcc arm-linux-nm arm-linux-strings
.....
I've also cross-compiled libpcap; the header files are located in
$TOOLCHAIN_DIR/include and the shared objects are stored in
$TOOLCHAIN_DIR/lib.
So now, all I had to do is issue the following command:
LD=/opt/arm_linux_toolchain/bin/arm-linux-ld \
CXX=/opt/arm_linux_toolchain/bin/arm-linux-g++ \
./configure --with-pcap-include-path=/opt/arm_linux_toolchain/include/ \
--with-pcap-lib-path=/opt/arm_linux_toolchain/lib/
Where:
LD indicates the path to the linker you're going to use.
CXX indicates the path to the C++ compiler you're going to use.
--with-pcap-include-path indicates the path in which you're storing the
pcap header files.
--with-pcap-lib-path indicates the path in which you're storing the pcap
shared objects(libpcap.so.whatever)
Once that script finishes running, you should execute "make" as usual.
Note that you don't have to provide an absolute path for the compiler
and linker if they're installed in one of the paths listed in the
environment variable PATH(this was not true for me).
According to what's mentioned here
http://wiki.openwrt.org/doc/devel/crosscompile the compiler and linker
will be stored inside your toolchain directory and their names will
follow this format:
ARCHITECTURE-openwrt-linux-uclibc-g++
ARCHITECTURE-openwrt-linux-uclibc-ld
Where ARCHITECTURE would probably be "arm" in my example.
If you're using eclipse, then you should do the exact same thing through
the GUI: specify the C++ cross-compiler, the linker, the libpcap include
directory, and the pcap shared objects path.
I hope this helps you. I'm going to add an explanation about how to
cross-compile the library in the libtins website soon.
Cheers,
Matias