发布MinGW 4.4.5,附交叉编译方法
有需要要,就从这里下载吧: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"
编译方法
一、编译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"
...全文
相关推荐
ubuntu下mingw32交叉编译环境搭建
ubuntu下mingw32交叉编译环境搭建,包含详细的步骤和执行命令行。
golang 交叉编译MinGW x64
解压即可,然后按照网上的教程编写一个bat处理文件点击稍等十多分钟就可以完成golang交叉编译。
编译器mingw4.4.0 Qt
Qt开发用的mingw4.4.0编译器 mingw4.4.0
visualstudio 20017 调试ubuntu 16 mingw交叉编译出来的vlc3.0.4
如果你在使用ubuntu 编译开发vlc3.0.4 windows 版本,苦于无法调试的时候,这个工具能帮助到你。使得在windows 可以调式vlc dump情况。
Qt5.12.0 MinGW32位, 附安装教程
qt 5.12mingw32位 超详细安装步骤,保存到百度云自行下载


工具平台和程序库
