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
开发者_Python百科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
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.
I resolved the issue.
Looking here: 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.
精彩评论