This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / d_modfl.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 2000 Jarkko Hietaniemi
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:d_modfl d_modflproto: Inlibc Compile Hasproto cat \
9         test ccflags uselongdouble i_math \
10         d_sqrtl d_aintl d_copysignl d_ilogbl d_scalbnl d_frexpl d_ldexpl \
11         d_truncl
12 ?MAKE:  -pick add $@ %<
13 ?S:d_modfl:
14 ?S:     This variable conditionally defines the HAS_MODFL symbol, which
15 ?S:     indicates to the C program that the modfl() routine is available.
16 ?S:.
17 ?S:d_modflproto:
18 ?S:     This symbol, if defined, indicates that the system provides
19 ?S:     a prototype for the modfl() function.  Otherwise, it is up
20 ?S:     to the program to supply one.  C99 says it should be
21 ?S:             long double modfl(long double, long double *);
22 ?S:.
23 ?C:HAS_MODFL:
24 ?C:     This symbol, if defined, indicates that the modfl routine is
25 ?C:     available to split a long double x into a fractional part f and
26 ?C:     an integer part i such that |f| < 1.0 and (f + i) = x.
27 ?C:.
28 ?C:HAS_MODFL_PROTO:
29 ?C:     This symbol, if defined, indicates that the system provides
30 ?C:     a prototype for the modfl() function.  Otherwise, it is up
31 ?C:     to the program to supply one.
32 ?C:.
33 ?H:#$d_modfl HAS_MODFL          /**/
34 ?H:#$d_modflproto HAS_MODFL_PROTO               /**/
35 ?H:.
36 ?T:message
37 ?LINT:set d_modfl
38 ?LINT:set d_modflproto
39 ?LINT:change ccflags
40 : see if modfl exists
41 set modfl d_modfl
42 eval $inlibc
43
44 : see if prototype for modfl is available
45 echo " "
46 set d_modflproto modfl $i_math math.h
47 eval $hasproto
48
49 if $test "$uselongdouble" = "$define"; then
50     message=""
51     if $test "$d_sqrtl" != "$define"; then
52         message="$message sqrtl"
53     fi
54     if $test "$d_modfl" != "$define"; then
55         if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
56             echo "You have both truncl and copysignl, so I can emulate modfl."
57         else
58             if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
59                 echo "You have both aintl and copysignl, so I can emulate modfl."
60             else
61                 message="$message modfl"
62             fi
63         fi
64     fi
65     if $test "$d_frexpl" != "$define"; then
66         if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
67             echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
68         else
69             message="$message frexpl"
70         fi
71     fi
72     if $test "$d_ldexpl" != "$define"; then
73         message="$message ldexpl"
74     fi
75
76     if $test "$message" != ""; then
77         $cat <<EOM >&4
78
79 *** You requested the use of long doubles but you do not seem to have
80 *** the following mathematical functions needed for long double support:
81 ***    $message
82 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
83 *** Cannot continue, aborting.
84
85 EOM
86
87         exit 1
88     fi
89 fi
90