From: Ben Pfaff Date: Tue, 19 Jul 2005 03:59:52 +0000 (+0000) Subject: Turns out GCC 3.x support -isystem also, they just don't document it. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee87ee08ebb35df6c3f8e4b6f5c066bed072936c;p=pintos-anon Turns out GCC 3.x support -isystem also, they just don't document it. Use -isystem unconditionally instead of trying to detect support for it. --- diff --git a/src/Make.config b/src/Make.config index f9822b6..5cee541 100644 --- a/src/Make.config +++ b/src/Make.config @@ -18,21 +18,11 @@ LD = i386-elf-ld OBJCOPY = i386-elf-objcopy endif -# GCC 3.3 specifies directories for #include <> as "-I- -Idir" -# GCC 4.x specifies directories for #include <> as "-isystem dir" -# Figure out which format to use. -ifeq (0, $(shell $(CC) -v 2>&1 | grep 'gcc version 4' >/dev/null 2>&1; echo $$?)) -SYSINCFLAGS = $(patsubst %,-isystem %,$(SYSINCDIRS)) -else -SYSINCFLAGS = -I- $(patsubst %,-I%,$(SYSINCDIRS)) -endif - # Compiler and assembler invocation. DEFINES = WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers CFLAGS = -g -MMD -msoft-float -masm=intel -SYSINCDIRS = $(SRCDIR)/lib -CPPFLAGS = -nostdinc -I$(SRCDIR) $(SYSINCFLAGS) +CPPFLAGS = -nostdinc -I$(SRCDIR) -isystem $(SRCDIR)/lib ASFLAGS = -Wa,--gstabs -MMD LDFLAGS = diff --git a/src/Makefile.build b/src/Makefile.build index 2e1d6e9..d6e5b4b 100644 --- a/src/Makefile.build +++ b/src/Makefile.build @@ -9,7 +9,7 @@ include ../Make.vars include ../../tests/Make.tests # Compiler and assembler options. -os.dsk: SYSINCDIRS += $(SRCDIR)/lib/kernel +os.dsk: CPPFLAGS += -isystem $(SRCDIR)/lib/kernel # Core kernel. threads_SRC = threads/init.c # Main program. diff --git a/src/Makefile.userprog b/src/Makefile.userprog index dddb1aa..36cdcda 100644 --- a/src/Makefile.userprog +++ b/src/Makefile.userprog @@ -2,7 +2,7 @@ include $(SRCDIR)/Make.config -$(PROGS): SYSINCDIRS += $(SRCDIR)/lib/user +$(PROGS): CPPFLAGS += -isystem $(SRCDIR)/lib/user # Linker flags. $(PROGS): LDFLAGS = -nostdlib -static -Wl,-T,$(LDSCRIPT)