This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
evat => eval as found by Tom Hukins
[metaconfig.git] / U / modified / models.U
1 ?RCS: $Id: models.U 1 2006-08-24 12:32:52Z rmanfredi $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
4 ?RCS:
5 ?RCS: You may redistribute only under the terms of the Artistic License,
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 License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
10 ?RCS:
11 ?RCS: $Log: models.U,v $
12 ?RCS: Revision 3.0.1.2  1997/02/28  16:13:17  ram
13 ?RCS: patch61: added ?F: metalint hint
14 ?RCS:
15 ?RCS: Revision 3.0.1.1  1993/08/25  14:02:39  ram
16 ?RCS: patch6: added default for large
17 ?RCS:
18 ?RCS: Revision 3.0  1993/08/18  12:09:17  ram
19 ?RCS: Baseline for dist 3.0 netwide release.
20 ?RCS:
21 ?MAKE:models split small medium large huge: test cat Myread sysman Oldconfig \
22         Loc contains rm
23 ?MAKE:  -pick add $@ %<
24 ?S:models:
25 ?S:     This variable contains the list of memory models supported by this
26 ?S:     system.  Possible component values are none, split, unsplit, small,
27 ?S:     medium, large, and huge.  The component values are space separated.
28 ?S:.
29 ?S:split:
30 ?S:     This variable contains a flag which will tell the C compiler and loader
31 ?S:     to produce a program that will run in separate I and D space, for those
32 ?S:     machines that support separation of instruction and data space.  It is
33 ?S:     up to the Makefile to use this.
34 ?S:.
35 ?S:small:
36 ?S:     This variable contains a flag which will tell the C compiler and loader
37 ?S:     to produce a program running with a small memory model.  It is up to
38 ?S:     the Makefile to use this.
39 ?S:.
40 ?S:medium:
41 ?S:     This variable contains a flag which will tell the C compiler and loader
42 ?S:     to produce a program running with a medium memory model.  If the
43 ?S:     medium model is not supported, contains the flag to produce large
44 ?S:     model programs.  It is up to the Makefile to use this.
45 ?S:.
46 ?S:large:
47 ?S:     This variable contains a flag which will tell the C compiler and loader
48 ?S:     to produce a program running with a large memory model.  It is up to
49 ?S:     the Makefile to use this.
50 ?S:.
51 ?S:huge:
52 ?S:     This variable contains a flag which will tell the C compiler and loader
53 ?S:     to produce a program running with a huge memory model.  If the
54 ?S:     huge model is not supported, contains the flag to produce large
55 ?S:     model programs.  It is up to the Makefile to use this.
56 ?S:.
57 ?T:unsplit tans modelcc
58 ?F:!pdp11
59 ?D:large=''
60 ?LINT:extern cc
61 : see what memory models we can support
62 case "$models" in
63 '')
64 ?X: We may not use Cppsym or we get a circular dependency through cc.
65 ?X: But this should work regardless of which cc we eventually use.
66         $cat >pdp11.c <<'EOP'
67 int main() {
68 #ifdef pdp11
69         exit(0);
70 #else
71         exit(1);
72 #endif
73 }
74 EOP
75 ?X: Run cc in a subshell in case they don't have a 'cc' command.
76 ?X: Presumably they do have gcc or something.
77         case "$cc" in
78         '') modelcc="$cc" ;;
79         *) modelcc="cc" ;;
80         esac
81         ( $modelcc -o pdp11 pdp11.c ) >/dev/null 2>&1
82         if $test -f pdp11 && ./pdp11 2>/dev/null; then
83                 dflt='unsplit split'
84         else
85                 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
86                 case "$tans" in
87                 X) dflt='none';;
88                 *) if $test -d /lib/small || $test -d /usr/lib/small; then
89                                 dflt='small'
90                         else
91                                 dflt=''
92                         fi
93                         if $test -d /lib/medium || $test -d /usr/lib/medium; then
94                                 dflt="$dflt medium"
95                         fi
96                         if $test -d /lib/large || $test -d /usr/lib/large; then
97                                 dflt="$dflt large"
98                         fi
99                         if $test -d /lib/huge || $test -d /usr/lib/huge; then
100                                 dflt="$dflt huge"
101                         fi
102                 esac
103         fi;;
104 *) dflt="$models";;
105 esac
106 $cat <<EOM
107
108 Some systems have different model sizes.  On most systems they are called
109 small, medium, large, and huge.  On the PDP11 they are called unsplit and
110 split.  If your system doesn't support different memory models, say "none".
111 If you wish to force everything to one memory model, say "none" here and
112 put the appropriate flags later when it asks you for other cc and ld flags.
113 Venix systems may wish to put "none" and let the compiler figure things out.
114 (In the following question multiple model names should be space separated.)
115
116 The default for most systems is "none".
117
118 EOM
119 rp="Which memory models are supported?"
120 . ./myread
121 models="$ans"
122
123 case "$models" in
124 none)
125         small=''
126         medium=''
127         large=''
128         huge=''
129         unsplit=''
130         split=''
131         ;;
132 *split)
133         case "$split" in
134         '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
135                          $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
136                         dflt='-i'
137                 else
138                         dflt='none'
139                 fi;;
140         *) dflt="$split";;
141         esac
142         rp="What flag indicates separate I and D space?"
143         . ./myread
144         tans="$ans"
145         case "$tans" in
146         none) tans='';;
147         esac
148         split="$tans"
149         unsplit='';;
150 *large*|*small*|*medium*|*huge*)
151         case "$models" in
152         *large*)
153                 case "$large" in
154                 '') dflt='-Ml';;
155                 *) dflt="$large";;
156                 esac
157         rp="What flag indicates large model?"
158         . ./myread
159         tans="$ans"
160         case "$tans" in
161         none) tans='';
162         esac
163         large="$tans";;
164         *) large='';;
165         esac
166         case "$models" in
167         *huge*) case "$huge" in
168                 '') dflt='-Mh';;
169                 *) dflt="$huge";;
170                 esac
171                 rp="What flag indicates huge model?"
172                 . ./myread
173                 tans="$ans"
174                 case "$tans" in
175                 none) tans='';
176                 esac
177                 huge="$tans";;
178         *) huge="$large";;
179         esac
180         case "$models" in
181         *medium*) case "$medium" in
182                 '') dflt='-Mm';;
183                 *) dflt="$medium";;
184                 esac
185                 rp="What flag indicates medium model?"
186                 . ./myread
187                 tans="$ans"
188                 case "$tans" in
189                 none) tans='';
190                 esac
191                 medium="$tans";;
192         *) medium="$large";;
193         esac
194         case "$models" in
195         *small*) case "$small" in
196                 '') dflt='none';;
197                 *) dflt="$small";;
198                 esac
199                 rp="What flag indicates small model?"
200                 . ./myread
201                 tans="$ans"
202                 case "$tans" in
203                 none) tans='';
204                 esac
205                 small="$tans";;
206         *) small='';;
207         esac
208         ;;
209 *)
210         echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
211         ;;
212 esac
213 $rm -f pdp11.* pdp11
214