diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 53d2c84990a..5742ae68ebe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2012-01-06 Han Shen + + 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 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 PR lto/50490 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 33e15696293..a03bb9366bc 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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)\" \ diff --git a/gcc/configure b/gcc/configure index ba6156f0087..4dd9faa335f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -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. diff --git a/gcc/configure.ac b/gcc/configure.ac index 12492ff1fe5..ffe7148e5df 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -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) diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c index 099899a7726..927083e939d 100644 --- a/gcc/cppdefault.c +++ b/gcc/cppdefault.c @@ -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. */