* [PATCH] build: allow use of LLVM_CONFIG to override llvm-config config script
@ 2014-04-15 17:22 Cody P Schafer
2014-04-15 18:00 ` Josh Triplett
0 siblings, 1 reply; 3+ messages in thread
From: Cody P Schafer @ 2014-04-15 17:22 UTC (permalink / raw)
To: linux-sparse; +Cc: Cody P Schafer
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 <cody@linux.vnet.ibm.com>
---
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)
--
1.9.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] build: allow use of LLVM_CONFIG to override llvm-config config script
2014-04-15 17:22 [PATCH] build: allow use of LLVM_CONFIG to override llvm-config config script Cody P Schafer
@ 2014-04-15 18:00 ` Josh Triplett
2014-04-15 22:05 ` Christopher Li
0 siblings, 1 reply; 3+ messages in thread
From: Josh Triplett @ 2014-04-15 18:00 UTC (permalink / raw)
To: Cody P Schafer; +Cc: linux-sparse
On Tue, Apr 15, 2014 at 10:22:49AM -0700, Cody P Schafer wrote:
> 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 <cody@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> 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)
> --
> 1.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] build: allow use of LLVM_CONFIG to override llvm-config config script
2014-04-15 18:00 ` Josh Triplett
@ 2014-04-15 22:05 ` Christopher Li
0 siblings, 0 replies; 3+ messages in thread
From: Christopher Li @ 2014-04-15 22:05 UTC (permalink / raw)
To: Josh Triplett; +Cc: Cody P Schafer, Linux-Sparse
On Tue, Apr 15, 2014 at 11:00 AM, Josh Triplett <josh@joshtriplett.org> wrote:
> On Tue, Apr 15, 2014 at 10:22:49AM -0700, Cody P Schafer wrote:
>> 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 <cody@linux.vnet.ibm.com>
>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Applied with trivial modification to use simple
expanded variable.
Chris
diff --git a/Makefile b/Makefile
index bbdc088..f453ded 100644
--- a/Makefile
+++ b/Makefile
@@ -30,10 +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')
-LLVM_CONFIG=llvm-config
+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/nul
-LLVM_VERSION=$(shell $(LLVM_CONFIG) --version)
+LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version)
GCC_BASE = $(shell $(CC) --print-file-name=)
BASIC_CFLAGS = -DGCC_BASE=\"$(GCC_BASE)\"
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-15 22:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 17:22 [PATCH] build: allow use of LLVM_CONFIG to override llvm-config config script Cody P Schafer
2014-04-15 18:00 ` Josh Triplett
2014-04-15 22:05 ` Christopher Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.