<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems-testing (2010-07-19)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-19 Joel Sherrill <joel.sherrilL@OARcorp.com>

        * build_tools: Add command line arguments and let you do individual
        parts of the build process.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems-testing/simple-build-script/ChangeLog.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>simple-build-script/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems-testing/simple-build-script/build_tools.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>simple-build-script/build_tools</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems-testing/simple-build-script/ChangeLog:1.2 rtems-testing/simple-build-script/ChangeLog:1.3
--- rtems-testing/simple-build-script/ChangeLog:1.2     Mon Jul 19 16:05:46 2010
+++ rtems-testing/simple-build-script/ChangeLog Mon Jul 19 16:48:57 2010
</font><font color='#997700'>@@ -1,5 +1,10 @@
</font> 2010-07-19        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
<font color='#000088'>+   * build_tools: Add command line arguments and let you do individual
+       parts of the build process.
+
+2010-07-19     Joel Sherrill <joel.sherrilL@OARcorp.com>
+
</font>   * README: Fix typo.
 
 2010-03-28     Joel Sherrill <joel.sherrill@oarcorp.com>

<font color='#006600'>diff -u rtems-testing/simple-build-script/build_tools:1.1 rtems-testing/simple-build-script/build_tools:1.2
--- rtems-testing/simple-build-script/build_tools:1.1   Sun Mar 28 10:56:15 2010
+++ rtems-testing/simple-build-script/build_tools       Mon Jul 19 16:48:57 2010
</font><font color='#997700'>@@ -1,30 +1,29 @@
</font> #! /bin/sh
 #
 #  This script is a simple script to build and install rtems toolset
<font color='#880000'>-#  for the target you specify by editing TARGET below.  It should be
-#  of the form <CPU>-rtems<VERSION>.  For example, sparc-rtems4.11
</font><font color='#000088'>+#  for the target you specify on the command line.  It should be of
+#  the form <CPU>-rtems<VERSION>.  For example, sparc-rtems4.11
</font> #
 #  This can be used to build versions from CVS/SVN or released versions.
 #  Please be sure to apply appropriate patches from
 #  rtems/contrib/crossrpms/patches.
 #
<font color='#880000'>-#  --Joel Sherrill (28 Match 2010)
</font><font color='#000088'>+#  --Joel Sherrill (28 March 2010)
</font> #
 #  $Id$
 #
 
 ### EDIT THESE AS NEEDED
<font color='#880000'>-INSTALL=NOT_SET
-TARGET=sparc-rtems4.10
-AUTOCONF=autoconf-2.65
</font><font color='#000088'>+AUTOCONF=autoconf-2.66
</font> AUTOMAKE=automake-1.11.1
 BINUTILS=binutils-2.20.1
 GDB=gdb-7.1
<font color='#880000'>-GCC=gcc-4.4.3
</font><font color='#000088'>+GCC=gcc-4.5.0
</font> NEWLIB=newlib-1.18.0
 LANGUAGES="c,c++"
 ### END OF EDIT THESE
 
<font color='#000088'>+
</font> BASE=`pwd`
 
 #   log an error to stderr
<font color='#997700'>@@ -48,50 +47,143 @@
</font>   fi
 }
 
<font color='#880000'>-test $# -eq 1<span style="background-color: #FF0000"> </span>
-check_status $? "Useage: $0 install_point"
</font><font color='#000088'>+toggle()
+{
+  case $1 in
+    no)  echo "yes" ;;
+    yes) echo "no" ;;
+    *)   fatal "Unknown value to toggle ($1)" ;;
+  esac
+}
</font> 
<font color='#880000'>-INSTALL=$1
</font><font color='#000088'>+usage()
+{
+cat <<EOF
+  -v             verbose
+  -A             toggle building all parts
+  -a             toggle building autoconf
+  -m             toggle building automake
+  -b             toggle building binutils
+  -g             toggle building gcc/newlib
+  -d             toggle building db
+  -i INSTALL     specify install directory (required)
+  -t TARGET      specify target (required)
+
+EOF
+exit 1
+}
+
+do_autoconf=no
+do_automake=no
+do_binutils=no
+do_gdb=no
+do_gcc_newlib=no
+verbose=no
+TARGET=NOT_SET
+INSTALL=NOT_SET
+
+while getopts vAambgdi:t: OPT
+do
+  case "$OPT" in
+    A) do_autoconf=`toggle ${do_autoconf}`
+       do_automake=`toggle ${do_automake}`
+       do_binutils=`toggle ${do_binutils}`
+       do_gdb=`toggle ${do_gdb}`
+       do_gcc_newlib=`toggle ${do_gcc_newlib}`
+       ;;
+    a) do_autoconf=`toggle ${do_autoconf}` ;;
+    m) do_automake=`toggle ${do_automake}` ;;
+    b) do_binutils=`toggle ${do_binutils}` ;;
+    g) do_gcc_newlib=`toggle ${do_gcc_newlib}` ;;
+    d) do_gdb=`toggle ${do_gdb}` ;;
+    i) INSTALL="${OPTARG}" ;;
+    t) TARGET="${OPTARG}" ;;
+    v) verbose=`toggle ${verbose}` ;;
+    *) echo ERROR ; exit 1 ;;
+  esac
+done
+
+if [ ${verbose} = "yes" ] ; then
+  echo "Build autoconf:   " ${do_autoconf}
+  echo "Build automake:   " ${do_automake}
+  echo "Build binutils:   " ${do_binutils}
+  echo "Build gdb:        " ${do_gdb}
+  echo "Build gcc/newlib: " ${do_gcc_newlib}
+  echo "Install point:    " ${INSTALL}
+  echo "Target:           " ${TARGET}
+  echo
+fi
</font> 
 ### Validate arguments
<font color='#000088'>+test ${TARGET} != NOT_SET
+check_status $? "TARGET not specified"
+
+test ${INSTALL} != NOT_SET
+check_status $? "INSTALL not specified"
+<span style="background-color: #FF0000">  </span>
</font> if [ ! -d ${INSTALL} ] ; then
   mkdir ${INSTALL}
   check_status $? "failed to make ${INSTALL}"
 fi
 
<font color='#880000'>-test -d ${BINUTILS}
-check_status $? "No ${BINUTILS} - You do not appear to be in src directory"
</font><font color='#000088'>+if [ ${do_autoconf} = yes ] ; then
+  test -d ${AUTOCONF}
+  check_status $? "No ${AUTOCONF} - You do not appear to be in src directory"
+  TOBUILD="${TOBUILD} ${AUTOCONF}"
+fi
</font> 
<font color='#880000'>-test -d ${GCC}
-check_status $? "No ${GCC} - You do not appear to be in src directory"
</font><font color='#000088'>+if [ ${do_automake} = yes ] ; then
+  test -d ${AUTOMAKE}
+  check_status $? "No ${AUTOMAKE} - You do not appear to be in src directory"
+  TOBUILD="${TOBUILD} ${AUTOMAKE}"
+fi
</font> 
<font color='#880000'>-test -d ${NEWLIB}
-check_status $? "No ${NEWLIB} - You do not appear to be in src directory"
</font><font color='#000088'>+if [ ${do_binutils} = yes ] ; then
+  test -d ${BINUTILS}
+  check_status $? "No ${BINUTILS} - You do not appear to be in src directory"
+  TOBUILD="${TOBUILD} ${BINUTILS}"
+fi
</font> 
<font color='#880000'>-test -d ${GDB}
-check_status $? "No ${GDB} - You do not appear to be in src directory"
-
-if [ ! -d ${GCC}/newlib -o ! -d ${GCC}/libgloss ] ; then
-  echo "Please ensure that ${GCC}/newlib and ${GCC}/libgloss are symbolic"
-  echo "links into the newlib tree.  Use commands simiilar to the following:"
-  echo ""
-  echo "ln -s ${BASE}/${NEWLIB}/newlib ${BASE}/${GCC}/newlib"
-  echo "ln -s ${BASE}/${NEWLIB}/libgloss ${BASE}/${GCC}/libgloss"
-  exit 1
</font><font color='#000088'>+if [ ${do_gdb} = yes ] ; then
+  test -d ${GDB}
+  check_status $? "No ${GDB} - You do not appear to be in src directory"
+  TOBUILD="${TOBUILD} ${GDB}"
</font> fi
 
<font color='#880000'>-export PATH=${INSTALL}/bin:$PATH
</font><font color='#000088'>+if [ ${do_gcc_newlib} = yes ] ; then
+  test -d ${GCC}
+  check_status $? "No ${GCC} - You do not appear to be in src directory"
+
+  test -d ${NEWLIB}
+  check_status $? "No ${NEWLIB} - You do not appear to be in src directory"
+
+  if [ ! -d ${GCC}/newlib -o ! -d ${GCC}/libgloss ] ; then
+    echo "Please ensure that ${GCC}/newlib and ${GCC}/libgloss are symbolic"
+    echo "links into the newlib tree.  Use commands simiilar to the following:"
+    echo ""
+    echo "ln -s ${BASE}/${NEWLIB}/newlib ${BASE}/${GCC}/newlib"
+    echo "ln -s ${BASE}/${NEWLIB}/libgloss ${BASE}/${GCC}/libgloss"
+    exit 1
+  fi
+
+  TOBUILD="${TOBUILD} ${GCC}"
+fi
</font> 
<font color='#880000'>-### Everything except GCC
-for pkg in ${AUTOCONF} ${AUTOMAKE} ${BINUTILS} ${GDB}
</font><font color='#000088'>+export PATH=${INSTALL}/bin:$PATH
+### Build everything
+for pkg in ${TOBUILD}
</font> do
<font color='#000088'>+  rm -rf b-${pkg}
+  check_status $? "failed to rm b-${pkg}"
+
</font>   mkdir b-${pkg}
   check_status $? "failed to make b-${pkg}"
 
   cd b-${pkg}
   check_status $? "failed to cd b-${pkg}"
 
<font color='#880000'>-  case pkg in
</font><font color='#000088'>+  echo "Configuring ${pkg}..."
+  case $pkg in
</font>     auto*)                               # autotools are native
       ../${pkg}/configure --prefix=${INSTALL} >c.log 2>&1
       check_status $? "failed to configure ${pkg}"
<font color='#997700'>@@ -109,15 +201,27 @@
</font>         >c.log 2>&1
       check_status $? "failed to configure ${pkg}"
       ;;
<font color='#000088'>+    gcc*)
+      ../${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 \
+        --enable-version-specific-runtime-libs \
+        --enable-languages=${LANGUAGES} --target=${TARGET} --prefix=${INSTALL} \
+      >c.log 2>&1
+      check_status $? "failed to configure ${pkg}"
+      ;;
</font>     *)
       prerr "UNKNOWN PACKAGE ${pkg}"
       exit 1
       ;;
   esac
 
<font color='#000088'>+  echo "Building ${pkg}..."
</font>   make >b.log 2>&1
   check_status $? "failed to make ${pkg}"
 
<font color='#000088'>+  echo "Installing ${pkg}..."
</font>   make install >i.log 2>&1
   check_status $? "failed to install ${pkg}"
 
<font color='#997700'>@@ -125,28 +229,4 @@
</font>   rm -rf b-${pkg}
 done
 
<font color='#880000'>-### GCC/NEWLIB
-mkdir b-${GCC}
-check_status $? "failed to make b-${GCC}"
-
-cd b-${GCC}
-check_status $? "failed to cd b-${GCC}"
-
-../${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 \
-  --enable-version-specific-runtime-libs \
-  --enable-languages=${LANGUAGES} --target=${TARGET} --prefix=${INSTALL} \
-  >c.log 2>&1
-
-make >b.log 2>&1
-check_status $? "failed to make ${GCC}/newlib"
-
-make install >i.log 2>&1
-check_status $? "failed to install ${GCC}/newlib"
-
-cd ..
-rm -rf b-${GCC}
-
</font> exit 0
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>