This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Even better use64bitall logic.
[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 \
027391d4 9 uselargefiles usemorebits longsize ccflags
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
959f3c4c 54?H:.
33b2427b
JH
55?H:?%<:#ifndef USE_64_BIT_ALL
56?H:?%<:#$use64bitall USE_64_BIT_ALL /**/
0fdea05a
JH
57?H:?%<:#endif
58?H:.
33b2427b 59?LINT:set use64bitint
42979b28
JH
60?LINT:extern ccflags
61?LINT:change ccflags
313cb6b3 62?LINT:use uselargefiles
f062a9c5 63?LINT:use usemorebits
2bdc7c0c
JH
64?LINT:extern uselonglong
65?LINT:use uselonglong
33b2427b
JH
66?LINT:set use64bitall
67?F:!use64bitint.cbu
68?F:!use64bitall.cbu
959f3c4c 69
027391d4
JH
70# Backward compatibility (uselonglong is deprecated).
71case "$uselonglong" in
72"$define"|true|[yY]*)
73 cat <<EOM >&4
74
33b2427b 75*** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
027391d4 76EOM
33b2427b 77 use64bitint="$define"
027391d4
JH
78 ;;
79esac
33b2427b
JH
80# Backward compatibility (use64bits is deprecated).
81case "$use64bits" in
82"$define"|true|[yY]*)
83 cat <<EOM >&4
84
85*** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
33b2427b
JH
86EOM
87 use64bitint="$define"
88 ;;
89esac
90# Thinko compatibility
91case "$use64bitints" in
92"$define"|true|[yY]*)
93 cat <<EOM >&4
94
95*** There is no Configure -Duse64bitints, using -Duse64bitint instead.
33b2427b
JH
96EOM
97 use64bitint="$define"
98 ;;
99esac
100
027391d4 101case "$ccflags" in
33b2427b 102*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
027391d4 103esac
33b2427b
JH
104case "$use64bitall" in
105"$define"|true|[yY]*) use64bitint="$define" ;;
027391d4
JH
106esac
107
108case "$longsize" in
1098) cat <<EOM
f062a9c5 110
027391d4 111You have natively 64-bit long integers.
f062a9c5 112EOM
2bdc7c0c
JH
113 val="$define"
114 ;;
33b2427b 115*) case "$use64bitint" in
027391d4 116 "$define"|true|[yY]*) dflt='y';;
2bdc7c0c
JH
117 *) dflt='n';;
118 esac
0fdea05a 119 cat <<EOM
f062a9c5
JH
120
121Perl can be built to take advantage of 64-bit integer types
33b2427b 122on some systems. To do so, Configure can be run with -Duse64bitint.
0fdea05a 123Choosing this option will most probably introduce binary incompatibilities.
959f3c4c 124
2bdc7c0c 125If this doesn't make any sense to you, just accept the default '$dflt'.
959f3c4c 126EOM
2bdc7c0c
JH
127 rp='Try to use 64-bit integers, if available?'
128 . ./myread
129 case "$ans" in
130 [yY]*) val="$define" ;;
131 *) val="$undef" ;;
132 esac
133 ;;
959f3c4c 134esac
33b2427b 135set use64bitint
959f3c4c
JH
136eval $setvar
137
55f37661
JH
138case "$use64bitint" in
139"$define") case "$longsize" in
eb9ee163
JH
140 8) dflt='y' ;;
141 *) dflt='n' ;;
55f37661
JH
142 esac
143 ;;
144*) case "$use64bitall" in
eb9ee163
JH
145 "$define"|true|[yY]*) dflt='y' ;;
146 *) dflt='n' ;;
0fdea05a
JH
147 esac
148 ;;
149esac
eb9ee163
JH
150cat <<EOM
151
152You may also choose to try maximal 64-bitness. It means using as much
15364-bitness as possible on the platform. This in turn means even more
154binary incompatibilities. On the other hand, your platform may not
155have any more 64-bitness available than what you already have chosen.
156
157If this doesn't make any sense to you, just accept the default '$dflt'.
158EOM
159rp='Try to use maximal 64-bit support, if available?'
160. ./myread
161case "$ans" in
162[yY]*) val="$define" ;;
163*) val="$undef" ;;
164esac
33b2427b 165set use64bitall
0fdea05a 166eval $setvar
eb9ee163
JH
167case "$use64bitall" in
168"$define")
169 case "$use64bitint" in
170 "$undef")
171 cat <<EOM
172
173Since you have chosen a maximally 64-bit build, I'm also turning on
174the use of 64-bit integers.
175EOM
176 use64bitint="$define" ;;
177 esac
178 ;;
179esac
0fdea05a 180
33b2427b 181case "$use64bitint" in
959f3c4c
JH
182"$define"|true|[yY]*)
183: Look for a hint-file generated 'call-back-unit'. If the
f062a9c5 184: user has specified that a 64-bit perl is to be built,
959f3c4c 185: we may need to set or change some other defaults.
33b2427b 186 if $test -f use64bitint.cbu; then
55f37661 187 echo "Your platform has some specific hints for 64-bit integers, using them..."
33b2427b 188 . ./use64bitint.cbu
42979b28 189 fi
0fdea05a
JH
190 case "$longsize" in
191 4) case "$ccflags" in
33b2427b
JH
192 *-DUSE_64_BIT_INT*) ;;
193 *) ccflags="$ccflags -DUSE_64_BIT_INT";;
0fdea05a
JH
194 esac
195 case "$archname64" in
33b2427b 196 '') archname64=64int ;;
0fdea05a
JH
197 esac
198 ;;
027391d4 199 esac
959f3c4c
JH
200 ;;
201esac
202
33b2427b 203case "$use64bitall" in
0fdea05a
JH
204"$define"|true|[yY]*)
205: Look for a hint-file generated 'call-back-unit'. If the
eb9ee163 206: user has specified that a maximally 64-bit perl is to be built,
0fdea05a 207: we may need to set or change some other defaults.
33b2427b 208 if $test -f use64bitall.cbu; then
eb9ee163 209 echo "Your platform has some specific hints for 64-bit builds, using them..."
33b2427b 210 . ./use64bitall.cbu
0fdea05a
JH
211 fi
212 case "$longsize" in
213 4) case "$ccflags" in
33b2427b
JH
214 *-DUSE_64_BIT_ALL*) ;;
215 *) ccflags="$ccflags -DUSE_64_BIT_ALL";;
0fdea05a
JH
216 esac
217 case "$archname64" in
33b2427b 218 ''|64) archname64=64all ;;
0fdea05a
JH
219 esac
220 ;;
221 esac
222 ;;
027391d4
JH
223esac
224