# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Sat Jan 15 23:59:51 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Sun Jan 16 18:22:25 EET 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
-d_qgcvt=''
d_readdir=''
d_rewinddir=''
d_seekdir=''
;;
esac
-: see if qgcvt exists
-set qgcvt d_qgcvt
-eval $inlibc
+: check for length of double
+echo " "
+case "$doublesize" in
+'')
+ $echo $n "Checking to see how big your double precision numbers are...$c" >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof(double));
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ doublesize=`./try`
+ $echo " $doublesize bytes." >&4
+ else
+ dflt='8'
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of a double precision number (in bytes)?"
+ . ./myread
+ doublesize="$ans"
+ fi
+ ;;
+esac
+$rm -f try.c try
+
+: check for long doubles
+echo " "
+$echo $n "Checking to see if your system supports long double..." $c >&4
+echo 'int main() { long double x = 7.0; }' > try.c
+set try
+if eval $compile; then
+ val="$define"
+ echo " Yes, it does." >&4
+else
+ val="$undef"
+ echo " No, it doesn't." >&4
+fi
+$rm try.*
+set d_longdbl
+eval $setvar
+
+: check for length of long double
+case "${d_longdbl}${longdblsize}" in
+$define)
+ echo " "
+ $echo $n "Checking to see how big your long doubles are..." $c >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", sizeof(long double));
+}
+EOCP
+ set try
+ set try
+ if eval $compile; then
+ longdblsize=`./try$exe_ext`
+ $echo " $longdblsize bytes." >&4
+ else
+ dflt='8'
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)" >&4
+ rp="What is the size of a long double (in bytes)?"
+ . ./myread
+ longdblsize="$ans"
+ fi
+ if $test "X$doublesize" = "X$longdblsize"; then
+ echo "(That isn't any different from an ordinary double.)"
+ fi
+ ;;
+esac
+$rm -f try.* try
: Check how to convert floats to strings.
if test "X$d_Gconvert" = X; then
echo " "
echo "Checking for an efficient way to convert floats to strings."
- $cat >try.c <<'EOP'
+ $cat >try.c <<EOP
#ifdef TRY_gconvert
#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
char *myname = "gconvert";
#ifdef TRY_qgcvt
#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
char *myname = "qgcvt";
+#define DOUBLETYPE long double
#endif
#ifdef TRY_sprintf
#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
char *myname = "sprintf";
#endif
+#ifndef DOUBLETYPE
+#define DOUBLETYPE double
+#endif
+
#include <stdio.h>
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+
int
checkit(expect, got)
char *expect;
/* This must be 1st test on (which?) platform */
/* Alan Burlison <AlanBurlsin@unn.unisys.com> */
- Gconvert(0.1, 8, 0, buf);
+ Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
checkit("0.1", buf);
- Gconvert(1.0, 8, 0, buf);
+ Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
checkit("1", buf);
- Gconvert(0.0, 8, 0, buf);
+ Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
checkit("0", buf);
- Gconvert(-1.0, 8, 0, buf);
+ Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
checkit("-1", buf);
/* Some Linux gcvt's give 1.e+5 here. */
- Gconvert(100000.0, 8, 0, buf);
+ Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
checkit("100000", buf);
/* Some Linux gcvt's give -1.e+5 here. */
- Gconvert(-100000.0, 8, 0, buf);
+ Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
checkit("-100000", buf);
exit(0);
*) xxx_list='gconvert gcvt sprintf' ;;
esac
- case "$uselongdouble$d_qgcvt" in
- definedefine) xxx_list="`echo $xxx_list|sed s/gcvt/qgcvt/`" ;;
+ case "$d_longdbl$uselongdouble" in
+ definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
esac
for xxx_convert in $xxx_list; do
$rm -f try try$_o
set try -DTRY_$xxx_convert
if eval $compile; then
- echo "$xxx_convert" found. >&4
+ echo "$xxx_convert() found." >&4
if ./try; then
echo "I'll use $xxx_convert to convert floats into a string." >&4
break;
esac
fi
-: check for length of double
-echo " "
-case "$doublesize" in
-'')
- $echo $n "Checking to see how big your double precision numbers are...$c" >&4
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", (int)sizeof(double));
- exit(0);
-}
-EOCP
- set try
- if eval $compile_ok; then
- doublesize=`./try`
- $echo " $doublesize bytes." >&4
- else
- dflt='8'
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of a double precision number (in bytes)?"
- . ./myread
- doublesize="$ans"
- fi
- ;;
-esac
-$rm -f try.c try
-
-: check for long doubles
-echo " "
-$echo $n "Checking to see if your system supports long double..." $c >&4
-echo 'int main() { long double x = 7.0; }' > try.c
-set try
-if eval $compile; then
- val="$define"
- echo " Yes, it does." >&4
-else
- val="$undef"
- echo " No, it doesn't." >&4
-fi
-$rm try.*
-set d_longdbl
-eval $setvar
-
-: check for length of long double
-case "${d_longdbl}${longdblsize}" in
-$define)
- echo " "
- $echo $n "Checking to see how big your long doubles are..." $c >&4
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", sizeof(long double));
-}
-EOCP
- set try
- set try
- if eval $compile; then
- longdblsize=`./try$exe_ext`
- $echo " $longdblsize bytes." >&4
- else
- dflt='8'
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)" >&4
- rp="What is the size of a long double (in bytes)?"
- . ./myread
- longdblsize="$ans"
- fi
- if $test "X$doublesize" = "X$longdblsize"; then
- echo "(That isn't any different from an ordinary double.)"
- fi
- ;;
-esac
-$rm -f try.* try
-
echo " "
if $test X"$d_longdbl" = X"$define"; then
d_pwgecos='$d_pwgecos'
d_pwpasswd='$d_pwpasswd'
d_pwquota='$d_pwquota'
-d_qgcvt='$d_qgcvt'
d_quad='$d_quad'
d_readdir='$d_readdir'
d_readlink='$d_readlink'