]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Makefile.tpl (gcc-no-fixedincludes): Rename into ...
authorOlivier Hainque <hainque@adacore.com>
Wed, 16 May 2012 13:37:14 +0000 (13:37 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Wed, 16 May 2012 13:37:14 +0000 (13:37 +0000)
toplevel/
* Makefile.tpl (gcc-no-fixedincludes): Rename into ...
(gcc-install-no-fixedincludes): Now forwarder to local target in gcc/
(install-no-fixedincludes): Adjust accordingly.
* Makefile.in: Regenerate.

gcc/
* Makefile.in (install-no-fixedincludes): New target, former toplevel
gcc-no-fixedincludes. Stash "include-fixed" in addition to "include".
Add comments and improve stamp preservation across the whole sequence.
(stmp-int-hdrs): Use move-if-change + cp -p to setup fix_dir/limits.h.

From-SVN: r187594

ChangeLog
Makefile.in
Makefile.tpl
gcc/ChangeLog
gcc/Makefile.in

index a50fa6793bffbca902bcd9c1871986831b55f3c9..e29515044c9a8de7890e22e6277118f50c7af247 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-16  Olivier Hainque  <hainque@adacore.com>
+
+       * Makefile.tpl (gcc-no-fixedincludes): Rename into ...
+       (gcc-install-no-fixedincludes): Now forwarder to local target in gcc/
+       (install-no-fixedincludes): Adjust accordingly.
+       * Makefile.in: Regenerate.
+
 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        Merge upstream change
index e30c5e2ad801fddc82060ca9a6502e9e544f173b..def860e386d173d87b7352411591dc1d11f41b04 100644 (file)
@@ -2447,11 +2447,12 @@ install.all: install-no-fixedincludes
                true ; \
        fi
 
-# install-no-fixedincludes is used because Cygnus can not distribute
-# the fixed header files.
+# install-no-fixedincludes is used to allow the elaboration of binary packages
+# suitable for distribution, where we cannot include the fixed system header
+# files.
 .PHONY: install-no-fixedincludes
 install-no-fixedincludes: installdirs install-host-nogcc \
-       install-target gcc-no-fixedincludes
+       install-target gcc-install-no-fixedincludes
 
 .PHONY: install-strip
 install-strip:
@@ -41200,25 +41201,16 @@ check-gcc-go:
 check-go: check-gcc-go check-target-libgo
 
 
-# Install the gcc headers files, but not the fixed include files,
-# which Cygnus is not allowed to distribute.  This rule is very
-# dependent on the workings of the gcc Makefile.in.
-.PHONY: gcc-no-fixedincludes
-gcc-no-fixedincludes:
+# The gcc part of install-no-fixedincludes, which relies on an intimate
+# knowledge of how a number of gcc internal targets (inter)operate.  Delegate.
+.PHONY: gcc-install-no-fixedincludes
+gcc-install-no-fixedincludes:
        @if [ -f ./gcc/Makefile ]; then \
-         rm -rf gcc/tmp-include; \
-         mv gcc/include gcc/tmp-include 2>/dev/null; \
-         mkdir gcc/include; \
-         cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
-         touch gcc/stmp-fixinc gcc/include/fixed; \
-         rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
          r=`${PWD_COMMAND}`; export r; \
-         s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
+         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
          $(HOST_EXPORTS) \
-         (cd ./gcc && \
-          $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
-         rm -rf gcc/include; \
-         mv gcc/tmp-include gcc/include 2>/dev/null; \
+         (cd ./gcc \
+          && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
        else true; fi
 @endif gcc
 
index ae263e6d36f152bb23617a088877a3d42231a8ff..371c3b6f7db65aa32b7ec74efe15e42dcd58b7a7 100644 (file)
@@ -906,11 +906,12 @@ install.all: install-no-fixedincludes
                true ; \
        fi
 
-# install-no-fixedincludes is used because Cygnus can not distribute
-# the fixed header files.
+# install-no-fixedincludes is used to allow the elaboration of binary packages
+# suitable for distribution, where we cannot include the fixed system header
+# files.
 .PHONY: install-no-fixedincludes
 install-no-fixedincludes: installdirs install-host-nogcc \
-       install-target gcc-no-fixedincludes
+       install-target gcc-install-no-fixedincludes
 
 .PHONY: install-strip
 install-strip:
@@ -1443,25 +1444,16 @@ check-gcc-[+language+]:
 check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +]
 [+ ENDFOR languages +]
 
-# Install the gcc headers files, but not the fixed include files,
-# which Cygnus is not allowed to distribute.  This rule is very
-# dependent on the workings of the gcc Makefile.in.
-.PHONY: gcc-no-fixedincludes
-gcc-no-fixedincludes:
+# The gcc part of install-no-fixedincludes, which relies on an intimate
+# knowledge of how a number of gcc internal targets (inter)operate.  Delegate.
+.PHONY: gcc-install-no-fixedincludes
+gcc-install-no-fixedincludes:
        @if [ -f ./gcc/Makefile ]; then \
-         rm -rf gcc/tmp-include; \
-         mv gcc/include gcc/tmp-include 2>/dev/null; \
-         mkdir gcc/include; \
-         cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
-         touch gcc/stmp-fixinc gcc/include/fixed; \
-         rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
          r=`${PWD_COMMAND}`; export r; \
-         s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
+         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
          $(HOST_EXPORTS) \
-         (cd ./gcc && \
-          $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
-         rm -rf gcc/include; \
-         mv gcc/tmp-include gcc/include 2>/dev/null; \
+         (cd ./gcc \
+          && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
        else true; fi
 @endif gcc
 
index 239992be54d26266ddeaf03c763ca7c38bfefd26..546ec91185b72b39b73e72c064f0d959d70cb09e 100644 (file)
@@ -1,3 +1,10 @@
+2012-05-16  Olivier Hainque  <hainque@adacore.com>
+
+       * Makefile.in (install-no-fixedincludes): New target, former toplevel
+       gcc-no-fixedincludes. Stash "include-fixed" in addition to "include".
+       Add comments and improve stamp preservation across the whole sequence.
+       (stmp-int-hdrs): Use move-if-change + cp -p to setup fix_dir/limits.h.
+
 2012-05-16  Richard Guenther  <rguenther@suse.de>
 
        * tree-inline.c (insert_init_stmt): Do not call
index 944436c7a814dc208991cc5e8237ec2c419a9b59..4853eb904523cbb7d7afe1fcb418e974eeea3870 100644 (file)
@@ -4053,10 +4053,16 @@ gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
 # Build the include directories.
 stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list
 # Copy in the headers provided with gcc.
+#
 # The sed command gets just the last file name component;
 # this is necessary because VPATH could add a dirname.
 # Using basename would be simpler, but some systems don't have it.
+#
 # The touch command is here to workaround an AIX/Linux NFS bug.
+#
+# The move-if-change + cp -p twists for limits.h are intended to preserve
+# the time stamp when we regenerate, to prevent pointless rebuilds during
+# e.g. install-no-fixedincludes.
        -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 \
@@ -4105,8 +4111,10 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list
          fi; \
          $(mkinstalldirs) $${fix_dir}; \
          chmod a+rx $${fix_dir} || true; \
+         $(SHELL) $(srcdir)/../move-if-change \
+           tmp-xlimits.h  tmp-limits.h; \
          rm -f $${fix_dir}/limits.h; \
-         mv tmp-xlimits.h $${fix_dir}/limits.h; \
+         cp -p tmp-limits.h $${fix_dir}/limits.h; \
          chmod a+r $${fix_dir}/limits.h; \
        done
 # Install the README
@@ -4208,6 +4216,42 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
        fi
        $(STAMP) stmp-fixinc
 #\f
+
+# Install with the gcc headers files, not the fixed include files, which we
+# are typically not allowed to distribute.  The general idea is to:
+#  - Get to "install" with a bare set of internal headers, not the
+#    fixed system ones,
+#  - Prevent rebuilds of what normally depends on the headers, which is
+#    useless for installation purposes and would rely on improper headers.
+#  - Restore as much of the original state as possible.
+
+.PHONY: install-no-fixedincludes
+
+install-no-fixedincludes:
+       # Stash the current set of headers away, save stamps we're going to
+       # alter explicitly, and arrange for fixincludes not to run next time
+       # we trigger a headers rebuild.
+       -rm -rf tmp-include
+       -mv include tmp-include 2>/dev/null
+       -mv include-fixed tmp-include-fixed 2>/dev/null
+       -mv stmp-int-hdrs tmp-stmp-int-hdrs 2>/dev/null
+       -mv stmp-fixinc tmp-stmp-fixinc 2>/dev/null
+       -mkdir include
+       -cp -p $(srcdir)/gsyslimits.h include/syslimits.h
+       -touch stmp-fixinc
+
+       # Rebuild our internal headers, restore the original stamps so that
+       # "install" doesn't trigger pointless rebuilds because of that update,
+       # then do install
+       $(MAKE) $(FLAGS_TO_PASS) stmp-int-hdrs
+       -mv tmp-stmp-int-hdrs stmp-int-hdrs 2>/dev/null
+       -mv tmp-stmp-fixinc stmp-fixinc 2>/dev/null
+       $(MAKE) $(FLAGS_TO_PASS) install
+
+       # Restore the original set of maybe-fixed headers
+       -rm -rf include; mv tmp-include include 2>/dev/null
+       -rm -rf include-fixed; mv tmp-include-fixed include-fixed 2>/dev/null
+
 # Remake the info files.
 
 doc: $(BUILD_INFO) $(GENERATED_MANPAGES)