Author Topic: Cross-compile Libs, Libjpeg In Particular  (Read 8488 times)

matthis

  • Full Member
  • ***
  • Posts: 217
    • View Profile
    • http://badaboum.bidibom.free.fr/mat/
Cross-compile Libs, Libjpeg In Particular
« on: March 14, 2007, 11:35:34 pm »
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  

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  

Thanks!

uth

  • Full Member
  • ***
  • Posts: 106
    • View Profile
Cross-compile Libs, Libjpeg In Particular
« Reply #1 on: March 15, 2007, 02:18:13 pm »
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

  • Full Member
  • ***
  • Posts: 217
    • View Profile
    • http://badaboum.bidibom.free.fr/mat/
Cross-compile Libs, Libjpeg In Particular
« Reply #2 on: March 17, 2007, 09:38:06 am »
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

  • Newbie
  • *
  • Posts: 13
    • View Profile
Cross-compile Libs, Libjpeg In Particular
« Reply #3 on: February 04, 2008, 08:03:14 am »
Quote from: 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

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
Alexandr.
Zaurus SL-C1000, CF WLAN D-LINK 660, 2Gb SD Transcend 133x
Angstrom 2007.12r3 with altboot

matthis

  • Full Member
  • ***
  • Posts: 217
    • View Profile
    • http://badaboum.bidibom.free.fr/mat/
Cross-compile Libs, Libjpeg In Particular
« Reply #4 on: February 08, 2008, 07:52:34 am »
Thank you!