[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Wrong placement of cross binaries
Miro Kropacek a écrit :
I assume you are speaking of a cross-compiler.
True but it applies to any installation.
There is no /usr/m68k-atari-mint directory on a native installation.
However there is a directory with the target name somewhere in lib for
gcc internals.
Can you imagine any reason why m68k-atari-mint-gcc
can't search for m68k-atari-mint-as, esp. when it's found during
./configure phase under this name?
Good question. You should ask it to the gcc mailing list. It is like
this for any target, not specific to MiNT.
And finally, target executables (by opposition to target libraries)
should not be installed on a host cross-environment, it is a
nonsense since they can't be run on the host.
Not entirely true, because:
1. ./configure isn't aware of (in)compatibilities between build / host /
target environments
That's one of its jobs.
and honestly, what should do instead? Ignore make
install for those executables?
Yes.
What if packager invokes it with make
install DESTDIR=... command for later (native) packaging?
Make install DESTDIR= should always do the same as make install, into
the specified directory.
But you have missed something.
If you want to build a cross-tool, you have to configure it with
--target=m68k-atari-mint. Note that the "--target" option is available
only for cross-tools, like the binutils and gcc. These tools will be
prefixed and installed in the native host directories.
If you want to cross-build a target library, you have to specify the
target with "--host" and use the target subdirectory as prefix.
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.
An example is ncurses. If I build it for a cross-compiler, I want only
libncurses.a and the includes. If I cross-build it for a native package,
I wand the library, the includes, but also the terminfo database and the
"clear" tool.
This should work like this. But autoconf is complicated, and the old
versions did not support cross-compiling very well. And most of the time
the developers don't care about cross-compiling, so the configure
scripts are wrong and must be manually tweaked. Bur things are better
with recent packages build with the newer autoconf.
2. Some executables are mandatory to be there. Perfect example is
sdl-config for m68k-atari-mint target. It's invoked from many configure
scripts under the name 'sdl-config', i.e. not m68k-atari-mint-sdl-config
(there's no such convention, sadly) and guess what? It works well
because it's shell script but it returns atari-specific flags.
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.
You should ask on the SDL mailing list if cross-compiling is supported
and how.
Personally I always hack makefiles using sdl-config because it never
works for cross-compiling.
It took me very long time to understand all that stuff, and I believe I
have now a quite right vision of the situation.
--
Vincent Rivière