This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Part 2 of a big cleanup action based on the upcoming dist-4.0
[metaconfig.git] / U / perl / uselongdbl.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:uselongdouble: Myread Oldconfig Setvar cat test usemorebits
9 ?MAKE:  -pick add $@ %<
10 ?Y:TOP
11 ?S:uselongdouble:
12 ?S:     This variable conditionally defines the USE_LONG_DOUBLE symbol,
13 ?S:     and indicates that long doubles should be used when available.
14 ?S:.
15 ?C:USE_LONG_DOUBLE:
16 ?C:     This symbol, if defined, indicates that long doubles should
17 ?C:     be used when available.
18 ?C:.
19 ?H:?%<:#ifndef USE_LONG_DOUBLE
20 ?H:?%<:#$uselongdouble  USE_LONG_DOUBLE         /**/
21 ?H:?%<:#endif
22 ?H:.
23 ?LINT:set uselongdouble
24 ?LINT:extern ccflags
25 ?LINT:change ccflags
26 ?LINT:use usemorebits
27 ?LINT:use uselargefiles
28 ?F:!uselongdouble.cbu
29 case "$ccflags" in
30 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
31 esac
32
33 case "$uselongdouble" in
34 $define|true|[yY]*)     dflt='y';;
35 *) dflt='n';;
36 esac
37 cat <<EOM
38
39 Perl can be built to take advantage of long doubles which
40 (if available) may give more accuracy and range for floating point numbers.
41
42 If this doesn't make any sense to you, just accept the default '$dflt'.
43 EOM
44 rp='Try to use long doubles if available?'
45 . ./myread
46 case "$ans" in
47 y|Y)    val="$define"   ;;
48 *)      val="$undef"    ;;
49 esac
50 set uselongdouble
51 eval $setvar
52
53 case "$uselongdouble" in
54 true|[yY]*) uselongdouble="$define" ;;
55 esac
56
57 : Look for a hint-file generated 'call-back-unit'.  If the
58 : user has specified that long doubles should be used,
59 : we may need to set or change some other defaults.
60 if $test -f uselongdouble.cbu; then
61     echo "Your platform has some specific hints regarding long doubles, using them..."
62     . ./uselongdouble.cbu
63 else
64     case "$uselongdouble" in
65         $define)
66                 $cat <<EOM
67 (Your platform does not have any specific hints for long doubles.)
68 EOM
69         ;;
70     esac
71 fi
72