Permalink
Browse files

bootstrap.sh: fix CC detection

There were three errors in CC detection:

1. The wrong variable was used in the for loop.

2. The selected CC was checked for existence and execute perm,
   but instead of the full path to the executable just the basename
   was passed to test -x.

3. The info log message accidentally printed the value of CC.
  • Loading branch information...
1 parent 973723f commit 1ac25dbd56b71908e9d5c6196cdd21ab280547df @tuncer tuncer committed Feb 7, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 cabal-install/bootstrap.sh
@@ -28,13 +28,13 @@ DEFAULT_PREFIX="${HOME}/.cabal"
# Check for a C compiler.
[ ! -x "$CC" ] && for ccc in gcc clang cc icc; do
- ${CC} --version > /dev/null 2>&1 && CC=$ccc &&
- echo "Using $CC for C compiler. If this is not what you want, set $CC." >&2 &&
+ ${ccc} --version > /dev/null 2>&1 && CC=$ccc &&
+ echo "Using $CC for C compiler. If this is not what you want, set CC." >&2 &&
break
done
# None found.
-[ ! -x "$CC" ] &&
+[ ! -x `which "$CC"` ] &&
die "C compiler not found (or could not be run).
If a C compiler is installed make sure it is on your PATH,
or set the CC variable."

0 comments on commit 1ac25db

Please sign in to comment.