Changeset 8da8788 in rtems-testing


Ignore:
Timestamp:
Jan 10, 2013, 12:54:56 AM (6 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
9cf72b1
Parents:
be12911
Message:

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.

Location:
simple-build-script
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • simple-build-script/README

    rbe12911 r8da8788  
    44development versions and patching as appropriate.
    55
    6 To build the tools, simply invoke the following command with INSTALL_POINT
    7 replaced with "prefix" in GNU tool terms:
     6The usage is as follows:
    87
    9 ./build_tools INSTALL_POINT
     8  -v             verbose (default=no)
     9  -c             clean after building if OK (default=yes)
     10  -A             toggle building binutils, gcc, newlib, and gdb
     11  -a             toggle building autoconf (default=no)
     12  -m             toggle building automake (default=no)
     13  -b             toggle building binutils (default=no)
     14  -g             toggle building gcc/newlib (default=no)
     15  -d             toggle building gdb (default=no)
     16  -i INSTALL     specify install directory (required)
     17  -t TARGET      specify target (required)
     18  -B DIRECTORY   specify directory for build tree (default=pwd)
     19  -T             toggle running test (default=no)
     20  -M             toggle sending test results email (default=no)
     21
     22To build a cross toolset for a target, invoke the build_tools command
     23with INSTALL_POINT replaced with "prefix" in GNU tool terms:
     24
     25./build_tools -i INSTALL_POINT -t TARGET -A
    1026
    1127Depending on the target and the speed of the machine, this can take
     
    1733
    1834Since you need the proper autoconf and automake versions to bootstrap
    19 RTEMS from CVS, these are included in the build script.
     35RTEMS, these are included in the build script.
    2036
    21 --Joel Sherrill (28 March 2010)
     37The script will also build non-RTEMS embedded GNU targets. This
     38script can be used to build and test a no-OS target that shares
     39a common code base with the RTEMS target. For example, arm-rtems
     40is very similar to arm-eabi. Testing the non-RTEMS target variant
     41can help when reporting issues and tracking down problems.
    2242
     43--Joel Sherrill (9 January 2013)
     44
  • simple-build-script/build_tools

    • Property mode changed from 100644 to 100755
    rbe12911 r8da8788  
    99#  rtems/contrib/crossrpms/patches.
    1010#
    11 --Joel Sherrill (28 March 2010)
     11Currently only testing of non-RTEMS targets is supported.
    1212#
    1313
    1414### EDIT THESE AS NEEDED
    15 AUTOCONF=autoconf-2.66
    16 AUTOMAKE=automake-1.11.1
    17 BINUTILS=binutils-2.20.1
    18 GDB=gdb-7.1
    19 GCC=gcc-4.5.0
    20 NEWLIB=newlib-1.18.0
     15AUTOCONF=autoconf-2.69
     16AUTOMAKE=automake-1.12.6
     17BINUTILS=binutils-cvs/src
     18GDB=gdb-cvs/src
     19GCC=gcc-svn
     20NEWLIB=newlib-cvs/src
    2121LANGUAGES="c,c++"
    2222### END OF EDIT THESE
    23 
    2423
    2524BASE=`pwd`
     
    5857{
    5958cat <<EOF
    60   -v             verbose
    61   -A             toggle building all parts
    62   -a             toggle building autoconf
    63   -m             toggle building automake
    64   -b             toggle building binutils
    65   -g             toggle building gcc/newlib
    66   -d             toggle building db
     59  -v             verbose (default=no)
     60  -c             clean after building if OK (default=yes)
     61  -A             toggle building binutils, gcc, newlib, and gdb
     62  -a             toggle building autoconf (default=no)
     63  -m             toggle building automake (default=no)
     64  -b             toggle building binutils (default=no)
     65  -g             toggle building gcc/newlib (default=no)
     66  -d             toggle building gdb (default=no)
    6767  -i INSTALL     specify install directory (required)
    6868  -t TARGET      specify target (required)
     69  -B DIRECTORY   specify directory for build tree (default=pwd)
     70  -T             toggle running test (default=no)
     71  -M             toggle sending test results email (default=no)
    6972
    7073EOF
     
    7275}
    7376
     77sourcedir=`pwd`
     78buildroot=`pwd`
     79do_clean=yes
    7480do_autoconf=no
    7581do_automake=no
     
    8086TARGET=NOT_SET
    8187INSTALL=NOT_SET
    82 
    83 while getopts vAambgdi:t: OPT
     88jobs=NOT_SET
     89do_tests=no
     90do_mail=no
     91
     92while getopts cj:B:vTMAambgdi:t: OPT
    8493do
    8594  case "$OPT" in
    86     A) do_autoconf=`toggle ${do_autoconf}`
    87        do_automake=`toggle ${do_automake}`
    88        do_binutils=`toggle ${do_binutils}`
     95    A) do_binutils=`toggle ${do_binutils}`
    8996       do_gdb=`toggle ${do_gdb}`
    9097       do_gcc_newlib=`toggle ${do_gcc_newlib}`
     
    97104    i) INSTALL="${OPTARG}" ;;
    98105    t) TARGET="${OPTARG}" ;;
     106    j) jobs="${OPTARG}" ;;
     107    B) buildroot="${OPTARG}" ;;
     108    c) do_clean=`toggle ${do_clean}` ;;
     109    T) do_tests=`toggle ${do_tests}` ;;
     110    M) do_mail=`toggle ${do_mail}` ;;
    99111    v) verbose=`toggle ${verbose}` ;;
    100     *) echo ERROR ; exit 1 ;;
     112    *) echo "Error ${OPT} is not a valid option" ; usage ; exit 1 ;;
    101113  esac
    102114done
    103115
     116# Specify the desired parallelism
     117if [ ${jobs} != "NOT_SET" ] ; then
     118  case ${jobs} in
     119    NOT_SET)
     120      JOBS=""
     121      ;;
     122    ''|*[!0-9]*)
     123      check_fatal 1 "Number of jobs (${jobs}) specified is not a number"
     124      ;;
     125    *)
     126      JOBS="-j ${jobs}"
     127      ;;
     128  esac
     129fi
     130
    104131if [ ${verbose} = "yes" ] ; then
    105   echo "Build autoconf:   " ${do_autoconf}
    106   echo "Build automake:   " ${do_automake}
    107   echo "Build binutils:   " ${do_binutils}
    108   echo "Build gdb:        " ${do_gdb}
    109   echo "Build gcc/newlib: " ${do_gcc_newlib}
    110   echo "Install point:    " ${INSTALL}
    111   echo "Target:           " ${TARGET}
     132  echo "Build autoconf:    " ${do_autoconf}
     133  echo "Build automake:    " ${do_automake}
     134  echo "Build binutils:    " ${do_binutils}
     135  echo "Build gdb:         " ${do_gdb}
     136  echo "Build gcc/newlib:  " ${do_gcc_newlib}
     137  echo "Clean as building: " ${do_clean}
     138  echo "Running Tests:     " ${do_tests}
     139  echo "  Mailing Results: " ${do_mail}
     140  echo "Parallel Jobs:     " ${jobs}
     141  echo "Install point:     " ${INSTALL}
     142  echo "Build root:        " ${buildroot}
     143  echo "Target:            " ${TARGET}
    112144  echo
    113145fi
     
    168200fi
    169201
     202test -d ${buildroot}
     203check_status $? "${buildroot} does not exist"
     204
    170205export PATH=${INSTALL}/bin:$PATH
    171206### Build everything
    172207for pkg in ${TOBUILD}
    173208do
    174   rm -rf b-${pkg}
    175   check_status $? "failed to rm b-${pkg}"
    176 
    177   mkdir b-${pkg}
    178   check_status $? "failed to make b-${pkg}"
    179 
    180   cd b-${pkg}
    181   check_status $? "failed to cd b-${pkg}"
    182 
    183   echo "Configuring ${pkg}..."
     209  cd ${buildroot}
     210  check_status $? "failed to cd ${buildroot}"
     211
     212  BUILDDIR=`echo b-${TARGET}-${pkg} | sed -e 's/\//-/g'`
     213
     214  rm -rf ${BUILDDIR}
     215  check_status $? "failed to rm ${BUILDDIR}"
     216
     217  mkdir ${BUILDDIR}
     218  check_status $? "failed to make ${BUILDDIR}"
     219
     220  cd ${BUILDDIR}
     221  check_status $? "failed to cd ${BUILDDIR}"
     222
     223  echo "Configuring ${pkg} in ${BUILDDIR}..."
    184224  case $pkg in
    185225    auto*)                               # autotools are native
    186       ../${pkg}/configure --prefix=${INSTALL} >c.log 2>&1
     226      ${sourcedir}/${pkg}/configure --prefix=${INSTALL} >c.log 2>&1
    187227      check_status $? "failed to configure ${pkg}"
    188228      ;;
    189229    binutils*)
    190       ../${pkg}/configure --target=${TARGET} \
     230      ${sourcedir}/${pkg}/configure --target=${TARGET} \
    191231        --prefix=${INSTALL} >c.log 2>&1
    192232      check_status $? "failed to configure ${pkg}"
    193233      ;;
    194234    gdb*)
    195       ../${pkg}/configure --target=${TARGET} \
     235      ${sourcedir}/${pkg}/configure --target=${TARGET} \
    196236        --prefix=${INSTALL} \
    197237        --enable-sim --enable-sim-hardware \
    198         --enable-timebase --enable-sim-trace
    199         >c.log 2>&1
     238        --enable-timebase --enable-sim-trace >c.log 2>&1
    200239      check_status $? "failed to configure ${pkg}"
    201240      ;;
    202241    gcc*)
    203       ../${GCC}/configure \
     242      ${sourcedir}/${GCC}/configure \
    204243       --enable-threads=rtems  --with-gnu-as --enable-multilib \
    205244       --enable-newlib-mb --enable-newlib-iconv \
     
    217256
    218257  echo "Building ${pkg}..."
    219   make >b.log 2>&1
     258  make ${JOBS} >b.log 2>&1
    220259  check_status $? "failed to make ${pkg}"
    221260
     
    224263  check_status $? "failed to install ${pkg}"
    225264
     265  # If testing the package, fall into this if
     266  if [ ${do_tests} = "yes" ] ; then
     267    echo "Testing ${pkg}..."
     268    case $pkg in
     269      auto*)
     270        # currently do not run test suite on autoconf and automake
     271        ;;
     272      binutils*)
     273        echo "Testing binutils for ${TARGET}"
     274        make check >check.log 2>&1
     275        ;;
     276      gdb*)
     277        # currently do not run test suite on gdb
     278        ;;
     279      gcc*)
     280        baseboard=NOT_SET
     281        case ${TARGET} in
     282          *-rtems*)
     283            echo "*** Currently do not support testing GCC with this script"
     284            ;;
     285          *-elf*|*-eabi*)
     286            cpu=`echo ${TARGET} | cut -d'-' -f1`
     287            case ${cpu} in
     288              arc*|arm*|basic*|cris*|d10v*|d30v*|fr30*|frv*|h8300*|i960*|iq2000*|jmr3904|\
     289              m32r*|m68hc11*|mcore*|mips*|mips64*|mips64vr4100*|mmixware*|mn10200|\
     290              mn10300*|powerpc*|powerpcle*|sh*|sparc*|sparc64*|sparclite*|tic80*|tx39|\
     291              v850*|vr4100*|vr4111*|vr4300*|xtensa*)
     292                baseboard=${cpu}-sim
     293                ;;
     294              *)
     295                ;;
     296            esac
     297            ;;
     298          *)
     299            ;;
     300         
     301        esac
     302
     303        # now see if we found a configuration to test with
     304        if [ ${baseboard} = "NOT_SET" ] ; then
     305          echo "*** Do not know how to test gcc on ${target}"
     306          continue
     307        fi
     308
     309        echo "Testing gcc for ${TARGET} on ${baseboard}"
     310        make check RUNTESTFLAGS="--target_board=${baseboard}" >check.log 2>&1
     311
     312        if [ ${do_mail} = "yes" ] ; then
     313          echo "Sending ${language} test results to GCC community.."
     314          ${sourcedir}/${GCC}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh
     315          check_status $? "Failed to email ${language} Test Results to GCC Community .. bailing"
     316
     317          echo "Sending ${language} test results to RTEMS community.."
     318          ${sourcedir}/${GCC}/contrib/test_summary -o -m rtems-tooltestresults@rtems.org | sh
     319          check_status $? "Failed to email ${language} Test Results to RTEMS Community .. bailing"
     320        fi
     321        ;;
     322      *)
     323        prerr "UNKNOWN PACKAGE ${pkg}"
     324        exit 1
     325        ;;
     326    esac
     327
     328  fi
     329  # END of if testing the package
     330
    226331  cd ..
    227   rm -rf b-${pkg}
     332  if [ ${do_clean} = "yes" ] ; then
     333    rm -rf ${BUILD}
     334  fi
    228335done
    229336
Note: See TracChangeset for help on using the changeset viewer.