From: H.Merijn Brand Date: Thu, 10 Feb 2005 15:56:04 +0000 (+0000) Subject: 'what' cannot find ccversion if `which cc` is a symlink to ccache X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bd7dcc1560fe205bfdd287ecf78da4eb59a80bf9;p=p5sagit%2Fp5-mst-13.2.git 'what' cannot find ccversion if `which cc` is a symlink to ccache ccversion is important enough to jump through some hoops to get it p4raw-id: //depot/perl@23958 --- diff --git a/hints/hpux.sh b/hints/hpux.sh index 8fe7092..c74b66a 100644 --- a/hints/hpux.sh +++ b/hints/hpux.sh @@ -136,7 +136,28 @@ case `$cc -v 2>&1`"" in esac ;; *) ccisgcc='' - ccversion=`which cc | xargs what | awk '/Compiler/{print $2}/Itanium/{print $6,$7}'` + # What cannot be use in combination with ccache links :( + cc_found="" + for p in `echo $PATH | tr : ' ''` ; do + x="$p/cc" + if [ -f $x ] && [ -x $x ]; then + if [ -h $x ]; then + l=`ls -l $x | sed 's,.*-> ,,'` + case $l in + /*) x=$l ;; + *) x="$p/$l" ;; + esac + fi + x=`echo $x | sed 's,/\./,/,g'` + case $x in + *ccache*) ;; + *) [ -z "$cc_found" ] && cc_found=$x ;; + esac + fi + done + [ -z "$cc_found" ] && cc_found=`which cc` + what $cc_found >&4 + ccversion=`which $cc_found | xargs what | awk '/Compiler/{print $2}/Itanium/{print $6,$7}'` case "$ccflags" in "-Ae "*) ;; *) ccflags="-Ae $cc_cppflags"