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