This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Megalopatch for Configure: Andy's new installation schemes;
[metaconfig.git] / U / modified / d_longdbl.U
1 ?RCS: $Id: d_longdbl.U,v $
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 ?RCS: $Log: d_longdbl.U,v $
9 ?RCS:
10 ?MAKE:d_longdbl longdblsize: Compile Setvar Myread \
11         cat rm test doublesize exe_ext
12 ?MAKE:  -pick add $@ %<
13 ?S:d_longdbl:
14 ?S:     This variable conditionally defines HAS_LONG_DOUBLE if 
15 ?S:     the long double type is supported.
16 ?S:.
17 ?S:longdblsize:
18 ?S:     This variable contains the value of the LONG_DOUBLESIZE symbol, which
19 ?S:     indicates to the C program how many bytes there are in a long double,
20 ?S:     if this system supports long doubles.
21 ?S:.
22 ?C:HAS_LONG_DOUBLE:
23 ?C:     This symbol will be defined if the C compiler supports long
24 ?C:     doubles.
25 ?C:.
26 ?C:LONG_DOUBLESIZE:
27 ?C:     This symbol contains the size of a long double, so that the 
28 ?C:     C preprocessor can make decisions based on it.  It is only
29 ?C:     defined if the system supports long doubles.
30 ?C:.
31 ?H:#$d_longdbl HAS_LONG_DOUBLE          /**/
32 ?H:?LONG_DOUBLESIZE:#ifdef HAS_LONG_DOUBLE
33 ?H:?LONG_DOUBLESIZE:#define LONG_DOUBLESIZE $longdblsize                /**/
34 ?H:?LONG_DOUBLESIZE:#endif
35 ?H:.
36 ?LINT:set d_longdbl
37 ?F:!try
38 : check for long doubles
39 echo " "
40 echo "Checking to see if you have long double..." >&4
41 echo 'int main() { long double x = 7.0; }' > try.c
42 set try
43 if eval $compile; then
44         val="$define"
45         echo "You have long double."
46 else
47         val="$undef"
48         echo "You do not have long double."
49 fi
50 $rm try.*
51 set d_longdbl
52 eval $setvar
53
54 @if LONG_DOUBLESIZE || longdblsize
55 : check for length of long double
56 ?X:  Check only if d_longdbl and if longdblsize is not already set.
57 case "${d_longdbl}${longdblsize}" in
58 $define)
59         echo " "
60         echo "Checking to see how big your long doubles are..." >&4
61         $cat >try.c <<'EOCP'
62 #include <stdio.h>
63 int main()
64 {
65         printf("%d\n", sizeof(long double));
66 }
67 EOCP
68         set try
69 ?X:     Don't use compile_ok because some compilers warn you that they have
70 ?X:     'long double' as just 'double'.
71         set try
72         if eval $compile; then
73                 longdblsize=`./try$exe_ext`
74                 echo "Your long doubles are $longdblsize bytes long."
75         else
76                 dflt='8'
77                 echo " "
78                 echo "(I can't seem to compile the test program.  Guessing...)" >&4
79                 rp="What is the size of a long double (in bytes)?"
80                 . ./myread
81                 longdblsize="$ans"
82         fi
83         if $test "X$doublesize" = "X$longdblsize"; then
84                 echo "(That isn't any different from an ordinary double.)"
85         fi      
86         ;;
87 esac
88 $rm -f try.* try
89 @end
90