From 965c3f43f9e5e017da24f17b8a5c539147b4279c Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Sat, 3 Apr 1999 13:01:48 +0000 Subject: [PATCH] Makefile.in (install-headers-tar, [...]): avoid problems with CDPATH Reported by Ralf Canis * Makefile.in (install-headers-tar, install-headers-cpio): avoid problems with CDPATH Reported by Ralf Canis From-SVN: r26157 --- gcc/ChangeLog | 6 ++++++ gcc/Makefile.in | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3816e965ece..fdb72eb5b0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Sat Apr 3 17:57:35 1999 Alexandre Oliva + + * Makefile.in (install-headers-tar, install-headers-cpio): avoid + problems with CDPATH + Reported by Ralf Canis + Sat Apr 3 13:50:16 1999 Jeffrey A Law (law@cygnus.com) * fixinc.x86-linux-gnu: Deleted. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 62597e32302..121b4dea6dd 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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; -- 2.30.2