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