diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-27 20:32:13 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-27 20:32:13 +0000 |
commit | d3036f42015f11fb5b884eb0dcc2815f3de6af20 (patch) | |
tree | 3e93aea7c703d1603d74187abbc272a37ad77597 | |
parent | 197f775164c11adb179c4dbb87e92cca17b2c1f7 (diff) | |
download | gcc-d3036f42015f11fb5b884eb0dcc2815f3de6af20.tar.gz |
fixincludes:
* mkheaders.in (incdir): Use include-fixed not include.
gcc:
* Makefile.in (PREPROCESSOR_DEFINES, test-protoize-simple): Define
FIXED_INCLUDE_DIR.
(stmp-int-hdrs, stmp-fixinc, install-headers): Use include-fixed
for fixed headers and limits.h.
(install-include-dir, install-headers-tar, install-headers-cpio,
install-headers-cp, real-install-headers-tar,
real-install-headers-cpio, real-install-headers-cp): Handle
include-fixed as well as include.
(install-mkheaders): Don't install files that go only in include
not include-fixed.
* cppdefault.c (cpp_include_defaults): Separate FIXED_INCLUDE_DIR
from GCC_INCLUDE_DIR.
* gcc.c (process_command): Remove special -BstageN/ handling.
(do_spec_1): Add include-fixed directories.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122384 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | fixincludes/ChangeLog | 4 | ||||
-rw-r--r-- | fixincludes/mkheaders.in | 2 | ||||
-rw-r--r-- | gcc/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/Makefile.in | 65 | ||||
-rw-r--r-- | gcc/cppdefault.c | 6 | ||||
-rw-r--r-- | gcc/gcc.c | 27 |
6 files changed, 70 insertions, 51 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 34a63ba36c7..d870ae423c7 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,7 @@ +2007-02-27 Joseph Myers <joseph@codesourcery.com> + + * mkheaders.in (incdir): Use include-fixed not include. + 2007-02-15 Brooks Moses <brooks.moses@codesourcery.com> * Makefile.in: Added "pdf" target to .PHONY. diff --git a/fixincludes/mkheaders.in b/fixincludes/mkheaders.in index 29f27f15972..cfe826eca0a 100644 --- a/fixincludes/mkheaders.in +++ b/fixincludes/mkheaders.in @@ -77,7 +77,7 @@ libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version} itoolsdir=${libexecsubdir}/install-tools itoolsdatadir=${libsubdir}/install-tools -incdir=${libsubdir}/include +incdir=${libsubdir}/include-fixed . ${itoolsdatadir}/mkheaders.conf diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 468f90fe8d6..e154b5c128e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2007-02-27 Joseph Myers <joseph@codesourcery.com> + + * Makefile.in (PREPROCESSOR_DEFINES, test-protoize-simple): Define + FIXED_INCLUDE_DIR. + (stmp-int-hdrs, stmp-fixinc, install-headers): Use include-fixed + for fixed headers and limits.h. + (install-include-dir, install-headers-tar, install-headers-cpio, + install-headers-cp, real-install-headers-tar, + real-install-headers-cpio, real-install-headers-cp): Handle + include-fixed as well as include. + (install-mkheaders): Don't install files that go only in include + not include-fixed. + * cppdefault.c (cpp_include_defaults): Separate FIXED_INCLUDE_DIR + from GCC_INCLUDE_DIR. + * gcc.c (process_command): Remove special -BstageN/ handling. + (do_spec_1): Add include-fixed directories. + 2007-02-27 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/t-bfin-elf (LIB1ASMFUNCS): Add _umulsi3_highpart and diff --git a/gcc/Makefile.in b/gcc/Makefile.in index af7b63e0f37..75c95ca8681 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3207,6 +3207,7 @@ intl.o: intl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h Makefile PREPROCESSOR_DEFINES = \ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ + -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \ -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \ @@ -3269,6 +3270,7 @@ test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \ $(GCC_CFLAGS) $(INCLUDES) \ -DGCC_INCLUDE_DIR=0 \ + -DFIXED_INCLUDE_DIR=0 \ -DGPLUSPLUS_INCLUDE_DIR=0 \ -DCROSS_INCLUDE_DIR=0 \ -DTOOL_INCLUDE_DIR=0 \ @@ -3281,6 +3283,7 @@ test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \ $(GCC_CFLAGS) $(INCLUDES) \ -DGCC_INCLUDE_DIR=0 \ + -DFIXED_INCLUDE_DIR=0 \ -DGPLUSPLUS_INCLUDE_DIR=0 \ -DCROSS_INCLUDE_DIR=0 \ -DTOOL_INCLUDE_DIR=0 \ @@ -3317,11 +3320,11 @@ GCOV_DUMP_OBJS = gcov-dump.o version.o errors.o gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) $(LIBS) -o $@ # -# Build the include directory. The stamp files are stmp-* rather than +# Build the include directories. The stamp files are stmp-* rather than # s-* so that mostlyclean does not force the include directory to # be rebuilt. -# Build the include directory +# Build the include directories. stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h $(UNWIND_H) # Copy in the headers provided with gcc. # The sed command gets just the last file name component; @@ -3329,6 +3332,7 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h $(UNWIND_H) # Using basename would be simpler, but some systems don't have it. # The touch command is here to workaround an AIX/Linux NFS bug. -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi + -if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi for file in .. $(USER_H); do \ if [ X$$file != X.. ]; then \ realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ @@ -3338,15 +3342,15 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h $(UNWIND_H) chmod a+r include/$$realfile; \ fi; \ done - rm -f include/limits.h - cp xlimits.h include/limits.h + rm -f include-fixed/limits.h + cp xlimits.h include-fixed/limits.h + chmod a+r include-fixed/limits.h rm -f include/unwind.h cp $(UNWIND_H) include/unwind.h - chmod a+r include/limits.h # Install the README - rm -f include/README - cp $(srcdir)/../fixincludes/README-fixinc include/README - chmod a+r include/README + rm -f include-fixed/README + cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README + chmod a+r include-fixed/README $(STAMP) $@ .PHONY: install-gcc-tooldir @@ -3389,8 +3393,8 @@ stmp-fixinc: gsyslimits.h macro_list \ if test "x${SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \ then sleep 1; else exit 1; fi; \ fi - rm -rf include; mkdir include - -chmod a+rx include + rm -rf include-fixed; mkdir include-fixed + -chmod a+rx include-fixed if [ -d ../prev-gcc ]; then \ cd ../prev-gcc && \ $(MAKE) real-$(INSTALL_HEADERS_DIR) DESTDIR=`pwd`/../gcc/ \ @@ -3400,16 +3404,16 @@ stmp-fixinc: gsyslimits.h macro_list \ SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \ export TARGET_MACHINE srcdir SHELL MACRO_LIST && \ cd $(build_objdir)/fixincludes && \ - $(SHELL) ./fixinc.sh ../../gcc/include \ + $(SHELL) ./fixinc.sh ../../gcc/include-fixed \ $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \ - rm -f include/syslimits.h; \ - if [ -f include/limits.h ]; then \ - mv include/limits.h include/syslimits.h; \ + rm -f include-fixed/syslimits.h; \ + if [ -f include-fixed/limits.h ]; then \ + mv include-fixed/limits.h include-fixed/syslimits.h; \ else \ - cp $(srcdir)/gsyslimits.h include/syslimits.h; \ + cp $(srcdir)/gsyslimits.h include-fixed/syslimits.h; \ fi; \ fi - chmod a+r include/syslimits.h + chmod a+r include-fixed/syslimits.h $(STAMP) stmp-fixinc # Files related to the fixproto script. @@ -3944,14 +3948,14 @@ install-headers: $(INSTALL_HEADERS_DIR) # Fix symlinks to absolute paths in the installed include directory to # point to the installed directory, not the build directory. # Don't need to use LN_S here since we really do need ln -s and no substitutes. - -files=`cd $(DESTDIR)$(libsubdir)/include; find . -type l -print 2>/dev/null`; \ + -files=`cd $(DESTDIR)$(libsubdir)/include-fixed; find . -type l -print 2>/dev/null`; \ if [ $$? -eq 0 ]; then \ - dir=`cd include; ${PWD_COMMAND}`; \ + dir=`cd include-fixed; ${PWD_COMMAND}`; \ for i in $$files; do \ - dest=`ls -ld $(DESTDIR)$(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \ + dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \ if expr "$$dest" : "$$dir.*" > /dev/null; then \ - rm -f $(DESTDIR)$(libsubdir)/include/$$i; \ - ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include/$$i; \ + rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \ + ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \ fi; \ done; \ fi @@ -3959,8 +3963,11 @@ install-headers: $(INSTALL_HEADERS_DIR) # Create or recreate the gcc private include file directory. install-include-dir: installdirs -rm -rf $(DESTDIR)$(libsubdir)/include + -rm -rf $(DESTDIR)$(libsubdir)/include-fixed mkdir $(DESTDIR)$(libsubdir)/include + mkdir $(DESTDIR)$(libsubdir)/include-fixed -chmod a+rx $(DESTDIR)$(libsubdir)/include + -chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed # Create or recreate the install-tools include file directory. itoolsdir = $(libexecsubdir)/install-tools @@ -3977,6 +3984,8 @@ install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir # output of `cd', but some shells lose on redirection within `()'s (cd `${PWD_COMMAND}`/include ; \ tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - ) + (cd `${PWD_COMMAND}`/include-fixed ; \ + tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - ) # /bin/sh on some systems returns the status of the first tar, # and that can lose with GNU tar which always writes a full block. # So use `exit 0' to ignore its exit status. @@ -3986,33 +3995,35 @@ install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir # See discussion about the use of `pwd` above cd `${PWD_COMMAND}`/include ; \ find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include + cd `${PWD_COMMAND}`/include-fixed ; \ + find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed # Install the include directory using cp. install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir cp -p -r include $(DESTDIR)$(libsubdir) + cp -p -r include-fixed $(DESTDIR)$(libsubdir) # Targets without dependencies, for use in prev-gcc during bootstrap. real-install-headers-tar: (cd `${PWD_COMMAND}`/include ; \ tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - ) + (cd `${PWD_COMMAND}`/include-fixed ; \ + tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - ) real-install-headers-cpio: cd `${PWD_COMMAND}`/include ; \ find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include + cd `${PWD_COMMAND}`/include-fixed ; \ + find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed real-install-headers-cp: cp -p -r include $(DESTDIR)$(libsubdir) + cp -p -r include-fixed $(DESTDIR)$(libsubdir) # Install supporting files for fixincludes to be run later. install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-itoolsdirs \ macro_list xlimits.h - for file in $(USER_H); do \ - realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ - $(INSTALL_DATA) $$file \ - $(DESTDIR)$(itoolsdatadir)/include/$$realfile ; \ - done $(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdatadir)/include/limits.h - $(INSTALL_DATA) $(UNWIND_H) $(DESTDIR)$(itoolsdatadir)/include/unwind.h $(INSTALL_DATA) $(srcdir)/gsyslimits.h \ $(DESTDIR)$(itoolsdatadir)/gsyslimits.h $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c index dfea0b8d51b..afe358e1067 100644 --- a/gcc/cppdefault.c +++ b/gcc/cppdefault.c @@ -66,9 +66,13 @@ const struct default_include cpp_include_defaults[] { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 }, #endif #ifdef GCC_INCLUDE_DIR - /* This is the dir for fixincludes and for gcc's private headers. */ + /* This is the dir for gcc's private headers. */ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, #endif +#ifdef FIXED_INCLUDE_DIR + /* This is the dir for fixincludes. */ + { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, +#endif #ifdef CROSS_INCLUDE_DIR /* One place the target system's headers might be. */ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, diff --git a/gcc/gcc.c b/gcc/gcc.c index d2f479b2257..808699d9427 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -3816,28 +3816,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" value = tmp; } - /* As a kludge, if the arg is "[foo/]stageN/", just - add "[foo/]include" to the include prefix. */ - if ((len == 7 - || (len > 7 - && (IS_DIR_SEPARATOR (value[len - 8])))) - && strncmp (value + len - 7, "stage", 5) == 0 - && ISDIGIT (value[len - 2]) - && (IS_DIR_SEPARATOR (value[len - 1]))) - { - if (len == 7) - add_prefix (&include_prefixes, "./", NULL, - PREFIX_PRIORITY_B_OPT, 0, 0); - else - { - char *string = xmalloc (len - 6); - memcpy (string, value, len - 7); - string[len - 7] = 0; - add_prefix (&include_prefixes, string, NULL, - PREFIX_PRIORITY_B_OPT, 0, 0); - } - } - add_prefix (&exec_prefixes, value, NULL, PREFIX_PRIORITY_B_OPT, 0, 0); add_prefix (&startfile_prefixes, value, NULL, @@ -4998,6 +4976,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) for_each_path (&include_prefixes, false, info.append_len, spec_path, &info); + + info.append = "include-fixed"; + info.append_len = strlen (info.append); + for_each_path (&include_prefixes, false, info.append_len, + spec_path, &info); } break; |