This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix a copy-paste error in d_double_has_nan description
[metaconfig.git] / U / perl / issymlink.U
CommitLineData
39ca37a0 1?RCS: $Id$
a3d599a6 2?RCS:
39ca37a0 3?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
65a32477
MBT
4?RCS:
5?RCS: You may redistribute only under the terms of the Artistic License,
a3d599a6
JH
6?RCS: as specified in the README file that comes with the distribution.
7?RCS: You may reuse parts of this distribution only within the terms of
65a32477 8?RCS: that same Artistic License; a copy of which may be found at the root
39ca37a0 9?RCS: of the source tree for dist 4.0.
a3d599a6
JH
10?RCS:
11?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
12?RCS:
13?RCS: $Log: lns.U,v $
14?RCS: Revision 3.0.1.1 1994/06/20 07:05:52 ram
15?RCS: patch30: created by ADO
16?RCS:
df0bcc5d 17?MAKE:issymlink: lns test rm
a3d599a6 18?MAKE: -pick add $@ %<
12e20a24
MB
19?S:issymlink:
20?S: This variable holds the test command to test for a symbolic link
21?S: (if they are supported). Typical values include 'test -h' and
22?S: 'test -L'.
a3d599a6 23?S:.
26074dbd 24?T:pth p
39ca37a0 25?LINT:change PATH test
e8970d08 26?LINT:extern newsh
a3d599a6
JH
27: determine whether symbolic links are supported
28echo " "
68f55076 29case "$lns" in
73528f55 30*"ln"*" -s")
68f55076
JH
31 echo "Checking how to test for symbolic links..." >&4
32 $lns blurfl sym
12e20a24
MB
33 if $test "X$issymlink" = X; then
34?X:
35?X: In some AIX 4 versions the (ksh) builtin test (-h) is broken.
36?X:
26074dbd
JH
37 case "$newsh" in
38 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
39 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
40 esac
12e20a24
MB
41 if test $? = 0; then
42 issymlink="test -h"
26074dbd
JH
43 else
44 echo "Your builtin 'test -h' may be broken." >&4
45 case "$test" in
46 /*) ;;
47 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
48 for p in $pth
49 do
50 if test -f "$p/$test"; then
51 test="$p/$test"
52 break
53 fi
54 done
55 ;;
56 esac
57 case "$test" in
58 /*)
59 echo "Trying external '$test -h'." >&4
60 issymlink="$test -h"
61 if $test ! -h sym >/dev/null 2>&1; then
2d8cf008 62 echo "External '$test -h' is broken, too." >&4
26074dbd
JH
63 issymlink=''
64 fi
65 ;;
66 *) issymlink='' ;;
67 esac
65a32477 68 fi
12e20a24 69 fi
12e20a24 70 if $test "X$issymlink" = X; then
68f55076 71 if $test -L sym 2>/dev/null; then
12e20a24 72 issymlink="$test -L"
26074dbd 73 echo "The builtin '$test -L' worked." >&4
68f55076
JH
74 fi
75 fi
12e20a24
MB
76 if $test "X$issymlink" != X; then
77 echo "You can test for symbolic links with '$issymlink'." >&4
68f55076
JH
78 else
79 echo "I do not know how you can test for symbolic links." >&4
80 fi
81 $rm -f blurfl sym
82 ;;
83*) echo "No symbolic links, so not testing for their testing..." >&4
84 ;;
85esac
a3d599a6 86