[MinGW] Set NATIVE_SYSTEM_HEADER_DIR relative to configured prefix

Danny Smith dannysmith@clear.net.nz
Wed Dec 20 07:01:00 GMT 2006


 'Bob Rossi'
 20 December 2006 4:07 a.m.

> Please read this entire email, I think it describes very well 
> the state
> of gcc-4.1.1 on mingw. Also, while reading, if you know about how
> --sysroot would effect any of this, please let me know.
> 
> Here we go. I'm using gcc-4.1.1 again, as a starting point. I've
> configured and built,
> 
>   ../gcc-4.1.1/configure  --disable-werror  --host=mingw32  
> --target=mingw32 \
>   --prefix=/mingw  --program-suffix="-4.1"  --with-gcc  
> --with-gnu-ld \
>   --with-gnu-as  --enable-threads=win32  --disable-nls  
> --enable-languages=c,c++ \
>   --disable-win32-registry --disable-shared  --enable-static  
> --without-x \
>   --enable-libstdcxx-debug  2>&1 | tee configure-out.txt
> 
>   make  CFLAGS="-O2 -fomit-frame-pointer" \
>   CXXFLAGS="-mthreads -fno-omit-frame-pointer -O2"  LDFLAGS=-s  \
>   bootstrap 2>&1 | tee make-out.txt
> 
> Then I do 'make DESTDIR=/home/bobbybrasko/gcc/gcc-4.1.1/destdir
> install'. They try,
>   $ 
> PATH=/home/bobbybrasko/gcc/gcc-4.1.1/destdir/mingw/bin:$PATH 
> gcc-4.1 -o main main.c                   
> works fine. but,
>   $ 
> PATH=/home/bobbybrasko/gcc/gcc-4.1.1/destdir/mingw/bin:$PATH 
> g++-4.1 -o main main.cpp                 
>   main.cpp:1:20: error: iostream: No such file or directory   
>                                             
>   main.cpp: In function 'int main(int, char**)':              
>                                             
>   main.cpp:8: error: 'cout' was not declared in this scope    
>                                             
>   main.cpp:8: error: 'endl' was not declared in this scope    
>                                             
> 
> fails. I already have the w32api, mingw-runtime and binutils 
> installed in my 
> C:/mingw. However, I haven't installed any of that into the DESTDIR.
> Should I?  From my understanding, this alone is a problem. Can someone
> please tell me if this is a bug in my configure or in gcc?
> 
> Now, if I install w32api, mingw-runtime and binutils into the DESTDIR,
> that also doesn't help the problem. Didn't think it would, but just
> trying to be thorough. Can someone please tell me that this shouldn't
> help? I assume it shouldn't because I'm still on the machine that has
> this stuff installed in C:\mingw already.
> 
> Now, here is the interesting part. Remember that I untared the w32api,
> mingw-runtime and bintutils into the DESTDIR. So now, I cd to the
> DESTDIR and do 'tar -cvf mingw.tar mingw'. I copy that to a 
> machine that
> has none of these things installed. I untar in C:\mingw. I 
> then run from 
> a dos shell this,
>   set PATH=C:\mingw\bin;C:\windows\system32
>   gcc-4.1 -o main main.c
>   g++-4.1 -o main main.cpp
> and they both run successfully. I didn't have to install w32-api,
> mingw-runtime or binutils, because they were already in the tar ball.


You may be running into this:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17621
ehich is ficxed on mainline.

What is in 'configured path', ie /mingw?
What happens if you rename the /mingw dir to /mingw-old?

Danny
Danny



More information about the Gcc-patches mailing list