More portability.
[p5sagit/p5-mst-13.2.git] / hints / solaris_2.sh
index bf8f422..5b57433 100644 (file)
@@ -119,7 +119,7 @@ esac
 
 # Check that /dev/fd is mounted.  If it is not mounted, let the
 # user know that suid scripts may not work.
-/usr/bin/df /dev/fd 2>&1 > /dev/null
+df /dev/fd 2>&1 > /dev/null
 case $? in
 0) ;;
 *)
@@ -252,15 +252,21 @@ END
            # apparently don't reveal that unless you pass in -V.
            # (This may all depend on local configurations too.)
 
+           # Recompute verbose with -Wl,-v to find GNU ld if present
+           verbose=`${cc:-cc} -v -Wl,-v -o try try.c 2>&1 | grep ld 2>&1`
+
            myld=`echo $verbose| grep ld | awk '/\/ld/ {print $1}'`
            # This assumes that gcc's output will not change, and that
            # /full/path/to/ld will be the first word of the output.
-           # Thus myld is something like opt/gnu/sparc-sun-solaris2.5/bin/ld
+           # Thus myld is something like /opt/gnu/sparc-sun-solaris2.5/bin/ld
 
-           if $myld -V 2>&1 | grep "ld: Software Generation Utilities" >/dev/null 2>&1; then
+           # Allow that $myld may be '', due to changes in gcc's output 
+           if ${myld:-ld} -V 2>&1 |
+               grep "ld: Software Generation Utilities" >/dev/null 2>&1; then
                # Ok, /usr/ccs/bin/ld eventually does get called.
                :
            else
+               echo "Found GNU ld='$myld'" >&4
                cat <<END >&2
 
 NOTE: You are using GNU ld(1).  GNU ld(1) might not build Perl.  If you
@@ -342,9 +348,6 @@ cat > UU/usethreads.cbu <<'EOCBU'
 # after it has prompted the user for whether to use threads.
 case "$usethreads" in
 $define|true|[yY]*)
-    case "$ccflags" in
-    *_REENTRANT*) ;; # Already been here,  I presume.
-    *)
         ccflags="-D_REENTRANT $ccflags"
 
         # sched_yield is in -lposix4 up to Solaris 2.6, in -lrt starting with Solaris 2.7
@@ -388,9 +391,7 @@ for more information.
 
 EOM
         fi
-        ;;
-    esac 
-    ;;
+       ;;
 esac
 EOCBU