path: root/mcon/U/d_brokstat.U
diff options
Diffstat (limited to 'mcon/U/d_brokstat.U')
1 files changed, 72 insertions, 0 deletions
diff --git a/mcon/U/d_brokstat.U b/mcon/U/d_brokstat.U
new file mode 100644
index 0000000..29886f3
--- /dev/null
+++ b/mcon/U/d_brokstat.U
@@ -0,0 +1,72 @@
+?RCS: $Id: d_brokstat.U,v 1997/02/28 15:30:53 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: $Log: d_brokstat.U,v $
+?RCS: Revision 1997/02/28 15:30:53 ram
+?RCS: patch61: created
+?MAKE:d_brokstat: cat contains cppstdin cppminus +cppflags rm Setvar
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines STAT_MACROS_BROKEN if some
+?S: of the S_IS*() macros from <sys/stat.h> give false positive on
+?S: regular files.
+?C: This symbol, if defined, indicates that the S_IS*() stat macros
+?C: such as S_ISBLK() give false positive and are thus unusable.
+?C: Your best bet is then to supply your own set.
+?H:#$d_brokstat STAT_MACROS_BROKEN /**/
+?LINT:set d_brokstat
+?X: This test inspired by autoconf -- RAM, 28/02/97
+echo " "
+echo "Checking whether your stat() macros are broken..."
+$cat >try.c <<'EOC'
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined(S_ISBLK) && defined(S_IFDIR)
+#if defined(S_ISBLK) && defined(S_IFCHR)
+#if defined(S_ISLNK) && defined(S_IFREG)
+#if defined(S_ISSOCK) && defined(S_IFREG)
+$cppstdin $cppflags $cppminus <try.c 2>/dev/null >try
+if $contains Broken try >/dev/null 2>&1; then
+ echo "Alas, they are. I'll use my own macro set then." >&4
+ val="$define"
+ echo "Nope, working just fine." >&4
+ val="$undef"
+$rm -f try try.c
+set d_brokstat
+eval $setvar