views:

111

answers:

2

I'm following this guide mostly to compile gcc on windows:

http://www.aristeia.com/Misc/gcc4ForWindows.html

The difference is that I am using msys 1.10 and trying to build gcc trunk from SVN. the source tree compiles fine on linux, however when I attempt to build on windows, i get the following error upon running the configure script.

<snip>
checking where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
c:\MinGW\bin\sed.exe: -e expression #1, char 1: unknown command: `C'
configure: creating ./config.status
config.status: creating Makefile
gawk: ./conf6456-2346/subs.awk:19: S["FLAGS_FOR_TARGET"]=" -L$$r/$(TARGET_SUBDIR
)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/ming
w/include -isystem $$s/winsup/w32api/include -"\
gawk: ./conf6456-2346/subs.awk:19:

                                           ^ backslash not last character on
 line
c:\MinGW\bin\sed.exe: couldn't write 38 items to stdout: No error
config.status: error: could not create Makefile
c:\MinGW\bin\sed.exe: -e expression #1, char 1: unknown command: `C'    

The command line I am using is this:

../configure --prefix=C:/rosbe/i586 --build=mingw32 --host=mingw32 --target=mingw32 --enable-languages=c,c++ --disable-win32-registry --enable-sjlj-exceptions --enable-threads=win32 --enable-checking=release

A: 

The Scott Meyers' article is outdated in that prebuilt gcc4 binaries are finally available on Windows. Just head over to MinGW site and download them.

Laurynas Biveinis
But they don't have gcc 4.6
Raindog
GCC 4.6 is unreleased. Anyway, if you want to just have a recent enough GCC, then 4.5 or 4.4 will be good enough. On the other hand, if your goal is specifically to build GCC trunk on MinGW, then my answer is not useful.
Laurynas Biveinis
A: 

I resolved the issue.

Looking here: http://stackoverflow.com/questions/1642694/problem-compiling-freetype2-with-mingw-msys

I noticed that I had the same error too.

It turns out that I have an installation of MinGW that appeared in my $PATH before my msys installation. I fixed that and now it is compiling away.

Raindog