diff --git a/Makefile.PL b/Makefile.PL
index 1ff014e..ea16b52 100644
--- a/Makefile.PL
+++ b/Makefile.PL

@@ -66,11 +69,17 @@ elsif ($Config{osname} eq 'darwin'){
         "-L$stdcpp -lstdc++";
 }
 elsif ($Config{osname} eq 'solaris' or $Config{osname} eq 'SunOS') {
-    if ($Config{cc} eq 'gcc') {
+    if (
+        $Config{cc} eq 'gcc' ||
+        ( exists( $Config{gccversion} ) && $Config{gccversion} > 0 )
+    ) {
         $cc_guess = 'g++';
         $libs_guess = '-lstdc++';
     }
-    else {
+    elsif( $Config{cc} eq 'cc' ) {
+       $cc_guess = 'cc';
+       $libs_guess = '-lCrun';
+   } else {
         $cc_guess = 'CC';
         $libs_guess ='-lCrun';
     }
@@ -171,7 +180,7 @@ WriteMakefile(
     NAME            => 'Inline::CPP',
     AUTHOR          => 'David Oswald <davido@cpan.org>',
     VERSION_FROM    => 'CPP.pm',
-    ABSTRACT_FROM  => 'lib/Inline/CPP.pod',
+    ABSTRACT_FROM   => 'lib/Inline/CPP.pod',
     PREREQ_PM       => \%PREREQ_PM,
     clean           => {
         FILES           => '_Inline/ grammar/_Inline'
diff --git a/t/00load_prereqs.t b/t/00load_prereqs.t
index bf6b142..dc5b24a 100644
--- a/t/00load_prereqs.t
+++ b/t/00load_prereqs.t
@@ -1,10 +1,15 @@
 use strict;
 use Test::More;
+use Config;

 # diag() the PERL5LIB %ENV value so it shows up in smoke test reports.
 # This is to help identify the cause of the Parse::RecDescent issue.
 BEGIN {
-    diag( "\$ENV{PERL5LIB}: $ENV{PERL5LIB}\n" );
+#    diag( "\$ENV{PERL5LIB}:      $ENV{PERL5LIB}\n"      ); # Shouldn't be needed anymore.
+# Some diagnostic information for sorting out the Solaris Makefile.PL bug.
+    diag( "\$Config{osname}:     $Config{osname}\n"     );
+    diag( "\$Config{cc}:         $Config{cc}\n"         );
+    diag( "\$Config{gccversion}: $Config{gccversion}\n" );
 };

 sub prereq_message {
