source: rtems-testing/rtems/common.sh @ 486e255

4.11
Last change on this file since 486e255 was 69a2cf1, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 24, 2009 at 2:35:51 PM

2009-02-24 Joel Sherrill <joel.sherrill@…>

  • common.sh, user.cfg: If not running tests, do not confirm BSP has a DejaGNU configuration.
  • Property mode set to 100755
File size: 3.0 KB
Line 
1#
2#  Some shell functions and shared setup shared across the build scripts
3#
4#  Including this file assumes these are defined:
5#
6#  CPU        - user argument
7#  my_exit()  - shell script specific exit routine
8#  usage()    - shell script usage routine
9#
10#  Including this file sets:
11#
12#  target   - to the GNU tools target name
13#  CPU      - to the canonical RTEMS CPU
14#
15#
16#  $Id$
17#
18
19#
20#  Checks the status returned by executables and exits if it is non-zero.
21#
22check_fatal()
23{
24  if [ $1 -ne 0 ] ; then
25    shift
26    echo "ERROR: $*" >&2
27    my_exit 1
28  fi
29  #echo
30  #echo "End of $*"
31  #echo -n "Press return to continue> "
32  #echo
33  #read line
34}
35
36print_rtems_cpus()
37{
38  echo
39  echo "CPU is one of the following: "
40  echo "  arm           h8300           i386            lm32"
41  echo "  m68k          nios2           powerpc         sh"
42  echo "  m32c          m32r            sparc           tic4x"
43  echo 
44  echo "Formats without a -XXX suffix are the preferred target."
45  echo 
46  echo "CPU-rtems is used as the GNU target and results in:"
47  echo "    arm-rtems         -- ARM"
48  echo "    avr-rtems         -- Atmel AVR"
49  echo "    bfin-rtems        -- Blackfin"
50  echo "    h8300-rtems       -- Renesas H8/300"
51  echo "    i386-rtems        -- Intel i386 and above in protected mode (ELF)"
52  echo "    lm32-rtems        -- Lattice Micro (ELF)"
53  echo "    m32c-rtems        -- Renesas M32C (ELF)"
54  echo "    m32R-rtems        -- Renesas M32R (ELF)"
55  echo "    m68k-rtems        -- Motorola mc680x0, mc683xx, and ColdFire (ELF)"
56  echo "    nios2-rtems       -- Altera NIOS2"
57  echo "    powerpc-rtems     -- IBM and Motorola PowerPC"
58  echo "    sh-rtems          -- Renesas SH (COFF)"
59  echo "    sparc-rtems       -- SPARC (ELF)"
60}
61
62# CPU must be set before we run any of this stuff
63test "x${CPU}" != "x" || check_fatal $? "(common.sh) CPU not set"
64
65# The argument to the "--target" argument of configure.
66target=${CPU}-rtems
67
68case ${CPU} in
69  a29k)        ;;
70  arm)         ;;
71  avr)         ;;
72  bfin)         ;;
73  c3x)         CPU=c4x ; target=c4x-rtems ;;
74  c4x)         ;;
75  h8300)       ;;
76  hppa1.1)     ;;
77  i386)        ;;
78  lm32)        ;;
79  m32c)        ;;
80  m32r)        ;;
81  m68k)        ;;
82  mips)        ;;
83  nios2)       ;;
84  or32)        ;;
85  powerpc)     ;;
86  sh)          ;;
87  tic4x)       ;;
88  sparc)       ;;
89  native)      CPU=unix;;
90  unix)        ;;
91  *) 
92     echo ${CPU} is not a supported CPU
93     echo
94     usage
95     exit 1
96     ;;
97esac
98 
99# insert the os version
100#target=`echo $target | sed -e 's/-rtems$/-rtems4.9/' -e 's/-rtemself$/-rtemself4.9/'`
101target=`echo $target | sed -e 's/-rtems$/-rtems4.10/' -e 's/-rtemself$/-rtemself4.10/'`
102
103#
104#  Figure out if GNU make is available
105#
106gmake_found=no
107for name in gmake make
108do
109  if [ ${gmake_found} = "no" ] ; then
110    ${name} --version >/dev/null 2>&1
111    if [ $? -eq 0 ] ; then
112      MAKE=${name}
113      gmake_found=yes
114    fi
115  fi
116
117done
118
119if [ ${gmake_found} = "no" ] ; then
120   echo "Unable to locate a version of GNU make in your PATH"
121   echo "GNU Make is required to build these tools."
122   exit 1
123fi
Note: See TracBrowser for help on using the repository browser.