# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Jan 18 00:51:01 EET 2002 [metaconfig 3.0 PL70]
+# Generated on Fri Jan 18 01:06:38 EET 2002 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
set sqrtl d_sqrtl
eval $inlibc
-case "$ccflags" in
-*-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
-esac
-
-case "$uselongdouble" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-cat <<EOM
-
-Perl can be built to take advantage of long doubles which
-(if available) may give more accuracy and range for floating point numbers.
-
-If this doesn't make any sense to you, just accept the default '$dflt'.
-EOM
-rp='Try to use long doubles if available?'
-. ./myread
-case "$ans" in
-y|Y) val="$define" ;;
-*) val="$undef" ;;
-esac
-set uselongdouble
-eval $setvar
-
-case "$uselongdouble" in
-true|[yY]*) uselongdouble="$define" ;;
-esac
-
-case "$uselongdouble" in
-$define)
-: Look for a hint-file generated 'call-back-unit'. If the
-: user has specified that long doubles should be used,
-: we may need to set or change some other defaults.
- if $test -f uselongdouble.cbu; then
- echo "Your platform has some specific hints for long doubles, using them..."
- . ./uselongdouble.cbu
- else
- $cat <<EOM
-(Your platform doesn't have any specific hints for long doubles.)
-EOM
- fi
- ;;
-esac
-
-case "$uselongdouble:$d_sqrtl" in
-$define:$undef)
- $cat <<EOM >&4
-
-*** You requested the use of long doubles but you do not seem to have
-*** the mathematic functions for long doubles. I'm disabling the use
-*** of long doubles.
-
-EOM
- uselongdouble=$undef
- ;;
-esac
-
: check for length of double
echo " "
case "$doublesize" in
esac
$rm -f try.* try
+echo " "
+
+if $test X"$d_longdbl" = X"$define"; then
+
+echo "Checking how to print long doubles..." >&4
+
+if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ double d = 123.456;
+ printf("%.3f\n", d);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`$run ./try`
+ case "$yyy" in
+ 123.456)
+ sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
+ sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
+ echo "We will use %f."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRIfldbl" = X; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ long double d = 123.456;
+ printf("%.3Lf\n", d);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`$run ./try`
+ case "$yyy" in
+ 123.456)
+ sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
+ sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
+ echo "We will use %Lf."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRIfldbl" = X; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ long double d = 123.456;
+ printf("%.3llf\n", d);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`$run ./try`
+ case "$yyy" in
+ 123.456)
+ sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
+ sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
+ echo "We will use %llf."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRIfldbl" = X; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ long double d = 123.456;
+ printf("%.3lf\n", d);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`$run ./try`
+ case "$yyy" in
+ 123.456)
+ sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
+ sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
+ echo "We will use %lf."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRIfldbl" = X; then
+ echo "Cannot figure out how to print long doubles." >&4
+else
+ sSCNfldbl=$sPRIfldbl # expect consistency
+fi
+
+$rm -f try try.*
+
+fi # d_longdbl
+
+case "$sPRIfldbl" in
+'') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
+ d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
+ d_SCNfldbl="$undef";
+ ;;
+*) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
+ d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
+ d_SCNfldbl="$define";
+ ;;
+esac
+
+: see if modfl exists
+set modfl d_modfl
+eval $inlibc
+
+d_modfl_pow32_bug="$undef"
+
+case "$d_longdbl$d_modfl" in
+$define$define)
+ $cat <<EOM
+Checking to see whether your modfl() is okay for large values...
+EOM
+$cat >try.c <<EOCP
+#include <math.h>
+#include <stdio.h>
+int main() {
+ long double nv = 4294967303.15;
+ long double v, w;
+ v = modfl(nv, &w);
+#ifdef __GLIBC__
+ printf("glibc");
+#endif
+ printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
+ return 0;
+}
+EOCP
+ case "$osname:$gccversion" in
+ aix:) saveccflags="$ccflags"
+ ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
+ esac
+ set try
+ if eval $compile; then
+ foo=`$run ./try`
+ case "$foo" in
+ *" 4294967303.150000 1.150000 4294967302.000000")
+ echo >&4 "Your modfl() is broken for large values."
+ d_modfl_pow32_bug="$define"
+ case "$foo" in
+ glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
+ ;;
+ esac
+ ;;
+ *" 4294967303.150000 0.150000 4294967303.000000")
+ echo >&4 "Your modfl() seems okay for large values."
+ ;;
+ *) echo >&4 "I don't understand your modfl() at all."
+ d_modfl="$undef"
+ ;;
+ esac
+ $rm -f try.* try core core.try.*
+ else
+ echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
+ d_modfl="$undef"
+ fi
+ case "$osname:$gccversion" in
+ aix:) ccflags="$saveccflags" ;; # restore
+ esac
+ ;;
+esac
+
+case "$ccflags" in
+*-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
+esac
+
+case "$uselongdouble" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+cat <<EOM
+
+Perl can be built to take advantage of long doubles which
+(if available) may give more accuracy and range for floating point numbers.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Try to use long doubles if available?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*) val="$undef" ;;
+esac
+set uselongdouble
+eval $setvar
+
+case "$uselongdouble" in
+true|[yY]*) uselongdouble="$define" ;;
+esac
+
+case "$uselongdouble" in
+$define)
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that long doubles should be used,
+: we may need to set or change some other defaults.
+ if $test -f uselongdouble.cbu; then
+ echo "Your platform has some specific hints for long doubles, using them..."
+ . ./uselongdouble.cbu
+ else
+ $cat <<EOM
+(Your platform doesn't have any specific hints for long doubles.)
+EOM
+ fi
+ ;;
+esac
+
+message=X
+case "$uselongdouble:$d_sqrtl:$d_modfl" in
+$define:$define:$define)
+ : You have both
+ ;;
+$define:$define:$undef)
+ message="I could not find modfl"
+ ;;
+$define:$undef:$define)
+ message="I could not find sqrtl"
+ ;;
+$define:$undef:$undef)
+ message="I found neither sqrtl nor modfl"
+ ;;
+esac
+
+if $test "$message" != X; then
+ $cat <<EOM >&4
+
+*** You requested the use of long doubles but you do not seem to have
+*** the mathematic functions for long doubles.
+*** ($message)
+*** I'm disabling the use of long doubles.
+
+EOM
+
+ uselongdouble=$undef
+fi
+
case "$useperlio" in
$define|true|[yY]*|'') dflt='y';;
*) dflt='n';;
set qgcvt d_qgcvt
eval $inlibc
-echo " "
-
-if $test X"$d_longdbl" = X"$define"; then
-
-echo "Checking how to print long doubles..." >&4
-
-if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- double d = 123.456;
- printf("%.3f\n", d);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`$run ./try`
- case "$yyy" in
- 123.456)
- sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
- sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
- echo "We will use %f."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRIfldbl" = X; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- long double d = 123.456;
- printf("%.3Lf\n", d);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`$run ./try`
- case "$yyy" in
- 123.456)
- sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
- sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
- echo "We will use %Lf."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRIfldbl" = X; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- long double d = 123.456;
- printf("%.3llf\n", d);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`$run ./try`
- case "$yyy" in
- 123.456)
- sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
- sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
- echo "We will use %llf."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRIfldbl" = X; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- long double d = 123.456;
- printf("%.3lf\n", d);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`$run ./try`
- case "$yyy" in
- 123.456)
- sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
- sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
- echo "We will use %lf."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRIfldbl" = X; then
- echo "Cannot figure out how to print long doubles." >&4
-else
- sSCNfldbl=$sPRIfldbl # expect consistency
-fi
-
-$rm -f try try.*
-
-fi # d_longdbl
-
-case "$sPRIfldbl" in
-'') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
- d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
- d_SCNfldbl="$undef";
- ;;
-*) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
- d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
- d_SCNfldbl="$define";
- ;;
-esac
-
: Check how to convert floats to strings.
echo " "
echo "Checking for an efficient way to convert floats to strings."
-: see if modfl exists
-set modfl d_modfl
-eval $inlibc
-
-d_modfl_pow32_bug="$undef"
-
-case "$d_longdbl$d_modfl" in
-$define$define)
- $cat <<EOM
-Checking to see whether your modfl() is okay for large values...
-EOM
-$cat >try.c <<EOCP
-#include <math.h>
-#include <stdio.h>
-int main() {
- long double nv = 4294967303.15;
- long double v, w;
- v = modfl(nv, &w);
-#ifdef __GLIBC__
- printf("glibc");
-#endif
- printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
- return 0;
-}
-EOCP
- case "$osname:$gccversion" in
- aix:) saveccflags="$ccflags"
- ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
- esac
- set try
- if eval $compile; then
- foo=`$run ./try`
- case "$foo" in
- *" 4294967303.150000 1.150000 4294967302.000000")
- echo >&4 "Your modfl() is broken for large values."
- d_modfl_pow32_bug="$define"
- case "$foo" in
- glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
- ;;
- esac
- ;;
- *" 4294967303.150000 0.150000 4294967303.000000")
- echo >&4 "Your modfl() seems okay for large values."
- ;;
- *) echo >&4 "I don't understand your modfl() at all."
- d_modfl="$undef"
- ;;
- esac
- $rm -f try.* try core core.try.*
- else
- echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
- d_modfl="$undef"
- fi
- case "$osname:$gccversion" in
- aix:) ccflags="$saveccflags" ;; # restore
- esac
- ;;
-esac
-
: see if mprotect exists
set mprotect d_mprotect
eval $inlibc