PDA

Bekijk de volledige versie : How to cross-compile Linux APP for WL500GP



fillmore
24-03-2007, 19:28
My WL500Gp's firmware : 1.9.2.7-7f (2006-11-06)

I want to cross-compile Linux application like enhanced-ctorrent for running on my WL500GP.

How should I do ?

I can install enhanced-ctorrent by using http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/enhanced-ctorrent_dnh2.2-6_mipsel.ipk

package. But i can't find the source code of this ipk and i don't know how to build this package.

I want build this package by myself,so I want to know how to cross-compile enhanced-ctorrent source code for WL500GP.

Enhanced-ctorrent's Source code : http://www.rahul.net/dholmes/ctorrent/ctorrent-1.3.4-dnh2.2.tar.gz

Thanks a lot.

diody
24-03-2007, 22:13
I succesfully compiled some stuff with this tutorial on Suse 10.2:

http://www.macsat.com/BuildEnvironment.php

The tutorial is a little outdated. You have to change the address of cvs.sourceforge.net to nslu.cvs.sourceforge.net and you also need to export the paths with:
export PATH=$PATH:/opt/brcm/hndtools-mipsel-uclibc/bin:/opt/brcm/hndtools-mipsel-linux/bin

Then if you are lucky just do "make". Otherwise you'll have to edit the Makefile to change the paths to the right directories.

oleo
25-03-2007, 10:40
Read http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild

fillmore
25-03-2007, 13:32
Read http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild

This articale only describles Native compilation ?

I don't understand how to cross-compile enhanced-ctorrent on my linux PC.

fillmore
25-03-2007, 13:49
I try dioby's method.

Steps :

1.Download GPL_ToolChain.zip From ASUS web site.
2.tar zxvf opt.tar.gz
3. Now my directories :
/opt/brcm/opt/hndtools-mipsel-linux
/opt/brcm/opt/hndtools-mipsel-linux-3.0
/opt/brcm/opt/hndtools-mipsel-linux-3.2.3
/opt/brcm/opt/hndtools-mipsel-uclibc
/opt/brcm/opt/hndtools-mipsel-uclibc-0.9.19
/opt/brcm/opt/hndtools-mipsel-uclibc-3.2.3

4. cd /opt
cvs -z3 -d:pserver:anonymous@nslu.cvs.sourceforge.net:/cvsroot/nslu co unslung
5. Now my directories add : /opt/unslung

6. cd /opt/unslung
make directories
make ipkg-utils
make enhanced-ctorrent

7. Now my directories add :
/opt/unslung/builds/enhanced-ctorrent
/opt/unslung/builds/libstdc++
/opt/unslung/builds/openssl
/opt/unslung/builds/zlib

8.make enhanced-ctorrent-ipk
Error Now :
make -C /opt/unslung/builds/enhanced-ctorrent
make[1]: Entering directory `/opt/unslung/builds/enhanced-ctorrent'
make all-am
make[2]: Entering directory `/opt/unslung/builds/enhanced-ctorrent'
make[2]: Leaving directory `/opt/unslung/builds/enhanced-ctorrent'
make[1]: Leaving directory `/opt/unslung/builds/enhanced-ctorrent'
rm -rf /opt/unslung/builds/enhanced-ctorrent-dnh2-ipk /opt/unslung/builds/enhanced-ctorrent_dnh2-1_mipsel.ipk
install -d /opt/unslung/builds/enhanced-ctorrent-dnh2-ipk/opt/bin
/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-strip --remove-section=.comment --remove-section=.note --strip-unneeded /opt/unslung/builds/enhanced-ctorrent/ctorrent -o /opt/unslung/builds/enhanced-ctorrent-dnh2-ipk/opt/bin/enhanced-ctorrent
make /opt/unslung/builds/enhanced-ctorrent-dnh2-ipk/CONTROL/control
make[1]: Entering directory `/opt/unslung'
make[1]: Leaving directory `/opt/unslung' cd /opt/unslung/builds;PATH=/opt/unslung/staging/opt/bin:/opt/unslung/staging/bin:/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin TAR_OPTIONS=--format=ustar ipkg-build -c -o root -g root /opt/unslung/builds/enhanced-ctorrent-dnh2-ipk
tar: unknown option `--format=ustar'
Try `tar --help' for more information.
make: *** [/opt/unslung/builds/enhanced-ctorrent_dnh2-1_mipsel.ipk] Error 1


How should i do ? Or any steps go wrong ?

Thanks a lot

diody
25-03-2007, 15:29
Have you downloaded the Asus sources GPL_1927.zip?

fillmore
25-03-2007, 20:28
Have you downloaded the Asus sources GPL_1927.zip?


WL500gp directory : GPL_ToolChain.zip ,GPL_WL-500gP_1972.zip

opt directory is only in GPL_ToolChain.zip.

I don't use GPL_WL-500gP_1972.zip.

diody
25-03-2007, 21:55
As you can see the problem is here:

tar: unknown option `--format=ustar'

Try to find where the line is located and remove it.

fillmore
26-03-2007, 09:22
I copy the cross-compiled enhanced-ctorrent to WL500GP.

When I run on WL500gp, there's an error.


enhanced-ctorrent : can't load library 'libstdc++.so.5'.

What should I do?

I just want to know the precedure of building http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/enhanced-ctorrent_dnh2.2-6_mipsel.ipk this file by myself.

I want to produce the same file with enhanced-ctorrent_dnh2.2-6_mipsel.ipk.

oleo
26-03-2007, 11:05
quick guide is http://trac.nslu2-linux.org/optware/wiki

install latest uclibc-opt

fillmore
27-03-2007, 23:13
quick guide is http://trac.nslu2-linux.org/optware/wiki

install latest uclibc-opt

http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild
http://trac.nslu2-linux.org/optware/wiki

from this two guides




svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
export OPTWARE_TARGET=ddwrt
make directories
make toolchain
make packages


can't work directly

When i make toolchain, there are lots of errors.

I still try to figure it out.

fillmore
28-03-2007, 00:09
optware/oleg/toolchain/buildroot => buildroot-svn-17310.tar.gz (download by "make toolchain")

Is this buildroot-svn version right ?
And how to configure it's .config file ? It uses the default .config file.

If i use the default .config file, there are lots of errors.

diody
28-03-2007, 07:57
optware/oleg/toolchain/buildroot does not exist. Try to edit and change the path to:

optware/oleg/cross/stable/

oleo
28-03-2007, 08:08
I recommend to use
tar 1.14
bash 2.05
autoconf-1.9
gcc 4.1.1

fillmore
29-03-2007, 12:10
I recommend to use
tar 1.14
bash 2.05
autoconf-1.9
gcc 4.1.1

It helps a lot.

I change my OS from RedHat 9.0 to Fedora Core 6.

It can work directly without any errors.

Thanks you