linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cody P Schafer <cody@linux.vnet.ibm.com>
To: linux-sparse@vger.kernel.org
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Subject: [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli
Date: Tue, 15 Apr 2014 12:51:29 -0700	[thread overview]
Message-ID: <1397591489-17411-1-git-send-email-cody@linux.vnet.ibm.com> (raw)

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>
---
 sparsec | 6 +++++-
 sparsei | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/sparsec b/sparsec
index 9c90b30..f8e7256 100755
--- a/sparsec
+++ b/sparsec
@@ -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
diff --git a/sparsei b/sparsei
index 4632154..7a2e0f1 100755
--- a/sparsei
+++ b/sparsei
@@ -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"
-- 
1.9.2


             reply	other threads:[~2014-04-15 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 19:51 Cody P Schafer [this message]
2014-04-15 22:28 ` [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli Christopher Li
2014-04-15 22:53   ` Cody P Schafer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397591489-17411-1-git-send-email-cody@linux.vnet.ibm.com \
    --to=cody@linux.vnet.ibm.com \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).