This is the mail archive of the gcc-patches@gcc.gnu.org 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 Mon, Dec 18, 2006 at 11:43:59AM +0530, Ranjit Mathew wrote:
> On 12/17/06, Bob Rossi <bob_rossi@cox.net> wrote:
> >> You're not using "/mingw" as the value for "--prefix". I remember
> >> stuff not working because of this, though I cannot be sure if that
> >> indeed is the problem here.
> >
> >Duh! OK, I'll try that change. Do I need to do this for binutils also?
> 
> The tools in binutils (ld, as, etc.) are directly invoked by GCC
> with the correct parameters while compiling. Therefore, I don't
> think you need to do this.
> 
> 
> >Do I even need to build binutils? The only reason I am, is because you
> >did it on your web page when cross compiling.
> 
> It's not necessary - you should be able to use the latest
> pre-compiled native binutils binaries available from the
> MinGW site. I needed to compile it for the cross-compiling
> case since I needed binutils running on Linux creating binaries
> for MinGW. I admit that I did not really need it for the
> crossed-native-compiling case, but I was just being masochistic.
> :-)
> 
> I haven't used the "--with-local-prefix" option and I don't
> know if it is interfering with anything here. Note that Danny
> also posts his build script every time he uploads a new
> MinGW GCC release and you can see for yourself just how
> the released GCC for MinGW is built. For example, for
> GCC 3.4.2, the build script is:
> 
>  http://downloads.sourceforge.net/mingw/gcc-3.4.2-build.sh
> 
> You can find this on the Sourceforge.net files page for
> MinGW.
> 
> Finally, I must admit that building GCC for MinGW natively
> on Windows with MSYS was just a diversion for me. I
> used to always build GCC for MinGW using the crossed-native
> compilation process that I have outlined in the document
> that I linked to earlier.

OK, well, I followed that script. I built gcc nativly with mingw and
then did a 'make DESTDIR=/home/bobbybrasko/gcc/destdir install'.

Then I tared up the destdir directory. Copied it over to a machine with
no mingw related tools on it. I copied it into C:/mingw, cause I just
want to get anything working, nevermind a relocatable version.

If I try to compile 'gcc -o main main.c' it can't find stdio.h. If I try
to compile 'g++ -o main main.cpp' it can't find iostream.

If I then untar the mingw-runtime and the w32api into the C:/mingw
directory both the gcc and g++ commands find the header files, however,
they end with this error,

  C:\cygwin\home\bar\tmp\main>g++ -o main main.cpp
  g++: _spawnvp: No such file or directory

My first question is, since I'm new at this, is what I'm doing sensable?
Is there a better way to accomplish this? At this point, I don't even
care about a relocatable gcc, since I can not even get a non-relocatable
version of gcc working.

BTW, if I run on the machine I compiled gcc, this command,
  PATH=/home/bobbybrasko/gcc/destdir/mingw/bin:$PATH gcc -o main main.c
it works. However, if I run this command
  PATH=/home/bobbybrasko/gcc/destdir/mingw/bin:$PATH g++ -o main main.cpp
it doesn't work.
  main.cpp:1:20: error: iostream: No such file or directory                                               
  main.cpp: In function 'int main(int, char**)':                                                          

Is what I'm trying to do typically complicated? The *only* way I have
got anything to work was to compile gcc on a machine with
--prefix=/mychoicedir and then install it with 'make install'. Then both
c and cpp works fine on that machine. In fact, I was able to compile a 
variety of c++ libraries.

Thanks,
Bob Rossi

Attachment: gcc.sh
Description: Bourne shell script


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