⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 build_or32_elf_tools.sh

📁 eCos操作系统源码
💻 SH
字号:
#!/bin/bash -x# Checkout and build gnu toolchain for OpenRISC (or32 target)# Usage:# build_or32_elf_tools.sh [-c]#   -c  Controls whether CVS checkout is done prior to build#       You probably only want to use this command-line option the first time you build.# Directory in which to checkout sources and buildBUILD_DIR=$HOME/or32-elf-src# Target architecture/OSTARGET=or32-elf# Directory in which to put compiled files, exported headers, etc.INSTALL_PREFIX=$HOME/tools/i386-redhat-linux########################################################################if [ $1foo = -cfoo ]; then DO_CVS_CHECKOUT=1; else DO_CVS_CHECKOUT=0; fi## Some common variables#OK_STR="Build OK"FAIL_STR="Build Failed"mkdir -p $BUILD_DIRcd $BUILD_DIR## Start with binutils#if [ $DO_CVS_CHECKOUT != 0 ]; thendate > checkout_binutils.log 2>&1cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d binutils or1k/binutils >> \ checkout_binutils.log 2>&1fimkdir -p b-bcd b-bdate > ../build_binutils.log 2>&1../binutils/configure --target=$TARGET --prefix=$INSTALL_PREFIX >> ../build_binutils.log 2>&1make all install >> ../build_binutils.log 2>&1BUILD_BINUTILS_STATUS=$?export PATH=$INSTALL_PREFIX/bin:$PATHcd ..## Check if binutils was built and installed correctly#if [ $BUILD_BINUTILS_STATUS = 0 ]; then        echo "$OK_STR (`date`)" >> build_binutils.logelse        echo "$FAIL_STR (`date`)" >>  build_binutils.logfi## Build gdb#if [ $DO_CVS_CHECKOUT != 0 ]; thendate > checkout_gdb.log 2>&1cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gdb or1k/gdb-5.0 >> checkout_gdb.log 2>&1fimkdir -p b-gdbcd b-gdbdate > ../build_gdb.log 2>&1# Current version of readline has a configuration bug, so you must not specify# the prefix#../gdb/configure --target=$TARGET --prefix=$INSTALL_PREFIX >> ../build_gdb.log 2>&1../gdb/configure --target=$TARGET >> ../build_gdb.log 2>&1make all >> ../build_gdb.log 2>&1BUILD_GDB_STATUS=$?cp gdb/gdb $INSTALL_PREFIX/bin/$TARGET-gdbcd ..## Check if gdb was built and installed correctly#if [ $BUILD_GDB_STATUS = 0 ]; then        echo "$OK_STR (`date`)" >> build_gdb.logelse        echo "$FAIL_STR (`date`)" >>  build_gdb.logfi## Build or1k simulator#if [ $DO_CVS_CHECKOUT != 0 ]; thendate > checkout_or1ksim.log 2>&1cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d or1ksim or1k/or1ksim >> checkout_or1ksim.log 2>&1ficd or1ksimdate > ../build_or1ksim.log 2>&1../or1ksim/configure --target=$TARGET --prefix=$INSTALL_PREFIX >> ../build_or1ksim.log 2>&1make all install >> ../build_or1ksim.log 2>&1BUILD_OR1KSIM_STATUS=$?cp sim $INSTALL_PREFIX/bin/or32-elf-simcd ..## Check if or1ksim was built and installed correctly#if [ $BUILD_OR1KSIM_STATUS = 0 ]; then        echo "$OK_STR (`date`)" >> build_or1ksim.logelse        echo "$FAIL_STR (`date`)" >>  build_or1ksim.logfi# For now, bail here#exit## Build gcc#if [ $DO_CVS_CHECKOUT != 0 ]; thendate > checkout_gcc.log 2>&1cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gcc or1k/gcc-3.1 >> checkout_gcc.log 2>&1fi# The config script looks for libraries in a weird place.  Instead of figuring out what's wrong,# I just placate it.pushd $INSTALL_PREFIXcp -pr lib $TARGETpopdmkdir -p b-gcccd b-gccdate > ../build_gcc.log 2>&1../gcc/configure --target=$TARGET \        --with-gnu-as --with-gnu-ld --verbose \        --enable-threads --prefix=$INSTALL_PREFIX \        --enable-languages="c,c++" >> ../build_gcc.log 2>&1make all install >> ../build_gcc.log 2>&1BUILD_GCC_STATUS=$?## Check if gcc was built and installed correctly#if [ $BUILD_GCC_STATUS = 0 ]; then        echo "$OK_STR (`date`)" >> build_gcc.logelse        echo "$FAIL_STR (`date`)" >>  build_gcc.logfi# Install even though g++ build fails due to inability to build libg++ without C library.# (How do we prevent building of libg++ ?)make install

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -