summaryrefslogtreecommitdiff
path: root/hints
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-06-16 09:05:57 +0000
committerNicholas Clark <nick@ccl4.org>2004-06-16 09:05:57 +0000
commit3e50adc28ddeb582e1860e49e66ba3adfef175d6 (patch)
tree7a71e9ecea8654ea34cfa5449de33314320e69bc /hints
parent1c33a35cacbed722d4acd472a2aa2fc114a4db3c (diff)
downloadperl-3e50adc28ddeb582e1860e49e66ba3adfef175d6.tar.gz
Improve the substitution to cc_r for threading so that compilers
specified with a full path or as a parameter to ccache are changed p4raw-id: //depot/perl@22939
Diffstat (limited to 'hints')
-rw-r--r--hints/aix.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/hints/aix.sh b/hints/aix.sh
index 29f2bdc758..e4966042bc 100644
--- a/hints/aix.sh
+++ b/hints/aix.sh
@@ -231,17 +231,26 @@ case "$usethreads" in
*gcc*) ccflags="-D_THREAD_SAFE $ccflags" ;;
cc_r) ;;
- cc|xl[cC]|xl[cC]_r)
+ '') cc=cc_r ;;
+
+ *)
+
+
+ # No | alternation in aix sed. :-(
+ newcc=`echo $cc | sed -e 's/cc$/cc_r/' -e 's/xl[cC]$/cc_r/' -e 's/xl[cC]_r$/cc_r/'`
+ case "$newcc" in
+ $cc) # No change
+ ;;
+
+ *cc_r)
echo >&4 "Switching cc to cc_r because of POSIX threads."
# xlc_r has been known to produce buggy code in AIX 4.3.2.
# (e.g. pragma/overload core dumps) Let's suspect xlC_r, too.
# --jhi@iki.fi
- cc=cc_r
+ cc="$newcc"
;;
- '') cc=cc_r ;;
-
- *)
+ *)
cat >&4 <<EOM
*** For pthreads you should use the AIX C compiler cc_r.
*** (now your compiler was set to '$cc')
@@ -250,6 +259,7 @@ EOM
exit 1
;;
esac
+ esac
# Insert pthreads to libswanted, before any libc or libC.
set `echo X "$libswanted "| sed -e 's/ \([cC]\) / pthreads \1 /'`