[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Wrong placement of cross binaries



Hi Vincent,

Good question. You should ask it to the gcc mailing list. It is like
this for any target, not specific to MiNT.
Thanks for reminding me about its existence, I'll do it.

1. ./configure isn't aware of (in)compatibilities between build / host / target environments

That's one of its jobs.

[...]

So if you want to cross-build a library for a cross-compiler, you have
to do this :
configure --host=m68k-atari-mint --prefix=/usr/m68k-atari-mint

And if you want to cross-build a library to make a native library
package, you have to do this :
configure --host=m68k-atari-mint --prefix=/usr

Note that the 2 options above will produce exactly the same include and
libraries. The only differences will be :
- the installation directory
- the native tools will not be installed for a cross-compiler.
Of course I know this. But my point was, it's not happening like this. So the problem is broken configure script in that case? Because look at your example, how ./configure should know when you're preparing distribution package (i.e. native one) or when just installation for your cross environment? In both cases there's --host the same, only --prefix is different. So my question was more about how one should write such ./configure scripts then. I was thinking about adding --target for libraries producing executables as well, but this option isn't what we need (it says nothing about on what platform it will run, i.e. we would need something like --host-for-bin or so?) Another option would be check for if cross_compiling && dirname(gcc_path) == prefix/bin but I'm not sure how clean this is...

SDL is a very specific case. The sdl-config has been designed for a
native compiler. I'm pretty sure it has never been designed with
cross-compilers in mind.
Maybe not designed but it works pretty well in cross environments, I assure you :)

You should ask on the SDL mailing list if cross-compiling is supported
and how.
The cross compiling of SDL itself it's supported, the question is how one should configure its environment when both native and cross tools should be available. I do it in such way I separate 'sdl-config' into some special directory and for that one case when I'm running ./configure for SDL application, I add it to my PATH... not very funny.

Personally I always hack makefiles using sdl-config because it never
works for cross-compiling.
True, true.

It took me very long time to understand all that stuff, and I believe I
have now a quite right vision of the situation.
I have no doubt about your knowledge by any means ;)


--
MiKRO / Mystic Bytes
http://mikro.atari.org