source: rtems/scripts/buildall.in @ 98e6eb8

4.104.114.84.95
Last change on this file since 98e6eb8 was 98e6eb8, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 21, 1999 at 5:07:17 AM

Shipping this all to Ralf.

  • Property mode set to 100755
File size: 3.9 KB
Line 
1#! /bin/sh
2#
3#  Generate all the specs and then cycle through building them.
4#
5
6RTEMS_DIR=`dirname $0`
7CFG=./user.cfg
8dst=@RPM_SPECSdir@
9
10usage()
11{
12  echo "$0 [options] <target_alias>"
13  echo "  options:"
14  echo "    -cfg <user.cfg>"
15  echo "    -o <rpm-spec-dir>"
16  exit 1 ;
17}
18
19while test $# -ge 1; do
20  case $1 in
21    -cfg)
22      test $# -ge 2 || usage
23      shift
24      CFG=$1
25      shift
26      ;;
27    -o)
28      test $# -ge 2 || usage
29      shift
30      dst=$1
31      shift
32      ;;
33    -*)
34      echo "invalid option $1";
35      usage
36      ;;
37    *)
38      TARGETS="${TARGETS} $1"
39      shift
40      ;;
41  esac
42done
43
44# This is the full list .. hppa1.1 does not build now.
45#ALL_TARGETS="hppa1.1-rtems i386-rtems i960-rtems m68k-rtems \
46#  m68k-rtemself mips64orion-rtems \
47#  powerpc-rtems sh-rtems sh-rtemself sparc-rtems"
48
49# This is the full buildable set.
50if [ "X${TARGETS}" = "X" ] ; then
51  TARGETS="i386-rtems i960-rtems m68k-rtems \
52    m68k-rtemself mips64orion-rtems \
53    powerpc-rtems sh-rtems sh-rtemself sparc-rtems"
54fi
55
56. $CFG
57
58binutils=${binutils_version}
59gcc=${gcc_version}
60gdb=${gdb_version}
61newlib=${newlib_version}
62# also use binutils_rpm_release
63buildroot=/opt/tmp
64
65testing=no
66do_binutils=yes
67do_gdb=yes
68do_gccnewlib=yes
69
70#
71#  Now get started
72#
73start=`date`
74
75echo PATH=$PATH
76
77if [ ${testing} = yes ] ; then
78  ECHO=echo
79fi
80
81installed_count=`rpm -qa | grep rtems | wc -l`
82if [ ${installed_count} -ne 0 ] ; then
83  echo This script should be run with NO rtems RPMs installed.
84  echo It appears that the following rtems RPMs are installed:
85  echo
86  rpm -qa | grep rtems
87  echo
88  echo Please remove these and restart this script.
89  exit 1
90fi
91
92echo Copying specs files.
93if [ ${testing} = no ] ; then
94  cd ${RTEMS_DIR}
95 
96  # ./configure || exit 1
97  make        || exit 1
98
99  #  Now generate all the specs
100  for target in ${TARGETS}
101  do
102    tspecs=`find . -name "${target}*"`
103    ${ECHO} cp -r ${tspecs} ${dst}
104  done
105fi
106
107# clean up a bit before we start
108cd ${dst}
109test -d log || mkdir log
110
111#  do all the tools
112for target in ${TARGETS}
113do
114  if [ ${do_binutils} = yes ] ; then
115    logfile=log/${target}-binutils
116    specfile=${dst}/${target}-binutils-${binutils}.spec
117    echo "rpm -ba ${specfile} >${logfile} 2>&1"
118    if [ ${testing} = no ] ; then
119      rpm -ba ${specfile} >${logfile} 2>&1
120    fi
121    ${ECHO} rm -rf ${dst}/../BUILD/${target}-binutils*
122    ${ECHO} rm -rf ${buildroot}/opt
123  else
124    echo Skipping binutils for ${target}
125  fi
126
127  #
128  #  build gcc/newlib
129  #
130
131  if [ ${do_gccnewlib} = yes ] ; then
132    # now build gcc/newlib
133    #    NOTE: This requires having binutils installed and we immediately
134    #          remove it once finished.
135    binutils_rpm=${dst}/../RPMS/i386/${target}-binutils-${binutils}-${binutils_rpm_release}.i386.rpm
136    if [ ! -f ${binutils_rpm} ] ; then
137      echo There is no RPM for binutils for ${target}.
138      echo Looked for ${binutils_rpm}.
139    fi
140    ${ECHO} rpm -i ${binutils_rpm}
141
142    logfile=log/${target}-gccnewlib
143    specfile=${dst}/${target}-gcc-${gcc}-newlib-${newlib}.spec
144    echo "rpm -ba ${specfile} >${logfile} 2>&1"
145    if [ ${testing} = no ] ; then
146      rpm -ba ${specfile} >${logfile} 2>&1
147    fi
148    ${ECHO} rm -rf ${dst}/../BUILD/${target}-gcc*
149    ${ECHO} rm -rf ${buildroot}/opt
150
151    echo uninstalling binutils for ${target}
152    if [ ${testing} = no ] ; then
153      rpm -e `rpm -qa | grep rtems`
154    fi
155  else
156    echo Skipping gcc/newlib for ${target}
157  fi
158
159  #
160  # build gdb
161  #
162
163  if [ ${do_gdb} = yes ] ; then
164    # now build gdb
165    logfile=log/${target}-gdb
166    specfile=${dst}/${target}-gdb-${gdb}.spec
167    echo "rpm -ba ${specfile} >${logfile} 2>&1"
168    if [ ${testing} = no ] ; then
169      rpm -ba ${specfile} >${logfile} 2>&1
170    fi
171    ${ECHO} rm -rf ${dst}/../BUILD/${target}-gdb*
172    ${ECHO} rm -rf ${buildroot}/opt
173  else
174    echo Skipping gdb for ${target}
175  fi
176
177done
178
179# Now we are done
180
181stop=`date`
182
183echo
184echo "Started:  " $start
185echo "Finished: " $stop
186exit 0
Note: See TracBrowser for help on using the repository browser.