summaryrefslogtreecommitdiff
path: root/mcon/U/d_brokstat.U
diff options
context:
space:
mode:
authorrmanfredi <rmanfredi@190e5f8e-a817-0410-acf6-e9863daed9af>2006-08-24 12:32:52 +0000
committerrmanfredi <rmanfredi@190e5f8e-a817-0410-acf6-e9863daed9af>2006-08-24 12:32:52 +0000
commit8bfc5756fb68e0b13d7e7c0073ad5b9a4790d1b6 (patch)
treedee05e98bc53766d609ef2a3a07a5672627d812c /mcon/U/d_brokstat.U
Moving project to sourceforge.
git-svn-id: https://dist.svn.sourceforge.net/svnroot/dist/trunk/dist@1 190e5f8e-a817-0410-acf6-e9863daed9af
Diffstat (limited to 'mcon/U/d_brokstat.U')
-rw-r--r--mcon/U/d_brokstat.U75
1 files changed, 75 insertions, 0 deletions
diff --git a/mcon/U/d_brokstat.U b/mcon/U/d_brokstat.U
new file mode 100644
index 0000000..a330dba
--- /dev/null
+++ b/mcon/U/d_brokstat.U
@@ -0,0 +1,75 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+?RCS:
+?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 4.0.
+?RCS:
+?RCS: $Log: d_brokstat.U,v $
+?RCS: Revision 3.0.1.1 1997/02/28 15:30:53 ram
+?RCS: patch61: created
+?RCS:
+?MAKE:d_brokstat: cat contains cppstdin cppminus +cppflags rm Setvar
+?MAKE: -pick add $@ %<
+?S:d_brokstat:
+?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.
+?S:.
+?C:STAT_MACROS_BROKEN:
+?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.
+?C:.
+?H:#$d_brokstat STAT_MACROS_BROKEN /**/
+?H:.
+?F:!try.c !try
+?LINT:set d_brokstat
+?LINT:usefile try
+?X: This test inspired by autoconf -- RAM, 28/02/97
+: are stat macros sane?
+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 S_ISBLK(S_IFDIR)
+Broken
+#endif
+#endif
+
+#if defined(S_ISBLK) && defined(S_IFCHR)
+#if S_ISBLK(S_IFCHR)
+Broken
+#endif
+#endif
+
+#if defined(S_ISLNK) && defined(S_IFREG)
+#if S_ISLNK(S_IFREG)
+Broken.
+#endif
+#endif
+
+#if defined(S_ISSOCK) && defined(S_IFREG)
+#if S_ISSOCK(S_IFREG)
+Broken.
+#endif
+#endif
+EOC
+$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"
+else
+ echo "Nope, working just fine." >&4
+ val="$undef"
+fi
+$rm -f try try.c
+set d_brokstat
+eval $setvar
+