File: run_acats.sh

package info (click to toggle)
gcc-arm-none-eabi 15%3A12.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 959,712 kB
  • sloc: cpp: 3,275,382; ansic: 2,061,766; ada: 840,956; f90: 208,513; makefile: 76,132; asm: 73,433; xml: 50,448; exp: 34,146; sh: 32,436; objc: 15,637; fortran: 14,012; python: 11,991; pascal: 6,787; awk: 4,779; perl: 3,054; yacc: 338; ml: 285; lex: 201; haskell: 122
file content (71 lines) | stat: -rwxr-xr-x 2,003 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh

if [ "$testdir" = "" ]; then
   echo You must use make check or make check-ada
   exit 1
fi

# Provide which replacement.
#
# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
# ksh93 and bash have it.
# type output format differs between ksh88 and ksh93, so avoid it if
# type -p is present.  Unfortunately, HP-UX /bin/sh ignores -p with type.
# Fall back to whence which ksh88 and ksh93 provide, but bash does not.

which () {
    path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
    path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
    path=`whence $* 2>/dev/null` && { echo $path; return 0; }
    return 1
}

# Set up environment to use the Ada compiler from the object tree

host_gnatchop=`which gnatchop`
host_gnatmake=`which gnatmake`
ROOT=`${PWDCMD-pwd}`
BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}`

PATH=$BASE:$ROOT:$PATH
ADA_INCLUDE_PATH=$BASE/ada/rts
LD_LIBRARY_PATH=$ADA_INCLUDE_PATH:$BASE:$LD_LIBRARY_PATH
ADA_OBJECTS_PATH=$ADA_INCLUDE_PATH

if [ ! -d $ADA_INCLUDE_PATH ]; then
   echo gnatlib missing, exiting.
   exit 1
fi

if [ ! -f $BASE/gnatchop ]; then
   echo gnattools missing, exiting.
   exit 1
fi

if [ ! -f $BASE/gnatmake ]; then
   echo gnattools missing, exiting.
   exit 1
fi

export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH BASE LD_LIBRARY_PATH

echo '#!/bin/sh' > host_gnatchop
echo PATH=`dirname $host_gnatchop`:'$PATH' >> host_gnatchop
echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatchop
echo export PATH >> host_gnatchop
echo exec gnatchop '"$@"' >> host_gnatchop

chmod +x host_gnatchop

echo '#!/bin/sh' > host_gnatmake
echo PATH=`dirname $host_gnatmake`:'$PATH' >> host_gnatmake
echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatmake
echo export PATH >> host_gnatmake
echo exec gnatmake '"$@"' >> host_gnatmake

chmod +x host_gnatmake

# Limit the stack to 16MB for stack checking
ulimit -s 16384

exec $testdir/run_all.sh ${1+"$@"}