在windows下用 cgywin编译MIPS的gnu交叉编译器

来源:互联网 发布:照片加密软件 编辑:程序博客网 时间:2024/05/22 12:58

build_mips_gnu_tools.bat

@echo off

::set TARGET=mips-elf
::set PREFIX=/opt/mips-gnu-tools
::set BIN_PATH=/opt/mips-gnu-tools/bin

set LANG=C.UTF-8
set CYGWIN_DIR=d:\cygwin
set PATH=%CYGWIN_DIR%\bin;%PATH%
set HOME=e:\build-mips-tools\

bash --login -i

1. build binutils-2.22

cd build-binutils

../binutils-2.22/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib

make all

make install


2. build gcc-4.6.3  first

ln -s /opt/mips-gnu-tools/bin/* /usr/local/bin

cd ../build-gcc

../gcc-4.6.3/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib --enable-languages="c,c++" --without-headers --with-gnu-as --with-gnu-ld

make all-gcc

make install-gcc

ln -s /opt/mips-gnu-tools/bin/* /usr/local/bin


3. build newlib-1.2.0

cd ../build-newlib

../newlib-1.20.0/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib

make all

make install


4. build gcc-4.6.3 again

cd ../build-gcc

../gcc-4.6.3/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib --enable-languages="c,c++" --with-newlib --with-gnu-as --with-gnu-ld --disable-shared --disable-libssp

make all

make install


5. build gdb-7.4.1

cd ../build-gdb

../gdb-7.4.1/configure --target=mips-elf --prefix=/opt/mips-gnu-tools --enable-multilib

make all

make install

ln -s /opt/mips-gnu-tools/bin/* /usr/local/bin

原创粉丝点击