This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
MileStone! I can now configure and build with dist-4.0
[metaconfig.git] / U / perl / use64bits.U
CommitLineData
959f3c4c
JH
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:
33b2427b 8?MAKE:use64bitint use64bitall archname64: Myread Oldconfig Setvar test \
88dc2d68 9 usemorebits longsize ccflags d_quad
959f3c4c
JH
10?MAKE: -pick add $@ %<
11?Y:TOP
33b2427b
JH
12?S:use64bitint:
13?S: This variable conditionally defines the USE_64_BIT_INT symbol,
f062a9c5 14?S: and indicates that 64-bit integer types should be used
0fdea05a
JH
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.
0fdea05a 19?S:.
33b2427b
JH
20?S:use64bitall:
21?S: This variable conditionally defines the USE_64_BIT_ALL symbol,
0fdea05a
JH
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
33b2427b 26?S: even more binary incompatible than USE_64_BIT_INT. You may not
0fdea05a
JH
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.
959f3c4c
JH
29?S:.
30?S:archname64:
31?S: This variable is used for the 64-bitness part of $archname.
32?S:.
33b2427b 33?C:USE_64_BIT_INT:
f062a9c5
JH
34?C: This symbol, if defined, indicates that 64-bit integers should
35?C: be used when available. If not defined, the native integers
0fdea05a
JH
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.
0fdea05a 40?C:.
33b2427b 41?C:USE_64_BIT_ALL:
0fdea05a
JH
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
33b2427b 47?C: even more binary incompatible than USE_64_BIT_INT. You may not
0fdea05a
JH
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.
959f3c4c 50?C:.
33b2427b
JH
51?H:?%<:#ifndef USE_64_BIT_INT
52?H:?%<:#$use64bitint USE_64_BIT_INT /**/
a38738d1 53?H:?%<:#endif
33b2427b
JH
54?H:?%<:#ifndef USE_64_BIT_ALL
55?H:?%<:#$use64bitall USE_64_BIT_ALL /**/
0fdea05a
JH
56?H:?%<:#endif
57?H:.
662bdb9a 58?INIT:archname64=''
42979b28 59?LINT:extern ccflags
f062a9c5 60?LINT:use usemorebits
ef22c3d9 61?LINT:extern use64bits
2bdc7c0c 62?LINT:extern uselonglong
ef22c3d9 63?LINT:extern uselonglongs
ef22c3d9 64?LINT:extern use64bitints
ef22c3d9 65?LINT:extern use64bitsint
ef22c3d9 66?LINT:extern use64bitsall
33b2427b
JH
67?F:!use64bitint.cbu
68?F:!use64bitall.cbu
959f3c4c 69
027391d4
JH
70case "$uselonglong" in
71"$define"|true|[yY]*)
72 cat <<EOM >&4
73
33b2427b 74*** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
027391d4 75EOM
33b2427b 76 use64bitint="$define"
027391d4 77 ;;
4c42341b 78esac
33b2427b
JH
79case "$use64bits" in
80"$define"|true|[yY]*)
81 cat <<EOM >&4
82
83*** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
33b2427b
JH
84EOM
85 use64bitint="$define"
86 ;;
4c42341b 87esac
33b2427b
JH
88case "$use64bitints" in
89"$define"|true|[yY]*)
90 cat <<EOM >&4
91
92*** There is no Configure -Duse64bitints, using -Duse64bitint instead.
33b2427b
JH
93EOM
94 use64bitint="$define"
95 ;;
4c42341b 96esac
ef22c3d9
JH
97case "$use64bitsint" in
98"$define"|true|[yY]*)
99 cat <<EOM >&4
100
101*** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
102EOM
103 use64bitint="$define"
104 ;;
4c42341b 105esac
ef22c3d9
JH
106case "$uselonglongs" in
107"$define"|true|[yY]*)
108 cat <<EOM >&4
109
110*** There is no Configure -Duselonglongs, using -Duse64bitint instead.
111EOM
112 use64bitint="$define"
113 ;;
4c42341b 114esac
429bdab9
JH
115case "$use64bitsall" in
116"$define"|true|[yY]*)
117 cat <<EOM >&4
118
119*** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
120EOM
121 use64bitall="$define"
122 ;;
4c42341b 123esac
33b2427b 124
027391d4 125case "$ccflags" in
33b2427b 126*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
027391d4 127esac
33b2427b
JH
128case "$use64bitall" in
129"$define"|true|[yY]*) use64bitint="$define" ;;
027391d4
JH
130esac
131
132case "$longsize" in
1338) cat <<EOM
f062a9c5 134
027391d4 135You have natively 64-bit long integers.
f062a9c5 136EOM
2bdc7c0c
JH
137 val="$define"
138 ;;
33b2427b 139*) case "$use64bitint" in
027391d4 140 "$define"|true|[yY]*) dflt='y';;
2bdc7c0c
JH
141 *) dflt='n';;
142 esac
dcf40b7d
JH
143 case "$d_quad" in
144 "$define") ;;
145 *) dflt='n' ;;
146 esac
0fdea05a 147 cat <<EOM
f062a9c5
JH
148
149Perl can be built to take advantage of 64-bit integer types
33b2427b 150on some systems. To do so, Configure can be run with -Duse64bitint.
0fdea05a 151Choosing this option will most probably introduce binary incompatibilities.
959f3c4c 152
2bdc7c0c 153If this doesn't make any sense to you, just accept the default '$dflt'.
dcf40b7d 154(The default has been chosen based on your configuration.)
959f3c4c 155EOM
2bdc7c0c
JH
156 rp='Try to use 64-bit integers, if available?'
157 . ./myread
158 case "$ans" in
159 [yY]*) val="$define" ;;
160 *) val="$undef" ;;
161 esac
162 ;;
959f3c4c 163esac
33b2427b 164set use64bitint
959f3c4c
JH
165eval $setvar
166
08b5bf24
JH
167case "$use64bitall" in
168"$define"|true|[yY]*) dflt='y' ;;
169*) case "$longsize" in
170 8) dflt='y' ;;
171 *) dflt='n' ;;
172 esac
173 ;;
4c42341b 174esac
eb9ee163
JH
175cat <<EOM
176
177You may also choose to try maximal 64-bitness. It means using as much
17864-bitness as possible on the platform. This in turn means even more
179binary incompatibilities. On the other hand, your platform may not
180have any more 64-bitness available than what you already have chosen.
181
182If this doesn't make any sense to you, just accept the default '$dflt'.
dcf40b7d 183(The default has been chosen based on your configuration.)
eb9ee163
JH
184EOM
185rp='Try to use maximal 64-bit support, if available?'
186. ./myread
187case "$ans" in
188[yY]*) val="$define" ;;
189*) val="$undef" ;;
190esac
33b2427b 191set use64bitall
0fdea05a 192eval $setvar
eb9ee163
JH
193case "$use64bitall" in
194"$define")
195 case "$use64bitint" in
196 "$undef")
197 cat <<EOM
198
199Since you have chosen a maximally 64-bit build, I'm also turning on
200the use of 64-bit integers.
201EOM
202 use64bitint="$define" ;;
203 esac
204 ;;
205esac
0fdea05a 206
959f3c4c 207: Look for a hint-file generated 'call-back-unit'. If the
f062a9c5 208: user has specified that a 64-bit perl is to be built,
959f3c4c 209: we may need to set or change some other defaults.
57f835c9
MB
210if $test -f use64bitint.cbu; then
211 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
212 . ./use64bitint.cbu
213fi
214case "$use64bitint" in
215"$define"|true|[yY]*)
0fdea05a 216 case "$longsize" in
f218e781 217 4) case "$archname64" in
33b2427b 218 '') archname64=64int ;;
0fdea05a
JH
219 esac
220 ;;
027391d4 221 esac
959f3c4c
JH
222 ;;
223esac
224
0fdea05a 225: Look for a hint-file generated 'call-back-unit'. If the
eb9ee163 226: user has specified that a maximally 64-bit perl is to be built,
0fdea05a 227: we may need to set or change some other defaults.
57f835c9
MB
228if $test -f use64bitall.cbu; then
229 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
230 . ./use64bitall.cbu
231fi
232case "$use64bitall" in
233"$define"|true|[yY]*)
0fdea05a 234 case "$longsize" in
faa3593a 235 4) case "$archname64" in
df7dac98 236 ''|64int) archname64=64all ;;
0fdea05a
JH
237 esac
238 ;;
239 esac
240 ;;
027391d4
JH
241esac
242
4b62dc2e
JH
243case "$d_quad:$use64bitint" in
244$undef:$define)
245 cat >&4 <<EOF
246
247*** You have chosen to use 64-bit integers,
6e998565 248*** but none can be found.
907ef768 249*** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
4b62dc2e
JH
250*** Cannot continue, aborting.
251
252EOF
253 exit 1
254 ;;
255esac
256