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?
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?
@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
salass00 : Did you create /SDK as a link ?
I tried my first cross-compilation and I used the full path :
But I have the following error :
The library is not found but it is in :
@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".
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 :)
/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.
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?
@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).