This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the files from dist/meta to perl's repo
[metaconfig.git] / dist / U / d_flexfnam.U
CommitLineData
d8875586
MBT
1?RCS: $Id: d_flexfnam.U 1 2006-08-24 12:32:52Z rmanfredi $
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 Licence,
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 Licence; a copy of which may be found at the root
9?RCS: of the source tree for dist 4.0.
10?RCS:
11?RCS: $Log: d_flexfnam.U,v $
12?RCS: Revision 3.0 1993/08/18 12:06:04 ram
13?RCS: Baseline for dist 3.0 netwide release.
14?RCS:
15?MAKE:d_flexfnam: cat rm test Setvar
16?MAKE: -pick add $@ %<
17?S:d_flexfnam:
18?S: This variable conditionally defines the FLEXFILENAMES symbol, which
19?S: indicates that the system supports filenames longer than 14 characters.
20?S:.
21?C:FLEXFILENAMES:
22?C: This symbol, if defined, indicates that the system supports filenames
23?C: longer than 14 characters.
24?C:.
25?H:#$d_flexfnam FLEXFILENAMES /**/
26?H:.
27?T:first second
28?LINT:set d_flexfnam
29: see if we can have long filenames
30echo " "
31?X:
32?X: We have to test in both /tmp and . because of NFS (remote server may allow
33?X: long filenames while the local filesystem cannot support them). If at least
34?X: one of those file systems cannot support long filenames, then we assume the
35?X: whole system can't.
36?X:
37rmlist="$rmlist /tmp/cf$$"
38$test -d /tmp/cf$$ || mkdir /tmp/cf$$
39first=123456789abcdef
40second=/tmp/cf$$/$first
41$rm -f $first $second
42if (echo hi >$first) 2>/dev/null; then
43 if $test -f 123456789abcde; then
44 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
45 val="$undef"
46 else
47 if (echo hi >$second) 2>/dev/null; then
48 if $test -f /tmp/cf$$/123456789abcde; then
49 $cat <<'EOM'
50That's peculiar... You can have filenames longer than 14 characters, but only
51on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
52I shall consider your system cannot support long filenames at all.
53EOM
54 val="$undef"
55 else
56 echo 'You can have filenames longer than 14 characters.' >&4
57 val="$define"
58 fi
59 else
60 $cat <<'EOM'
61How confusing! Some of your filesystems are sane enough to allow filenames
62longer than 14 characters but some others like /tmp can't even think about them.
63So, for now on, I shall assume your kernel does not allow them at all.
64EOM
65 val="$undef"
66 fi
67 fi
68else
69 $cat <<'EOM'
70You can't have filenames longer than 14 chars. You can't even think about them!
71EOM
72 val="$undef"
73fi
74set d_flexfnam
75eval $setvar
76$rm -rf /tmp/cf$$ 123456789abcde*
77