aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCody P Schafer <cody@linux.vnet.ibm.com>2014-04-15 12:51:29 -0700
committerChristopher Li <sparse@chrisli.org>2014-04-15 15:30:28 -0700
commitfe5eda126b9f5315e0049fd174d2326fecea6249 (patch)
tree0422f8090d08dd1e1d2d31fc4e46a3c8ab45a42f
parent2ea26979e9134849c17a45aedcc80e20f27323b9 (diff)
downloadsparse-fe5eda126b9f5315e0049fd174d2326fecea6249.tar.gz
sparse{i,c}: use LLVM_CONFIG to find llc and lli
Some systems have multiple llvm versions installed, and have prefixed executables ("<exec>-<version>"). While we could require the user to specify a variable for each executable (LLC, LLI), using llvm-config --bindir to locate them and allowing them to override using LLVM_CONFIG makes much less work. Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
-rwxr-xr-xsparsec4
-rwxr-xr-xsparsei2
2 files changed, 4 insertions, 2 deletions
diff --git a/sparsec b/sparsec
index 9c90b305..9dc96c95 100755
--- a/sparsec
+++ b/sparsec
@@ -34,7 +34,9 @@ TMPFILE=`mktemp -t tmp.XXXXXX`".o"
$DIRNAME/sparse-llvm $SPARSEOPTS > $TMPLLVM
-llc -o - $TMPLLVM | as -o $TMPFILE
+LLC=`"${LLVM_CONFIG:-llvm-config}" --bindir`/llc
+
+$LLC -o - $TMPLLVM | as -o $TMPFILE
if [ $NEED_LINK -eq 1 ]; then
if [ -z $OUTFILE ]; then
diff --git a/sparsei b/sparsei
index 46321542..3431a9f0 100755
--- a/sparsei
+++ b/sparsei
@@ -3,7 +3,7 @@
set +e
DIRNAME=`dirname $0`
-LLI=`llvm-config --bindir`/lli
+LLI=`"${LLVM_CONFIG:-llvm-config}" --bindir`/lli
if [ $# -eq 0 ]; then
echo "`basename $0`: no input files"