Re: [2.5] [Cool stuff] "checking" mode for kernel builds

From: Ryan Anderson (ryan@michonline.com)
Date: Tue May 27 2003 - 04:19:13 EST


On Mon, May 26, 2003 at 10:07:28PM -0700, Linus Torvalds wrote:
>
> On Mon, 26 May 2003, Aaron Lehmann wrote:
> >
> > The output between "#include <...> search starts here:" and "End of
> > search list." seems like the combination of what you want for
> > gcc_includepath and sys_includepath. I assume the output is ordered. I
> > might send a patch if I'm bored tonight.
>
> If it comes to parsing "gcc -v" output, I have to say that I personally
> find that to be just crazy, and I'd much rather just see the (incorrect
> but working) '-print-file-name=include' hack.

How's this for a hack that makes it work a bit better?

# This is a BitKeeper generated patch for the following project:
# Project Name: TSCT - The Silly C Tokenizer
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.344 -> 1.345
# pre-process.c 1.62 -> 1.63
# Makefile 1.19 -> 1.20
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/27 ryan@xxxxxxxxxxxxxx 1.345
# This update (hopefully) will allow 'check' to find the appropriate, gcc-local
# include headers (dependent, of course, upon the system it was built on)
#
# It's still a hack, but at least it will work in a few more places.
# --------------------------------------------
#
diff -Nru a/Makefile b/Makefile
--- a/Makefile Tue May 27 05:10:56 2003
+++ b/Makefile Tue May 27 05:10:56 2003
@@ -32,7 +32,7 @@
expression.o: $(LIB_H)
lib.o: $(LIB_H)
parse.o: $(LIB_H)
-pre-process.o: $(LIB_H)
+pre-process.o: $(LIB_H) pre-process.h
scope.o: $(LIB_H)
show-parse.o: $(LIB_H)
symbol.o: $(LIB_H)
@@ -40,5 +40,8 @@
test-parsing.o: $(LIB_H)
tokenize.o: $(LIB_H)

+pre-process.h:
+ echo "#define GCC_INTERNAL_INCLUDE \"`gcc -print-file-name=include`\"" > pre-process.h
+
clean:
- rm -f *.[oasi] core core.[0-9]* $(PROGRAMS)
+ rm -f *.[oasi] core core.[0-9]* $(PROGRAMS) pre-process.h
diff -Nru a/pre-process.c b/pre-process.c
--- a/pre-process.c Tue May 27 05:10:56 2003
+++ b/pre-process.c Tue May 27 05:10:56 2003
@@ -18,6 +18,7 @@
#include <fcntl.h>
#include <limits.h>

+#include "pre-process.h"
#include "lib.h"
#include "parse.h"
#include "token.h"
@@ -47,6 +48,7 @@
const char *gcc_includepath[] = {
"/usr/lib/gcc-lib/i386-redhat-linux/3.2.1/include",
"/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include",
+ GCC_INTERNAL_INCLUDE,
NULL
};


--

Ryan Anderson
sometimes Pug Majere
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/