diff mbox

[1/3] build: allow easy override of GCC_BASE

Message ID 1302692766-30217-1-git-send-email-flameeyes@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Diego Elio Pettenò April 13, 2011, 11:06 a.m. UTC
Sometimes gcc reports the wrong path for its own base (for instance when
ICC is present in the same system); by allowing an override of GCC_BASE in
Makefile, it's easier for packages to fix this up.
---
 Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Christopher Li April 14, 2011, 9:59 a.m. UTC | #1
Will apply.

Chris

On Wed, Apr 13, 2011 at 4:06 AM, Diego Elio Pettenò <flameeyes@gmail.com> wrote:
> Sometimes gcc reports the wrong path for its own base (for instance when
> ICC is present in the same system); by allowing an override of GCC_BASE in
> Makefile, it's easier for packages to fix this up.
> ---
>  Makefile |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index cc6176f..e08143a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -21,7 +21,8 @@ HAVE_GCC_DEP:=$(shell touch .gcc-test.c &&                            \
>                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')
>
> -CFLAGS += -DGCC_BASE=\"$(shell $(CC) --print-file-name=)\"
> +GCC_BASE = $(shell $(CC) --print-file-name=)
> +CFLAGS += -DGCC_BASE=\"$(GCC_BASE)\"
>
>  ifeq ($(HAVE_GCC_DEP),yes)
>  CFLAGS += -Wp,-MD,$(@D)/.$(@F).d
> --
> 1.7.5.rc1
>
> --
> 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
>
--
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
diff mbox

Patch

diff --git a/Makefile b/Makefile
index cc6176f..e08143a 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,8 @@  HAVE_GCC_DEP:=$(shell touch .gcc-test.c && 				\
 		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')
 
-CFLAGS += -DGCC_BASE=\"$(shell $(CC) --print-file-name=)\"
+GCC_BASE = $(shell $(CC) --print-file-name=)
+CFLAGS += -DGCC_BASE=\"$(GCC_BASE)\"
 
 ifeq ($(HAVE_GCC_DEP),yes)
 CFLAGS += -Wp,-MD,$(@D)/.$(@F).d