summaryrefslogtreecommitdiff
path: root/mcon/U/errnolist.U
blob: 52b3237c404baf87c02f20973040ccd872f49988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
?RCS: $Id: errnolist.U 1 2006-08-24 12:32:52Z rmanfredi $
?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: errnolist.U,v $
?RCS: Revision 3.0.1.2  1997/02/28  15:48:01  ram
?RCS: patch61: replaced .a with $_a all over the place
?RCS: patch61: likewise for .o replaced by $_o
?RCS:
?RCS: Revision 3.0.1.1  1994/01/24  14:10:54  ram
?RCS: patch16: created
?RCS:
?MAKE:errnolist errnolist_SH errnolist_a errnolist_c errnolist_o: cat +cc \
	+ccflags +libs +d_sysernlst _a _o
?MAKE:	-pick add $@ %<
?S:errnolist:
?S:	This variable holds the base name of a file containing the
?S:	definition of the sys_errnolist array, if the C library
?S:	doesn't provide it already.  Otherwise, its value is empty.
?S:	The following lines should be included in your Makefile.SH:
?S:	
?S:		case "$errnolist" in
?S:		'') ;;
?S:		*)
?S:			$spitshell >>Makefile <<!GROK!THIS!
?S:		$errnolist_c: $errnolist_SH $errnolist_a
?S:			sh ./$errnolist_SH
?S:	
?S:		!GROK!THIS!
?S:			;;
?S:		esac
?S:	
?S:	You may define the 'errnolist' variable in your Myinit.U if you
?S:	wish to override its default value "errnolist".
?S:.
?S:errnolist_SH:
?S:	This is the name of a file which will generate errnolistc.
?S:.
?S:errnolist_a:
?S:	This is the name of the awk script called by errnolist_SH.
?S:.
?S:errnolist_c:
?S:	This is the name of a generated C file which provides the
?S:	definition of the sys_errnolist array.
?S:.
?S:errnolist_o:
?S:	This is the name of the object file which provides the
?S:	definition of the sys_errnolist array, if the C library
?S:	doesn't provide it already.  Otherwise, its value is empty.
?S:.
?INIT:errnolist=errnolist
: check for sys_errnolist
@if d_sysernlst || HAS_SYS_ERRNOLIST
case "$d_sysernlst" in
"$define")
    errnolist=''
    errnolist_SH=''
    errnolist_a=''
    errnolist_c=''
    errnolist_o=''
	;;
*)
	echo " "
	echo "I'll make sure your Makefile provides sys_errnolist in $errnolist.c"
    errnolist_SH=$errnolist.SH
    errnolist_a=$errnolist$_a
    errnolist_c=$errnolist.c
    errnolist_o=$errnolist$_o
	;;
esac
@else
echo " "
$cat <<EOM
Checking to see if your C library provides us with sys_errnolist[]...
EOM
$cat >errnolist.c <<'EOCP'
extern char *sys_errnolist[];
int main() {
    char *p0 = sys_errnolist[0];
    char *p1 = sys_errnolist[1];

    return (p0 == p1);	/* Make sure they're not optimized away */
}
EOCP
if $cc $ccflags -o errnolist errnolist.c $libs >/dev/null 2>&1 ; then
    echo "It does."
    errnolist=''
    errnolist_SH=''
    errnolist_a=''
    errnolist_c=''
    errnolist_o=''
else
	echo "I'll make sure your Makefile provides sys_errnolist in $errnolist.c"
    errnolist_SH=$errnolist.SH
    errnolist_a=$errnolist$_a
    errnolist_c=$errnolist.c
    errnolist_o=$errnolist$_o
fi
@end