scan-build prefers -include over --includes=, gcc knows both.
authorPatrick Georgi <patrick.georgi@coresystems.de>
Tue, 21 Apr 2009 12:41:55 +0000 (12:41 +0000)
committerPatrick Georgi <patrick.georgi@coresystems.de>
Tue, 21 Apr 2009 12:41:55 +0000 (12:41 +0000)
With this change, romcc knows -include and the build system uses it.

Also use a full path to settings.h because scan-build has trouble
finding it otherwise.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Joseph Smith <joe@settoplinux.org>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4151 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/newconfig/config.g
util/romcc/romcc.c

index 69b3b64a807fec28b80a3fba10f8b2f738a89a31..a8130c8c66a980e1a962f2e119a7344c4fc9e907 100644 (file)
@@ -2098,7 +2098,7 @@ def writeimagemakefile(image):
        file.write("# Function to create an item like -Di586 or -DCONFIG_MAX_CPUS='1' or -Ui686\n")
        file.write("D_item = $(shell echo '$(if $(subst undefined,,$(origin $1)),\\#define $1$(if $($1), $($1),),\\#undef $1)' >> settings.h)\n\n")
        file.write("# Compute the value of CPUFLAGS here during make's first pass.\n")
-       file.write("CPUFLAGS := $(strip $(shell echo '/* autogenerated */' > settings.h)$(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))--include=settings.h)\n\n")
+       file.write("CPUFLAGS := $(strip $(shell echo '/* autogenerated */' > settings.h)$(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))-include $(PWD)/settings.h)\n\n")
 
        for i in image.getuserdefines():
                file.write("%s\n" %i)
index 0fc83a168b1db2e20abbeb38e1adf74a6c72ce61..bc647fd75b83d6b0e8fdc3a98e3d232e5e7807b0 100644 (file)
@@ -25118,11 +25118,13 @@ int main(int argc, char **argv)
                        else if (strncmp(argv[1], "-m", 2) == 0) {
                                result = arch_encode_flag(&arch, argv[1]+2);
                        }
-                       else if (strncmp(argv[1], "--include=", 10) == 0) {
+                       else if (strncmp(argv[1], "-include", 10) == 0) {
                                if (includefile) {
-                                       arg_error("Only one --include option may be specified.\n");
+                                       arg_error("Only one -include option may be specified.\n");
                                } else {
-                                       includefile = argv[1] + 10;
+                                       argv++;
+                                       argc--;
+                                       includefile = argv[1];
                                        result = 0;
                                }
                        }