Index: doc/fragments.texi
===================================================================
--- doc/fragments.texi	(revision 179696)
+++ doc/fragments.texi	(working copy)
@@ -1,5 +1,6 @@
 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-@c 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
+@c 1999, 2000, 2001, 2003, 2004, 2005, 2008, 2011
+@c Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
@@ -128,12 +129,6 @@ compiler.  In that case, set @code{MULTI
 of options to be used for all builds.  If you set this, you should
 probably set @code{CRTSTUFF_T_CFLAGS} to a dash followed by it.
 
-@findex NATIVE_SYSTEM_HEADER_DIR
-@item NATIVE_SYSTEM_HEADER_DIR
-If the default location for system headers is not @file{/usr/include},
-you must set this to the directory containing the headers.  This value
-should match the value of the @code{SYSTEM_INCLUDE_DIR} macro.
-
 @findex SPECS
 @item SPECS
 Unfortunately, setting @code{MULTILIB_EXTRA_OPTS} is not enough, since
Index: doc/tm.texi.in
===================================================================
--- doc/tm.texi.in	(revision 179696)
+++ doc/tm.texi.in	(working copy)
@@ -468,33 +468,15 @@ initialize the necessary environment var
 Define this macro as a C string constant if you wish to override the
 standard choice of @file{/usr/local/include} as the default prefix to
 try when searching for local header files.  @code{LOCAL_INCLUDE_DIR}
-comes before @code{SYSTEM_INCLUDE_DIR} in the search order.
+comes before @code{NATIVE_SYSTEM_HEADER_DIR} (set in
+@file{config.gcc}, normally @file{/usr/include}) in the search order.
 
 Cross compilers do not search either @file{/usr/local/include} or its
 replacement.
 @end defmac
 
-@defmac SYSTEM_INCLUDE_DIR
-Define this macro as a C string constant if you wish to specify a
-system-specific directory to search for header files before the standard
-directory.  @code{SYSTEM_INCLUDE_DIR} comes before
-@code{STANDARD_INCLUDE_DIR} in the search order.
-
-Cross compilers do not use this macro and do not search the directory
-specified.
-@end defmac
-
-@defmac STANDARD_INCLUDE_DIR
-Define this macro as a C string constant if you wish to override the
-standard choice of @file{/usr/include} as the default prefix to
-try when searching for header files.
-
-Cross compilers ignore this macro and do not search either
-@file{/usr/include} or its replacement.
-@end defmac
-
-@defmac STANDARD_INCLUDE_COMPONENT
-The ``component'' corresponding to @code{STANDARD_INCLUDE_DIR}.
+@defmac NATIVE_SYSTEM_HEADER_COMPONENT
+The ``component'' corresponding to @code{NATIVE_SYSTEM_HEADER_DIR}.
 See @code{INCLUDE_DEFAULTS}, below, for the description of components.
 If you do not define this macro, no component is used.
 @end defmac
@@ -503,8 +485,8 @@ If you do not define this macro, no comp
 Define this macro if you wish to override the entire default search path
 for include files.  For a native compiler, the default search path
 usually consists of @code{GCC_INCLUDE_DIR}, @code{LOCAL_INCLUDE_DIR},
-@code{SYSTEM_INCLUDE_DIR}, @code{GPLUSPLUS_INCLUDE_DIR}, and
-@code{STANDARD_INCLUDE_DIR}.  In addition, @code{GPLUSPLUS_INCLUDE_DIR}
+@code{GPLUSPLUS_INCLUDE_DIR}, and
+@code{NATIVE_SYSTEM_HEADER_DIR}.  In addition, @code{GPLUSPLUS_INCLUDE_DIR}
 and @code{GCC_INCLUDE_DIR} are defined automatically by @file{Makefile},
 and specify private search areas for GCC@.  The directory
 @code{GPLUSPLUS_INCLUDE_DIR} is used only for C++ programs.
Index: doc/install.texi
===================================================================
--- doc/install.texi	(revision 179696)
+++ doc/install.texi	(working copy)
@@ -903,6 +903,14 @@ ideas of what it is for.  People use it 
 install part of GCC@.  Perhaps they make this assumption because
 installing GCC creates the directory.
 
+@item --with-native-system-header-dir=@var{dirname}
+Specifies that @var{dirname} is the directory that contains native system
+header files, rather than @file{/usr/include}.  This option is most useful
+if you are creating a compiler that should be isolated from the system
+as much as possible.  It is most commonly used with the
+@option{--with-sysroot} option and will cause GCC to search
+@var{dirname} inside the system root specified by that option.
+
 @item --enable-shared[=@var{package}[,@dots{}]]
 Build shared versions of libraries, if shared libraries are supported on
 the target platform.  Unlike GCC 2.95.x and earlier, shared libraries
@@ -1736,6 +1744,10 @@ target libraries (which runs on the buil
 installed with @code{make install}; it does not affect the compiler which is
 used to build GCC itself.
 
+If you specify the @option{--with-native-system-header-dir=@var{dirname}}
+option then the compiler will search that directory within @var{dirname} for
+native system headers rather than the default @file{/usr/include}.
+
 @item --with-build-sysroot
 @itemx --with-build-sysroot=@var{dir}
 Tells GCC to consider @var{dir} as the system root (see
@@ -1750,6 +1762,10 @@ This option affects the system root for 
 target libraries (which runs on the build system); it does not affect
 the compiler which is used to build GCC itself.
 
+If you specify the @option{--with-native-system-header-dir=@var{dirname}}
+option then the compiler will search that directory within @var{dirname} for
+native system headers rather than the default @file{/usr/include}.
+
 @item --with-headers
 @itemx --with-headers=@var{dir}
 Deprecated in favor of @option{--with-sysroot}.
Index: configure.ac
===================================================================
--- configure.ac	(revision 179696)
+++ configure.ac	(working copy)
@@ -725,6 +725,19 @@ AC_ARG_ENABLE(shared,
 ], [enable_shared=yes])
 AC_SUBST(enable_shared)
 
+AC_ARG_WITH([native-system-header-dir],
+  [  --with-native-system-header-dir=dir
+                          use dir as the directory to look for standard
+                          system header files in.  Defaults to /usr/include.],
+[
+ case ${with_native_system_header_dir} in
+ yes|no) AC_MSG_ERROR([bad value ${withval} given for --with-native-system-header-dir]) ;;
+ /*) ;;
+ *) AC_MSG_ERROR([--with-native-system-header-dir argument ${withval} must be an absolute directory]) ;;
+ esac
+ configured_native_system_header_dir="${withval}"
+], [configured_native_system_header_dir=])
+
 AC_ARG_WITH(build-sysroot, 
   [AS_HELP_STRING([--with-build-sysroot=sysroot],
                   [use sysroot as the system root during the build])],
@@ -1331,6 +1344,12 @@ if test "$host_xm_file" != "$build_xm_fi
 	fi
 fi
 
+if test -n "$configured_native_system_header_dir"; then
+  native_system_header_dir=$configured_native_system_header_dir
+fi
+NATIVE_SYSTEM_HEADER_DIR="$native_system_header_dir"
+AC_SUBST(NATIVE_SYSTEM_HEADER_DIR)
+
 case ${host} in
   powerpc*-*-darwin*)
     AC_CACHE_CHECK([whether mcontext_t fields have underscores],
@@ -4517,14 +4536,14 @@ if test x$host != x$target || test "x$TA
   elif test "x$with_sysroot" = x; then
     target_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
   elif test "x$with_build_sysroot" != "x"; then
-    target_header_dir="${with_build_sysroot}/usr/include"
+    target_header_dir="${with_build_sysroot}${native_system_header_dir}"
   elif test "x$with_sysroot" = xyes; then
-    target_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
+    target_header_dir="${exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"
   else
-    target_header_dir="${with_sysroot}/usr/include"
+    target_header_dir="${with_sysroot}${native_system_header_dir}"
   fi
 else
-  target_header_dir=/usr/include
+  target_header_dir=${native_system_header_dir}
 fi
 
 # Test for stack protector support in target C library.
Index: cppdefault.c
===================================================================
--- cppdefault.c	(revision 179696)
+++ cppdefault.c	(working copy)
@@ -1,6 +1,7 @@
 /* CPP Library.
    Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2003, 2004, 2006, 2007, 2010 Free Software Foundation, Inc.
+   1999, 2000, 2003, 2004, 2006, 2007, 2010, 2011
+   Free Software Foundation, Inc.
    Contributed by Per Bothner, 1994-95.
    Based on CCCP program by Paul Rubin, June 1986
    Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -25,18 +26,12 @@
 #include "tm.h"
 #include "cppdefault.h"
 
-#ifndef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "/usr/include"
-#endif
-
-#ifndef STANDARD_INCLUDE_COMPONENT
-#define STANDARD_INCLUDE_COMPONENT 0
+#ifndef NATIVE_SYSTEM_HEADER_COMPONENT
+#define NATIVE_SYSTEM_HEADER_COMPONENT 0
 #endif
 
 #if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
 # undef LOCAL_INCLUDE_DIR
-# undef SYSTEM_INCLUDE_DIR
-# undef STANDARD_INCLUDE_DIR
 #else
 # undef CROSS_INCLUDE_DIR
 #endif
@@ -89,14 +84,8 @@ const struct default_include cpp_include
     /* Another place the target system's headers might be.  */
     { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
 #endif
-#ifdef SYSTEM_INCLUDE_DIR
-    /* Some systems have an extra dir of include files.  */
-    { SYSTEM_INCLUDE_DIR, 0, 0, 0, 1, 0 },
-#endif
-#ifdef STANDARD_INCLUDE_DIR
     /* /usr/include comes dead last.  */
-    { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1, 0 },
-#endif
+    { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
     { 0, 0, 0, 0, 0, 0 }
   };
 #endif /* no INCLUDE_DEFAULTS */
@@ -136,4 +125,3 @@ cpp_relocated (void)
 
   return relocated;
 }
-
Index: system.h
===================================================================
--- system.h	(revision 179696)
+++ system.h	(working copy)
@@ -867,7 +867,8 @@ extern void fancy_abort (const char *, i
 	FUNCTION_INCOMING_ARG IRA_COVER_CLASSES TARGET_VERSION		   \
 	MACHINE_TYPE TARGET_HAS_TARGETCM ASM_OUTPUT_BSS			   \
 	SETJMP_VIA_SAVE_AREA FORBIDDEN_INC_DEC_CLASSES			   \
-	PREFERRED_OUTPUT_RELOAD_CLASS
+	PREFERRED_OUTPUT_RELOAD_CLASS SYSTEM_INCLUDE_DIR		   \
+	STANDARD_INCLUDE_DIR STANDARD_INCLUDE_COMPONENT
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
Index: config.gcc
===================================================================
--- config.gcc	(revision 179696)
+++ config.gcc	(working copy)
@@ -186,6 +186,13 @@
 #  configure_default_options
 #			Set to an initializer for configure_default_options
 #			in configargs.h, based on --with-cpu et cetera.
+#
+#  native_system_header_dir
+#			Where system header files are found for this
+#			target.  This defaults to /usr/include.  If
+#			the --with-sysroot configure option or the
+#			--sysroot command line option is used this
+#			will be relative to the sysroot.
 
 # The following variables are used in each case-construct to build up the
 # outgoing variables:
@@ -238,6 +245,7 @@ default_gnu_indirect_function=no
 target_gtfiles=
 need_64bit_hwint=
 need_64bit_isa=
+native_system_header_dir=/usr/include
 
 # Don't carry these over build->host->target.  Please.
 xm_file=
@@ -596,7 +604,8 @@ case ${target} in
     *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-kopensolaris*-gnu)
       :;;
     *-*-gnu*)
-      tmake_file="$tmake_file t-gnu";;
+      native_system_header_dir=/include
+      ;;
   esac
   # glibc / uclibc / bionic switch.
   # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
@@ -1370,7 +1379,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu
 i[34567]86-pc-msdosdjgpp*)
 	xm_file=i386/xm-djgpp.h
 	tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
-	tmake_file="${tmake_file} i386/t-djgpp"
+	native_system_header_dir=/dev/env/DJDIR/include
 	extra_options="${extra_options} i386/djgpp.opt"
 	gnu_ld=yes
 	gas=yes
@@ -1540,6 +1549,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
                		tmake_file="${tmake_file} i386/t-mingw32"
                      	;;
 	esac
+        native_system_header_dir=/mingw/include
 	target_gtfiles="\$(srcdir)/config/i386/winnt.c"
 	extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
 	case ${target} in
@@ -2563,6 +2573,7 @@ sparc64-*-openbsd*)
 spu-*-elf*)
 	tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h newlib-stdint.h"
 	tmake_file="spu/t-spu-elf"
+        native_system_header_dir=/include
 	extra_headers="spu_intrinsics.h spu_internals.h vmx2spu.h spu_mfcio.h vec_types.h spu_cache.h"
 	extra_modes=spu/spu-modes.def
 	c_target_objs="${c_target_objs} spu-c.o"
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 179696)
+++ Makefile.in	(working copy)
@@ -455,7 +455,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../inclu
 LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
 
 # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-NATIVE_SYSTEM_HEADER_DIR = /usr/include
+NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
 CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
 
@@ -4074,6 +4074,7 @@ PREPROCESSOR_DEFINES = \
   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
+  -DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\" \
   -DPREFIX=\"$(prefix)/\" \
   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
   @TARGET_SYSTEM_ROOT_DEFINE@
Index: config/spu/t-spu-elf
===================================================================
--- config/spu/t-spu-elf	(revision 179696)
+++ config/spu/t-spu-elf	(working copy)
@@ -15,10 +15,6 @@
 #  along with GCC; see the file COPYING3.  If not see
 #  <http://www.gnu.org/licenses/>.
 
-# Define system directory to match STANDARD_INCLUDE_DIR in spu-elf.h,
-# allowing combined SPU/PPU sysroot builds.
-NATIVE_SYSTEM_HEADER_DIR = /include
-
 # Suppress building libgcc1.a
 LIBGCC1 =
 CROSS_LIBGCC1 =
Index: config/spu/spu-elf.h
===================================================================
--- config/spu/spu-elf.h	(revision 179696)
+++ config/spu/spu-elf.h	(working copy)
@@ -35,10 +35,6 @@
 #undef STANDARD_STARTFILE_PREFIX_2
 #define STANDARD_STARTFILE_PREFIX_2 ""
 
-/* Use "/include" instead of "/usr/include".  */
-#undef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "/include"
-
 /* We do not provide any "/usr/local/include" directory on SPU.  */
 #undef LOCAL_INCLUDE_DIR
 
@@ -77,4 +73,3 @@
       mcache-size=16 :-lgcc_cache16k; \
       mcache-size=8  :-lgcc_cache8k; \
                      :-lgcc_cache64k}"
-
Index: config/i386/t-mingw-w64
===================================================================
--- config/i386/t-mingw-w64	(revision 179696)
+++ config/i386/t-mingw-w64	(working copy)
@@ -1,6 +1,3 @@
-# Match SYSTEM_INCLUDE_DIR
-NATIVE_SYSTEM_HEADER_DIR = /mingw/include
-
 MULTILIB_OPTIONS = m64/m32
 MULTILIB_DIRNAMES = 64 32
 MULTILIB_OSDIRNAMES = ../lib ../lib32
Index: config/i386/djgpp.h
===================================================================
--- config/i386/djgpp.h	(revision 179696)
+++ config/i386/djgpp.h	(working copy)
@@ -48,10 +48,6 @@ along with GCC; see the file COPYING3.  
 /* We override default /usr or /usr/local part with /dev/env/DJDIR which */
 /* points to actual DJGPP installation directory.  */
 
-/* Standard include directory */
-#undef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "/dev/env/DJDIR/include/"
-
 /* Search for as.exe and ld.exe in DJGPP's binary directory.  */ 
 #undef MD_EXEC_PREFIX
 #define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
Index: config/i386/t-djgpp
===================================================================
--- config/i386/t-djgpp	(revision 179696)
+++ config/i386/t-djgpp	(working copy)
@@ -1,2 +0,0 @@
-# Location of DJGPP's header directory.
-NATIVE_SYSTEM_HEADER_DIR=$(DJDIR)/include
Index: config/i386/t-mingw32
===================================================================
--- config/i386/t-mingw32	(revision 179696)
+++ config/i386/t-mingw32	(working copy)
@@ -1,5 +1,2 @@
-# Match SYSTEM_INCLUDE_DIR
-NATIVE_SYSTEM_HEADER_DIR = /mingw/include
-
 # MinGW-specific parts of LIB_SPEC
 SHLIB_LC = -lmingwthrd -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
Index: config/i386/t-mingw-w32
===================================================================
--- config/i386/t-mingw-w32	(revision 179696)
+++ config/i386/t-mingw-w32	(working copy)
@@ -1,6 +1,3 @@
-# Match SYSTEM_INCLUDE_DIR
-NATIVE_SYSTEM_HEADER_DIR = /mingw/include
-
 MULTILIB_OPTIONS = m64/m32
 MULTILIB_DIRNAMES = 64 32
 MULTILIB_OSDIRNAMES = ../lib64 ../lib
Index: config/i386/mingw32.h
===================================================================
--- config/i386/mingw32.h	(revision 179696)
+++ config/i386/mingw32.h	(working copy)
@@ -78,12 +78,8 @@ along with GCC; see the file COPYING3.  
 #define SUB_LINK_ENTRY SUB_LINK_ENTRY32
 #endif
 
-/* Override the standard choice of /usr/include as the default prefix
-   to try when searching for header files.  */
-#undef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "/mingw/include"
-#undef STANDARD_INCLUDE_COMPONENT
-#define STANDARD_INCLUDE_COMPONENT "MINGW"
+#undef NATIVE_HEADER_HEADER_COMPONENT
+#define NATIVE_SYSTEM_HEADER_COMPONENT "MINGW"
 
 #undef CPP_SPEC
 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} " \
@@ -235,4 +231,3 @@ do {						         \
 
 /* We should find a way to not have to update this manually.  */
 #define LIBGCJ_SONAME "libgcj" /*LIBGCC_EH_EXTN*/ "-12.dll"
-
Index: config/t-gnu
===================================================================
--- config/t-gnu	(revision 179696)
+++ config/t-gnu	(working copy)
@@ -1,2 +0,0 @@
-# In GNU, "/usr" is a four-letter word.
-NATIVE_SYSTEM_HEADER_DIR = /include
Index: config/vms/xm-vms.h
===================================================================
--- config/vms/xm-vms.h	(revision 179696)
+++ config/vms/xm-vms.h	(working copy)
@@ -1,6 +1,6 @@
 /* Configuration for GCC for hosting on VMS
    using a Unix style C library.
-   Copyright (C) 1996, 1997, 2001, 2004, 2007, 2009
+   Copyright (C) 1996, 1997, 2001, 2004, 2007, 2009, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -55,4 +55,3 @@ do                                      
 
 #define STANDARD_EXEC_PREFIX "/gnu/libexec/gcc/"
 #define STANDARD_STARTFILE_PREFIX "/gnu/lib/"
-#define STANDARD_INCLUDE_DIR "/gnu/include"
Index: config/gnu.h
===================================================================
--- config/gnu.h	(revision 179696)
+++ config/gnu.h	(working copy)
@@ -28,10 +28,6 @@ along with GCC.  If not, see <http://www
 #undef LIB_SPEC
 #define LIB_SPEC "%{pthread:-lpthread} %{pg|p|profile:-lc_p;:-lc}"
 
-/* Standard include directory.  In GNU, "/usr" is a four-letter word.  */
-#undef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "/include"
-
 #undef GNU_USER_TARGET_OS_CPP_BUILTINS
 #define GNU_USER_TARGET_OS_CPP_BUILTINS()		\
     do {					\
Index: config/openbsd.h
===================================================================
--- config/openbsd.h	(revision 179696)
+++ config/openbsd.h	(working copy)
@@ -1,5 +1,5 @@
 /* Base configuration file for all OpenBSD targets.
-   Copyright (C) 1999, 2000, 2004, 2005, 2007, 2009, 2010
+   Copyright (C) 1999, 2000, 2004, 2005, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -59,7 +59,7 @@ along with GCC; see the file COPYING3.  
     { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },	\
     { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 }, \
     { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 }, \
-    { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 }, \
+    { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0 }, \
     { 0, 0, 0, 0 }				\
   }
 
