From patchwork Tue Apr 15 17:22:49 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: 3994341 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 5BACB9F2CC for ; Tue, 15 Apr 2014 17:23:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8BB2620272 for ; Tue, 15 Apr 2014 17:23:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98C332026D for ; Tue, 15 Apr 2014 17:23:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753931AbaDORXH (ORCPT ); Tue, 15 Apr 2014 13:23:07 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:38985 "EHLO e9.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855AbaDORXF (ORCPT ); Tue, 15 Apr 2014 13:23:05 -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 13:23:04 -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 13:23:02 -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 A3F4238C801C for ; Tue, 15 Apr 2014 13:23:01 -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 s3FHN1Sw9896254 for ; Tue, 15 Apr 2014 17:23:01 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 s3FHN1o3027421 for ; Tue, 15 Apr 2014 13:23:01 -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 s3FHN0BP027366; Tue, 15 Apr 2014 13:23:00 -0400 Received: from localhost (localhost [127.0.0.1]) by localdomain.local (Postfix) with ESMTP id A16CC181040; Tue, 15 Apr 2014 10:22:58 -0700 (PDT) From: Cody P Schafer To: linux-sparse@vger.kernel.org Cc: Cody P Schafer Subject: [PATCH] build: allow use of LLVM_CONFIG to override llvm-config config script Date: Tue, 15 Apr 2014 10:22:49 -0700 Message-Id: <1397582569-7043-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: 14041517-7182-0000-0000-00000A57BE77 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 On systems like ubuntu 12.04, llvm-config is llvm 2.9, but llvm-config-3.0 and llvm-config-3.3 (for example) are versions 3.0 and 3.3 respectively. Allow overriding the name/path of the llvm-config script so people can use these versioned config scripts Signed-off-by: Cody P Schafer Reviewed-by: Josh Triplett --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c3f3104..bbdc088 100644 --- a/Makefile +++ b/Makefile @@ -30,9 +30,10 @@ HAVE_GCC_DEP:=$(shell touch .gcc-test.c && \ $(CC) -c -Wp,-MD,.gcc-test.d .gcc-test.c 2>/dev/null && \ echo 'yes'; rm -f .gcc-test.d .gcc-test.o .gcc-test.c) HAVE_GTK2:=$(shell pkg-config --exists gtk+-2.0 2>/dev/null && echo 'yes') -HAVE_LLVM:=$(shell llvm-config --version >/dev/null 2>&1 && echo 'yes') -HAVE_LLVM_VERSION:=$(shell llvm-config --version | grep "^[3-9].*" >/dev/null 2>&1 && echo yes) -LLVM_VERSION=$(shell llvm-config --version) +LLVM_CONFIG=llvm-config +HAVE_LLVM:=$(shell $(LLVM_CONFIG) --version >/dev/null 2>&1 && echo 'yes') +HAVE_LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version | grep "^[3-9].*" >/dev/null 2>&1 && echo yes) +LLVM_VERSION=$(shell $(LLVM_CONFIG) --version) GCC_BASE = $(shell $(CC) --print-file-name=) BASIC_CFLAGS = -DGCC_BASE=\"$(GCC_BASE)\" @@ -84,9 +85,9 @@ HAVE_LLVM=no else LLVM_PROGS := sparse-llvm $(LLVM_PROGS): LD := g++ -LLVM_LDFLAGS := $(shell llvm-config --ldflags) -LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g") -LLVM_LIBS := $(shell llvm-config --libs) +LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags) +LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cflags | sed -e "s/-DNDEBUG//g") +LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs) PROGRAMS += $(LLVM_PROGS) INST_PROGRAMS += sparse-llvm sparsec sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)