This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig units changes for #13188.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 22 Nov 2001 04:44:03 +0000 (04:44 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 22 Nov 2001 04:44:03 +0000 (04:44 +0000)
p4raw-id: //depot/metaconfig@13189

U/modified/Head.U
U/perl/issymlink.U

index 7f50bc7..2dbeda9 100644 (file)
@@ -243,6 +243,7 @@ EOM
 esac
 case "$changesh" in
 true)
+       export newsh
        echo "(Feeding myself to $newsh $reason.)"
 ?X: Make sure they didn't say sh <Configure by checking whether $0 ends
 ?X: with Configure or not. If they did say sh <../../Configure, then too
index 1efb3ca..546f664 100644 (file)
@@ -21,7 +21,9 @@
 ?S:    (if they are supported).  Typical values include 'test -h' and
 ?S:    'test -L'.
 ?S:.
+?T:pth p
 ?LINT:change PATH
+?LINT:change test
 : determine whether symbolic links are supported
 echo " "
 case "$lns" in
@@ -32,22 +34,43 @@ case "$lns" in
 ?X:
 ?X: In some AIX 4 versions the (ksh) builtin test (-h) is broken.
 ?X:
-               sh -c "PATH= test -h sym" >/dev/null 2>&1
+               case "$newsh" in
+               '') sh     -c "PATH= test -h sym" >/dev/null 2>&1 ;;
+               *)  $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
+               esac
                if test $? = 0; then
                        issymlink="test -h"
+               else
+                       echo "Your builtin 'test -h' may be broken." >&4
+                       case "$test" in
+                       /*)     ;;
+                       *)      pth=`echo $PATH | sed -e "s/$p_/ /g"`
+                               for p in $pth
+                               do
+                                       if test -f "$p/$test"; then
+                                               test="$p/$test"
+                                               break
+                                       fi
+                               done
+                               ;;
+                       esac
+                       case "$test" in
+                       /*)
+                               echo "Trying external '$test -h'." >&4
+                               issymlink="$test -h"
+                               if $test ! -h sym >/dev/null 2>&1; then
+                                       echo "External '$test -h' is broken, too." >& 4
+                                       issymlink=''
+                               fi
+                               ;;
+                       *)      issymlink='' ;;
+                       esac
                fi              
        fi
-       case "$issymlink" in
-       "test -h")
-               if $test -h >/dev/null 2>&1; then
-                       issymlink="/bin/test -h"
-                       echo "Your builtin 'test -h' may be broken, I'm using external '/bin/test -h'." >&4
-               fi
-               ;;
-       esac
        if $test "X$issymlink" = X; then
                if $test -L sym 2>/dev/null; then
                        issymlink="$test -L"
+                       echo "The builtin '$test -L' worked." >&4
                fi
        fi
        if $test "X$issymlink" != X; then