From 8da8788c7e6b8d7510a8326d0c7646f7b91566d0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 Jan 2013 18:54:56 -0600 Subject: simple-build-scripts: Significant update This script can now build RTEMS and non-RTEMS targets. It can be used to test non-RTEMS no-OS targets. --- simple-build-script/ChangeLog | 13 --- simple-build-script/README | 34 +++++-- simple-build-script/build_tools | 191 +++++++++++++++++++++++++++++++--------- 3 files changed, 177 insertions(+), 61 deletions(-) delete mode 100644 simple-build-script/ChangeLog mode change 100644 => 100755 simple-build-script/build_tools diff --git a/simple-build-script/ChangeLog b/simple-build-script/ChangeLog deleted file mode 100644 index a20ff1b..0000000 --- a/simple-build-script/ChangeLog +++ /dev/null @@ -1,13 +0,0 @@ -2010-07-19 Joel Sherrill - - * build_tools: Add command line arguments and let you do individual - parts of the build process. - -2010-07-19 Joel Sherrill - - * README: Fix typo. - -2010-03-28 Joel Sherrill - - * ChangeLog, README, build_tools: New files. - diff --git a/simple-build-script/README b/simple-build-script/README index 4b4d8b8..bb26d63 100644 --- a/simple-build-script/README +++ b/simple-build-script/README @@ -3,10 +3,26 @@ build and install an RTEMS toolset from source. You are responsible for downloading the various tools from either release images or their development versions and patching as appropriate. -To build the tools, simply invoke the following command with INSTALL_POINT -replaced with "prefix" in GNU tool terms: - -./build_tools INSTALL_POINT +The usage is as follows: + + -v verbose (default=no) + -c clean after building if OK (default=yes) + -A toggle building binutils, gcc, newlib, and gdb + -a toggle building autoconf (default=no) + -m toggle building automake (default=no) + -b toggle building binutils (default=no) + -g toggle building gcc/newlib (default=no) + -d toggle building gdb (default=no) + -i INSTALL specify install directory (required) + -t TARGET specify target (required) + -B DIRECTORY specify directory for build tree (default=pwd) + -T toggle running test (default=no) + -M toggle sending test results email (default=no) + +To build a cross toolset for a target, invoke the build_tools command +with INSTALL_POINT replaced with "prefix" in GNU tool terms: + +./build_tools -i INSTALL_POINT -t TARGET -A Depending on the target and the speed of the machine, this can take anywhere from 30 minutes to a few hours. @@ -16,7 +32,13 @@ When completed, you should prepend INSTALL_POINT/bin to your PATH: export PATH=INSTALL_POINT/bin:$PATH Since you need the proper autoconf and automake versions to bootstrap -RTEMS from CVS, these are included in the build script. +RTEMS, these are included in the build script. + +The script will also build non-RTEMS embedded GNU targets. This +script can be used to build and test a no-OS target that shares +a common code base with the RTEMS target. For example, arm-rtems +is very similar to arm-eabi. Testing the non-RTEMS target variant +can help when reporting issues and tracking down problems. ---Joel Sherrill (28 March 2010) +--Joel Sherrill (9 January 2013) diff --git a/simple-build-script/build_tools b/simple-build-script/build_tools old mode 100644 new mode 100755 index 759199d..972c8e6 --- a/simple-build-script/build_tools +++ b/simple-build-script/build_tools @@ -8,20 +8,19 @@ # Please be sure to apply appropriate patches from # rtems/contrib/crossrpms/patches. # -# --Joel Sherrill (28 March 2010) +# Currently only testing of non-RTEMS targets is supported. # ### EDIT THESE AS NEEDED -AUTOCONF=autoconf-2.66 -AUTOMAKE=automake-1.11.1 -BINUTILS=binutils-2.20.1 -GDB=gdb-7.1 -GCC=gcc-4.5.0 -NEWLIB=newlib-1.18.0 +AUTOCONF=autoconf-2.69 +AUTOMAKE=automake-1.12.6 +BINUTILS=binutils-cvs/src +GDB=gdb-cvs/src +GCC=gcc-svn +NEWLIB=newlib-cvs/src LANGUAGES="c,c++" ### END OF EDIT THESE - BASE=`pwd` # log an error to stderr @@ -57,20 +56,27 @@ toggle() usage() { cat <c.log 2>&1 + ${sourcedir}/${pkg}/configure --prefix=${INSTALL} >c.log 2>&1 check_status $? "failed to configure ${pkg}" ;; binutils*) - ../${pkg}/configure --target=${TARGET} \ + ${sourcedir}/${pkg}/configure --target=${TARGET} \ --prefix=${INSTALL} >c.log 2>&1 check_status $? "failed to configure ${pkg}" ;; gdb*) - ../${pkg}/configure --target=${TARGET} \ + ${sourcedir}/${pkg}/configure --target=${TARGET} \ --prefix=${INSTALL} \ --enable-sim --enable-sim-hardware \ - --enable-timebase --enable-sim-trace - >c.log 2>&1 + --enable-timebase --enable-sim-trace >c.log 2>&1 check_status $? "failed to configure ${pkg}" ;; gcc*) - ../${GCC}/configure \ + ${sourcedir}/${GCC}/configure \ --enable-threads=rtems --with-gnu-as --enable-multilib \ --enable-newlib-mb --enable-newlib-iconv \ --with-gnu-ld --with-newlib --verbose --with-system-zlib --disable-nls \ @@ -216,15 +255,83 @@ do esac echo "Building ${pkg}..." - make >b.log 2>&1 + make ${JOBS} >b.log 2>&1 check_status $? "failed to make ${pkg}" echo "Installing ${pkg}..." make install >i.log 2>&1 check_status $? "failed to install ${pkg}" + # If testing the package, fall into this if + if [ ${do_tests} = "yes" ] ; then + echo "Testing ${pkg}..." + case $pkg in + auto*) + # currently do not run test suite on autoconf and automake + ;; + binutils*) + echo "Testing binutils for ${TARGET}" + make check >check.log 2>&1 + ;; + gdb*) + # currently do not run test suite on gdb + ;; + gcc*) + baseboard=NOT_SET + case ${TARGET} in + *-rtems*) + echo "*** Currently do not support testing GCC with this script" + ;; + *-elf*|*-eabi*) + cpu=`echo ${TARGET} | cut -d'-' -f1` + case ${cpu} in + arc*|arm*|basic*|cris*|d10v*|d30v*|fr30*|frv*|h8300*|i960*|iq2000*|jmr3904|\ + m32r*|m68hc11*|mcore*|mips*|mips64*|mips64vr4100*|mmixware*|mn10200|\ + mn10300*|powerpc*|powerpcle*|sh*|sparc*|sparc64*|sparclite*|tic80*|tx39|\ + v850*|vr4100*|vr4111*|vr4300*|xtensa*) + baseboard=${cpu}-sim + ;; + *) + ;; + esac + ;; + *) + ;; + + esac + + # now see if we found a configuration to test with + if [ ${baseboard} = "NOT_SET" ] ; then + echo "*** Do not know how to test gcc on ${target}" + continue + fi + + echo "Testing gcc for ${TARGET} on ${baseboard}" + make check RUNTESTFLAGS="--target_board=${baseboard}" >check.log 2>&1 + + if [ ${do_mail} = "yes" ] ; then + echo "Sending ${language} test results to GCC community.." + ${sourcedir}/${GCC}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh + check_status $? "Failed to email ${language} Test Results to GCC Community .. bailing" + + echo "Sending ${language} test results to RTEMS community.." + ${sourcedir}/${GCC}/contrib/test_summary -o -m rtems-tooltestresults@rtems.org | sh + check_status $? "Failed to email ${language} Test Results to RTEMS Community .. bailing" + fi + ;; + *) + prerr "UNKNOWN PACKAGE ${pkg}" + exit 1 + ;; + esac + + fi + # END of if testing the package + cd .. - rm -rf b-${pkg} + if [ ${do_clean} = "yes" ] ; then + rm -rf ${BUILD} + fi done exit 0 -- cgit v1.2.3