diff options
Diffstat (limited to 'main/lzo/util/checkasm.sh')
-rw-r--r-- | main/lzo/util/checkasm.sh | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/main/lzo/util/checkasm.sh b/main/lzo/util/checkasm.sh index 4fee682e..aef5ec00 100644 --- a/main/lzo/util/checkasm.sh +++ b/main/lzo/util/checkasm.sh @@ -8,39 +8,48 @@ set -e # on a complete directory tree. # It is not suitable for accurate timings. # -# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +# Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer # -LZOTEST="lzotest" -test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest" -test -x ./lzotest.exe && LZOTEST="./lzotest.exe" -test -x ./lzotest.out && LZOTEST="./lzotest.out" -LFLAGS="-q" +if test "X$LZOTEST" = X; then +LZOTEST="./lzotest/lzotest" +for d in ./lzotest .; do + for ext in "" .exe .out; do + if test -f "$d/lzotest$ext" && test -x "$d/lzotest$ext"; then + LZOTEST="$d/lzotest$ext" + break 2 + fi + done +done +fi -dir="${*-.}" +dir="${1-.}" -TMPFILE="/tmp/lzo_$$.tmp" -rm -f $TMPFILE -(find $dir/ -type f -print > $TMPFILE) || true +TMPFILE="/tmp/lzotest_$$.tmp" +rm -f "$TMPFILE" +(find "$dir/." -type f -print | LC_ALL=C sort > "$TMPFILE") || true + +LFLAGS="-q" -for i in 11; do - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S +for m in 11; do + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A -S done -for i in 61; do - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S +for m in 61; do + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F -S done -for i in 71 81; do - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S +for m in 71 81; do + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A -S + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F -S done -rm -f $TMPFILE +rm -f "$TMPFILE" echo "Done." exit 0 +# vim:set ts=4 sw=4 et: |