History

Fix bashims in configure and gcctestsuite.sh.

configure and gcctestsuite.sh shell scripts contains bashisms although being bourne shell script. This patch fixes the following bashisms: * Use of $RANDOM variable (replaced by reading in /dev/urandom) * Use == in tests instead of just = * Use $[] for arithmetic computation istead of $(())

Thomas Preud'homme committed 16 years ago

Commit dc265fe1 parent a867f422 files · +19 −9Browse files

Unified · Split

2 files
  1. configure +15 −5
  2. tests/gcctestsuite.sh +4 −4
configure+15−5
@@ -11,11 +11,21 @@ else · 10 unmodified lines
11 TMPDIR1="/tmp"11 TMPDIR1="/tmp"
12fi12fi
13 13
14TMPC="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.c"14RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
15TMPO="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.o"15RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
16TMPE="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}"16TMPC="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.c"
17TMPS="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.S"17RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
18TMPH="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.h"18RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
19TMPO="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.o"
20RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
21RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
22TMPE="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}"
23RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
24RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
25TMPS="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.S"
26RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
27RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
28TMPH="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.h"
19 29
20# default parameters30# default parameters
21build_cross="no"31build_cross="no"
tests/gcctestsuite.sh+4−4
@@ -8,11 +8,11 @@ nb_failed="0" · 7 unmodified lines
8for src in $TESTSUITE_PATH/compile/*.c ; do8for src in $TESTSUITE_PATH/compile/*.c ; do
9 echo $TCC -o /tmp/test.o -c $src 9 echo $TCC -o /tmp/test.o -c $src
10 $TCC -o /tmp/test.o -c $src >> tcc.log 2>&110 $TCC -o /tmp/test.o -c $src >> tcc.log 2>&1
11 if [ "$?" == "0" ] ; then11 if [ "$?" = "0" ] ; then
12 result="PASS"12 result="PASS"
13 else13 else
14 result="FAIL"14 result="FAIL"
15 nb_failed=$[ $nb_failed + 1 ]15 nb_failed=$(( $nb_failed + 1 ))
16 fi16 fi
17 echo "$result: $src" >> tcc.sum17 echo "$result: $src" >> tcc.sum
18done18done
@@ -20,11 +20,11 @@ done · 1 unmodified line
20for src in $TESTSUITE_PATH/execute/*.c ; do20for src in $TESTSUITE_PATH/execute/*.c ; do
21 echo $TCC $src 21 echo $TCC $src
22 $TCC $src >> tcc.log 2>&122 $TCC $src >> tcc.log 2>&1
23 if [ "$?" == "0" ] ; then23 if [ "$?" = "0" ] ; then
24 result="PASS"24 result="PASS"
25 else25 else
26 result="FAIL"26 result="FAIL"
27 nb_failed=$[ $nb_failed + 1 ]27 nb_failed=$(( $nb_failed + 1 ))
28 fi28 fi
29 echo "$result: $src" >> tcc.sum29 echo "$result: $src" >> tcc.sum
30done30done

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t