You are here: Home » Topic » Cross compile for NSLU2

Cross compile for NSLU2

This topic contains 16 replies, has 2 voices, and was last updated by  fizze 10 years, 10 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #842

    jm

    Hi,

    I’m in the process of setting up my Ubuntu box to build for NSLU2. However, my attempts so far shows limited success and I could really need some advice.

    I’ve downloaded one of tha latest nightlies. I have a setup so that i can build for the Ubuntu box. From some postings it appears to me that all that needs to be done for building for the NSLU is to run ./configure with –enable-nslu2 flag.
    Is that all that’s needed?
    Does this really make all required modifications for the Makefile?

    I read in a thread about ‘room correction’ that running ‘make mt-daapd-ipk’ should download and install croos compilation tools. Doing so just gives me an error message saying there is no rule for building mt-daapd-ipk. I guess this is due to the Makefile not being correct?

    I know I’m quite far outside my field of expertice on this, but I’d appreciate any advice helping me in the right direction.

    Thanks
    /J

    #7630

    fizze
    Participant

    why not just go with the
    http://nightlies.mt-daapd.org/dl.php?FILE=mt-daapd_0.9-svn-1450_armeb.deb
    ?

    thats a deb package just for ARM architectures (like the NSLU2).

    you should be able to install cleanly with apt-get πŸ˜‰

    #7631

    jm

    Yes, I know, that’s what I’ve been using for quite a while (not exactly 1450, but since 1400 or so).

    The main reason is I’ve made some modifications that I’d like to incorporate. E.g. how compilations are handled.

    Second reason is that Id like to learn. πŸ™‚

    #7632

    fizze
    Participant

    erm, that make mtdaapd-ipk does only work un unslung 6.8, since its based around ipkg.

    debonaras or whatever flavour you’re using isnt capable of ipkg, I guess *shrug*

    apt-get install gcc make automake make-utils

    and the likes seem to be more like it πŸ˜‰

    anyway, as Ron runs debian himself on his slug, he deffo can help you out.

    #7633

    rpedde
    Participant

    @jm wrote:

    Does this really make all required modifications for the Makefile?

    The place to start is here:

    http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware

    Basicaly, check out the source as described in that document using svn. Then, once you have that, just change into the optware directory and do a “make mt-daapd-ipk”. That will download and compile the cross-tools and stuff. That will take some time.

    Once you have that, you will have build the package for the stable version – 0.2.4. You’ll need an updated makefile for the nightlies. If you get started on getting the crosstools and whatnot set up, I’ll set up svn for the files I’m using for packaging. Right now, I don’t really have those anywhere.

    I’ll post back here when I have them posted somewhere.

    — Ron

    #7634

    jm

    Thanks a lot.

    Crosstool installed and first build up and running on NSLU. πŸ˜€

    I’ll post back here when I have them posted somewhere.

    Take your time. I’m in no hurry, I appreciate the work you put into making all this available to everyone. Thanks!

    #7635

    rpedde
    Participant

    @jm wrote:

    Thanks a lot.

    Crosstool installed and first build up and running on NSLU. πŸ˜€

    I’ll post back here when I have them posted somewhere.

    Take your time. I’m in no hurry, I appreciate the work you put into making all this available to everyone. Thanks!

    Okay. the files I use for the slug package are at http://www.fireflymediaserver.org/files.tar.gz. It’s kind of all blobbed together. I’ll get it cleaned up and in svn soonish, but this should get you running.

    The .mk file replaces the mt-daapd.mk in make/, and the contents of the mt-daapd directory go in sources/mt-daapd.

    Edit the makefile. Set MT_DAAPD_SITE to “http://nightlies.mt-daapd.org”, and set MT_DAAPD_VERSION to the version you want to build (svn-1450, maybe?)

    Then make mt-daapd-ipk

    Yell if you have trouble.

    — Ron

    #7636

    fizze
    Participant

    Finally got my Ubuntu up on my main machine.
    Dualhead is tricky to set up nicely πŸ˜‰

    Anyway, Im about to check out the SVN etc so I can finally compile some for my slug. Is that stuff of yours in SVN already or do I need to checkout that archive you posted above?

    edit:
    hehe, post# 333 for me.
    halfling of the beast? πŸ˜†

    #7637

    rpedde
    Participant

    @fizze wrote:

    Finally got my Ubuntu up on my main machine.
    Dualhead is tricky to set up nicely πŸ˜‰

    Anyway, Im about to check out the SVN etc so I can finally compile some for my slug. Is that stuff of yours in SVN already or do I need to checkout that archive you posted above?

    edit:
    hehe, post# 333 for me.
    halfling of the beast? πŸ˜†

    I have svn set up, at https://svn.fireflymediaserver.org/svn/firefly-build/trunk

    But I only have the win32 stuff in there now. I still have to add the debian, rpm, and unslung stuff. So until then, yeah… grab it from the tarball above.

    #7638

    fizze
    Participant

    Alright. I suppose its not that urgent.
    What about the stuff on TRAC? Cant i just leech these as I guess the above archive is kinda outdated?

    #7639

    rpedde
    Participant

    @fizze wrote:

    Alright. I suppose its not that urgent.
    What about the stuff on TRAC? Cant i just leech these as I guess the above archive is kinda outdated?

    Nope, that’s still the stuff I use to build nightlies — it’s all current.

    #7640

    fizze
    Participant

    Alright, seems like I got the configure script right and all those deps.

    Now Im configuring for:

    ./configure --enable-nslu2 --enable-sqlite --host=armv5b

    But the bastard isnt creating an ARM5 executable, but a i386 one. what did I wrong? I suppose it would scream if I had no cross-compiler installed?
    But the configure checks vs. all those armv5-libs succeed, so…?
    πŸ™„

    #7641

    rpedde
    Participant

    @fizze wrote:

    what did I wrong? I suppose it would scream if I had no cross-compiler installed?
    But the configure checks vs. all those armv5-libs succeed, so…?
    πŸ™„

    Easiest way is to do it through the unslung build process documented here.

    That builds the cross compiler, necessary libs, etc.

    You could probably get it to compile without it by setting CFLAGS, LDFLAGS, etc.


    $ export CC=/path/to/cross-cc
    $ export CFLAGS=-I/path/to/cross/includes
    $ export DLFLAGS=-L/path/to/cross/libs
    $ ./configure --with-nslu2 --enable-sqlite --host=arm5b

    Still think the best way is with unslung though — it will build all the prereq libs and stuff for you, including any hackery you have to have to cross compile it.

    — Ron

    #7642

    fizze
    Participant

    Thanks.
    well, i thought I can just sneak by all that stuff if I just compile on my host machine, and copy the binary over to the slug, where all the libraries and whatnot are πŸ˜‰

    edit:
    in case anyone else gets a weird error about missing terminating ” character in version_info.h, its an error in the glibc Makefile.
    It only really becomes apparent in recent Ubuntu installs, since some genious there swapped out the symlink /bin/sh from bash to dash.
    And dash isnt compatible to that extent.

    A quick fix is to revert the symlink back to bash. Might be trouble if you aint got root.

    #7643

    fizze
    Participant

    sweetness, changed the symlink /bin/sh -> /bin/bash, and now the build script worked like a charm.

    Used your files archive, and updated the Makefile, downloaded 1463 and built just fine.

    A question though:
    Is there something like ‘latest’ on the nightlies page?
    Or can I just checkout the stuff from the trac-trunk and overwrite my sources?
    Will the make mt-daapd-ipk always download from the site i set up there?

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.