This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #85738] cc deprecated option warnings on solaris 10 sparc 64-bit
authorArvan <apritchard@zeus.com>
Wed, 9 Mar 2011 19:35:48 +0000 (11:35 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 9 Mar 2011 20:42:18 +0000 (12:42 -0800)
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.

hints/solaris_2.sh

index 8f0c3e6..cb3c1a0 100644 (file)
@@ -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