In metaconfig.git, the branch master has been updated <http://perl5.git.perl.org/metaconfig.git/commitdiff/0e620fbb347b7bf10ec2459f3646808509a30c3c?hp=4bd46abc0fc7eb714609c1df737b8f0a7557adc6>
- Log ----------------------------------------------------------------- commit 0e620fbb347b7bf10ec2459f3646808509a30c3c Author: H.Merijn Brand - Tux <[email protected]> Date: Tue Nov 18 22:14:15 2014 +0100 Backport all of Jarkko's new (math) function probes next are the other changes and checks on Glossary and config_h.SH ----------------------------------------------------------------------- Summary of changes: U/modified/d_longdbl.U | 18 +++++-- U/modified/libs.U | 5 +- U/perl/d_asinh.U | 20 +++++++ U/perl/d_atanh.U | 20 +++++++ U/perl/d_copysign.U | 24 +++++++++ U/perl/d_erf.U | 20 +++++++ U/perl/d_erfc.U | 20 +++++++ U/perl/d_exp2.U | 20 +++++++ U/perl/d_expm1.U | 20 +++++++ U/perl/d_fdim.U | 20 +++++++ U/perl/d_fma.U | 20 +++++++ U/perl/d_fmax.U | 20 +++++++ U/perl/d_fmin.U | 20 +++++++ U/perl/d_hypot.U | 20 +++++++ U/perl/d_ilogb.U | 20 +++++++ U/perl/d_isless.U | 37 +++++++++++++ U/perl/d_isnormal.U | 37 +++++++++++++ U/perl/d_lgamma.U | 21 ++++++++ U/perl/d_lgamma_r.U | 21 ++++++++ U/perl/d_llrint.U | 21 ++++++++ U/perl/d_llround.U | 20 +++++++ U/perl/d_log1p.U | 20 +++++++ U/perl/d_log2.U | 20 +++++++ U/perl/d_logb.U | 20 +++++++ U/perl/d_lrint.U | 21 ++++++++ U/perl/d_lround.U | 20 +++++++ U/perl/d_nan.U | 20 +++++++ U/perl/d_nearbyint.U | 21 ++++++++ U/perl/d_nextafter.U | 21 ++++++++ U/perl/d_nexttoward.U | 21 ++++++++ U/perl/d_remainder.U | 20 +++++++ U/perl/d_remquo.U | 20 +++++++ U/perl/d_rint.U | 21 ++++++++ U/perl/d_round.U | 20 +++++++ U/perl/d_scalbn.U | 20 +++++++ U/perl/d_tgamma.U | 21 ++++++++ U/perl/d_trunc.U | 21 ++++++++ U/perl/i_fp.U | 2 +- U/perl/i_quadmath.U | 20 +++++++ U/perl/longdblfio.U | 141 +++++++++++++++++++++++++++++++++++++++++++++++-- U/perl/perlxv.U | 48 +++++++++++++++-- U/perl/perlxvf.U | 37 ++++++++----- U/perl/usequadmath.U | 24 +++++++++ U/threads/archname.U | 84 +++++++++++++++++------------ 44 files changed, 1065 insertions(+), 62 deletions(-) create mode 100644 U/perl/d_asinh.U create mode 100644 U/perl/d_atanh.U create mode 100644 U/perl/d_copysign.U create mode 100644 U/perl/d_erf.U create mode 100644 U/perl/d_erfc.U create mode 100644 U/perl/d_exp2.U create mode 100644 U/perl/d_expm1.U create mode 100644 U/perl/d_fdim.U create mode 100644 U/perl/d_fma.U create mode 100644 U/perl/d_fmax.U create mode 100644 U/perl/d_fmin.U create mode 100644 U/perl/d_hypot.U create mode 100644 U/perl/d_ilogb.U create mode 100644 U/perl/d_isless.U create mode 100644 U/perl/d_isnormal.U create mode 100644 U/perl/d_lgamma.U create mode 100644 U/perl/d_lgamma_r.U create mode 100644 U/perl/d_llrint.U create mode 100644 U/perl/d_llround.U create mode 100644 U/perl/d_log1p.U create mode 100644 U/perl/d_log2.U create mode 100644 U/perl/d_logb.U create mode 100644 U/perl/d_lrint.U create mode 100644 U/perl/d_lround.U create mode 100644 U/perl/d_nan.U create mode 100644 U/perl/d_nearbyint.U create mode 100644 U/perl/d_nextafter.U create mode 100644 U/perl/d_nexttoward.U create mode 100644 U/perl/d_remainder.U create mode 100644 U/perl/d_remquo.U create mode 100644 U/perl/d_rint.U create mode 100644 U/perl/d_round.U create mode 100644 U/perl/d_scalbn.U create mode 100644 U/perl/d_tgamma.U create mode 100644 U/perl/d_trunc.U create mode 100644 U/perl/i_quadmath.U create mode 100644 U/perl/usequadmath.U diff --git a/U/modified/d_longdbl.U b/U/modified/d_longdbl.U index 16c7b13..6cd9f5f 100644 --- a/U/modified/d_longdbl.U +++ b/U/modified/d_longdbl.U @@ -144,6 +144,7 @@ $cat <<EOP >try.c #$i_float I_FLOAT #$i_stdlib I_STDLIB #define LONGDBLSIZE $longdblsize +#define DOUBLESIZE $doublesize #ifdef I_FLOAT #include <float.h> #endif @@ -154,7 +155,11 @@ $cat <<EOP >try.c static const long double d = -0.1L; int main() { unsigned const char* b = (unsigned const char*)(&d); -#if LDBL_MANT_DIG == 113 && LONGDBLSIZE == 16 +#if DOUBLESIZE == LONGDBLSIZE + printf("0\n"); /* if it floats like double */ + exit(0); +#endif +#if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) { /* IEEE 754 128-bit little-endian */ printf("1\n"); @@ -166,6 +171,8 @@ int main() { exit(0); } #endif +/* For alignment 32-bit platforms have the 80 bits in 12 bytes, + * while 64-bits platforms have it in 16 bytes. */ #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12) if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) { /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86) @@ -180,8 +187,9 @@ int main() { exit(0); } #endif -#if LDBL_MANT_DIG == 106 && LONGDBLSIZE == 16 - /* software "double double", the 106 is 53+53 */ +#if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16 + /* software "double double", the 106 is 53+53. + * but irix thinks it is 107. */ if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) { /* double double 128-bit little-endian, * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */ @@ -213,8 +221,10 @@ case "$longdblkind" in 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;; 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;; 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;; +4) echo "You have x86 80-bit big endian long doubles." >& 4 ;; +5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;; +6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;; *) echo "Cannot figure out your long double." >&4 ;; esac $rm_try - diff --git a/U/modified/libs.U b/U/modified/libs.U index 7c6dafe..ddccbb7 100644 --- a/U/modified/libs.U +++ b/U/modified/libs.U @@ -34,7 +34,7 @@ ?RCS: ?MAKE:libs ignore_versioned_solibs libsfound libsfiles libsdirs libspath: \ test cat Myread Oldconfig Loc libpth package xlibpth so _a \ - usesocks sed uselongdouble + usesocks sed uselongdouble usequadmath ?MAKE: -pick add $@ %< ?S:libs: ?S: This variable holds the additional libraries we want to use. @@ -110,6 +110,9 @@ esac case "$usecbacktrace" in "$define") libswanted="$libswanted bfd" ;; esac +case "$usequadmath" in +"$define") libswanted="$libswanted quadmath" ;; +esac libsfound='' libsfiles='' libsdirs='' diff --git a/U/perl/d_asinh.U b/U/perl/d_asinh.U new file mode 100644 index 0000000..912d82f --- /dev/null +++ b/U/perl/d_asinh.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_asinh: Inlibc +?MAKE: -pick add $@ %< +?S:d_asinh: +?S: This variable conditionally defines the HAS_ASINH symbol, which +?S: indicates to the C program that the asinh() routine is available. +?S:. +?C:HAS_ASINH: +?C: This symbol, if defined, indicates that the asinh routine is +?C: available to do the inverse hyperbolic sine function. +?C:. +?H:#$d_asinh HAS_ASINH /**/ +?H:. +?LINT:set d_asinh +: see if asinh exists +set asinh d_asinh +eval $inlibc + diff --git a/U/perl/d_atanh.U b/U/perl/d_atanh.U new file mode 100644 index 0000000..c64967e --- /dev/null +++ b/U/perl/d_atanh.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_atanh: Inlibc +?MAKE: -pick add $@ %< +?S:d_atanh: +?S: This variable conditionally defines the HAS_ATANH symbol, which +?S: indicates to the C program that the atanh() routine is available. +?S:. +?C:HAS_ATANH: +?C: This symbol, if defined, indicates that the atanh routine is +?C: available to do the inverse hyperbolic tangent function. +?C:. +?H:#$d_atanh HAS_ATANH /**/ +?H:. +?LINT:set d_atanh +: see if atanh exists +set atanh d_atanh +eval $inlibc + diff --git a/U/perl/d_copysign.U b/U/perl/d_copysign.U new file mode 100644 index 0000000..b769416 --- /dev/null +++ b/U/perl/d_copysign.U @@ -0,0 +1,24 @@ +?RCS: $Id$ +?RCS: +?RCS: Copyright (c) 2014 Jarkko Hietaniemi & H.Merijn Brand +?RCS: +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_copysign: Inlibc +?MAKE: -pick add $@ %< +?S:d_copysign: +?S: This variable conditionally defines the HAS_COPYSIGN symbol, which +?S: indicates to the C program that the copysign() routine is available. +?S:. +?C:HAS_COPYSIGN: +?C: This symbol, if defined, indicates that the copysign routine is +?C: available to do the copysign function. +?C:. +?H:#$d_copysign HAS_COPYSIGN /**/ +?H:. +?LINT:set d_copysign +: see if copysign exists +set copysign d_copysign +eval $inlibc + diff --git a/U/perl/d_erf.U b/U/perl/d_erf.U new file mode 100644 index 0000000..100e9ce --- /dev/null +++ b/U/perl/d_erf.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_erf: Inlibc +?MAKE: -pick add $@ %< +?S:d_erf: +?S: This variable conditionally defines the HAS_ERF symbol, which +?S: indicates to the C program that the erf() routine is available. +?S:. +?C:HAS_ERF: +?C: This symbol, if defined, indicates that the erf routine is +?C: available to do the error function. +?C:. +?H:#$d_erf HAS_ERF /**/ +?H:. +?LINT:set d_erf +: see if erf exists +set erf d_erf +eval $inlibc + diff --git a/U/perl/d_erfc.U b/U/perl/d_erfc.U new file mode 100644 index 0000000..9e32135 --- /dev/null +++ b/U/perl/d_erfc.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_erfc: Inlibc +?MAKE: -pick add $@ %< +?S:d_erfc: +?S: This variable conditionally defines the HAS_ERFC symbol, which +?S: indicates to the C program that the erfc() routine is available. +?S:. +?C:HAS_ERFC: +?C: This symbol, if defined, indicates that the erfc routine is +?C: available to do the complementary error function. +?C:. +?H:#$d_erfc HAS_ERFC /**/ +?H:. +?LINT:set d_erfc +: see if erfc exists +set erfc d_erfc +eval $inlibc + diff --git a/U/perl/d_exp2.U b/U/perl/d_exp2.U new file mode 100644 index 0000000..37d3411 --- /dev/null +++ b/U/perl/d_exp2.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_exp2: Inlibc +?MAKE: -pick add $@ %< +?S:d_exp2: +?S: This variable conditionally defines the HAS_EXP2 symbol, which +?S: indicates to the C program that the exp2() routine is available. +?S:. +?C:HAS_EXP2: +?C: This symbol, if defined, indicates that the exp2 routine is +?C: available to do the 2**x function. +?C:. +?H:#$d_exp2 HAS_EXP2 /**/ +?H:. +?LINT:set d_exp2 +: see if exp2 exists +set exp2 d_exp2 +eval $inlibc + diff --git a/U/perl/d_expm1.U b/U/perl/d_expm1.U new file mode 100644 index 0000000..cf42440 --- /dev/null +++ b/U/perl/d_expm1.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_expm1: Inlibc +?MAKE: -pick add $@ %< +?S:d_expm1: +?S: This variable conditionally defines the HAS_EXPM1 symbol, which +?S: indicates to the C program that the expm1() routine is available. +?S:. +?C:HAS_EXPM1: +?C: This symbol, if defined, indicates that the expm1 routine is +?C: available to do the exp(x) - 1 when x is near 1 function. +?C:. +?H:#$d_expm1 HAS_EXPM1 /**/ +?H:. +?LINT:set d_expm1 +: see if expm1 exists +set expm1 d_expm1 +eval $inlibc + diff --git a/U/perl/d_fdim.U b/U/perl/d_fdim.U new file mode 100644 index 0000000..391aa35 --- /dev/null +++ b/U/perl/d_fdim.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_fdim: Inlibc +?MAKE: -pick add $@ %< +?S:d_fdim: +?S: This variable conditionally defines the HAS_FDIM symbol, which +?S: indicates to the C program that the fdim() routine is available. +?S:. +?C:HAS_FDIM: +?C: This symbol, if defined, indicates that the fdim routine is +?C: available to do the positive difference function. +?C:. +?H:#$d_fdim HAS_FDIM /**/ +?H:. +?LINT:set d_fdim +: see if fdim exists +set fdim d_fdim +eval $inlibc + diff --git a/U/perl/d_fma.U b/U/perl/d_fma.U new file mode 100644 index 0000000..b03b88d --- /dev/null +++ b/U/perl/d_fma.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_fma: Inlibc +?MAKE: -pick add $@ %< +?S:d_fma: +?S: This variable conditionally defines the HAS_FMA symbol, which +?S: indicates to the C program that the fma() routine is available. +?S:. +?C:HAS_FMA: +?C: This symbol, if defined, indicates that the fma routine is +?C: available to do the multiply-add function. +?C:. +?H:#$d_fma HAS_FMA /**/ +?H:. +?LINT:set d_fma +: see if fma exists +set fma d_fma +eval $inlibc + diff --git a/U/perl/d_fmax.U b/U/perl/d_fmax.U new file mode 100644 index 0000000..e735944 --- /dev/null +++ b/U/perl/d_fmax.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_fmax: Inlibc +?MAKE: -pick add $@ %< +?S:d_fmax: +?S: This variable conditionally defines the HAS_FMAX symbol, which +?S: indicates to the C program that the fmax() routine is available. +?S:. +?C:HAS_FMAX: +?C: This symbol, if defined, indicates that the fmax routine is +?C: available to do the maximum function. +?C:. +?H:#$d_fmax HAS_FMAX /**/ +?H:. +?LINT:set d_fmax +: see if fmax exists +set fmax d_fmax +eval $inlibc + diff --git a/U/perl/d_fmin.U b/U/perl/d_fmin.U new file mode 100644 index 0000000..3391140 --- /dev/null +++ b/U/perl/d_fmin.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_fmin: Inlibc +?MAKE: -pick add $@ %< +?S:d_fmin: +?S: This variable conditionally defines the HAS_FMIN symbol, which +?S: indicates to the C program that the fmin() routine is available. +?S:. +?C:HAS_FMIN: +?C: This symbol, if defined, indicates that the fmin routine is +?C: available to do the minimum function. +?C:. +?H:#$d_fmin HAS_FMIN /**/ +?H:. +?LINT:set d_fmin +: see if fmin exists +set fmin d_fmin +eval $inlibc + diff --git a/U/perl/d_hypot.U b/U/perl/d_hypot.U new file mode 100644 index 0000000..e9b796c --- /dev/null +++ b/U/perl/d_hypot.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_hypot: Inlibc +?MAKE: -pick add $@ %< +?S:d_hypot: +?S: This variable conditionally defines the HAS_HYPOT symbol, which +?S: indicates to the C program that the hypot() routine is available. +?S:. +?C:HAS_HYPOT: +?C: This symbol, if defined, indicates that the hypot routine is +?C: available to do the hypotenuse function. +?C:. +?H:#$d_hypot HAS_HYPOT /**/ +?H:. +?LINT:set d_hypot +: see if hypot exists +set hypot d_hypot +eval $inlibc + diff --git a/U/perl/d_ilogb.U b/U/perl/d_ilogb.U new file mode 100644 index 0000000..a88c5b7 --- /dev/null +++ b/U/perl/d_ilogb.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_ilogb: Inlibc +?MAKE: -pick add $@ %< +?S:d_ilogb: +?S: This variable conditionally defines the HAS_ILOGB symbol, which +?S: indicates to the C program that the ilogb() routine is available. +?S:. +?C:HAS_ILOGB: +?C: This symbol, if defined, indicates that the ilogb routine is +?C: available to get integer exponent of a floating-point value. +?C:. +?H:#$d_ilogb HAS_ILOGB /**/ +?H:. +?LINT:set d_ilogb +: see if ilogb exists +set ilogb d_ilogb +eval $inlibc + diff --git a/U/perl/d_isless.U b/U/perl/d_isless.U new file mode 100644 index 0000000..7a0f6fb --- /dev/null +++ b/U/perl/d_isless.U @@ -0,0 +1,37 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_isless: cat i_math Compile rm_try Setvar +?MAKE: -pick add $@ %< +?S:d_isless: +?S: This variable conditionally defines the HAS_ISLESS symbol, which +?S: indicates to the C program that the isless() routine is available. +?S:. +?C:HAS_ISLESS: +?C: This symbol, if defined, indicates that the isless routine is +?C: available to do the error function. +?C:. +?H:#$d_isless HAS_ISLESS /**/ +?H:. +?LINT:set d_isless +: check for isless +echo "Checking to see if you have isless..." >&4 +$cat >try.c <<EOCP +#$i_math I_MATH +#ifdef I_MATH +#include <math.h> +#endif +int main() { return isless(0.0); } +EOCP +set try +if eval $compile; then + val="$define" + echo "You have isless." +else + val="$undef" + echo "You do not have isless." +fi +$rm_try +set d_isless +eval $setvar + diff --git a/U/perl/d_isnormal.U b/U/perl/d_isnormal.U new file mode 100644 index 0000000..4bf89f3 --- /dev/null +++ b/U/perl/d_isnormal.U @@ -0,0 +1,37 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_isnormal: cat i_math Compile Setvar rm_try +?MAKE: -pick add $@ %< +?S:d_isnormal: +?S: This variable conditionally defines the HAS_ISNORMAL symbol, which +?S: indicates to the C program that the isnormal() routine is available. +?S:. +?C:HAS_ISNORMAL: +?C: This symbol, if defined, indicates that the isnormal routine is +?C: available to check whether a double is normal (non-zero normalized). +?C:. +?H:#$d_isnormal HAS_ISNORMAL /**/ +?H:. +?LINT:set d_isnormal +: check for isnormal +echo "Checking to see if you have isnormal..." >&4 +$cat >try.c <<EOCP +#$i_math I_MATH +#ifdef I_MATH +#include <math.h> +#endif +int main() { return isnormal(0.0); } +EOCP +set try +if eval $compile; then + val="$define" + echo "You have isnormal." +else + val="$undef" + echo "You do not have isnormal." +fi +$rm_try +set d_isnormal +eval $setvar + diff --git a/U/perl/d_lgamma.U b/U/perl/d_lgamma.U new file mode 100644 index 0000000..3a68e95 --- /dev/null +++ b/U/perl/d_lgamma.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_lgamma: Inlibc +?MAKE: -pick add $@ %< +?S:d_lgamma: +?S: This variable conditionally defines the HAS_LGAMMA symbol, which +?S: indicates to the C program that the lgamma() routine is available. +?S:. +?C:HAS_LGAMMA: +?C: This symbol, if defined, indicates that the lgamma routine is +?C: available to do the log gamma function. See also HAS_TGAMMA and +?C: HAS_LGAMMA_R. +?C:. +?H:#$d_lgamma HAS_LGAMMA /**/ +?H:. +?LINT:set d_lgamma +: see if lgamma exists +set lgamma d_lgamma +eval $inlibc + diff --git a/U/perl/d_lgamma_r.U b/U/perl/d_lgamma_r.U new file mode 100644 index 0000000..24411fd --- /dev/null +++ b/U/perl/d_lgamma_r.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_lgamma_r: Inlibc +?MAKE: -pick add $@ %< +?S:d_lgamma_r: +?S: This variable conditionally defines the HAS_LGAMMA_R symbol, which +?S: indicates to the C program that the lgamma_r() routine is available. +?S:. +?C:HAS_LGAMMA_R: +?C: This symbol, if defined, indicates that the lgamma_r routine is +?C: available to do the log gamma function without using the global +?C: signgam variable. +?C:. +?H:#$d_lgamma_r HAS_LGAMMA_R /**/ +?H:. +?LINT:set d_lgamma_r +: see if lgamma_r exists +set lgamma_r d_lgamma_r +eval $inlibc + diff --git a/U/perl/d_llrint.U b/U/perl/d_llrint.U new file mode 100644 index 0000000..5dab0e5 --- /dev/null +++ b/U/perl/d_llrint.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_llrint: Inlibc +?MAKE: -pick add $@ %< +?S:d_llrint: +?S: This variable conditionally defines the HAS_LLRINT symbol, which +?S: indicates to the C program that the llrint() routine is available. +?S:. +?C:HAS_LLRINT: +?C: This symbol, if defined, indicates that the llrint routine is +?C: available to to return the closest long long value according to +?C: the current rounding mode. +?C:. +?H:#$d_llrint HAS_LLRINT /**/ +?H:. +?LINT:set d_llrint +: see if llrint exists +set llrint d_llrint +eval $inlibc + diff --git a/U/perl/d_llround.U b/U/perl/d_llround.U new file mode 100644 index 0000000..3899af3 --- /dev/null +++ b/U/perl/d_llround.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_llround: Inlibc +?MAKE: -pick add $@ %< +?S:d_llround: +?S: This variable conditionally defines the HAS_LLROUND symbol, which +?S: indicates to the C program that the llround() routine is available. +?S:. +?C:HAS_LLROUND: +?C: This symbol, if defined, indicates that the llround routine is +?C: available to return the nearest long long value. +?C:. +?H:#$d_llround HAS_LLROUND /**/ +?H:. +?LINT:set d_llround +: see if llround exists +set llround d_llround +eval $inlibc + diff --git a/U/perl/d_log1p.U b/U/perl/d_log1p.U new file mode 100644 index 0000000..154ddcc --- /dev/null +++ b/U/perl/d_log1p.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_log1p: Inlibc +?MAKE: -pick add $@ %< +?S:d_log1p: +?S: This variable conditionally defines the HAS_LOG1P symbol, which +?S: indicates to the C program that the log1p() routine is available. +?S:. +?C:HAS_LOG1P: +?C: This symbol, if defined, indicates that the log1p routine is +?C: available to do the logarithm of 1 plus argument function. +?C:. +?H:#$d_log1p HAS_LOG1P /**/ +?H:. +?LINT:set d_log1p +: see if log1p exists +set log1p d_log1p +eval $inlibc + diff --git a/U/perl/d_log2.U b/U/perl/d_log2.U new file mode 100644 index 0000000..32401b6 --- /dev/null +++ b/U/perl/d_log2.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_log2: Inlibc +?MAKE: -pick add $@ %< +?S:d_log2: +?S: This variable conditionally defines the HAS_LOG2 symbol, which +?S: indicates to the C program that the log2() routine is available. +?S:. +?C:HAS_LOG2: +?C: This symbol, if defined, indicates that the log2 routine is +?C: available to do the log2 function. +?C:. +?H:#$d_log2 HAS_LOG2 /**/ +?H:. +?LINT:set d_log2 +: see if log2 exists +set log2 d_log2 +eval $inlibc + diff --git a/U/perl/d_logb.U b/U/perl/d_logb.U new file mode 100644 index 0000000..ec47f22 --- /dev/null +++ b/U/perl/d_logb.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_logb: Inlibc +?MAKE: -pick add $@ %< +?S:d_logb: +?S: This variable conditionally defines the HAS_LOGB symbol, which +?S: indicates to the C program that the logb() routine is available. +?S:. +?C:HAS_LOGB: +?C: This symbol, if defined, indicates that the logb routine is +?C: available to do the logb function. +?C:. +?H:#$d_logb HAS_LOGB /**/ +?H:. +?LINT:set d_logb +: see if logb exists +set logb d_logb +eval $inlibc + diff --git a/U/perl/d_lrint.U b/U/perl/d_lrint.U new file mode 100644 index 0000000..54b81fa --- /dev/null +++ b/U/perl/d_lrint.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_lrint: Inlibc +?MAKE: -pick add $@ %< +?S:d_lrint: +?S: This variable conditionally defines the HAS_LRINT symbol, which +?S: indicates to the C program that the lrint() routine is available. +?S:. +?C:HAS_LRINT: +?C: This symbol, if defined, indicates that the lrint routine is +?C: available to return the closest integral value according to +?C: the current rounding mode. +?C:. +?H:#$d_lrint HAS_LRINT /**/ +?H:. +?LINT:set d_lrint +: see if lrint exists +set lrint d_lrint +eval $inlibc + diff --git a/U/perl/d_lround.U b/U/perl/d_lround.U new file mode 100644 index 0000000..8a5b6a2 --- /dev/null +++ b/U/perl/d_lround.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_lround: Inlibc +?MAKE: -pick add $@ %< +?S:d_lround: +?S: This variable conditionally defines the HAS_LROUND symbol, which +?S: indicates to the C program that the lround() routine is available. +?S:. +?C:HAS_LROUND: +?C: This symbol, if defined, indicates that the lround routine is +?C: available to return the nearest integral value. +?C:. +?H:#$d_lround HAS_LROUND /**/ +?H:. +?LINT:set d_lround +: see if lround exists +set lround d_lround +eval $inlibc + diff --git a/U/perl/d_nan.U b/U/perl/d_nan.U new file mode 100644 index 0000000..4e8c2f8 --- /dev/null +++ b/U/perl/d_nan.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_nan: Inlibc +?MAKE: -pick add $@ %< +?S:d_nan: +?S: This variable conditionally defines the HAS_NAN symbol, which +?S: indicates to the C program that the nan() routine is available. +?S:. +?C:HAS_NAN: +?C: This symbol, if defined, indicates that the nan routine is +?C: available to generate NaN. +?C:. +?H:#$d_nan HAS_NAN /**/ +?H:. +?LINT:set d_nan +: see if nan exists +set nan d_nan +eval $inlibc + diff --git a/U/perl/d_nearbyint.U b/U/perl/d_nearbyint.U new file mode 100644 index 0000000..efce779 --- /dev/null +++ b/U/perl/d_nearbyint.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_nearbyint: Inlibc +?MAKE: -pick add $@ %< +?S:d_nearbyint: +?S: This variable conditionally defines the HAS_NEARBYINT symbol, which +?S: indicates to the C program that the nearbyint() routine is available. +?S:. +?C:HAS_NEARBYINT: +?C: This symbol, if defined, indicates that the nearbyint routine is +?C: available to return the integral value closest to (according to +?C: the current rounding mode) to x. +?C:. +?H:#$d_nearbyint HAS_NEARBYINT /**/ +?H:. +?LINT:set d_nearbyint +: see if nearbyint exists +set nearbyint d_nearbyint +eval $inlibc + diff --git a/U/perl/d_nextafter.U b/U/perl/d_nextafter.U new file mode 100644 index 0000000..a994001 --- /dev/null +++ b/U/perl/d_nextafter.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_nextafter: Inlibc +?MAKE: -pick add $@ %< +?S:d_nextafter: +?S: This variable conditionally defines the HAS_NEXTAFTER symbol, which +?S: indicates to the C program that the nextafter() routine is available. +?S:. +?C:HAS_NEXTAFTER: +?C: This symbol, if defined, indicates that the nextafter routine is +?C: available to return the next machine representable long double from +?C: x in direction y. +?C:. +?H:#$d_nextafter HAS_NEXTAFTER /**/ +?H:. +?LINT:set d_nextafter +: see if nextafter exists +set nextafter d_nextafter +eval $inlibc + diff --git a/U/perl/d_nexttoward.U b/U/perl/d_nexttoward.U new file mode 100644 index 0000000..6fd9464 --- /dev/null +++ b/U/perl/d_nexttoward.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_nexttoward: Inlibc +?MAKE: -pick add $@ %< +?S:d_nexttoward: +?S: This variable conditionally defines the HAS_NEXTTOWARD symbol, which +?S: indicates to the C program that the nexttoward() routine is available. +?S:. +?C:HAS_NEXTTOWARD: +?C: This symbol, if defined, indicates that the nexttoward routine is +?C: available to return the next machine representable long double from +?C: x in direction y. +?C:. +?H:#$d_nexttoward HAS_NEXTTOWARD /**/ +?H:. +?LINT:set d_nexttoward +: see if nexttoward exists +set nexttoward d_nexttoward +eval $inlibc + diff --git a/U/perl/d_remainder.U b/U/perl/d_remainder.U new file mode 100644 index 0000000..7a9fef5 --- /dev/null +++ b/U/perl/d_remainder.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_remainder: Inlibc +?MAKE: -pick add $@ %< +?S:d_remainder: +?S: This variable conditionally defines the HAS_REMAINDER symbol, which +?S: indicates to the C program that the remainder() routine is available. +?S:. +?C:HAS_REMAINDER: +?C: This symbol, if defined, indicates that the remainder routine is +?C: available to return the floating-point remainder. +?C:. +?H:#$d_remainder HAS_REMAINDER /**/ +?H:. +?LINT:set d_remainder +: see if remainder exists +set remainder d_remainder +eval $inlibc + diff --git a/U/perl/d_remquo.U b/U/perl/d_remquo.U new file mode 100644 index 0000000..5b283b2 --- /dev/null +++ b/U/perl/d_remquo.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_remquo: Inlibc +?MAKE: -pick add $@ %< +?S:d_remquo: +?S: This variable conditionally defines the HAS_REMQUO symbol, which +?S: indicates to the C program that the remquo() routine is available. +?S:. +?C:HAS_REMQUO: +?C: This symbol, if defined, indicates that the remquo routine is +?C: available to return the remainder and part of quotient. +?C:. +?H:#$d_remquo HAS_REMQUO /**/ +?H:. +?LINT:set d_remquo +: see if remquo exists +set remquo d_remquo +eval $inlibc + diff --git a/U/perl/d_rint.U b/U/perl/d_rint.U new file mode 100644 index 0000000..eba0b29 --- /dev/null +++ b/U/perl/d_rint.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_rint: Inlibc +?MAKE: -pick add $@ %< +?S:d_rint: +?S: This variable conditionally defines the HAS_RINT symbol, which +?S: indicates to the C program that the rint() routine is available. +?S:. +?C:HAS_RINT: +?C: This symbol, if defined, indicates that the rint routine is +?C: available to return the nearest integral value to x as double +?C: using the current rounding mode. +?C:. +?H:#$d_rint HAS_RINT /**/ +?H:. +?LINT:set d_rint +: see if rint exists +set rint d_rint +eval $inlibc + diff --git a/U/perl/d_round.U b/U/perl/d_round.U new file mode 100644 index 0000000..451b07c --- /dev/null +++ b/U/perl/d_round.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_round: Inlibc +?MAKE: -pick add $@ %< +?S:d_round: +?S: This variable conditionally defines the HAS_ROUND symbol, which +?S: indicates to the C program that the round() routine is available. +?S:. +?C:HAS_ROUND: +?C: This symbol, if defined, indicates that the round routine is +?C: available to round to nearest integer, away from zero. +?C:. +?H:#$d_round HAS_ROUND /**/ +?H:. +?LINT:set d_round +: see if round exists +set round d_round +eval $inlibc + diff --git a/U/perl/d_scalbn.U b/U/perl/d_scalbn.U new file mode 100644 index 0000000..2c90d96 --- /dev/null +++ b/U/perl/d_scalbn.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_scalbn: Inlibc +?MAKE: -pick add $@ %< +?S:d_scalbn: +?S: This variable conditionally defines the HAS_SCALBN symbol, which +?S: indicates to the C program that the scalbn() routine is available. +?S:. +?C:HAS_SCALBN: +?C: This symbol, if defined, indicates that the scalbn routine is +?C: available to multiply floating-point number by integral power of radix. +?C:. +?H:#$d_scalbn HAS_SCALBN /**/ +?H:. +?LINT:set d_scalbn +: see if scalbn exists +set scalbn d_scalbn +eval $inlibc + diff --git a/U/perl/d_tgamma.U b/U/perl/d_tgamma.U new file mode 100644 index 0000000..1eb3443 --- /dev/null +++ b/U/perl/d_tgamma.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_tgamma: Inlibc +?MAKE: -pick add $@ %< +?S:d_tgamma: +?S: This variable conditionally defines the HAS_TGAMMA symbol, which +?S: indicates to the C program that the tgamma() routine is available +?S: for the gamma function. See also d_lgamma. +?S:. +?C:HAS_TGAMMA: +?C: This symbol, if defined, indicates that the tgamma routine is +?C: available to do the gamma function. See also HAS_LGAMMA. +?C:. +?H:#$d_tgamma HAS_TGAMMA /**/ +?H:. +?LINT:set d_tgamma +: see if tgamma exists +set tgamma d_tgamma +eval $inlibc + diff --git a/U/perl/d_trunc.U b/U/perl/d_trunc.U new file mode 100644 index 0000000..eb53ba5 --- /dev/null +++ b/U/perl/d_trunc.U @@ -0,0 +1,21 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:d_trunc: Inlibc +?MAKE: -pick add $@ %< +?S:d_trunc: +?S: This variable conditionally defines the HAS_TRUNC symbol, which +?S: indicates to the C program that the trunc() routine is available +?S: to round doubles towards zero. +?S:. +?C:HAS_TRUNC: +?C: This symbol, if defined, indicates that the trunc routine is +?C: available to round doubles towards zero. +?C:. +?H:#$d_trunc HAS_TRUNC /**/ +?H:. +?LINT:set d_trunc +: see if trunc exists +set trunc d_trunc +eval $inlibc + diff --git a/U/perl/i_fp.U b/U/perl/i_fp.U index 15ad462..a97ce1a 100644 --- a/U/perl/i_fp.U +++ b/U/perl/i_fp.U @@ -5,7 +5,7 @@ ?RCS: You may distribute under the terms of either the GNU General Public ?RCS: License or the Artistic License, as specified in the README file. ?RCS: -?MAKE:i_fp: Inhdr Hasfield +?MAKE:i_fp: Inhdr ?MAKE: -pick add $@ %< ?S:i_fp: ?S: This variable conditionally defines the I_FP symbol, and indicates diff --git a/U/perl/i_quadmath.U b/U/perl/i_quadmath.U new file mode 100644 index 0000000..b071dda --- /dev/null +++ b/U/perl/i_quadmath.U @@ -0,0 +1,20 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:i_quadmath: Inhdr +?MAKE: -pick add $@ %< +?S:i_quadmath: +?S: This variable conditionally defines the I_QUADMATH symbol, and indicates +?S: whether a C program should include <quadmath.h>. +?S:. +?C:I_QUADMATH: +?C: This symbol, if defined, indicates that <quadmath.h> exists and +?C: should be included. +?C:. +?H:#$i_quadmath I_QUADMATH /**/ +?H:. +?LINT:set i_quadmath +: see if this is a quadmath.h system +set quadmath.h i_quadmath +eval $inhdr + diff --git a/U/perl/longdblfio.U b/U/perl/longdblfio.U index a25c28c..d655fc7 100644 --- a/U/perl/longdblfio.U +++ b/U/perl/longdblfio.U @@ -8,10 +8,22 @@ ?MAKE:d_PRIfldbl sPRIfldbl d_PRIgldbl d_PRIFUldbl sPRIGUldbl d_PRIEUldbl \ sPRIgldbl d_PRIeldbl sPRIeldbl sPRIFUldbl d_PRIGUldbl sPRIEUldbl \ d_SCNfldbl \ - sSCNfldbl: \ - d_longdbl longdblsize doublesize test cat rm_try \ - Setvar Compile run + sSCNfldbl doublekind: \ + d_longdbl longdblsize doublesize uselongdouble test echo cat rm_try \ + Setvar Compile run i_stdlib osname gccversion ccflags ?MAKE: -pick add $@ %< +?S:doublekind: +?S: This variable, if defined, encodes the type of a double: +?S: 1 = IEEE 754 32-bit big little endian, +?S: 2 = IEEE 754 32-bit big big endian, +?S: 3 = IEEE 754 64-bit big little endian, +?S: 4 = IEEE 754 64-bit big big endian, +?S: 5 = IEEE 754 128-bit big little endian, +?S: 6 = IEEE 754 128-bit big big endian, +?S: 7 = IEEE 754 64-bit big mixed endian le-be, +?S: 8 = IEEE 754 64-bit big mixed endian be-le, +?S: -1 = unknown format. +?S:. ?S:d_PRIfldbl: ?S: This variable conditionally defines the PERL_PRIfldbl symbol, which ?S: indicates that stdio has a symbol to print long doubles. @@ -116,8 +128,97 @@ ?H:#$d_PRIEUldbl PERL_PRIEldbl $sPRIEUldbl /**/ ?H:#$d_SCNfldbl PERL_SCNfldbl $sSCNfldbl /**/ ?H:. -?T:yyy +?T:yyy message saveccflags ?F:!try +?LINT:change ccflags +?LINT:change uselongdouble +: Check what kind of doubles your system has +$echo "Checking the kind of doubles you have..." >&4 +$cat >try.c <<EOP +#$i_stdlib I_STDLIB +#define DOUBLESIZE $doublesize +#ifdef I_STDLIB +#include <stdlib.h> +#endif +#include <stdio.h> +static const double d = -0.1; +int main() { + unsigned const char* b = (unsigned const char*)(&d); +#if DOUBLESIZE == 4 + if (b[0] == 0xCD && b[3] == 0xBD) { + /* IEEE 754 32-bit little-endian */ + printf("1\n"); + exit(0); + } + if (b[0] == 0xBD && b[3] == 0xCD) { + /* IEEE 754 32-bit big-endian */ + printf("2\n"); + exit(0); + } +#endif +#if DOUBLESIZE == 8 + if (b[0] == 0x9A && b[7] == 0xBF) { + /* IEEE 754 64-bit little-endian */ + printf("3\n"); + exit(0); + } + if (b[0] == 0xBF && b[7] == 0x9A) { + /* IEEE 754 64-bit big-endian */ + printf("4\n"); + exit(0); + } + if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) { + /* ARM mixed endian: two little-endian 32-bit floats, in big endian order: + * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0) + * 99 99 b9 bf 9a 99 99 99 */ + printf("7\n"); + exit(0); + } + if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) { + /* The opposite of case 7, mixed endian: two big-endian 32-bit floats, + * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0) + * 99 99 99 9a bf b9 99 99 */ + printf("8\n"); + exit(0); + } +#endif +#if DOUBLESIZE == 16 + if (b[0] == 0x9A && b[15] == 0xBF) { + /* IEEE 754 128-bit little-endian */ + printf("5\n"); + exit(0); + } + if (b[0] == 0xBF && b[15] == 0x9A) { + /* IEEE 754 128-bit big-endian */ + printf("6\n"); + exit(0); + } +#endif + /* Rumoredly some old ARM processors have 'mixed endian' doubles, + * two 32-bit little endians stored in big-endian order. */ + /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY. + * Whether those environments can still build Perl is debatable. */ + printf("-1\n"); /* unknown */ + exit(0); +} +EOP +set try +if eval $compile; then + doublekind=`$run ./try` +else + doublekind=-1 +fi +case "$doublekind" in +1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;; +2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;; +3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;; +4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;; +5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;; +6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;; +*) echo "Cannot figure out your double. You VAX, or something?" >&4 ;; +esac +$rm_try + : Check print/scan long double stuff echo " " @@ -234,3 +335,35 @@ case "$sPRIfldbl" in ;; esac +: Before committing on uselongdouble, see whether that looks sane. +if $test "$uselongdouble" = "$define"; then + message="" + echo " " + echo "Checking if your long double math functions work right..." >&4 + $cat > try.c <<EOF +#include <math.h> +#include <stdio.h> +int main() { + printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L))); +} +EOF + case "$osname:$gccversion" in + aix:) saveccflags="$ccflags" + ccflags="$ccflags -qlongdouble" ;; # to avoid core dump + esac + set try + if eval $compile_ok; then + yyy=`$run ./try` + fi + case "$yyy" in + 3) echo "Your long double math functions are working correctly." >&4 ;; + *) echo "Your long double math functions are broken, not using long doubles." >&4 + uselongdouble=$undef + ;; + esac + $rm_try + case "$osname:$gccversion" in + aix:) ccflags="$saveccflags" ;; # restore + esac +fi + diff --git a/U/perl/perlxv.U b/U/perl/perlxv.U index 6393c89..01c4d29 100644 --- a/U/perl/perlxv.U +++ b/U/perl/perlxv.U @@ -10,9 +10,9 @@ i8size u8size i16size u16size i32size u32size i64size u64size \ d_nv_preserves_uv nv_preserves_uv_bits nv_overflows_integers_at \ d_nv_zero_is_allbits_zero: \ - echo rm_try use64bitint d_quad quadtype uquadtype \ - d_longdbl uselongdouble longdblsize doublesize \ - shortsize intsize longsize i_stdlib i_string \ + echo rm_try use64bitint d_quad quadtype uquadtype usequadmath \ + d_longdbl uselongdouble longdblsize doublesize i_quadmath \ + shortsize intsize longsize i_stdlib i_string libs gccversion \ cat Compile i_inttypes test d_volatile signal_t run ?MAKE: -pick add $@ %< ?S:ivtype: @@ -258,6 +258,48 @@ define:define) ;; esac +case "$usequadmath:$i_quadmath" in +define:define) + nvtype="__float128" + nvsize=16 + case "$libs" in + *quadmath*) ;; + *) $cat <<EOM >&4 + +*** You requested the use of the quadmath library, but you +*** do not seem to have the quadmath library installed. +*** Cannot continue, aborting. +EOM + exit 1 + ;; + esac + ;; +define:*) $cat <<EOM >&4 + +*** You requested the use of the quadmath library, but you +*** do not seem to have the required header, <quadmath.h>. +EOM + case "$gccversion" in + [23].*|4.[0-5]*) + $cat <<EOM >&4 +*** Your gcc looks a bit old: +*** $gccversion +EOM + ;; + '') + $cat <<EOM >&4 +*** You are not running a gcc. +EOM + ;; + esac + $cat <<EOM >&4 +*** For the quadmath library you need at least gcc 4.6. +*** Cannot continue, aborting. +EOM + exit 1 + ;; +esac + $echo "(IV will be "$ivtype", $ivsize bytes)" $echo "(UV will be "$uvtype", $uvsize bytes)" $echo "(NV will be "$nvtype", $nvsize bytes)" diff --git a/U/perl/perlxvf.U b/U/perl/perlxvf.U index effac69..68111f1 100644 --- a/U/perl/perlxvf.U +++ b/U/perl/perlxvf.U @@ -10,7 +10,7 @@ nveformat nvfformat nvgformat: \ ivsize longsize intsize shortsize \ sPRId64 sPRIu64 sPRIo64 sPRIx64 sPRIXU64 \ - uselongdouble d_longdbl d_PRIgldbl \ + uselongdouble d_longdbl usequadmath d_PRIgldbl \ sPRIEUldbl sPRIFUldbl sPRIGUldbl sPRIeldbl sPRIfldbl sPRIgldbl \ test echo ?MAKE: -pick add $@ %< @@ -151,20 +151,29 @@ else fi fi -if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then - nveformat="$sPRIeldbl" - nvfformat="$sPRIfldbl" - nvgformat="$sPRIgldbl" - nvEUformat="$sPRIEUldbl" - nvFUformat="$sPRIFUldbl" - nvGUformat="$sPRIGUldbl" +if $test X"$usequadmath" = X"$define"; then + nveformat='"Qe"' + nvfformat='"Qf"' + nvgformat='"Qg"' + nvEUformat='"QE"' + nvFUformat='"QF"' + nvGUformat='"QG"' else - nveformat='"e"' - nvfformat='"f"' - nvgformat='"g"' - nvEUformat='"E"' - nvFUformat='"F"' - nvGUformat='"G"' + if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then + nveformat="$sPRIeldbl" + nvfformat="$sPRIfldbl" + nvgformat="$sPRIgldbl" + nvEUformat="$sPRIEUldbl" + nvFUformat="$sPRIFUldbl" + nvGUformat="$sPRIGUldbl" + else + nveformat='"e"' + nvfformat='"f"' + nvgformat='"g"' + nvEUformat='"E"' + nvFUformat='"F"' + nvGUformat='"G"' + fi fi case "$ivdformat" in diff --git a/U/perl/usequadmath.U b/U/perl/usequadmath.U new file mode 100644 index 0000000..f0aa532 --- /dev/null +++ b/U/perl/usequadmath.U @@ -0,0 +1,24 @@ +?RCS: You may distribute under the terms of either the GNU General Public +?RCS: License or the Artistic License, as specified in the README file. +?RCS: +?MAKE:usequadmath: Setvar +?MAKE: -pick add $@ %< +?S:usequadmath: +?S: This variable conditionally defines the USE_QUADMATH symbol, +?S: and indicates that the quadmath library __float128 long doubles +?S: should be used when available. +?S:. +?C:USE_QUADMATH: +?C: This symbol, if defined, indicates that the quadmath library should +?C: be used when available. +?C:. +?H:?%<:#ifndef USE_QUADMATH +?H:?%<:#$usequadmath USE_QUADMATH /**/ +?H:?%<:#endif +?H:. +: Check if quadmath is requested +case "$usequadmath" in +"$define"|true|[yY]*) usequadmath="$define" ;; +*) usequadmath="$undef" ;; +esac + diff --git a/U/threads/archname.U b/U/threads/archname.U index c5d1f07..153ce37 100644 --- a/U/threads/archname.U +++ b/U/threads/archname.U @@ -21,7 +21,7 @@ ?MAKE:archname myarchname useversionedarchname: sed Loc Myread Oldconfig \ osname test rm usethreads usemultiplicity use64bitint use64bitall \ archname64 uselongdouble longdblsize doublesize targetarch Setvar \ - api_versionstring + api_versionstring usequadmath ?MAKE: -pick add $@ %< ?S:archname: ?S: This variable is a short name to characterize the current @@ -101,16 +101,16 @@ y|Y) useversionedarchname="$define" ;; esac case "$useversionedarchname" in $define) - case "$archname" in - *-$api_versionstring) - echo "...and architecture name already has -$api_versionstring" >&4 - ;; - *) - archname="$archname-$api_versionstring" - echo "...setting architecture name to $archname." >&4 - ;; - esac - ;; + case "$archname" in + *-$api_versionstring) + echo "...and architecture name already has -$api_versionstring" >&4 + ;; + *) + archname="$archname-$api_versionstring" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; esac @if usethreads @@ -118,12 +118,12 @@ case "$usethreads" in $define) echo "Threads selected." >&4 case "$archname" in - *-thread*) echo "...and architecture name already has -thread." >&4 - ;; - *) archname="$archname-thread" - echo "...setting architecture name to $archname." >&4 - ;; - esac + *-thread*) echo "...and architecture name already has -thread." >&4 + ;; + *) archname="$archname-thread" + echo "...setting architecture name to $archname." >&4 + ;; + esac ;; esac @end @@ -132,12 +132,12 @@ case "$usemultiplicity" in $define) echo "Multiplicity selected." >&4 case "$archname" in - *-multi*) echo "...and architecture name already has -multi." >&4 - ;; - *) archname="$archname-multi" - echo "...setting architecture name to $archname." >&4 - ;; - esac + *-multi*) echo "...and architecture name already has -multi." >&4 + ;; + *) archname="$archname-multi" + echo "...setting architecture name to $archname." >&4 + ;; + esac ;; esac @end @@ -156,12 +156,12 @@ case "$use64bitint$use64bitall" in "$define") echo "Maximal 64 bitness selected." >&4 ;; esac case "$archname" in - *-$archname64*) echo "...and architecture name already has $archname64." >&4 - ;; - *) archname="$archname-$archname64" - echo "...setting architecture name to $archname." >&4 - ;; - esac + *-$archname64*) echo "...and architecture name already has $archname64." >&4 + ;; + *) archname="$archname-$archname64" + echo "...setting architecture name to $archname." >&4 + ;; + esac ;; esac esac @@ -176,12 +176,26 @@ $define) ;; *) case "$archname" in - *-ld*) echo "...and architecture name already has -ld." >&4 - ;; - *) archname="$archname-ld" - echo "...setting architecture name to $archname." >&4 - ;; - esac + *-ld*) echo "...and architecture name already has -ld." >&4 + ;; + *) archname="$archname-ld" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; + esac + ;; +esac +@end +@if usequadmath +case "$usequadmath" in +$define) + echo "quadmath selected." >&4 + case "$archname" in + *-ld*) echo "...and architecture name already has -quadmath." >&4 + ;; + *) archname="$archname-quadmath" + echo "...setting architecture name to $archname." >&4 ;; esac ;; -- perl5 metaconfig repository
