Diffstat (limited to 'mcon/U/d_wifstat.U')
1 files changed, 87 insertions, 0 deletions
diff --git a/mcon/U/d_wifstat.U b/mcon/U/d_wifstat.U
new file mode 100644
@@ -0,0 +1,87 @@
+?RCS: $Id: d_wifstat.U,v 220.127.116.11 1997/02/28 15:47:43 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_wifstat.U,v $
+?RCS: Revision 18.104.22.168 1997/02/28 15:47:43 ram
+?RCS: patch61: added a ?F: metalint hint
+?RCS: Revision 22.214.171.124 1995/07/25 14:09:10 ram
+?RCS: patch56: re-arranged compile line to include ldflags before objects
+?RCS: Revision 126.96.36.199 1995/03/21 08:47:46 ram
+?RCS: patch52: created
+?MAKE:d_wifstat: d_uwait +cc +ccflags +ldflags +libs Oldconfig cat rm
+?MAKE: -pick add $@ %<
+?S: This symbol conditionally defines USE_WIFSTAT if the C program can
+?S: safely use the WIFxxx macros with the kind of wait() parameter
+?S: declared in the program (see UNION_WAIT), or if it can't. Should
+?S: only matter on HP-UX, where the macros are incorrectly written and
+?S: therefore cause programs using them with an 'union wait' variable
+?S: to not compile properly.
+?C: This symbol, if defined, indicates to the C program that the argument
+?C: for the WIFxxx set of macros such as WIFSIGNALED or WIFEXITED can
+?C: be of the same kind as the one used to hold the wait() status. Should
+?C: only matter on HP-UX, where the macros are incorrectly written and
+?C: therefore cause programs using them with an 'union wait' variable
+?C: to not compile properly. See also UNION_WAIT.
+?H:#$d_wifstat USE_WIFSTAT /**/
+: see if we can use WIFxxx macros
+echo " "
+case "$d_wifstat" in
+"$define") echo "As before, you can safely use WIFEXITED and friends!" >&4;;
+"$undef") echo "You still can't use WIFEXITED and friends!" >&4;;
+ echo "Let's see whether you can use the WIFEXITED(status) macro and its"
+ case "$d_uwait" in
+ "$define") type='union wait';;
+ *) type='int';;
+ echo "friends with status declared as '$type status'..."
+ $cat >foo.c <<EOCP
+ $type status;
+ int e = 0;
+ if (WIFEXITED(status))
+ if $cc $ccflags $ldflags foo.c -o foo $libs >/dev/null 2>&1; then
+ if ./foo >/dev/null; then
+ echo "Great! Looks like we can use the WIFxxx macros." >&4
+ echo "You don't seem to have WIFxxx macros, but that's ok." >&4
+ echo "Apparently you can't use WIFxxx macros properly." >&4
+ $rm -f foo.* foo core