Skip to contentSkip to conversation

build: allow easy override of GCC_BASE

PATCH In review Diego Elio Pettenò 3 participants 7 messages Apr 13, 2011 – Apr 14, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 build: allow easy override of GCC_BASE

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(-)
Makefile +2 -1
index cc6176f..e08143a 100644
@@ -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
Signature · 1 line
1.7.5.rc1
#1 lore raw

PATCH 2/3 build: add an all-installable target that builds the targets to install.

This is useful for distributions that don't want to build content that won't be installed.

---
 Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Makefile +3 -1
index e08143a..ffb513f 100644
@@ -118,7 +118,9 @@ SED_PC_CMD = 's|@version@|$(VERSION)|g;		\
 
 all: $(PROGRAMS) sparse.pc
 
-install: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
+all-installable: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
+
+install: all-installable
 	$(Q)install -d $(DESTDIR)$(BINDIR)
 	$(Q)install -d $(DESTDIR)$(LIBDIR)
 	$(Q)install -d $(DESTDIR)$(MAN1DIR)
Signature · 1 line
1.7.5.rc1
#2 lore raw

Re: [PATCH 2/3] build: add an all-installable target that builds the targets to install.

Quoted 11 lines · Diego Elio Pettenò

This is useful for distributions that don't want to build content that won't be installed.

---
 Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Makefile +0 -0
index e08143a..ffb513f 100644

Makefile SED_PC_CMD = 's|@version@|$(VERSION)|g; \ · line 126

Quoted 10 lines
Makefile +3 -1
@@ -118,7 +118,9 @@ SED_PC_CMD = 's|@version@|$(VERSION)|g;		\
 
 all: $(PROGRAMS) sparse.pc
 
-install: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
+all-installable: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
+
+install: all-installable
 	$(Q)install -d $(DESTDIR)$(BINDIR)
 	$(Q)install -d $(DESTDIR)$(LIBDIR)
 	$(Q)install -d $(DESTDIR)$(MAN1DIR)

Why not just "make install" instead? You don't have to separately make and make install; make install will build all the installed programs and then install them.

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Re: [PATCH 2/3] build: add an all-installable target that builds the targets to install.

Il giorno mer, 13/04/2011 alle 11.34 -0700, Josh Triplett ha scritto:

Quoted 6 lines

Why not just "make install" instead? You don't have to separately make
and make install; make install will build all the installed programs and
then install them.

Most distributions – including Gentoo – prefer running the steps separately, adding safety checks between one step and the other.

Signature · 7 lines
Diego Elio Pettenò — Flameeyes
http://blog.flameeyes.eu/

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

PATCH 3/3 Fix build with GCC 4.6 series.

In reply to Diego Elio Pettenò

The label_statement attribute in the anonymous structures' union was duplicated for label_arg and labeled_struct alises, which were identical. Since the former is never used, delete it and leave the other as the only copy.

---
 parse.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
parse.h +0 -4
index 6b21e23..b26bd03 100644
@@ -35,10 +35,6 @@ struct statement {
 		struct /* declaration */ {
 			struct symbol_list *declaration;
 		};
-		struct /* label_arg */ {
-			struct symbol *label;
-			struct statement *label_statement;
-		};
 		struct {
 			struct expression *expression;
 			struct expression *context;
Signature · 1 line
1.7.5.rc1
maintainer
#5 lore raw

Re: [PATCH 3/3] Fix build with GCC 4.6 series.

Will apply.

Chris

Quoted 26 lines · Diego Elio Pettenò

The label_statement attribute in the anonymous structures' union was duplicated for label_arg and labeled_struct alises, which were identical. Since the former is never used, delete it and leave the other as the only copy.
---
 parse.h |    4 ----

 1 files changed, 0 insertions(+), 4 deletions(-)
parse.h +0 -5
index 6b21e23..b26bd03 100644
@@ -35,10 +35,6 @@ struct statement {
                struct /* declaration */ {
                        struct symbol_list *declaration;
                };
-               struct /* label_arg */ {
-                       struct symbol *label;
-                       struct statement *label_statement;
-               };
                struct {
                        struct expression *expression;
                        struct expression *context;
--

1.7.5.rc1

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#6 lore raw
In reply to Diego Elio Pettenò

Will apply.

Chris

Quoted 24 lines · Diego Elio Pettenò

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(-)
Makefile +2 -1
index cc6176f..e08143a 100644
@@ -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

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html