summaryrefslogtreecommitdiff
path: root/hints/solaris_2.sh
diff options
context:
space:
mode:
authorArvan <apritchard@zeus.com>2011-03-09 11:35:48 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-03-09 12:42:18 -0800
commitb641685a8cdb14c8728fd97660d09571268ec117 (patch)
tree7fdfb159e1c2a5180f2f33905dbf626173b19e03 /hints/solaris_2.sh
parent54e72eecfd995bf46f012038fe57c401a27e7686 (diff)
downloadperl-b641685a8cdb14c8728fd97660d09571268ec117.tar.gz
[perl #85738] cc deprecated option warnings on solaris 10 sparc 64-bit
When building on Solaris 10 multiple warnings are produced saying: Warning: -xarch=generic64 is deprecated, use -m64 to create 64-bit programs This is because the config script hints/solaris_2.sh uses the values returned by getconf which are incorrect for newer versions of Sun's compiler. I believe they are correct for earlier versions, but do not have a system to test this on. This change to solaris_2.sh checks that the compiler produces this warning, and if so updates the flags to the correct values.
Diffstat (limited to 'hints/solaris_2.sh')
-rw-r--r--hints/solaris_2.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh
index 8f0c3e6fbb..cb3c1a0a2f 100644
--- a/hints/solaris_2.sh
+++ b/hints/solaris_2.sh
@@ -571,9 +571,21 @@ EOM
lddlflags="$lddlflags -G -m64"
;;
*)
- ccflags="$ccflags `getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
- ldflags="$ldflags `getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`"
- lddlflags="$lddlflags -G `getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`"
+ getconfccflags="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
+ getconfldflags="`getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`"
+ getconflddlflags="`getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`"
+ echo "int main() { return(0); } " > try.c
+ case "`${cc:-cc} $getconfccflags try.c 2>&1 | grep 'deprecated'`" in
+ *" -xarch=generic64 is deprecated, use -m64 "*)
+ getconfccflags=`echo $getconfccflags | sed -e 's/xarch=generic64/m64/'`
+ getconfldflags=`echo $getconfldflags | sed -e 's/xarch=generic64/m64/'`
+ getconflddlflags=`echo $getconfldllflags | sed -e 's/xarch=generic64/m64/'`
+ ;;
+ esac
+ ccflags="$ccflags $getconfccflags"
+ ldflags="$ldflags $getconfldflags"
+ lddlflags="$lddlflags -G $getconflddlflags"
+
echo "int main() { return(0); } " > try.c
tryworkshopcc="${cc:-cc} try.c -o try $ccflags"
if test "$processor" = sparc; then