This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Populate metaconfig branch.
[metaconfig.git] / dist-3.0at70b / mcon / U / d_brokstat.U
1 ?RCS: $Id: d_brokstat.U,v 3.0.1.1 1997/02/28 15:30:53 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, 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 3.0.
10 ?RCS:
11 ?RCS: $Log: d_brokstat.U,v $
12 ?RCS: Revision 3.0.1.1  1997/02/28  15:30:53  ram
13 ?RCS: patch61: created
14 ?RCS:
15 ?MAKE:d_brokstat: cat contains cppstdin cppminus +cppflags rm Setvar
16 ?MAKE:  -pick add $@ %<
17 ?S:d_brokstat:
18 ?S:     This variable conditionally defines STAT_MACROS_BROKEN if some
19 ?S:     of the S_IS*() macros from <sys/stat.h> give false positive on
20 ?S:     regular files.
21 ?S:.
22 ?C:STAT_MACROS_BROKEN:
23 ?C:     This symbol, if defined, indicates that the S_IS*() stat macros
24 ?C:     such as S_ISBLK() give false positive and are thus unusable.
25 ?C:     Your best bet is then to supply your own set.
26 ?C:.
27 ?H:#$d_brokstat STAT_MACROS_BROKEN      /**/
28 ?H:.
29 ?LINT:set d_brokstat
30 ?X: This test inspired by autoconf -- RAM, 28/02/97
31 echo " "
32 echo "Checking whether your stat() macros are broken..."
33 $cat >try.c <<'EOC'
34 #include <sys/types.h>
35 #include <sys/stat.h>
36
37 #if defined(S_ISBLK) && defined(S_IFDIR)
38 #if S_ISBLK(S_IFDIR)
39 Broken
40 #endif
41 #endif
42
43 #if defined(S_ISBLK) && defined(S_IFCHR)
44 #if S_ISBLK(S_IFCHR)
45 Broken
46 #endif
47 #endif
48
49 #if defined(S_ISLNK) && defined(S_IFREG)
50 #if S_ISLNK(S_IFREG)
51 Broken.
52 #endif
53 #endif
54
55 #if defined(S_ISSOCK) && defined(S_IFREG)
56 #if S_ISSOCK(S_IFREG)
57 Broken.
58 #endif
59 #endif
60 EOC
61 $cppstdin $cppflags $cppminus <try.c 2>/dev/null >try
62 if $contains Broken try >/dev/null 2>&1; then
63         echo "Alas, they are.  I'll use my own macro set then." >&4
64         val="$define"
65 else
66         echo "Nope, working just fine." >&4
67         val="$undef"
68 fi
69 $rm -f try try.c
70 set d_brokstat
71 eval $setvar
72