source: rtems/scripts/buildall.in @ 1cb2f89a

4.104.114.84.95
Last change on this file since 1cb2f89a was 1cb2f89a, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 14, 2000 at 5:41:45 PM

Updated list of targets to build.

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