This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
894f05e9478aeed57d23beed0de843d8bbe0c67a
[metaconfig.git] / U / perl / use64bits.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1998 Andy Dougherty
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?MAKE:use64bitint use64bitall archname64: Myread Oldconfig Setvar test \
9         usemorebits longsize ccflags d_quad
10 ?MAKE:  -pick add $@ %<
11 ?Y:TOP
12 ?S:use64bitint:
13 ?S:     This variable conditionally defines the USE_64_BIT_INT symbol,
14 ?S:     and indicates that 64-bit integer types should be used
15 ?S:     when available.  The minimal possible 64-bitness
16 ?S:     is employed, just enough to get 64-bit integers into Perl.
17 ?S:     This may mean using for example "long longs", while your memory
18 ?S:     may still be limited to 2 gigabytes.
19 ?S:.
20 ?S:use64bitall:
21 ?S:     This variable conditionally defines the USE_64_BIT_ALL symbol,
22 ?S:     and indicates that 64-bit integer types should be used
23 ?S:     when available.  The maximal possible
24 ?S:     64-bitness is employed: LP64 or ILP64, meaning that you will
25 ?S:     be able to use more than 2 gigabytes of memory.  This mode is
26 ?S:     even more binary incompatible than USE_64_BIT_INT. You may not
27 ?S:     be able to run the resulting executable in a 32-bit CPU at all or
28 ?S:     you may need at least to reboot your OS to 64-bit mode.
29 ?S:.
30 ?S:archname64:
31 ?S:     This variable is used for the 64-bitness part of $archname.
32 ?S:.
33 ?C:USE_64_BIT_INT:
34 ?C:     This symbol, if defined, indicates that 64-bit integers should
35 ?C:     be used when available.  If not defined, the native integers
36 ?C:     will be employed (be they 32 or 64 bits).  The minimal possible
37 ?C:     64-bitness is used, just enough to get 64-bit integers into Perl.
38 ?C:     This may mean using for example "long longs", while your memory
39 ?C:     may still be limited to 2 gigabytes.
40 ?C:.
41 ?C:USE_64_BIT_ALL:
42 ?C:     This symbol, if defined, indicates that 64-bit integers should
43 ?C:     be used when available.  If not defined, the native integers
44 ?C:     will be used (be they 32 or 64 bits).  The maximal possible
45 ?C:     64-bitness is employed: LP64 or ILP64, meaning that you will
46 ?C:     be able to use more than 2 gigabytes of memory.  This mode is
47 ?C:     even more binary incompatible than USE_64_BIT_INT. You may not
48 ?C:     be able to run the resulting executable in a 32-bit CPU at all or
49 ?C:     you may need at least to reboot your OS to 64-bit mode.
50 ?C:.
51 ?H:?%<:#ifndef USE_64_BIT_INT
52 ?H:?%<:#$use64bitint    USE_64_BIT_INT          /**/
53 ?H:?%<:#endif
54 ?H:.
55 ?H:?%<:#ifndef USE_64_BIT_ALL
56 ?H:?%<:#$use64bitall    USE_64_BIT_ALL          /**/
57 ?H:?%<:#endif
58 ?H:.
59 ?INIT:archname64=''
60 ?LINT:set use64bitint
61 ?LINT:extern ccflags
62 ?LINT:change ccflags
63 ?LINT:use usemorebits
64 ?LINT:extern use64bits
65 ?LINT:use use64bits
66 ?LINT:extern uselonglong
67 ?LINT:use uselonglong
68 ?LINT:extern uselonglongs
69 ?LINT:use uselonglongs
70 ?LINT:extern use64bitints
71 ?LINT:use use64bitints
72 ?LINT:extern use64bitsint
73 ?LINT:use use64bitints
74 ?LINT:extern use64bitsall
75 ?LINT:use use64bitsall
76 ?LINT:set use64bitall
77 ?F:!use64bitint.cbu
78 ?F:!use64bitall.cbu
79
80 case "$uselonglong" in
81 "$define"|true|[yY]*)
82         cat <<EOM >&4
83
84 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
85 EOM
86         use64bitint="$define"
87         ;;
88 esac                          
89 case "$use64bits" in
90 "$define"|true|[yY]*)
91         cat <<EOM >&4
92
93 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
94 EOM
95         use64bitint="$define"
96         ;;
97 esac                          
98 case "$use64bitints" in
99 "$define"|true|[yY]*)
100         cat <<EOM >&4
101
102 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
103 EOM
104         use64bitint="$define"
105         ;;
106 esac                          
107 case "$use64bitsint" in
108 "$define"|true|[yY]*)
109         cat <<EOM >&4
110
111 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
112 EOM
113         use64bitint="$define"
114         ;;
115 esac                          
116 case "$uselonglongs" in
117 "$define"|true|[yY]*)
118         cat <<EOM >&4
119
120 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
121 EOM
122         use64bitint="$define"
123         ;;
124 esac                          
125 case "$use64bitsall" in
126 "$define"|true|[yY]*)
127         cat <<EOM >&4
128
129 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
130 EOM
131         use64bitall="$define"
132         ;;
133 esac                          
134
135 case "$ccflags" in
136 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
137 esac
138 case "$use64bitall" in
139 "$define"|true|[yY]*) use64bitint="$define" ;;
140 esac
141
142 case "$longsize" in
143 8) cat <<EOM
144
145 You have natively 64-bit long integers.
146 EOM
147    val="$define"
148    ;;
149 *) case "$use64bitint" in
150    "$define"|true|[yY]*) dflt='y';;
151    *) dflt='n';;
152    esac
153    case "$d_quad" in
154    "$define") ;;
155    *) dflt='n' ;;
156    esac
157    cat <<EOM
158
159 Perl can be built to take advantage of 64-bit integer types
160 on some systems.  To do so, Configure can be run with -Duse64bitint.
161 Choosing this option will most probably introduce binary incompatibilities.
162
163 If this doesn't make any sense to you, just accept the default '$dflt'.
164 (The default has been chosen based on your configuration.)
165 EOM
166    rp='Try to use 64-bit integers, if available?'
167    . ./myread
168    case "$ans" in
169    [yY]*) val="$define" ;;
170    *)     val="$undef"  ;;
171    esac
172    ;;
173 esac
174 set use64bitint
175 eval $setvar
176
177 case "$use64bitall" in
178 "$define"|true|[yY]*) dflt='y' ;;
179 *) case "$longsize" in
180    8) dflt='y' ;;
181    *) dflt='n' ;;
182    esac
183    ;;
184 esac    
185 cat <<EOM
186
187 You may also choose to try maximal 64-bitness.  It means using as much
188 64-bitness as possible on the platform.  This in turn means even more
189 binary incompatibilities.  On the other hand, your platform may not
190 have any more 64-bitness available than what you already have chosen.
191
192 If this doesn't make any sense to you, just accept the default '$dflt'.
193 (The default has been chosen based on your configuration.)
194 EOM
195 rp='Try to use maximal 64-bit support, if available?'
196 . ./myread
197 case "$ans" in
198 [yY]*) val="$define" ;;
199 *)     val="$undef"  ;;
200 esac
201 set use64bitall
202 eval $setvar
203 case "$use64bitall" in
204 "$define")
205         case "$use64bitint" in
206         "$undef")
207                 cat <<EOM
208
209 Since you have chosen a maximally 64-bit build, I'm also turning on
210 the use of 64-bit integers.
211 EOM
212                 use64bitint="$define" ;;
213         esac
214         ;;
215 esac
216
217 case "$use64bitint" in
218 "$define"|true|[yY]*)
219 : Look for a hint-file generated 'call-back-unit'.  If the
220 : user has specified that a 64-bit perl is to be built,
221 : we may need to set or change some other defaults.
222         if $test -f use64bitint.cbu; then
223                 echo "Your platform has some specific hints for 64-bit integers, using them..."
224                 . ./use64bitint.cbu
225         fi
226         case "$longsize" in
227         4) case "$archname64" in
228            '') archname64=64int ;;
229            esac
230            ;;
231         esac
232         ;;
233 esac
234
235 case "$use64bitall" in
236 "$define"|true|[yY]*)
237 : Look for a hint-file generated 'call-back-unit'.  If the
238 : user has specified that a maximally 64-bit perl is to be built,
239 : we may need to set or change some other defaults.
240         if $test -f use64bitall.cbu; then
241                 echo "Your platform has some specific hints for 64-bit builds, using them..."
242                 . ./use64bitall.cbu
243         fi
244         case "$longsize" in
245         4) case "$archname64" in
246            ''|64int) archname64=64all ;;
247            esac
248            ;;
249         esac
250         ;;
251 esac
252
253 case "$d_quad:$use64bitint" in
254 $undef:$define)
255         cat >&4 <<EOF
256
257 *** You have chosen to use 64-bit integers,
258 *** but none cannot be found.
259 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
260 *** Cannot continue, aborting.
261
262 EOF
263         exit 1
264         ;;
265 esac
266