有需要要,就从这里下载吧:
http://code.google.com/p/qp-gcc/
编译方法
一、编译gmp
DIR=/home/loaden/AUR/mingw32
ABI=32 ../../src/gmp-5.0.1/configure \
--prefix=$DIR/depends \
--host=i686-mingw32 \
--target=i686-mingw32 \
--build=i686-pc-linux-gnu \
--enable-cxx \
--enable-static \
--disable-shared
make -j2 && make install
二、编译mpfr
DIR=/home/loaden/AUR/mingw32
../../src/mpfr-3.0.0/configure \
--prefix=$DIR/depends \
--host=i686-mingw32 \
--target=i686-mingw32 \
--build=i686-pc-linux-gnu \
--with-gmp=$DIR/depends \
--enable-thread-safe \
--enable-static \
--disable-shared
make -j2 && make install
三、编译iconv
DIR=/home/loaden/AUR/mingw32
../../src/libiconv-1.13.1/configure \
--prefix=$DIR/depends \
--host=i686-mingw32 \
--target=i686-mingw32 \
--build=i686-pc-linux-gnu \
--disable-shared \
--enable-static
make -j2 && make install && i686-mingw32-strip $DIR/depends/bin/iconv.exe
四、编译mpc
DIR=/home/loaden/AUR/mingw32
../../src/mpc-0.8.2/configure \
--prefix=$DIR/depends \
--host=i686-mingw32 \
--target=i686-mingw32 \
--build=i686-pc-linux-gnu \
--with-gmp=$DIR/depends \
--with-mpfr=$DIR/depends \
--enable-static \
--disable-shared
make -j2 && make install
五、编译gcc
# 给GCC源码打上补丁(在源码目录下执行)
for files in ../patches-4.4.5/gcc*; do patch -p0 < $files; done
# 在/mingw内建立链接(在编译目录下执行:可拷贝下列命令后同时执行)
sudo mkdir /mingw
sudo ln -s /usr/i686-mingw32/include/ /mingw/include
sudo ln -s /usr/i686-mingw32/lib/ /mingw/lib
# 定义变量
DIR=/home/loaden/AUR/mingw32
# 配置
../../src/gcc-4.4.5/configure \
--prefix=/mingw \
--host=i686-mingw32 \
--target=i686-mingw32 \
--build=i686-pc-linux-gnu \
--enable-languages=c,c++ \
--enable-static \
--enable-cxx-flags='-fno-function-sections -fno-data-sections' \
--enable-fully-dynamic-string \
--enable-version-specific-runtime-libs \
--enable-threads=win32 \
--enable-libgomp \
--enable-libiconv \
--disable-shared \
--disable-nls \
--disable-werror \
--disable-libstdcxx-pch \
--disable-win32-registry \
--disable-sjlj-exceptions \
--with-dwarf2 \
--with-gmp=$DIR/depends \
--with-mpfr=$DIR/depends \
--with-pkgversion='QP MinGW32' \
--with-bugurl=http://qp-gcc.googlecode.com
make CFLAGS="-I$DIR/depends/include -O2 -D__USE_MINGW_ACCESS" \
BOOT_CFLAGS="-I$DIR/depends/include -O2 -D__USE_MINGW_ACCESS" \
CFLAGS_FOR_TARGET="-I$DIR/depends/include -O2 -D__USE_MINGW_ACCESS" \
CXXFLAGS="-I$DIR/depends/include -mthreads -O2 -D__USE_MINGW_ACCESS" \
BOOT_CXXFLAGS="-I$DIR/depends/include -mthreads -O2 -D__USE_MINGW_ACCESS" \
CXXFLAGS_FOR_TARGET="-I$DIR/depends/include -mthreads -O2 -D__USE_MINGW_ACCESS" \
LDFLAGS="-L$DIR/depends/lib -s" BOOT_LDFLAGS="-L$DIR/depends/lib -s" \
LDFLAGS_FOR_TARGET="-L$DIR/depends/lib -s" \
-j2
# -Wl,...: 告诉GCC传递后面的选项给liker链接器
# 加入--stack=0x2000000把stack设为32MB,解决可能的stack overflow。
rm -f gcc/cc1.exe gcc/cc1plus.exe
make install DESTDIR=~ LDFLAGS="-s -Wl,--stack=0x2000000"