#$i_float I_FLOAT
#$i_stdlib I_STDLIB
#define LONGDBLSIZE $longdblsize
+#define DOUBLESIZE $doublesize
#ifdef I_FLOAT
#include <float.h>
#endif
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");
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)
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 */
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
-
?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.
case "$usecbacktrace" in
"$define") libswanted="$libswanted bfd" ;;
esac
+case "$usequadmath" in
+"$define") libswanted="$libswanted quadmath" ;;
+esac
libsfound=''
libsfiles=''
libsdirs=''
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
--- /dev/null
+?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
+
?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
--- /dev/null
+?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
+
?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.
?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 " "
;;
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
+
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:
;;
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)"
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 $@ %<
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
--- /dev/null
+?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
+
?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
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
$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
$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
"$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
;;
*)
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
;;