Translate built-in include paths for sysroot.
authorHan Shen <shenhan@gcc.gnu.org>
Fri, 6 Jan 2012 00:14:32 +0000 (00:14 +0000)
committerHan Shen <shenhan@gcc.gnu.org>
Fri, 6 Jan 2012 00:14:32 +0000 (00:14 +0000)
  gcc/
  * Makefile.in (gcc_gxx_include_dir_add_sysroot): New.
  (PREPROCESSOR_DEFINES): Define GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT.

  * cppdefault.c (cpp_include_defaults): Replace hard coded "0" with
  GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT for "add_sysroot" field.

  * configure.ac (AC_SUBST): Add gcc_gxx_include_dir_add_sysroot to
  control whether sysroot should be prepended to gxx include dir.

  * configure: Regenerate.

From-SVN: r182938

gcc/ChangeLog
gcc/Makefile.in
gcc/configure
gcc/configure.ac
gcc/cppdefault.c

index 53d2c84990af270fb38b4b1fbb49cc1fd10d2c4d..5742ae68ebeda3754592ee2962bde96009118ab6 100644 (file)
@@ -1,3 +1,17 @@
+2012-01-06  Han Shen  <shenhan@google.com>
+
+       Translate built-in include paths for sysroot.
+       * Makefile.in (gcc_gxx_include_dir_add_sysroot): New.
+       (PREPROCESSOR_DEFINES): Define GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT.
+
+       * cppdefault.c (cpp_include_defaults): Replace hard coded "0" with
+       GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT for "add_sysroot" field.
+
+       * configure.ac (AC_SUBST): Add gcc_gxx_include_dir_add_sysroot to
+       control whether sysroot should be prepended to gxx include dir.
+
+       * configure: Regenerate.
+
 2012-01-06  Torvald Riegel  <triegel@redhat.com>
 
        PR rtl-optimization/51771
@@ -50,6 +64,7 @@
        * cfgloopmanip.c (remove_path): Walk loop hiearchy upwards when
        unlooping loops.
 
+>>>>>>> .r182937
 2012-01-05  Richard Guenther  <rguenther@suse.de>
 
        PR lto/50490
index 33e156962933f3e5c3cdf87c5e52469462f3bbde..a03bb9366bc4a5ec8f5b2afc3f96d06f7920486c 100644 (file)
@@ -615,6 +615,7 @@ gcc_tooldir = @gcc_tooldir@
 build_tooldir = $(exec_prefix)/$(target_noncanonical)
 # Directory in which the compiler finds target-independent g++ includes.
 gcc_gxx_include_dir = @gcc_gxx_include_dir@
+gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@
 # Directory to search for site-specific includes.
 local_includedir = $(local_prefix)/include
 includedir = $(prefix)/include
@@ -3980,6 +3981,7 @@ PREPROCESSOR_DEFINES = \
   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
   -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+  -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
index ba6156f0087d7682b48650ed56264acc6ee97944..4dd9faa335f39d904b0f773ce1a3cb8dedd7f176 100755 (executable)
@@ -637,6 +637,7 @@ host_xm_defines
 host_xm_include_list
 host_xm_file_list
 host_exeext
+gcc_gxx_include_dir_add_sysroot
 gcc_gxx_include_dir
 gcc_config_arguments
 float_h_file
@@ -3313,6 +3314,15 @@ if test x${gcc_gxx_include_dir} = x; then
   fi
 fi
 
+gcc_gxx_include_dir_add_sysroot=0
+if test "${with_sysroot+set}" = set; then
+  gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+  if test "${gcc_gxx_without_sysroot}"; then
+    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
+    gcc_gxx_include_dir_add_sysroot=1
+  fi
+fi
+
 
 # Check whether --with-cpp_install_dir was given.
 if test "${with_cpp_install_dir+set}" = set; then :
@@ -18106,7 +18116,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18109 "configure"
+#line 18119 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18212,7 +18222,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18215 "configure"
+#line 18225 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -27052,6 +27062,7 @@ fi
 
 
 
+
 
 
 # Echo link setup.
index 12492ff1fe50fc30c1ac8ebe7d6769970790bf1d..ffe7148e5dfb5b25d471c52ca672527bdbb08b37 100644 (file)
@@ -145,6 +145,15 @@ if test x${gcc_gxx_include_dir} = x; then
   fi
 fi
 
+gcc_gxx_include_dir_add_sysroot=0
+if test "${with_sysroot+set}" = set; then
+  gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+  if test "${gcc_gxx_without_sysroot}"; then
+    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
+    gcc_gxx_include_dir_add_sysroot=1
+  fi
+fi
+
 AC_ARG_WITH(cpp_install_dir,
 [AC_HELP_STRING([--with-cpp-install-dir=DIR],
                 [install the user visible C preprocessor in DIR
@@ -4927,6 +4936,7 @@ AC_SUBST(extra_programs)
 AC_SUBST(float_h_file)
 AC_SUBST(gcc_config_arguments)
 AC_SUBST(gcc_gxx_include_dir)
+AC_SUBST(gcc_gxx_include_dir_add_sysroot)
 AC_SUBST(host_exeext)
 AC_SUBST(host_xm_file_list)
 AC_SUBST(host_xm_include_list)
index 099899a7726090d5894a44b79c1ecb5b440fed90..927083e939dfc5625c8594a4bc930859b253a13a 100644 (file)
@@ -44,15 +44,18 @@ const struct default_include cpp_include_defaults[]
 = {
 #ifdef GPLUSPLUS_INCLUDE_DIR
     /* Pick up GNU C++ generic include files.  */
-    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
+    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
+      GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
 #endif
 #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
     /* Pick up GNU C++ target-dependent include files.  */
-    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 },
+    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
+      GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
 #endif
 #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
     /* Pick up GNU C++ backward and deprecated include files.  */
-    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
+    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
+      GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
 #endif
 #ifdef GCC_INCLUDE_DIR
     /* This is the dir for gcc's private headers.  */