OpenWrt Forum Archive

Topic: How to compile for openwrt/wrt54gs..

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

I compiled my kernel using buildroot..

I have asked this before, but could someone help a bit.. How can I compile stuff for this platform on my i386 linux?

For e.g. I'd like to re-compile miau, as miau mipsel package there is, does not seem to support ipv6 hmm
(I want to use it with my ipv6 I-Line to irc)

So, I downloaded sources for miau, and tried it first like this:
"./configure mipsel-linux"
but it didn't work that way..
I propably also need to change Makefile (right?) so it can find proper gcc for this operation or what?
Please, someone could provide some help here..

I compiled my kernel using buildroot..

I have asked this before, but could someone help a bit.. How can I compile stuff for this platform on my i386 linux?

For e.g. I'd like to re-compile miau, as miau mipsel package there is, does not seem to support ipv6 hmm
(I want to use it with my ipv6 I-Line to irc)

So, I downloaded sources for miau, and tried it first like this:
"./configure mipsel-linux"
but it didn't work that way..
I propably also need to change Makefile (right?) so it can find proper gcc for this operation or what?
Please, someone could provide some help here..

Okay, alreadu found it out, if someone is wondering about how to do it, here's a small HOWTO..

Create a kernel with buildroot, you do not need to install new kernel that u have just compiled, we did this just to get the toolchain so we can compile code for wrt54g.

Now we need to set path variable, so shell can find our compilation tools.

Type "env" (or "set") to get list of shell environment variables, we need to find variable "PATH" if the list is too long, so it doesn't fit to 1 screen and you aren't using putty or similar tool so you can't browse, use "env |more" (or "set |more") so it pauses between screens. After you have found PATH variable type:
export PATH = (original path variable):/buildroot_dir/build_mipsel/staging_dir/bin

for example:
export PATH = /bin:/usr/bin:/sbin:/usr/sbin:/src/buildroot_dir/build_mipsel/staging_dir/bin

you can test it with "mipsel-linux-uclibc-gcc" if command reports "no input files" then it works, if it can't find command, then your path variable is incorrect.

Download program sources you want to get compiled and untar them (.tgz packages can be exctracted like this "tar xvfz package.tgz"), read readme or other docs on compilation, most usual way to compile programs is to use first configure-script then make and last, make install, as we are about to move these to wrt, we don't need to use make install, it would copy files to program directories, but wrt code won't run on i386 so we couldn't use them afterall..

so for the usual case, here's command line for compilation:
CC=mipsel-linux-uclibc-gcc LD=mipsel-linux-uclibc-ld ./configure --host=mipsel

before this u might want to try ./configure --help to see available options, reducing things usually also reduces size of file. Also advanced options like support for ipv6 are disabled as default usually.

then type make.

After compilation, if you want to change some settings, command "make clean" this will erase objects, compiled executables and libraries and you can have a fresh start.

Ofcourse compilation can differ very much of this short example. But usually programs ship with document "INSTALL" or "README" which will guide you on compilation. Also remember that you can't compile every program. For example, I tryied to compile nmap (on general there's a thread that contains nmap.tgz) but still haven't succeeded.

But this will help everyone to get started.

Okay, alreadu found it out, if someone is wondering about how to do it, here's a small HOWTO..

awesome!

awesome!

Really? Thanks. smile Got anything compiled yet?

.. Still waiting for a good howto on setting up a wireless bridging between 2 wrt54's in openwrt..

./configure doesn't run through...

configure: error: unable to find a compiler for building build tools

But the cross-compiler already exists... Or what is meant by "build tools"?

The discussion might have continued from here.