-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup-working-directory.sh
executable file
·61 lines (52 loc) · 2.06 KB
/
setup-working-directory.sh
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
# Sets up the source code & other data required for the grading tools,
# in the directory from which the tools are to be run (best if this
# isn't the same as the grading tools' directory).
set -eu
# Locate the tools.
tools_dir="`dirname $0`"
# Assumes the ACATS tests (from https://github.com/simonjwright/ACATS)
# are to be found at $tools_dir/../ACATS.
rm -rf support
mkdir support
# The GCC version of ACATS expects ACATS4GNATDIR to be the directory
# in which the tests are run, below which the support/ directory
# contains processed GNAT-ready Ada code.
rm -f ACATS4GNATDIR
ln -s $PWD ACATS4GNATDIR
# Pick up the C and Fortran sources from ACATS/tests/ and compile
# them. We need a real library (libsupport.a) for the test links to
# succeed (in most cases: not CD30005).
find $tools_dir/../ACATS/tests -name \*.c -exec cp {} support/ \;
find $tools_dir/../ACATS/tests -name \*.ftn -exec cp {} support/ \;
# Build the library
cp $tools_dir/support_lib.gpr .
gprbuild -k -P support_lib.gpr
# cd300051.o is picked up directly from support/ (via impdef). On
# Linux, this conflicts with an element in libsupport.a, presumably
# because of some link ordering.
ar d libsupport.a cd300051.o
# Pick up Ada code from ACATS/support
for ada in $tools_dir/../ACATS/support/*.a*; do
gnatchop $ada support/
done
# Pick up code that needs to have macros substituted (only in the
for tst in $tools_dir/../ACATS/support/*.tst; do
cp $tst support/
done
# Control file tells macrosub which files to process (into .adt).
# NB, macrosub is written to use upper-case filenames.
ls $PWD/support/*.tst >support/TSTTESTS.DAT
# Macros for substitution
cp $tools_dir/../ACATS/support/macro.dfs support/MACRO.DFS
# Build macrosub (and send_sigint_to_parent, while we're here)
(cd support; gnatmake macrosub send_sigint_to_parent)
# Run macrosub
(cd support; ./macrosub)
# Chop the processed files
for processed in support/*.adt; do
gnatchop $processed support/
done
# Copy the standard manual processing list, unless it's already here
if [ ! -f gnat-man.txt ]; then
cp -v $tools_dir/gnat-man.txt .
fi