Skip to content

Commit

Permalink
Merge pull request #1711 from pullreq/bootstrap-sh-fix
Browse files Browse the repository at this point in the history
Avoid $TMPDIR / linker detection conflict in bootstrap.sh. [Fix for #1710.]
  • Loading branch information
23Skidoo committed Mar 3, 2014
2 parents 379652d + f5a44a9 commit fb351fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cabal-install/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ GZIP="${GZIP:-gzip}"
SCOPE_OF_INSTALLATION="--user"
DEFAULT_PREFIX="${HOME}/.cabal"

# Try to respect $TMPDIR but override if needed - see #1710.
[ -"$TMPDIR"- = -""- ] || echo "$TMPDIR" | grep -q ld &&
export TMPDIR=/tmp/cabal-$(echo $(od -XN4 -An /dev/random)) && mkdir $TMPDIR

# Check for a C compiler.
[ ! -x "$CC" ] && for ccc in gcc clang cc icc; do
${ccc} --version > /dev/null 2>&1 && CC=$ccc &&
Expand All @@ -35,7 +39,8 @@ DEFAULT_PREFIX="${HOME}/.cabal"
done

# None found.
[ ! -x `which "$CC"` ] &&
# `command command -v` is ugly, but `which` is non-standard (see man 1 which).
[ ! -x "$(command command -v "$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."
Expand Down

0 comments on commit fb351fa

Please sign in to comment.