diff options
-rw-r--r-- | hints/aix.sh | 20 |
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 /'` |