This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [MinGW] Set NATIVE_SYSTEM_HEADER_DIR relative to configured prefix
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mark Mitchell wrote:
>>> Yes, we use a similar technique for our cross releases; the "system
>>> headers" are in $prefix/sysroot/include. We point the system root at
>>> that $prefix/sysroot, and arrange for the entire toolchain to be
>>> relocatable. Then, you can put it anywhere you like, and it still finds
>>> the system headers.
With a bit of trial and error, I finally got a relocatable
toolchain for MinGW for cross and crossed-native configurations
using unpatched mainline GCC and unpatched binutils 2.16.1. I
only tried out C and am yet to try out C++ and Java.
For either configuration, I started with a clean $PREFIX
folder, created "sys-root/mingw" under that folder and
then extracted mingw-runtime and w32api binaries into this
folder.
I then configured binutils with
"--with-sysroot=$PREFIX/sys-root" and GCC with
"--with-sysroot=$PREFIX/sys-root --with-build-sysroot=$PREFIX/sys-root"
(for both cross and crossed-native configurations).
I *had* to use "--with-build-sysroot" and I had to make "sys-root"
a sub-folder of $PREFIX for the toolchains to be relocatable. I
had to configure binutils with the sysroot option as well as
had been pointed out by Mark.
Now that I have things working with an unpatched mainline GCC,
I withdraw my patch that started this discussion.
If C++ and Java also work with this incantation, I will update
my article and scripts:
http://rmathew.com/articles/gcj/bldgcj.html
Thanks, (especially Mark and Danny)
Ranjit.
- --
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://rmathew.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEhsCrYb1hx2wRS48RAhV4AJ9Tb/M9Tv2QfVrTyUEGHsoR3/bcEACfQHx8
NQxmm8aCfLtf5tkggbRsIq8=
=ljK+
-----END PGP SIGNATURE-----