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
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
4 ?RCS:
5 ?RCS: You may redistribute only under the terms of the Artistic License,
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
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
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:
17 ?MAKE:issymlink: lns test rm
18 ?MAKE:  -pick add $@ %<
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'.
23 ?S:.
24 ?T:pth p
25 ?LINT:change PATH test
26 ?LINT:extern newsh
27 : determine whether symbolic links are supported
28 echo " "
29 case "$lns" in
30 *"ln"*" -s")
31         echo "Checking how to test for symbolic links..." >&4
32         $lns blurfl sym
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:
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
41                 if test $? = 0; then
42                         issymlink="test -h"
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
62                                         echo "External '$test -h' is broken, too." >&4
63                                         issymlink=''
64                                 fi
65                                 ;;
66                         *)      issymlink='' ;;
67                         esac
68                 fi
69         fi
70         if $test "X$issymlink" = X; then
71                 if $test -L sym 2>/dev/null; then
72                         issymlink="$test -L"
73                         echo "The builtin '$test -L' worked." >&4
74                 fi
75         fi
76         if $test "X$issymlink" != X; then
77                 echo "You can test for symbolic links with '$issymlink'." >&4
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         ;;
85 esac
86