Changeset 532c9ef in rtems-testing


Ignore:
Timestamp:
Jul 19, 2010, 9:48:57 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
a34504d
Parents:
f866027
Message:

2010-07-19 Joel Sherrill <joel.sherrilL@…>

  • build_tools: Add command line arguments and let you do individual parts of the build process.
Location:
simple-build-script
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-build-script/ChangeLog

    rf866027 r532c9ef  
     12010-07-19      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * build_tools: Add command line arguments and let you do individual
     4        parts of the build process.
     5
    162010-07-19      Joel Sherrill <joel.sherrilL@OARcorp.com>
    27
  • simple-build-script/build_tools

    rf866027 r532c9ef  
    22#
    33#  This script is a simple script to build and install rtems toolset
    4 #  for the target you specify by editing TARGET below.  It should be
    5 of the form <CPU>-rtems<VERSION>.  For example, sparc-rtems4.11
     4#  for the target you specify on the command line.  It should be of
     5the form <CPU>-rtems<VERSION>.  For example, sparc-rtems4.11
    66#
    77#  This can be used to build versions from CVS/SVN or released versions.
     
    99#  rtems/contrib/crossrpms/patches.
    1010#
    11 #  --Joel Sherrill (28 Match 2010)
     11#  --Joel Sherrill (28 March 2010)
    1212#
    1313#  $Id$
     
    1515
    1616### EDIT THESE AS NEEDED
    17 INSTALL=NOT_SET
    18 TARGET=sparc-rtems4.10
    19 AUTOCONF=autoconf-2.65
     17AUTOCONF=autoconf-2.66
    2018AUTOMAKE=automake-1.11.1
    2119BINUTILS=binutils-2.20.1
    2220GDB=gdb-7.1
    23 GCC=gcc-4.4.3
     21GCC=gcc-4.5.0
    2422NEWLIB=newlib-1.18.0
    2523LANGUAGES="c,c++"
    2624### END OF EDIT THESE
     25
    2726
    2827BASE=`pwd`
     
    4948}
    5049
    51 test $# -eq 1
    52 check_status $? "Useage: $0 install_point"
    53 
    54 INSTALL=$1
     50toggle()
     51{
     52  case $1 in
     53    no)  echo "yes" ;;
     54    yes) echo "no" ;;
     55    *)   fatal "Unknown value to toggle ($1)" ;;
     56  esac
     57}
     58
     59usage()
     60{
     61cat <<EOF
     62  -v             verbose
     63  -A             toggle building all parts
     64  -a             toggle building autoconf
     65  -m             toggle building automake
     66  -b             toggle building binutils
     67  -g             toggle building gcc/newlib
     68  -d             toggle building db
     69  -i INSTALL     specify install directory (required)
     70  -t TARGET      specify target (required)
     71
     72EOF
     73exit 1
     74}
     75
     76do_autoconf=no
     77do_automake=no
     78do_binutils=no
     79do_gdb=no
     80do_gcc_newlib=no
     81verbose=no
     82TARGET=NOT_SET
     83INSTALL=NOT_SET
     84
     85while getopts vAambgdi:t: OPT
     86do
     87  case "$OPT" in
     88    A) do_autoconf=`toggle ${do_autoconf}`
     89       do_automake=`toggle ${do_automake}`
     90       do_binutils=`toggle ${do_binutils}`
     91       do_gdb=`toggle ${do_gdb}`
     92       do_gcc_newlib=`toggle ${do_gcc_newlib}`
     93       ;;
     94    a) do_autoconf=`toggle ${do_autoconf}` ;;
     95    m) do_automake=`toggle ${do_automake}` ;;
     96    b) do_binutils=`toggle ${do_binutils}` ;;
     97    g) do_gcc_newlib=`toggle ${do_gcc_newlib}` ;;
     98    d) do_gdb=`toggle ${do_gdb}` ;;
     99    i) INSTALL="${OPTARG}" ;;
     100    t) TARGET="${OPTARG}" ;;
     101    v) verbose=`toggle ${verbose}` ;;
     102    *) echo ERROR ; exit 1 ;;
     103  esac
     104done
     105
     106if [ ${verbose} = "yes" ] ; then
     107  echo "Build autoconf:   " ${do_autoconf}
     108  echo "Build automake:   " ${do_automake}
     109  echo "Build binutils:   " ${do_binutils}
     110  echo "Build gdb:        " ${do_gdb}
     111  echo "Build gcc/newlib: " ${do_gcc_newlib}
     112  echo "Install point:    " ${INSTALL}
     113  echo "Target:           " ${TARGET}
     114  echo
     115fi
    55116
    56117### Validate arguments
     118test ${TARGET} != NOT_SET
     119check_status $? "TARGET not specified"
     120
     121test ${INSTALL} != NOT_SET
     122check_status $? "INSTALL not specified"
     123 
    57124if [ ! -d ${INSTALL} ] ; then
    58125  mkdir ${INSTALL}
     
    60127fi
    61128
    62 test -d ${BINUTILS}
    63 check_status $? "No ${BINUTILS} - You do not appear to be in src directory"
    64 
    65 test -d ${GCC}
    66 check_status $? "No ${GCC} - You do not appear to be in src directory"
    67 
    68 test -d ${NEWLIB}
    69 check_status $? "No ${NEWLIB} - You do not appear to be in src directory"
    70 
    71 test -d ${GDB}
    72 check_status $? "No ${GDB} - You do not appear to be in src directory"
    73 
    74 if [ ! -d ${GCC}/newlib -o ! -d ${GCC}/libgloss ] ; then
    75   echo "Please ensure that ${GCC}/newlib and ${GCC}/libgloss are symbolic"
    76   echo "links into the newlib tree.  Use commands simiilar to the following:"
    77   echo ""
    78   echo "ln -s ${BASE}/${NEWLIB}/newlib ${BASE}/${GCC}/newlib"
    79   echo "ln -s ${BASE}/${NEWLIB}/libgloss ${BASE}/${GCC}/libgloss"
    80   exit 1
     129if [ ${do_autoconf} = yes ] ; then
     130  test -d ${AUTOCONF}
     131  check_status $? "No ${AUTOCONF} - You do not appear to be in src directory"
     132  TOBUILD="${TOBUILD} ${AUTOCONF}"
     133fi
     134
     135if [ ${do_automake} = yes ] ; then
     136  test -d ${AUTOMAKE}
     137  check_status $? "No ${AUTOMAKE} - You do not appear to be in src directory"
     138  TOBUILD="${TOBUILD} ${AUTOMAKE}"
     139fi
     140
     141if [ ${do_binutils} = yes ] ; then
     142  test -d ${BINUTILS}
     143  check_status $? "No ${BINUTILS} - You do not appear to be in src directory"
     144  TOBUILD="${TOBUILD} ${BINUTILS}"
     145fi
     146
     147if [ ${do_gdb} = yes ] ; then
     148  test -d ${GDB}
     149  check_status $? "No ${GDB} - You do not appear to be in src directory"
     150  TOBUILD="${TOBUILD} ${GDB}"
     151fi
     152
     153if [ ${do_gcc_newlib} = yes ] ; then
     154  test -d ${GCC}
     155  check_status $? "No ${GCC} - You do not appear to be in src directory"
     156
     157  test -d ${NEWLIB}
     158  check_status $? "No ${NEWLIB} - You do not appear to be in src directory"
     159
     160  if [ ! -d ${GCC}/newlib -o ! -d ${GCC}/libgloss ] ; then
     161    echo "Please ensure that ${GCC}/newlib and ${GCC}/libgloss are symbolic"
     162    echo "links into the newlib tree.  Use commands simiilar to the following:"
     163    echo ""
     164    echo "ln -s ${BASE}/${NEWLIB}/newlib ${BASE}/${GCC}/newlib"
     165    echo "ln -s ${BASE}/${NEWLIB}/libgloss ${BASE}/${GCC}/libgloss"
     166    exit 1
     167  fi
     168
     169  TOBUILD="${TOBUILD} ${GCC}"
    81170fi
    82171
    83172export PATH=${INSTALL}/bin:$PATH
    84 
    85 ### Everything except GCC
    86 for pkg in ${AUTOCONF} ${AUTOMAKE} ${BINUTILS} ${GDB}
     173### Build everything
     174for pkg in ${TOBUILD}
    87175do
     176  rm -rf b-${pkg}
     177  check_status $? "failed to rm b-${pkg}"
     178
    88179  mkdir b-${pkg}
    89180  check_status $? "failed to make b-${pkg}"
     
    92183  check_status $? "failed to cd b-${pkg}"
    93184
    94   case pkg in
     185  echo "Configuring ${pkg}..."
     186  case $pkg in
    95187    auto*)                               # autotools are native
    96188      ../${pkg}/configure --prefix=${INSTALL} >c.log 2>&1
     
    110202      check_status $? "failed to configure ${pkg}"
    111203      ;;
     204    gcc*)
     205      ../${GCC}/configure \
     206       --enable-threads=rtems  --with-gnu-as --enable-multilib \
     207       --enable-newlib-mb --enable-newlib-iconv \
     208       --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
     209        --enable-version-specific-runtime-libs \
     210        --enable-languages=${LANGUAGES} --target=${TARGET} --prefix=${INSTALL} \
     211      >c.log 2>&1
     212      check_status $? "failed to configure ${pkg}"
     213      ;;
    112214    *)
    113215      prerr "UNKNOWN PACKAGE ${pkg}"
     
    116218  esac
    117219
     220  echo "Building ${pkg}..."
    118221  make >b.log 2>&1
    119222  check_status $? "failed to make ${pkg}"
    120223
     224  echo "Installing ${pkg}..."
    121225  make install >i.log 2>&1
    122226  check_status $? "failed to install ${pkg}"
     
    126230done
    127231
    128 ### GCC/NEWLIB
    129 mkdir b-${GCC}
    130 check_status $? "failed to make b-${GCC}"
    131 
    132 cd b-${GCC}
    133 check_status $? "failed to cd b-${GCC}"
    134 
    135 ../${GCC}/configure \
    136  --enable-threads=rtems  --with-gnu-as --enable-multilib \
    137  --enable-newlib-mb --enable-newlib-iconv \
    138  --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
    139   --enable-version-specific-runtime-libs \
    140   --enable-languages=${LANGUAGES} --target=${TARGET} --prefix=${INSTALL} \
    141   >c.log 2>&1
    142 
    143 make >b.log 2>&1
    144 check_status $? "failed to make ${GCC}/newlib"
    145 
    146 make install >i.log 2>&1
    147 check_status $? "failed to install ${GCC}/newlib"
    148 
    149 cd ..
    150 rm -rf b-${GCC}
    151 
    152232exit 0
Note: See TracChangeset for help on using the changeset viewer.