diff mbox

gengtype improvements for plugins. What is missing???

Message ID 4C7BDD7F.3010908@gnu.org
State New
Headers show

Commit Message

Paolo Bonzini Aug. 30, 2010, 4:34 p.m. UTC
On 08/29/2010 09:23 PM, Basile Starynkevitch wrote:
> 
> 
> See http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02058.html

> +ifdef REVISION_c
> +build/version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
> +else
> +build/version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
> +endif

Instead include something like this:


and use $(REVISION) unconditionally in your rule just like I'm doing
above.

> +## The build/version.o is compiled by the $(COMPILER_FOR_BUILD) so
> +build/version.o: BUILD_CPPFLAGS +=  \
> +	-DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
> +	-DREVISION=$(REVISION_s) \
> +	-DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
> +	-DBUGURL=$(BUGURL_s) -c $(srcdir)/version.c $(OUTPUT_OPTION)

Adding the -c option to build/version.o's value of BUILD_CPPFLAGS is a
cut-and-paste error from version.o's rule.  Please use the whole rule,
as in

build/version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
        $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) \
		$(BUILD_CPPFLAGS) ... other flags above ... \
                -o $@ $<


> Ian Taylor, Diego Novillo, Paolo Bonzini and others, is that slicing in
> several pieces enough for you? I hope yes!

Yes, looks good to me in principle, though I only reviewed the minor
build changes you have.

Paolo
diff mbox

Patch

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 162940)
+++ Makefile.in	(working copy)
@@ -834,6 +834,7 @@  DATESTAMP_c := $(shell cat $(DATESTAMP))
 
 ifeq (,$(wildcard $(REVISION)))
 REVISION_c  :=
+REVISION    :=
 else
 REVISION_c  := $(shell cat $(REVISION))
 endif
@@ -2238,11 +2239,7 @@  gcc-options.o: options.c $(CONFIG_H) $(S
 
 dumpvers: dumpvers.c
 
-ifdef REVISION_c
 version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
-else
-version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
-endif
 	$(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
 	-DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
 	-DREVISION=$(REVISION_s) \