===================================================================
@@ -874,6 +874,18 @@ 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.
+
+Please note that for certain targets, such as DJGPP, this value is
+ignored. If the target specifies a default value for native system
+header files then this option is ignored.
+
@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
@@ -1686,6 +1698,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} option
+then the compiler will search that directory within @var{dir} 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
@@ -1700,6 +1716,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} option
+then the compiler will search that directory within @var{dir} 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}.
===================================================================
@@ -759,6 +759,7 @@ CONFIGURE_SPECS
CROSS_SYSTEM_HEADER_DIR
TARGET_SYSTEM_ROOT_DEFINE
TARGET_SYSTEM_ROOT
+NATIVE_SYSTEM_HEADER_DIR
enable_shared
enable_fixed_point
enable_decimal_float
@@ -879,6 +880,7 @@ enable_tls
enable_objc_gc
with_dwarf2
enable_shared
+with_native_system_header_dir
with_build_sysroot
with_sysroot
with_specs
@@ -1643,6 +1645,9 @@ Optional Packages:
--with-as arrange to use the specified as (full pathname)
--with-stabs arrange to use stabs instead of host debug format
--with-dwarf2 force the default debug format to be DWARF 2
+ --with-native-system-header-dir=dir
+ use dir as the directory to look for standard
+ system header files in. Defaults to /usr/include.
--with-build-sysroot=sysroot
use sysroot as the system root during the build
--with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR.
@@ -7057,6 +7062,27 @@ fi
+# The use of native_system_header_dir here is for the value (optionally)
+# configured here. Uses of NATIVE_SYSTEM_HEADER_DIR in this file refer
+# to the make variable defined in Makefile or in target make fragments.
+
+# Check whether --with-native-system-header-dir was given.
+if test "${with_native_system_header_dir+set}" = set; then :
+ withval=$with_native_system_header_dir;
+ case ${with_native_system_header_dir} in
+ yes|no) as_fn_error "bad value ${withval} given for native system include directory" "$LINENO" 5 ;;
+ /*) ;;
+ *) as_fn_error "${withval} should be an absolute directory" "$LINENO" 5 ;;
+ esac
+ native_system_header_dir="${withval}"
+
+else
+ native_system_header_dir=/usr/include
+fi
+
+NATIVE_SYSTEM_HEADER_DIR=$native_system_header_dir
+
+
# Check whether --with-build-sysroot was given.
if test "${with_build_sysroot+set}" = set; then :
@@ -17513,7 +17539,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17516 "configure"
+#line 17542 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17619,7 +17645,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17622 "configure"
+#line 17648 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -25664,14 +25690,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.
===================================================================
@@ -709,6 +709,23 @@ AC_ARG_ENABLE(shared,
], [enable_shared=yes])
AC_SUBST(enable_shared)
+# The use of native_system_header_dir here is for the value (optionally)
+# configured here. Uses of NATIVE_SYSTEM_HEADER_DIR in this file refer
+# to the make variable defined in Makefile or in target make fragments.
+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 native system include directory]) ;;
+ /*) ;;
+ *) AC_MSG_ERROR([${withval} should be an absolute directory]) ;;
+ esac
+ native_system_header_dir="${withval}"
+], [native_system_header_dir=/usr/include])
+AC_SUBST(NATIVE_SYSTEM_HEADER_DIR, $native_system_header_dir)
+
AC_ARG_WITH(build-sysroot,
[ --with-build-sysroot=sysroot
use sysroot as the system root during the build])
@@ -4264,14 +4281,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.
===================================================================
@@ -440,7 +440,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@