Makefile.in (install-headers-tar, [...]): avoid problems with CDPATH Reported by...
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 3 Apr 1999 13:01:48 +0000 (13:01 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sat, 3 Apr 1999 13:01:48 +0000 (13:01 +0000)
* Makefile.in (install-headers-tar, install-headers-cpio): avoid
problems with CDPATH
Reported by Ralf Canis <canis@bigfoot.com>

From-SVN: r26157

gcc/ChangeLog
gcc/Makefile.in

index 3816e965ece32cea54bfdf3aaa51244dfd08a9d4..fdb72eb5b0bc5fc7a494de47ad04b2124880078f 100644 (file)
@@ -1,3 +1,9 @@
+Sat Apr  3 17:57:35 1999  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * Makefile.in (install-headers-tar, install-headers-cpio): avoid
+       problems with CDPATH
+       Reported by Ralf Canis <canis@bigfoot.com>
+
 Sat Apr  3 13:50:16 1999  Jeffrey A Law  (law@cygnus.com)
 
        * fixinc.x86-linux-gnu: Deleted.
index 62597e32302692a6d35fc78e442a35b26c4f05b1..121b4dea6ddca4cbb2bcbd6dc8e6b0bd0d8e304c 100644 (file)
@@ -2636,7 +2636,11 @@ install-include-dir: installdirs
 
 # Install the include directory using tar.
 install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
-       (cd include; \
+# We use `pwd`/include instead of just include to problems with CDPATH
+# Unless a full pathname is provided, some shells would print the new CWD,
+# found in CDPATH, corrupting the output.  We could just redirect the
+# output of `cd', but some shells lose on redirection within `()'s
+       (cd `pwd`/include ; \
         tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - )
 # /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.
@@ -2644,7 +2648,9 @@ install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
 
 # Install the include directory using cpio.
 install-headers-cpio: stmp-headers $(STMP_FIXPROTO) install-include-dir
-       (cd include; find . -print) | (cd include; cpio -pdum $(libsubdir)/include)
+# See discussion about the use of `pwd` above
+       cd `pwd`/include ; \
+       find . -print | cpio -pdum $(libsubdir)/include
 
 # Put assert.h where it won't override GNU libc's assert.h.
 # It goes in a dir that is searched after GNU libc's headers;