This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
hints/solaris_2.sh: g++ needs same treatment as gcc
[perl5.git] / hints / solaris_2.sh
index 5266020..c613406 100644 (file)
@@ -90,7 +90,7 @@ END
 `
 
 case "$cc" in
-'')    for i in `ls -r /opt/solstudio*/bin/cc` /opt/SUNWspro/bin/cc
+'')    for i in `ls -r /opt/*studio*/bin/cc` /opt/SUNWspro/bin/cc
        do
               if test -f "$i"; then
                       cc=$i
@@ -359,6 +359,19 @@ EOM
                        d_attribute_pure='undef'
                        d_attribute_unused='undef'
                        d_attribute_warn_unused_result='undef'
+                       case "$cc" in
+                       *c99)   # c99 rejects bare '-O'.
+                               case "$optimize" in
+                               ''|-O) optimize=-O3 ;;
+                               esac
+                               # Without -Xa c99 doesn't see
+                               # many OS interfaces.
+                               case "$ccflags" in
+                               *-Xa*)  ;;
+                               *) ccflags="$ccflags -Xa" ;;
+                               esac
+                               ;;
+                       esac
                        ;;
                esac
        fi
@@ -572,7 +585,7 @@ EOM
                fi
            fi
            case "${cc:-cc} -v 2>/dev/null" in
-           *gcc*)
+           *gcc*|*g++*)
                echo 'int main() { return 0; }' > try.c
                case "`${cc:-cc} $ccflags -mcpu=v9 -m64 -S try.c 2>&1 | grep 'm64 is not supported by this configuration'`" in
                *"m64 is not supported"*)
@@ -710,3 +723,9 @@ case "$cc" in
   ;;
 esac
 
+# Oracle/Sun builds their Perl shared since 5.6.1, and they also
+# strongly recommend using shared libraries in general.
+#
+# Furthermore, OpenIndiana seems to effectively require building perl
+# shared, or otherwise perl scripts won't even find the Perl library.
+useshrplib='true'