Can't cross-compile for WDTV

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
hapablap
Posts: 4
Joined: Fri May 08, 2009 11:58 am

Can't cross-compile for WDTV

Post by hapablap »

Hi,

I am trying to cross-compile Transmission for a WDTV (a mipsel machine), in order to help (and get the fixed version) in bug #2030. I have the toolchain of the target installed, so I am doing this:

Code: Select all

# svn co svn://svn.m0k.org/Transmission/trunk Transmission -r8349
(...)
Checked out revision 8349.
# cd Transmission
# ./autogen.sh --disable-nls --disable-gtk --disable-cli --disable-mac --disable-beos --disable-ws --disable-libnotify CPPFLAGS=-DTR_EMBEDDED --host=mipsel-linux
After some text, I get the 'error: po/Makefile is not ready' error, so I do a "./autogen", which does something that makes the previous autogen work when run again.

So... some lines later, I get this, which is apparently OK:

Code: Select all

    Source code location:       .
        Compiler:                   mipsel-linux-g++
        Build Command-Line client:  no
        Build Daemon:               yes
        Build GTK+ client:          no
          ... gio support:          no
          ... dbus-glib support:    no
          ... libnotify support:    no
        Build OS X client:          no
Then I do make, but I get these errors:

Code: Select all

crypto.c:21:24: error: openssl/bn.h: No such file or directory
crypto.c:22:24: error: openssl/dh.h: No such file or directory
crypto.c:23:25: error: openssl/err.h: No such file or directory
crypto.c:24:25: error: openssl/rc4.h: No such file or directory
crypto.c:25:25: error: openssl/sha.h: No such file or directory
crypto.c:26:26: error: openssl/rand.h: No such file or directory
From here, everything fails. The packages libssl-dev and libssl0.9.8 are installed, and their files are in the right location:

Code: Select all

# locate bn.h
/usr/include/openssl/bn.h
Any ideas? I am not an expert in compiling programs in Linux (let alone cross-compiling...), and I am not sure if this problem is about Transmission or about the toolchain...

I am using an updated Debian Lenny with all the packages mentioned here installed.

Thank you.
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Can't cross-compile for WDTV

Post by rb07 »

WDTV doesn't have a network, what good is Transmission there?
hapablap
Posts: 4
Joined: Fri May 08, 2009 11:58 am

Re: Can't cross-compile for WDTV

Post by hapablap »

It has USB, and many network adapters are compatible, even wireless! ;)
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Can't cross-compile for WDTV

Post by rb07 »

OK, then the answer to your original question is: the problem is either with the cross-compiling scripts, they don't set the required environment or you don't know/understand how to cross-compile... you know that one thing is to find the header (as you show) and a different thing is to find the cross-compiled library (which will not be in /usr/lib unless your scripts do a chroot).
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Can't cross-compile for WDTV

Post by Jordan »

If you want to do this brute force:

For an embedded system like that, first thing I'd do is tear out all mention of gettext, gettextize, glib-gettextize, intltool, etc. from configure.ac and autogen.sh. Banging your head against i18n without glib installed will cause you nothing but grief.

Next, as you noted it's failing to find openssl. You may have better luck telling configure EXACTLY where to look for openssl by setting the OPENSSL_CFLAGS and OPENSSL_LIBS environment variables and re-running autogen. Look at the include paths passed into gcc by inspecting the gcc invocation and looking for the arguments that begin with "-I" ... then look in those directories and compare them to what libtransmission is looking for in those error messages, and you should be able to figure out where the disconnect is.
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Can't cross-compile for WDTV

Post by rb07 »

hapablap wrote:It has USB, and many network adapters are compatible, even wireless! ;)
I just checked and just as I thought that is not very precise, first you need to flash a modified firmware, you are probably using WDLXTV firmare, then you can use one of the few supported adapters.

If you already have WDLXTV firmware, why not install and use Optware? they already distribute a compiled Transmission, latest version (even, as reported on another thread, with a recent patch).

Anyway, thanks for the pointer, I also have a WDTV 8-) I'm just about to install the latest firmware from WD; no I haven't experimented with networking or enhanced firmwares.
hapablap
Posts: 4
Joined: Fri May 08, 2009 11:58 am

Re: Can't cross-compile for WDTV

Post by hapablap »

rb07 wrote:I just checked and just as I thought that is not very precise, first you need to flash a modified firmware, you are probably using WDLXTV firmare
Sorry, I was posting from the phone and couldn't extend. Actually, I have ext3-boot from Zorander, it's an alternative firmware which creates a hook so it looks for a file in a disk which embeds a whole filesystem. That way you can mess around with it without wearing the flash.
rb07 wrote:then you can use one of the few supported adapters.
Actually, there are many supported adapters, but only a few are "approved" (= appear in the wiki). But any adapter with a AX88772 chipset will do, and they are the most cheap and popular. I got a fake Wii network adapter for 9 euros and it works great.
rb07 wrote:If you already have WDLXTV firmware, why not install and use Optware? they already distribute a compiled Transmission, latest version (even, as reported on another thread, with a recent patch).
Yes, I know, I reported that in #2030, but I wanted to help finding the problem, and not having to wait until a new package is uploaded to optware. I even tried to install optware-devel in the WDTV to compile things there, but that got me even more problems.
Jordan wrote:If you want to do this brute force...
Thanks for the advice. I will try the things you say and see what I can get. I'll report failure or success. Anyway, I have a doubt... shouldn't --disable-nls do the same as removing gettext, gettextize, etc. from the configure?
hapablap
Posts: 4
Joined: Fri May 08, 2009 11:58 am

Re: Can't cross-compile for WDTV

Post by hapablap »

After several hours of tinkering and reading, I came to a conclusion: it is very hard to cross-compile manually Transmission for a newbie like me. When I got that problem not finding openssl headers, I tried manually rerunning the exact line gcc invocation but appending -I/usr/include in the end. I got solved the problems with openssl, but then came similar ones: it tried to link with some curl libraries, that I didn't have, at least in mipsel form. So I should download curl, cross-compile it... and it's not worth it.

Frustrated, I sent an e-mail to a optware mantainer (bzhou, thank you!), asking that he updated the Transmission ipkg, since the fix from #2030 had been fixed. Not only he did that, he explained me how to cross-compile and create my own ipkgs without all the hassle, automatically:

Code: Select all

svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
make -C optware wdtv-target
cd optware/wdtv
make directories ipkg-utils toolchain
(... now here you can edit make/transmission.mk...)
make transmission-dirclean transmission-ipk
And after a little error which got solved installing libwww (to compile curl), I have a nice Transmission ipkg of the last revision available =)

PS: I know this is not the right place to discuss optware and such, but it may be useful to somebody with the same problem, since involves Transmission more or less...
Post Reply