Detect SunOS CC workshop c++ compiler
authorReini Urban <rurban@x-ray.at>
Tue, 15 Nov 2011 22:11:02 +0000 (16:11 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 17 Nov 2011 17:22:58 +0000 (09:22 -0800)
Solaris 11 SunStudio 12.2. ships without cc, so CC must be used.
Detect it and set ccversion correctly

hints/solaris_2.sh

index 508cd3e..b147b61 100644 (file)
@@ -311,11 +311,15 @@ else
        cat > try.c << 'EOM'
 #include <stdio.h>
 int main() {
-#ifdef __SUNPRO_C
+#if defined(__SUNPRO_C)
        printf("workshop\n");
 #else
+#if defined(__SUNPRO_CC)
+       printf("workshop CC\n");
+#else
        printf("\n");
 #endif
+#endif
 return(0);
 }
 EOM
@@ -323,7 +327,13 @@ EOM
        if $tryworkshopcc >/dev/null 2>&1; then
                cc_name=`./try`
                if test "$cc_name" = "workshop"; then
-                       ccversion="`${cc:-cc} -V 2>&1|sed -n -e '1s/^cc: //p'`"
+                       ccversion="`${cc:-cc} -V 2>&1|sed -n -e '1s/^cc: //ip'`"
+                       if test ! "$use64bitall_done"; then
+                               loclibpth="/usr/lib /usr/ccs/lib `$getworkshoplibs` $loclibpth"
+                       fi
+               fi
+               if test "$cc_name" = "workshop CC"; then
+                       ccversion="`${cc:-CC} -V 2>&1|sed -n -e '1s/^CC: //ip'`"
                        if test ! "$use64bitall_done"; then
                                loclibpth="/usr/lib /usr/ccs/lib `$getworkshoplibs` $loclibpth"
                        fi