This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [MinGW] Set NATIVE_SYSTEM_HEADER_DIR relative to configured prefix

On Sat, Dec 16, 2006 at 08:49:39AM -0500, Bob Rossi wrote:
> On Wed, Jun 07, 2006 at 05:33:56PM +0530, Ranjit Mathew wrote:
> > 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:
> > 
> >
> > 
> > Thanks, (especially Mark and Danny)
> > Ranjit.
> > 
> > - --
> > Ranjit Mathew      Email: rmathew AT gmail DOT com
> > 
> > Bangalore, INDIA.    Web:
> Hi Ranjit, 
> Did you ever create a script that makes a relocatable gcc on mingw that
> was built nativly?
> I'm currently working on this and do not have a solution yet. It takes
> so long to continually build gcc and determine if it works.

I am closer to having a relocatable gcc that supports C/C++. I was able
to run this program,
  #include <stdio.h>
  int main (int argc, char **argv) { printf ("Hello World\n"); return 0;}
on a machine that does not have any development tools installed on it at
all. Only the gcc I put on it. It created the executable and the program
ran fine.

However, when I run this program,
  #include <iostream>
  int main (int argc, char **argv) { cout << "Hello World" << endl; return 0;}
g++ fails because it can not find the file 'iostream'. Why would it be
able to find stdio.h and not iostream?

Attached is the script that I used to make the build. Any suggestions? I
was able to create this script by following previous users attempts and
there results from the mailing lists.

Bob Rossi

Description: Bourne shell script

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]