sparse{i,c}: use LLVM_CONFIG to find llc and lli
PATCH 1/1 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.
--- sparsec | 6 +++++- sparsei | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-)
sparsec +5 -1
@@ -34,7 +34,11 @@ TMPFILE=`mktemp -t tmp.XXXXXX`".o" $DIRNAME/sparse-llvm $SPARSEOPTS > $TMPLLVM -llc -o - $TMPLLVM | as -o $TMPFILE +if [ -z "$LLVM_CONFIG" ]; then + LLVM_CONFIG=llvm-config +fi + +`"$LLVM_CONFIG" --bindir`/llc -o - $TMPLLVM | as -o $TMPFILE if [ $NEED_LINK -eq 1 ]; then if [ -z $OUTFILE ]; then
sparsei +4 -1
@@ -3,7 +3,10 @@ set +e DIRNAME=`dirname $0` -LLI=`llvm-config --bindir`/lli +if [ -z "$LLVM_CONFIG" ]; then + LLVM_CONFIG=llvm-config +fi +LLI=`"$LLVM_CONFIG" --bindir`/lli if [ $# -eq 0 ]; then echo "`basename $0`: no input files"
Signature · 1 line
1.9.2
Christopher Li
maintainerQuoted 5 lines · Cody P Schafer
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_CONFIGmakes much less work.
How about this minor incremental patch? It will use the default variable to make the change smaller.
Chris
sparsec +2 -4
@@ -34,11 +34,9 @@ TMPFILE=`mktemp -t tmp.XXXXXX`".o" $DIRNAME/sparse-llvm $SPARSEOPTS > $TMPLLVM -if [ -z "$LLVM_CONFIG" ]; then - LLVM_CONFIG=llvm-config -fi +LLC=`"${LLVM_CONFIG:-llvm-config}" --bindir`/llc -`"$LLVM_CONFIG" --bindir`/llc -o - $TMPLLVM | as -o $TMPFILE +$LLC -o - $TMPLLVM | as -o $TMPFILE if [ $NEED_LINK -eq 1 ]; then if [ -z $OUTFILE ]; then
sparsei +1 -4
@@ -3,10 +3,7 @@ set +e DIRNAME=`dirname $0` -if [ -z "$LLVM_CONFIG" ]; then - LLVM_CONFIG=llvm-config -fi -LLI=`"$LLVM_CONFIG" --bindir`/lli +LLI=`"${LLVM_CONFIG:-llvm-config}" --bindir`/lli if [ $# -eq 0 ]; then echo "`basename $0`: no input files"
Quoted 11 lines · Christopher Li
Quoted 5 lines · Cody P Schafer
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_CONFIGmakes much less work.How about this minor incremental patch? It will use the default variable to make the change smaller.
Yep, should have remembered that I could just use a default value for the variable. Looks good.