Help - Search - Members - Calendar
Full Version: Cross-compile Libs, Libjpeg In Particular
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Qt/Qtopia
matthis
Dear devs, I'd be happy if someone could give me a hand with this. I've spent too many hours without success and I'm starting to be depressed blink.gif

Here is my problem. I've been trying to cross-compile libjeg so that I can cross-compile programs that need it. I need shared libs to I configured with --enable-shared

When trying to make, it complained that it couldn't find libtool, so I copied it from /usr/bin/libtool to ./
Then it complained that libtool couldn't find the proper tags so I added --tag=$(CC), with $(CC) pointing to arm-linux-gcc

But then when making, towards the end it uses gcc instead of arm-linux-gcc, and /usr/bin/ld instead of arm-linux-ld although I specified LD=arm-linux-ld at configure.

So, how to use libtool correctly??

If no one knows whats going on, a tarball of cross-compiled libjpeg libs/headers would also make me happy smile.gif

Thanks!
uth
Hi,

cross-compiling will give you major heartburn until you get all of your environment vars setup correctly

The sharp sdk comes with shell scripts that help do this, though I found some bugs in them.

Basically, I set my PATH variable to point to the directory containing the arm-linux-* and other arm tools, then source this when I want to cross-compile.

so if I type 'which gcc', it should show the one in the sharp sdk, not the one in /usr/bin.

I also created a directory /opt/sharplibs/arm, where I install my cross-compiled libs into (not sure if libjpeg is in there, it might be, I'll look tonight.)

But in short, though the apps are supposed to obey the CC and LD vars, it sounds like they are being ignored in your case, so setting your PATH should fix this

I'm not sure if you can use /usr/bin/libtool

I hope this helps, if it's confusing, I can send the script I source for cross-compiling
matthis
Thank you so much for helping out. I am proceeding via the same method, ie.sourcing to a script setting my variables. Here is its content:

CROSSCOMPILE=/opt/Embedix/tools
QPEDIR=/opt/Qtopia/sharp
QTDIR=/opt/Qtopia/sharp
PATH=$QTDIR/bin:$QPEDIR/bin:$CROSSCOMPILE/bin:$PATH
TMAKEPATH=/opt/Qtopia/tmake/lib/qws/linux-sharp-g++/
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QPEDIR QTDIR PATH LD_LIBRARY_PATH TMAKEPATH

Is anything wrong? Is anything missing?

Thanks
zensei
QUOTE(matthis @ Mar 17 2007, 02:38 PM) *
Thank you so much for helping out. I am proceeding via the same method, ie.sourcing to a script setting my variables. Here is its content:

CROSSCOMPILE=/opt/Embedix/tools
QPEDIR=/opt/Qtopia/sharp
QTDIR=/opt/Qtopia/sharp
PATH=$QTDIR/bin:$QPEDIR/bin:$CROSSCOMPILE/bin:$PATH
TMAKEPATH=/opt/Qtopia/tmake/lib/qws/linux-sharp-g++/
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QPEDIR QTDIR PATH LD_LIBRARY_PATH TMAKEPATH

Is anything wrong? Is anything missing?

Thanks


1. export CROSSCOMPILE
2. LD_LIBRARY_PATH: must be LD_LIBRARY_PATH=$QTDIR/lib, without $LD_LIBRARY_PATH i.e you have path to the "intel" libraries
matthis
Thank you!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.