-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtsp.sh
executable file
·63 lines (47 loc) · 1.43 KB
/
btsp.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
62
63
#!/bin/bash
# set -x
HASH=$1
TITLE=$2
REPO=/home/kyukhin/gcc/git/gcc
if [ -n "$3" ]; then REPO=$3; fi
TPATH=$PWD
if [ -n "$4" ]; then TPATH=$4; fi
STATUS=$TPATH/$$-$TITLE.status
TPATH=$TPATH/$$-$TITLE
echo "kyukhin ($$-$TITLE): Setting up..." |tee $STATUS
echo "kyukhin ($$-$TITLE): Working dir: $TPATH" |tee -a $STATUS
mkdir $TPATH || exit -1
mkdir $TPATH/src || exit -1
mkdir $TPATH/bld || exit -1
cp ~/bin/Makefile $TPATH/bld/Makefile ||exit -1
pushd $TPATH/src > /dev/null || exit -1
git clone $REPO gcc >> $STATUS || exit -1
cd gcc
git checkout $HASH >> $STATUS || exit -1
echo "kyukhin ($$-$TITLE): Bootstrapping..." |tee -a $STATUS
cd $TPATH/bld || exit -1
GCC_SOURCE=$TPATH/src/gcc time make config rr >> $STATUS.detail 2>&1
S=$?
echo "kyukhin ($$-$TITLE): STATUS is $S" |tee -a $STATUS
if [ $S -ne 0 ]
then
echo "**** ($$-$TITLE): BOOTSTRAP FAILED. STOP STOP STOP. FAILED ****" |tee -a $STATUS
popd
exit $1
fi
echo "kyukhin ($$-$TITLE): Testing..." |tee -a $STATUS
cd $TPATH/bld || exit -1
GCC_SOURCE=$TPATH/src/gcc time make c >> $STATUS.detail 2>&1
S=$?
echo "kyukhin ($$-$TITLE): STATUS is $S" |tee -a $STATUS
if [ $S -ne 0 ]
then
echo "**** ($$-$TITLE): TESTING FAILED. STOP STOP STOP. FAILED ****" |tee -a $STATUS
else
# rm -rf $TPATH
# rm $STATUS.detail
echo "**** ($$-$TITLE): OK! ****" |tee -a $STATUS
echo " Test results" |tee -a $STATUS
tail -n16 $STATUS.detail |head -n7 |tee -a $STATUS
fi
popd > /dev/null