#! /bin/sh
#cd /d/opensource
#wget mingw-w64
#wget gcc
#wget binutils
#make -p /d/opensource
#cd /d/opensource/
#cvs -z9 -d:pserver:anoncvs@sourceware.org:/cvs/src co binutils
#svn co svn://gcc.gnu.org/svn/gcc/trunk gcc-trunk
#svn co https://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/trunk mingw-w64-trunk
mkdir /d/portable/sysroot
mkdir -p /d/build/binutils-build
mkdir -p /d/build/mingw-w64-headers-build
mkdir -p /d/build/mingw-w64-crt-build
mkdir -p /d/build/gcc-build
cd /d/build/binutils-build
../../opensource/binutils-src/configure \
--target=x86_64-w64-mingw32 \
--enable-targets=x86_64-w64-mingw32,i686-w64-mingw32 \
--with-sysroot=/d/portable/sysroot --prefix=/d/portable/sysroot
make
make install
export PATH="$PATH:/d/portable/sysroot/bin"
cd ../mingw-w64-headers-build
../../opensource/mingw-w64-trunk/mingw-w64-headers/configure \
--build=i686-pc-mingw32 --host=x86_64-w64-mingw32 \
--prefix=/d/portable/sysroot
make install
#copy include
cp -a /d/portable/sysroot/include /d/portable/sysroot/x86_64-w64-mingw32
mkdir -p /d/portable/sysroot/x86_64-w64-mingw32/lib
cp -a /d/portable/sysroot/x86_64-w64-mingw32/lib /d/portable/sysroot/x86_64-w64-mingw32/lib64
cp -a /d/portable/sysroot/x86_64-w64-mingw32 /d/portable/sysroot/mingw
cd ../gcc-build
../../opensource/gcc-4.7.2-src/configure \
--target=x86_64-w64-mingw32 --enable-targets=all \
--with-sysroot=/d/portable/sysroot --prefix=/d/portable/sysroot
make all-gcc
make install-gcc
cd ../mingw-w64-crt-build
../../opensource/mingw-w64-trunk/mingw-w64-crt/configure \
--host=x86_64-w64-mingw32 --enable-lib32 \
--with-sysroot=/d/portable/sysroot --prefix=/d/portable/sysroot
make
make install
cp -a /d/portable/sysroot/lib /d/portable/sysroot/x86_64-w64-mingw32
cp -a /d/portable/sysroot/lib32 /d/portable/sysroot/x86_64-w64-mingw32
cp -a /d/portable/sysroot/x86_64-w64-mingw32/lib/* /d/portable/sysroot/x86_64-w64-mingw32/lib64
cp -a /d/portable/sysroot/x86_64-w64-mingw32/* /d/portable/sysroot/mingw
cd ../gcc-build
make
make install
compile script for mingw64
最新推荐文章于 2024-05-22 18:11:41 发布
本文详细介绍了如何从源码构建Mingw-w64交叉编译环境的过程,包括下载必要的源码包如binutils、gcc及mingw-w64等,并配置环境使其能够为Windows平台生成可执行文件。
2419

被折叠的 条评论
为什么被折叠?



