I am working on Mac OSX Lion with GCC4.7.0, and my goal is to compile win32 cross-compiler.
GMP and MPFR if installed using Macports (also GCC47).
Files used:
- w32api-3.17-2-mingw32-dev.tar.lzma
- mingwrt-3,20-mingw32-dev.tar.gz
- Binutils-2.22-1-mingw32-src.tar.lzma
- SRC-GCC-4.7.0-release.tar.7z
Win32 api and mingw runtime libaries, where installed here: / opt / mingw
Compiling binutils like this seemed to work fine:
mkdir build
cd build
../configure --prefix=/opt/mingw/ --target=i686-mingw32 --host=x86_64-apple-darwin \
--build=x86_64-apple-darwin --with-libs=/opt/mingw/lib --with-headers=/opt/mingw/include \
--with-gxx-include-dir=/opt/mingw/include/c++
make
sudo make install
So, the next step was to compile gcc, but this led to the error that I used:
mkdir build
cd build
../configure --prefix=/opt/mingw/ \
--with-gmp=/opt/local/ --with-mpfr=/opt/local/ \
--target=i686-mingw32 --host=x86_64-apple-darwin \
--build=x86_64-apple-darwin --with-libs=/opt/mingw/lib \
--with-headers=/opt/mingw/include \
--with-gxx-include-dir=/opt/mingw/include/c++ \
--with-gcc --with-tune=generic --disable-werror \
--disable-win32-registry --enable-sjlj-exceptions \
--enable-libstdcxx-debug \
--enable-cxx-flags='-fno-function-sections -fno-data-sections' \
--enable-version-specific-runtime-libs \
--disable-bootstrap --enable-threads --disable-nls \
--enable-languages=c,c++
make
sudo make install
Command line error:
//...
option to accept ISO C89... unsupported
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/Users/Nik/Development/mingw-src/gcc-4.7.0/build/i686-mingw32/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make: *** [all] Error 2
The config.log file can be found here !
-, , , - .
EDIT:
, c , , .