URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [web_uploads/] [ats/] [or32-uclinux/] [or1k_ats_uclinux.txt] - Rev 1765
Compare with Previous | Blame | View Log
#!/bin/bash## This script if used as part of ATS needs to be invoked with# argument 'ats'. All build directories will be removed.## W/o any argument this script can be used to# install the openrisc uclinux toolchain. It should automatically# checkout all the sources, automatically build all the tools and# install them. If you modify the sources, you can't commit back# to CVS because sources are checked out as anonymous. Build# directories are not removed.### Some common variables#if [ "$1" == "ats" ]; thenOR1K_WEB=../../www/cores/or1k/ats/or32-uclinuxOR1K_WEB_LAST=$OR1K_WEB/last_okINSTALL_PREFIX=/home/oc/testpool/or1k/or32-uclinuxexport PATH=$PATH:/usr/local/binelseOR1K_WEB=.OR1K_WEB_LAST=$OR1K_WEB/last_okINSTALL_PREFIX=/opt/or32-uclinuxfiOK_STR="<font color=#00af00>Test Passed</font>"FAIL_STR="<font color=#bf0000>Test Failed</font>"ALL_STABLE=1## Allocate test pool directory#mkdir or1kcd or1k## Copy script for web visitors' reference#cp ../or1k_ats_uclinux.sh $OR1K_WEB/or1k_ats_uclinux.txt## Start with binutils#date > checkout_binutils.txt 2>&1nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d binutils or1k/binutils >> checkout_binutils.txt 2>&1mkdir b-bcd b-bdate > ../build_binutils.txt 2>&1uname -a >> ../build_binutils.txt 2>&1../binutils/configure --target=or32-uclinux --prefix=$INSTALL_PREFIX >> ../build_binutils.txt 2>&1nice /usr/bin/make all install >> ../build_binutils.txt 2>&1BUILD_BINUTILS_STATUS=$?export PATH=$INSTALL_PREFIX/bin:$PATHcd ..if [ "$1" == "ats" ]; thenrm -rf binutilsfi## Copy all log files into or1k web directory#cp checkout_binutils.txt $OR1K_WEBcp build_binutils.txt $OR1K_WEB## Check if binutils was built and installed correctly#if [ $BUILD_BINUTILS_STATUS = 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/build_binutils.statuscp $OR1K_WEB/build_binutils.status $OR1K_WEB_LASTcp $OR1K_WEB/checkout_binutils.txt $OR1K_WEB_LASTcp $OR1K_WEB/build_binutils.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/binutils $OR1K_WEB_LAST/build_binutils.status < build_binutils.txtecho "$FAIL_STR (`date`)" > $OR1K_WEB/build_binutils.statusALL_STABLE=0fi## Start with gcc#date > checkout_gcc.txt 2>&1nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gcc or1k/gcc-3.2.3 >> checkout_gcc.txt 2>&1mkdir b-gcccd b-gccdate > ../build_gcc.txt 2>&1uname -a >> ../build_gcc.txt 2>&1nice ../gcc/configure --target=or32-uclinux \--with-gnu-as --with-gnu-ld --verbose \--enable-threads --prefix=$INSTALL_PREFIX \--local-prefix=$INSTALL_PREFIX/or32-uclinux --enable-languages="c" >> ../build_gcc.txt 2>&1nice /usr/bin/make all install >> ../build_gcc.txt 2>&1BUILD_GCC_STATUS=$?cd ..## Copy all log files into or1k web directory#cp checkout_gcc.txt $OR1K_WEBcp build_gcc.txt $OR1K_WEB## Check if gcc was built and installed correctly#if [ $BUILD_GCC_STATUS = 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/build_gcc.statuscp $OR1K_WEB/build_gcc.status $OR1K_WEB_LASTcp $OR1K_WEB/checkout_gcc.txt $OR1K_WEB_LASTcp $OR1K_WEB/build_gcc.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/gcc-3.2.3 $OR1K_WEB_LAST/build_gcc.status < build_gcc.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/build_gcc.statusALL_STABLE=0fi## Start with gdb#date > checkout_gdb.txt 2>&1nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gdb or1k/gdb-5.0 >> checkout_gdb.txt 2>&1mkdir b-gdbcd b-gdbdate > ../build_gdb.txt 2>&1uname -a >> ../build_gdb.txt 2>&1../gdb/configure --target=or32-uclinux --prefix=$INSTALL_PREFIX >> ../build_gdb.txt 2>&1nice /usr/bin/make all install >> ../build_gdb.txt 2>&1BUILD_GDB_STATUS=$?cd ..if [ "$1" == "ats" ]; thenrm -rf gdbfi## Copy all log files into or1k web directory#cp checkout_gdb.txt $OR1K_WEBcp build_gdb.txt $OR1K_WEB## Check if gdb was built and installed correctly#echo $BUILD_GDB_STATUSif [ $BUILD_GDB_STATUS = 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/build_gdb.statuscp $OR1K_WEB/build_gdb.status $OR1K_WEB_LASTcp $OR1K_WEB/checkout_gdb.txt $OR1K_WEB_LASTcp $OR1K_WEB/build_gdb.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/gdb-5.0 $OR1K_WEB_LAST/build_gdb.status < build_gdb.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/build_gdb.statusALL_STABLE=0fi## Start with or1ksim#date > checkout_or1ksim.txt 2>&1nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d or1ksim or1k/or1ksim >> checkout_or1ksim.txt 2>&1cd or1ksimdate > ../build_or1ksim.txt 2>&1uname -a >> ../build_or1ksim.txt 2>&1../or1ksim/configure --target=or32-uclinux --prefix=$INSTALL_PREFIX >> ../build_or1ksim.txt 2>&1nice /usr/bin/make all install >> ../build_or1ksim.txt 2>&1BUILD_OR1KSIM_STATUS=$?cd ..## Copy all log files into or1k web directory#cp checkout_or1ksim.txt $OR1K_WEBcp build_or1ksim.txt $OR1K_WEB## Check if or1ksim was built and installed correctly#if [ $BUILD_OR1KSIM_STATUS = 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/build_or1ksim.statuscp $OR1K_WEB/build_or1ksim.status $OR1K_WEB_LASTcp $OR1K_WEB/checkout_or1ksim.txt $OR1K_WEB_LASTcp $OR1K_WEB/build_or1ksim.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/or1ksim $OR1K_WEB_LAST/build_or1ksim.status < build_or1ksim.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/build_or1ksim.statusALL_STABLE=0fi## Start with uclinux#date > checkout_uclinux.txt 2>&1nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d uClinux-2.0.x \or1k/uclinux/uClinux-2.0.x >> checkout_uclinux.txt 2>&1mkdir uclinuxmv uClinux-2.0.x uclinuxcd uclinux/uClinux-2.0.xsed -e 's/^LIBGCC/#LIBGCC/; /^#LIBGCC/ a \LIBGCC = '$INSTALL_PREFIX'\/lib\/gcc-lib\/or32-uclinux\/3.2.3\/libgcc.a' \< arch/or32/Rules.make > arch/or32/Rules.make.editedmv arch/or32/Rules.make.edited arch/or32/Rules.makesed -e 's/^CONFIG_NET/#CONFIG_NET/; /^#CONFIG_NET/ a \CONFIG_NET=n' < arch/or32/defconfig > arch/or32/defconfig.editedmv arch/or32/defconfig.edited arch/or32/defconfignice make oldconfig >> ../../build_uclinux.txt 2>&1nice make dep >> ../../build_uclinux.txt 2>&1nice /usr/bin/make all >> ../../build_uclinux.txt 2>&1BUILD_UCLINUX_STATUS=$?touch uart0.rxecho -e "run 40000000 hush\nq" | or32-uclinux-sim -f sim.cfg linux -i > /dev/nullcp uart0.tx ../../or1ksim_uclinux.txtcd ../../## Copy all log files into or1k web directory#cp checkout_uclinux.txt $OR1K_WEBcp build_uclinux.txt $OR1K_WEBcp or1ksim_uclinux.txt $OR1K_WEB## Check if uclinux was built and installed correctly#if [ $BUILD_UCLINUX_STATUS = 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/build_uclinux.statuscp $OR1K_WEB/build_uclinux.status $OR1K_WEB_LASTcp $OR1K_WEB/checkout_uclinux.txt $OR1K_WEB_LASTcp $OR1K_WEB/build_uclinux.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/uclinux $OR1K_WEB_LAST/build_uclinux.status < build_uclinux.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/build_uclinux.statusALL_STABLE=0fiif [ `grep Executing or1ksim_uclinux.txt | wc -l` -gt 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/or1ksim_uclinux.statuscp $OR1K_WEB/or1ksim_uclinux.status $OR1K_WEB_LASTcp $OR1K_WEB/or1ksim_uclinux.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/uclinux $OR1K_WEB_LAST/or1ksim_uclinux.status < or1ksim_uclinux.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/or1ksim_uclinux.statusALL_STABLE=0fi## Start with uclibc#date > checkout_uclibc.txt 2>&1nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d uclibc \or1k/uclibc >> checkout_uclibc.txt 2>&1cd uclibcdate > ../build_uclibc.txt 2>&1uname -a >> ../build_uclibc.txt 2>&1ln -s ./extra/Configs/Config.cross.or32.uclinux Configsed -e 's/^KERNEL_SOURCE/#KERNEL_SOURCE/; /^#KERNEL_SOURCE/ a \KERNEL_SOURCE = '`pwd`'\/..\/uclinux\/uClinux-2.0.x' < Config > Config.editedsed -e 's/^DEVEL_PREFIX/#DEVEL_PREFIX/; /^#DEVEL_PREFIX/ a \DEVEL_PREFIX = '$INSTALL_PREFIX < Config.edited > Configrm Config.editednice /usr/bin/make all install >> ../build_uclibc.txt 2>&1BUILD_UCLIBC_STATUS=$?pushd .cd $INSTALL_PREFIX/binrm -f ar as cc cpp gasp gcc ld nm objcopy objdump ranlib size strings strip jar grepjarpopdcd ../b-gccdate > ../rebuild_gcc.txt 2>&1uname -a >> ../rebuild_gcc.txt 2>&1nice ../gcc/configure --target=or32-uclinux \--with-gnu-as --with-gnu-ld --verbose \--enable-threads --prefix=$INSTALL_PREFIX \--local-prefix=$INSTALL_PREFIX/or32-uclinux --enable-languages="c" >> ../rebuild_gcc.txt 2>&1nice make all install >> ../rebuild_gcc.txt 2>&1REBUILD_GCC_STATUS=$?cd ..## Check or1ksim testbench#cd or1ksim/testbenchdate > ../../or1ksim_testbench.txt 2>&1CFLAGS="-nostdlib" ./configure --target=or32-uclinux --host=or32-uclinux >> ../../or1ksim_testbench.txt 2>&1export PATH=$PATH:..make check >> ../../or1ksim_testbench.txt 2>&1cd ../..## Copy all log files into or1k web directory#cp or1ksim_testbench.txt $OR1K_WEB## Check if or1ksim testbench passed OK#if [ `grep passed or1ksim_testbench.txt | wc -l` -gt 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/or1ksim_testbench.statuscp $OR1K_WEB/or1ksim_testbench.status $OR1K_WEB_LASTcp $OR1K_WEB/or1ksim_testbench.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/or1ksim/testbench $OR1K_WEB_LAST/or1ksim_testbench.status < or1ksim_testbench.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/or1ksim_testbench.statusALL_STABLE=0fiif [ "$1" == "ats" ]; thenrm -rf uclibc uclinux gcc or1ksimfi## Copy all log files into or1k web directory#cp checkout_uclibc.txt $OR1K_WEBcp build_uclibc.txt $OR1K_WEBcp rebuild_gcc.txt $OR1K_WEB## Check if uclibc was built and installed correctly#if [ $BUILD_UCLIBC_STATUS = 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/build_uclibc.statuscp $OR1K_WEB/build_uclibc.status $OR1K_WEB_LASTcp $OR1K_WEB/checkout_uclibc.txt $OR1K_WEB_LASTcp $OR1K_WEB/build_uclibc.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/uclibc $OR1K_WEB_LAST/build_uclibc.status < build_uclibc.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/build_uclibc.statusALL_STABLE=0fiif [ $REBUILD_GCC_STATUS = 0 ]; thenecho "$OK_STR (`date`)" > $OR1K_WEB/rebuild_gcc.statuscp $OR1K_WEB/rebuild_gcc.status $OR1K_WEB_LASTcp $OR1K_WEB/rebuild_gcc.txt $OR1K_WEB_LASTelse../notice_developers.sh or1k/gcc-3.2.3 $OR1K_WEB_LAST/rebuild_gcc.status < rebuild_gcc.txtecho "$FAIL_STR (`date`)"> $OR1K_WEB/rebuild_gcc.statusALL_STABLE-0fi## rtag sources as ats-stable if everything worked#cd ..if [ "$1" == "ats" ]; thenif [ $ALL_STABLE = 1 ]; thennice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/binutils > /dev/null 2>&1nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/gcc-3.2.3 > /dev/null 2>&1nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/gdb-5.0 > /dev/null 2>&1nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/or1ksim > /dev/null 2>&1nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/uclinux > /dev/null 2>&1nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/uclibc > /dev/null 2>&1fifi## Clean testpool#if [ "$1" == "ats" ]; thenrm -rf or1kfi
