]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Support /bin/sh that doesn't update $PWD
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 30 May 2010 09:20:53 +0000 (11:20 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 30 May 2010 09:20:53 +0000 (11:20 +0200)
test.sh

diff --git a/test.sh b/test.sh
index d7b61bde7ea26cb41f1a7bf2958ba4f9253b365d..a252f3030913d4862d6668eef9d3c99a436e384d 100755 (executable)
--- a/test.sh
+++ b/test.sh
 # this program; if not, write to the Free Software Foundation, Inc., 51
 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-if test -n "$CC"; then
-    COMPILER="$CC"
-else
-    COMPILER=cc
-fi
-
-if [ "x$PWD" = x ]; then
-    PWD=`pwd`
-fi
-
-if [ -z "$CCACHE" ]; then
-    CCACHE=$PWD/ccache
-fi
-TESTDIR=testdir.$$
-
 unset CCACHE_BASEDIR
 unset CCACHE_CC
 unset CCACHE_COMPILERCHECK
@@ -1307,10 +1292,21 @@ EOF
 ######################################################################
 # main program
 
-suites="$*"
+TESTDIR=testdir.$$
 rm -rf $TESTDIR
 mkdir $TESTDIR
 cd $TESTDIR || exit 1
+PWD=`pwd`
+
+suites="$*"
+if [ -n "$CC" ]; then
+    COMPILER="$CC"
+else
+    COMPILER=cc
+fi
+if [ -z "$CCACHE" ]; then
+    CCACHE=`dirname $PWD`/ccache
+fi
 
 CCACHE_DIR=$PWD/.ccache
 export CCACHE_DIR