cross-compiling environment

8 posts / 0 new
Last post
billt
billt's picture
Offline
Last seen: 1 year 5 months ago
Joined: 2011-02-04 18:54
cross-compiling environment

I followed Zerohero's guide to setting up a Linux cross-compiler for OS4, and can run ppc-amigaos-gcc.

Now, how do I get ./configure to use that rather than the Linux-x86-64 native gcc? Anything else environment-wise I need to beat over the head?

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
@billt It depends on the

@billt

It depends on the configure script but usually it's just:

./configure --prefix=/SDK/local/newlib --host=ppc-amigaos

To get a list of options available type:

./configure -h

Note that not all configure scripts support cross-compiling as some might f.e. need to compile and run test programs to test various behaviors.

If the configure script uses pkg-config to check for installed libraries then you may also want to modify PKG_CONFIG_PATH first:

export PKG_CONFIG_PATH=/SDK/local/newlib/lib/pkgconfig

corto
corto's picture
Offline
Last seen: 7 years 1 month ago
Joined: 2011-09-09 11:43
salass00 : Did you create

salass00 : Did you create /SDK as a link ?

I tried my first cross-compilation and I used the full path :

  1. ./configure --prefix=/usr/local/amiga/ppc-amigaos/SDK/local/newlib --host=ppc-amigaos --disable-shared

But I have the following error :

  1. checking jpeglib.h usability... yes
  2. checking jpeglib.h presence... yes
  3. checking for jpeglib.h... yes
  4. checking for jpeg_read_header in -ljpeg... no
  5. configure: error: libjpeg not found

The library is not found but it is in :

  1. /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libjpeg.a
kas1e
kas1e's picture
Offline
Last seen: 1 year 5 months ago
Joined: 2010-11-30 15:30
@Corto I am sure you know it,

@Corto
I am sure you know it, but just in case: The best way is to check what configure.log says after you run config and have some not-founds. That configure.log creates and overwrites all the times when you run configure, and in it you always have full and detailed descriptions about what and where not found and why.

In your case for example, you have libjpeg where is need it, but, libjpeg want also (for example) libimage, or libttf, or libpng (by any of reassons), and so, configure say that problem about libjpeg, but if you will check configure.log, you will found what exactly need it, and why libjpeg "not found".

corto
corto's picture
Offline
Last seen: 7 years 1 month ago
Joined: 2011-09-09 11:43
You're right, I use to look

You're right, I use to look at config.log (at not configure.log ;-) ) but here I was focused on paths. Your advice is very good :

/usr/local/amiga/lib/gcc/ppc-amigaos/4.2.4/../../../../ppc-amigaos/bin/ld: skipping incompatible /usr/local/amiga/ppc-amigaos/SDK/local/newlib/lib/libjpeg.a when searching for -ljpeg

So now this problem is over. Nice to learn how to cross-compile from my powerful linux workstation at work :)

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
salass00 : Did you create


salass00 : Did you create /SDK as a link ?

/SDK is a symbolic link to /usr/local/amiga/ppc-amigaos/SDK on all my cross-compiler systems. The reason I do this is so that any libraries I cross-compile can easily be copied over to a native SDK without having to change any paths (in lib*.la files f.e.) and vice versa of course.

billt
billt's picture
Offline
Last seen: 1 year 5 months ago
Joined: 2011-02-04 18:54
I thought the

I thought the --prefix=/some/path was for telling it where to install on the make install part after compiling. I've used this on my linux box to direct things to install to /opt instead of whatever the default install location is, and to compile/install things at work to some path that I can actually write into (no root access for default locations).

./configure --prefix=/SDK/local/newlib --host=ppc-amigaos

Would make install into the location /SDK/local/newlib, which would likely only be useful if you're building and installing the OS4 version of newlib. It does not direct anything to use newlib already located there for compiling some other code.

Do I not understand this correctly?

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
@billt The headers and

@billt

The headers and libraries for newlib itself are installed under the prefix /SDK/newlib not /SDK/local/newlib. The /SDK/local drawer is where all 3rd-party SDK additions are supposed to be installed (/SDK/local/newlib for newlib dependent stuff, /SDK/local/clib2 for clib2 and /SDK/local/common for anything that doesn't depend on a specific c library).

Log in or register to post comments