This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
megalomaniac 64-bit update: most importantly,
[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:use64bits archname64: Myread Oldconfig Setvar test gccversion cat \
9         uselargefiles usemorebits longsize intsize ccflags
10 ?MAKE:  -pick add $@ %<
11 ?Y:TOP
12 ?S:use64bits:
13 ?S:     This variable conditionally defines the USE_64_BITS symbol,
14 ?S:     and indicates that 64-bit integer types should be used
15 ?S:     when available.
16 ?S:.
17 ?S:archname64:
18 ?S:     This variable is used for the 64-bitness part of $archname.
19 ?S:.
20 ?C:USE_64_BITS:
21 ?C:     This symbol, if defined, indicates that 64-bit integers should
22 ?C:     be used when available.  If not defined, the native integers
23 ?C:     will be used (be they 32 or 64 bits).
24 ?C:.
25 ?H:?%<:#ifndef USE_64_BITS
26 ?H:?%<:#$use64bits      USE_64_BITS             /**/
27 ?H:?%<:#endif
28 ?H:.
29 ?LINT:set use64bits
30 ?LINT:set archname64
31 ?LINT:extern ccflags
32 ?LINT:change ccflags
33 ?LINT:use uselargefiles
34 ?LINT:use usemorebits
35 ?LINT:extern uselonglong
36 ?LINT:use uselonglong
37 ?F:!use64bits.cbu
38
39 case "$intsize:$longsize" in
40 8:*|*:8) cat <<EOM
41
42 You have natively 64-bit integers.
43 EOM
44    val="$define"
45    ;;
46 *) case "$ccflags" in
47    *-DUSE_64_BITS*|*-DUSE_LONG_LONG*) use64bits="$define";;
48    *) case "$uselonglong" in
49       $define|true|[yY]*) use64bits="$define";;
50       esac
51       ;;
52    esac
53    case "$use64bits" in
54    $define|true|[yY]*) dflt='y';;
55    *) dflt='n';;
56    esac
57 cat <<EOM
58
59 Perl can be built to take advantage of 64-bit integer types
60 on some systems.  To do so, Configure must be run with -Duse64bits.
61
62 If this doesn't make any sense to you, just accept the default '$dflt'.
63 EOM
64    rp='Try to use 64-bit integers, if available?'
65    . ./myread
66    case "$ans" in
67    [yY]*) val="$define" ;;
68    *)     val="$undef"  ;;
69    esac
70    ;;
71 esac
72 set use64bits
73 eval $setvar
74
75 case "$archname64" in
76 '') archname64='' ;;    # not a typo
77 esac
78
79 case "$use64bits" in
80 "$define"|true|[yY]*)
81 : Look for a hint-file generated 'call-back-unit'.  If the
82 : user has specified that a 64-bit perl is to be built,
83 : we may need to set or change some other defaults.
84         if $test -f use64bits.cbu; then
85                 echo "Your platform has some specific hints for 64-bit builds, using them..."
86                 . ./use64bits.cbu
87         else
88                 $cat <<EOM
89 (Your platform doesn't have any specific hints for 64-bit builds.)
90 EOM
91                 case "$intsize:$longsize" in
92 8:*|*:8) cat <<EOM
93 (This is probably okay, as your system is a natively 64-bit system.)
94 EOM
95                   ;;
96                 esac
97                 case "$gccversion" in
98                 '')     ;;
99                 *)      case "$ccflags" in
100                         *-DUSE_LONG_LONG*) ;;
101                         *) $cat <<EOM
102 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
103 to the compilation flags.
104 EOM
105                            ccflags="$ccflags -DUSE_LONG_LONG"
106                            ;;
107                         esac
108                         ;;
109                 esac
110         fi
111         ;;
112 esac
113