OpenWrt Forum Archive

Topic: Cross-compiling documentation?

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I wanted to know how to compile software for mipsel on a x86 platform.

I've read openwrt documentation, googled for a while, read what I found, but I'm still not sure how should I start.

For example, if I have a program A, and would like to compile it on x86 PC, so that it runs on wrt54 - what steps should I do?

The easiest way is using the OpenWrt SDK. The only documentation for the SDK is BuildingPackagesHowTo.

(Last edited by olli on 21 Dec 2005, 16:50)

After reading BuildingPackagesHowto, I can compile the example "helloworld", but I've no idea how can I compile something else, like wget etc. (I know it's ported already, but I would like to know *how* to port such things).

The document doesn't really say much about it.

And I don't need a .ipk package, just "regular" compiled binaries etc. would be fine for a start.

Here is what i do (for smaller apps).
First of all you need to install a cross compiler.. On gentoo its just:
crossdev mipsel-linux-uclibc

Then, you have to configure your software to compile for a mipsel system:
LDFLAGS=-static ./configure --host=mipsel-linux-uclibc

This will make a static linked binary.

Last, compile:
make

And you have your app.

toft wrote:

Here is what i do (for smaller apps).
First of all you need to install a cross compiler.. On gentoo its just:
crossdev mipsel-linux-uclibc

Then, you have to configure your software to compile for a mipsel system:
LDFLAGS=-static ./configure --host=mipsel-linux-uclibc

This will make a static linked binary.

Last, compile:
make

And you have your app.

I'm on Fedora RC4, what cross-compiler would you suggest for it?

Bill

The discussion might have continued from here.