[HELP] Cross Compiling - Which Linux Distro?

Get help, report and discuss bugs.
Post Reply
phil-t
Posts: 31
Joined: 27 Jan 2009, 08:24

[HELP] Cross Compiling - Which Linux Distro?

Post by phil-t » 08 Feb 2009, 14:43

Hi,

I'm trying to cross compile NZGet following the guide Hugbug pointed me to ..
http://www.nslu2-linux.org/wiki/Optware ... eToOptware

But, using Ubunto 8.10, it won't build due to an issue with collect2.c .. this is an issue with the headers of the Ubuntu /usr/include/bits and the Crosstool build using older gcc verions

I have drawn a blank in getting it to work, so was wondering what linux distro / gcc versions etc people have used for cross compiling optware..

I suspect I need something with an older gcc already in it? using apt-get install gcc will always download the latest, which doesn't seem compatible with the optware make utility..

Considering I have to set up a ton of embedded tool-chains for a living, you'd think I would be able to sort this out!, but my small brain just can't get into Linux that well!

Any help appreciated.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [HELP] Cross Compiling - Which Linux Distro?

Post by hugbug » 08 Feb 2009, 18:49

I use Debian 4 as VM-image from vmplanet.net. A disadvantage of this particular image is that it contains only a minimal install. You have to use package manager (console version) to install X and then all development packages.

phil-t
Posts: 31
Joined: 27 Jan 2009, 08:24

Re: [HELP] Cross Compiling - Which Linux Distro?

Post by phil-t » 09 Feb 2009, 00:44

Thanks..

I think I may have sussed it out, me being silly!

The instructions wheren't too clear, but where I went wrong was in not running the make toolchain/make nzbget from the <platform> directory in /optware, but from the root of optware!

I notice they have a tsx09 platform defined for the QNAP NAS's, so I used that, it's built the executable (0.5.1) which I'll test tomorrow!

I just need to suss out how to make the latest source code using the optware platform, but it should be easy enough, I'll use the existing nzbget makefiles as the example, and there seems to be info on the Unslung web pages..

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [HELP] Cross Compiling - Which Linux Distro?

Post by hugbug » 09 Feb 2009, 08:16

As long as you get default version built (0.5.1) it is easy to build the latest version.
I use the following (possibly not optimal) way:

In a working svn-directory of nzbget:

Code: Select all

./configure
make dist
It creates a distribution archive, e.g. nzbget-0.6.0-testing.tar.gz.
Then copy this archive into "optware/downloads".
Edit file "optware/make/nzbget.mk" and change "NZBGET_VERSION" from "0.5.1" to "0.6.0-testing".

Now you can build with:

Code: Select all

cd optware/<platform>
make nzbget-ipk
You can install ipk-file or just copy the binary from directory "nzbget-ipk".

phil-t
Posts: 31
Joined: 27 Jan 2009, 08:24

Re: [HELP] Cross Compiling - Which Linux Distro?

Post by phil-t » 09 Feb 2009, 22:02

Thanks for the tip! it's a good job you reminded me of the make nzbget-ipk I was wondering what to do with normal build output which was a 2.2Mbyte executable!

In the end, I changed the /make/nzbget.mk make script to download the latest svn trunk directly from the server to /downloads/nzbget_code only if /downloads/nzbget_code doesn't exist.. then copy the contents of this over to the build directory..

I only did this to allow me to edit the code in downloads/nzbget_code and it will build any changes I make..

I've just got it to check out and build r284, and this works over on the NAS!


I may knock a guide to cross compiling for beginners, as it was a bit of a head scratcher for me, but I have used GNU make on some of our embedded tool-chains, so could just about suss that bit out!

DrChair
Posts: 11
Joined: 09 Feb 2009, 21:50

Re: [HELP] Cross Compiling - Which Linux Distro?

Post by DrChair » 09 Feb 2009, 22:03

Or you can use the attached nzbget.mk (zipped)

If NZBGET_SVN_REV is defined, it checks out and builds that revision.

Otherwise it downloads and build the NZBGET_VERSION from sf
------------------------------
edit, since r283 the source somehow needs een autoreconf before it'll build.
(atleast in my FedoraCore6 colinux)
I attached a new version the nzbget.mk which takes care of that.
Attachments
nzbget.zip
nzbget.mk
(3.08 KiB) Downloaded 179 times

phil-t
Posts: 31
Joined: 27 Jan 2009, 08:24

Re: [HELP] Cross Compiling - Which Linux Distro?

Post by phil-t » 10 Feb 2009, 09:05

Cheers for that!

I'll use that as a basis and apply the mods I did to allow it to use a file copy of source code as well, so I can develop locally..

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [HELP] Cross Compiling - Which Linux Distro?

Post by hugbug » 10 Feb 2009, 09:11

phil-t wrote:I may knock a guide to cross compiling for beginners, as it was a bit of a head scratcher for me, but I have used GNU make on some of our embedded tool-chains, so could just about suss that bit out!
If you decide to write the guide please post it in topic [HOW-TO] Build the latest development version from svn in order to have all info in one place.

Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests