Index: gcc/gcc/Makefile.in =================================================================== --- gcc.orig/gcc/Makefile.in 2010-07-21 20:09:20.471160100 +0200 +++ gcc/gcc/Makefile.in 2010-07-21 21:19:04.099455400 +0200 @@ -366,6 +366,9 @@ USER_H = $(srcdir)/ginclude/float.h \ $(srcdir)/ginclude/stdfix.h \ $(EXTRA_HEADERS) +USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre_list@ +USER_H_INC_NEXT_POST = @user_headers_inc_next_post_list@ + UNWIND_H = $(srcdir)/unwind-generic.h # The GCC to use for compiling crt*.o. @@ -4014,6 +4017,21 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) chmod a+r include/$$realfile; \ fi; \ done + for file in .. $(USER_H_INC_NEXT_PRE); do \ + if [ X$$file != X.. ]; then \ + mv include/$$file include/x_$$file; \ + echo "#include_next <$$file>" >include/$$file; \ + cat include/x_$$file >>include/$$file; \ + rm -f include/x_$$file; \ + chmod a+r include/$$file; \ + fi; \ + done + for file in .. $(USER_H_INC_NEXT_POST); do \ + if [ X$$file != X.. ]; then \ + echo "#include_next <$$file>" >>include/$$file; \ + chmod a+r include/$$file; \ + fi; \ + done rm -f include/unwind.h cp $(UNWIND_H) include/unwind.h chmod a+r include/unwind.h Index: gcc/gcc/config.gcc =================================================================== --- gcc.orig/gcc/config.gcc 2010-07-21 20:09:20.376160100 +0200 +++ gcc/gcc/config.gcc 2010-07-21 20:33:43.484845200 +0200 @@ -101,6 +101,12 @@ # extra_headers List of used header files from the directory # config/${cpu_type}. # +# user_headers_inc_next_pre +# List of header file names of internal gcc header +# files, which should be prefixed by an include_next. +# user_headers_inc_next_post +# List of header file names of internal gcc header +# files, which should be postfixed by an include_next. # use_gcc_tgmath If set, add tgmath.h to the list of used header # files. # @@ -171,6 +177,8 @@ out_file= tmake_file= extra_headers= +user_headers_inc_next_pre= +user_headers_inc_next_post= use_gcc_tgmath=yes use_gcc_stdint=none extra_passes= @@ -1376,9 +1384,11 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) *) ;; esac + user_headers_inc_next_post="${user_headers_inc_next_post} float.h" # This makes the logic if mingw's or the w64 feature set has to be used case ${target} in *-w64-*) + user_headers_inc_next_pre="${user_headers_inc_next_pre} stddef.h stdarg.h" tm_file="${tm_file} i386/mingw-w64.h" if test x$enable_targets = xall; then tm_defines="${tm_defines} TARGET_BI_ARCH=1" Index: gcc/gcc/configure =================================================================== --- gcc.orig/gcc/configure 2010-07-21 20:09:20.412160100 +0200 +++ gcc/gcc/configure 2010-07-21 20:36:04.899933600 +0200 @@ -646,6 +646,8 @@ extra_passes extra_parts extra_objs extra_headers_list +user_headers_inc_next_post_list +user_headers_inc_next_pre_list extra_gcc_objs TM_MULTILIB_EXCEPTIONS_CONFIG TM_MULTILIB_CONFIG @@ -10263,6 +10265,12 @@ then tm_file=$cpu_type/$cpu_type.h; fi if test x"$extra_headers" = x then extra_headers=; fi +if test x"$user_headers_inc_next_pre" = x +then user_headers_inc_next_pre=; fi + +if test x"$user_headers_inc_next_post" = x +then user_headers_inc_next_post=; fi + if test x$md_file = x then md_file=$cpu_type/$cpu_type.md; fi @@ -11003,6 +11011,16 @@ if test x"$use_gcc_tgmath" = xyes then extra_headers_list="${extra_headers_list} \$(srcdir)/ginclude/tgmath.h" fi +# Expand user_headers_inc_next_pre to user_headers_inc_next_pre_list +for file in ${user_headers_inc_next_pre} ; do + user_headers_inc_next_pre_list="${user_headers_inc_next_pre_list} ${file}" +done + +# Expand user_headers_inc_next_post to user_headers_inc_next_post_list +for file in ${user_headers_inc_next_post} ; do + user_headers_inc_next_post_list="${user_headers_inc_next_post_list} ${file}" +done + # Define collect2 in Makefile. case $host_can_use_collect2 in no) collect2= ;; @@ -17107,7 +17125,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17110 "configure" +#line 17128 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17213,7 +17231,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17216 "configure" +#line 17234 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -25394,6 +25412,8 @@ fi + + Index: gcc/gcc/configure.ac =================================================================== --- gcc.orig/gcc/configure.ac 2010-07-21 20:09:20.413160100 +0200 +++ gcc/gcc/configure.ac 2010-07-21 20:29:56.109840100 +0200 @@ -1235,6 +1235,12 @@ then tm_file=$cpu_type/$cpu_type.h; fi if test x"$extra_headers" = x then extra_headers=; fi +if test x"$user_headers_inc_next_pre" = x +then user_headers_inc_next_pre=; fi + +if test x"$user_headers_inc_next_post" = x +then user_headers_inc_next_post=; fi + if test x$md_file = x then md_file=$cpu_type/$cpu_type.md; fi @@ -1823,6 +1829,16 @@ if test x"$use_gcc_tgmath" = xyes then extra_headers_list="${extra_headers_list} \$(srcdir)/ginclude/tgmath.h" fi +# Expand user_headers_inc_next_pre to user_headers_inc_next_pre_list +for file in ${user_headers_inc_next_pre} ; do + user_headers_inc_next_pre_list="${user_headers_inc_next_pre_list} ${file}" +done + +# Expand user_headers_inc_next_post to user_headers_inc_next_post_list +for file in ${user_headers_inc_next_post} ; do + user_headers_inc_next_post_list="${user_headers_inc_next_post_list} ${file}" +done + # Define collect2 in Makefile. case $host_can_use_collect2 in no) collect2= ;; @@ -4499,6 +4515,8 @@ AC_SUBST(TM_ENDIAN_CONFIG) AC_SUBST(TM_MULTILIB_CONFIG) AC_SUBST(TM_MULTILIB_EXCEPTIONS_CONFIG) AC_SUBST(extra_gcc_objs) +AC_SUBST(user_headers_inc_next_pre_list) +AC_SUBST(user_headers_inc_next_post_list) AC_SUBST(extra_headers_list) AC_SUBST(extra_objs) AC_SUBST(extra_parts)