From patchwork Tue Apr 15 19:51:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cody@linux.vnet.ibm.com X-Patchwork-Id: 3995311 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CD31E9F336 for ; Tue, 15 Apr 2014 19:52:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0ECA520221 for ; Tue, 15 Apr 2014 19:52:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04EC02021A for ; Tue, 15 Apr 2014 19:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241AbaDOTwT (ORCPT ); Tue, 15 Apr 2014 15:52:19 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:54789 "EHLO e9.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751006AbaDOTwS (ORCPT ); Tue, 15 Apr 2014 15:52:18 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 15 Apr 2014 15:52:17 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 15 Apr 2014 15:52:15 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 01CF438C801A for ; Tue, 15 Apr 2014 15:52:15 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp23034.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s3FJqEri64094212 for ; Tue, 15 Apr 2014 19:52:14 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s3FJqE2Q026169 for ; Tue, 15 Apr 2014 15:52:14 -0400 Received: from localdomain.local ([9.80.109.194]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s3FJqCrn026054; Tue, 15 Apr 2014 15:52:13 -0400 Received: from localhost (localhost [127.0.0.1]) by localdomain.local (Postfix) with ESMTP id 0719F181040; Tue, 15 Apr 2014 12:52:11 -0700 (PDT) From: Cody P Schafer To: linux-sparse@vger.kernel.org Cc: Cody P Schafer Subject: [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli Date: Tue, 15 Apr 2014 12:51:29 -0700 Message-Id: <1397591489-17411-1-git-send-email-cody@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.2 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14041519-7182-0000-0000-00000A5827E6 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some systems have multiple llvm versions installed, and have prefixed executables ("-"). 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 --- 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"