aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Anderson <ryan@michonline.com>2003-05-27 08:57:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:45 -0700
commita2a8b9030ee009e83219c3ba783a8108cfca7b28 (patch)
tree862676a3a04c8bc871d52eecc72074c7ab522100
parentbb5b108c342b889b404577badc907f7b84842e5d (diff)
downloadsparse-a2a8b9030ee009e83219c3ba783a8108cfca7b28.tar.gz
sparse-a2a8b9030ee009e83219c3ba783a8108cfca7b28.tar.xz
sparse-a2a8b9030ee009e83219c3ba783a8108cfca7b28.zip
[PATCH] Get gcc internal header files path from gcc itself
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.
-rw-r--r--Makefile7
-rw-r--r--pre-process.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index fb47d21..7d56a18 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ evaluate.o: $(LIB_H)
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-lexing.o: $(LIB_H)
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 --git a/pre-process.c b/pre-process.c
index ce00a86..173904d 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -18,6 +18,7 @@
#include <fcntl.h>
#include <limits.h>
+#include "pre-process.h"
#include "lib.h"
#include "parse.h"
#include "token.h"
@@ -45,8 +46,7 @@ const char *sys_includepath[] = {
};
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
};