Blob Blame History Raw
# Patch sent to upstream developer on 2009-02-01

icecc-create-env: improve check for "specs"

From: Michal Schmidt <mschmidt@redhat.com>

The check for "specs" would get confused if there was a file
called "specs" in the current directory.
Notice that gcc -print-file-name just prints the given file name in case it
does not have anything useful to give to give:
  $ gcc -print-file-name=specs
  specs
---

 client/icecc-create-env |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/client/icecc-create-env b/client/icecc-create-env
index fb8afeb..860b10c 100755
--- a/client/icecc-create-env
+++ b/client/icecc-create-env
@@ -114,7 +114,7 @@ fi
 add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1
 add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus
 specfile=`$added_gcc -print-file-name=specs`
-if test -n "$specfile" && test -e "$specfile"; then
+if test -n "$specfile" && test "$specfile" != "specs" && test -e "$specfile"; then
   add_file "$specfile"
 fi
 add_file /etc/ld.so.conf