This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tidy up the 64-bit (and socklen_t) type probing.
[metaconfig.git] / U / modified / d_longdbl.U
CommitLineData
959f3c4c
JH
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:
a38738d1
JH
10?MAKE:d_longdbl longdblsize: Compile Setvar Myread \
11 echo n c cat rm test doublesize exe_ext
959f3c4c
JH
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
39echo " "
840deeaa 40echo "Checking to see if you have long double..." >&4
a38738d1
JH
41echo 'int main() { long double x = 7.0; }' > try.c
42set try
43if eval $compile; then
959f3c4c 44 val="$define"
1da6d93e 45 echo "You have long double."
959f3c4c
JH
46else
47 val="$undef"
1da6d93e 48 echo "You do not have long double."
959f3c4c
JH
49fi
50$rm try.*
51set d_longdbl
52eval $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.
57case "${d_longdbl}${longdblsize}" in
58$define)
59 echo " "
a38738d1 60 $echo $n "Checking to see how big your long doubles are..." $c >&4
959f3c4c
JH
61 $cat >try.c <<'EOCP'
62#include <stdio.h>
63int main()
64{
65 printf("%d\n", sizeof(long double));
66}
67EOCP
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'.
a38738d1 71 set try
959f3c4c 72 if eval $compile; then
a38738d1 73 longdblsize=`./try$exe_ext`
959f3c4c
JH
74 $echo " $longdblsize bytes." >&4
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 ;;
87esac
a38738d1 88$rm -f try.* try
959f3c4c
JH
89@end
90