X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=0f080a17a5302238ebae123eece90ea6f64261be;hb=f8f99792a41bb8e3b8d79451b979dbe275636f1a;hp=2485f57862f35c09088f0df99c947e483725ba25;hpb=3c728e001b4e97047ceb23f042d99fbaaeb10044;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index 2485f57..0f080a1 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed Dec 19 02:24:52 EET 2001 [metaconfig 3.0 PL70] +# Generated on Fri Mar 8 23:12:53 EET 2002 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ </dev/null 2>&1`; then shsharp=true spitshell=cat xcat=/bin/cat - test -f $xcat || xcat=/usr/bin/cat - if test ! -f $xcat; then - for p in $paths; do - if test -f $p/cat; then + test -f $xcat$_exe || xcat=/usr/bin/cat + if test ! -f $xcat$_exe; then + for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do + if test -f $p/cat$_exe; then xcat=$p/cat break fi done - if test ! -f $xcat; then - echo "Can't find cat anywhere!" >&4 + if test ! -f $xcat$_exe; then + echo "Can't find cat anywhere!" exit 1 fi fi @@ -1574,13 +1594,13 @@ if test -f MANIFEST; then set x `awk '{print $1}' < MANIFEST | grep '\.SH$'` else echo "(Looking for .SH files under the source directory.)" - set x `(cd $src; find . -name "*.SH" -print)` + set x `(cd "$src"; find . -name "*.SH" -print)` fi shift case $# in -0) set x `(cd $src; echo *.SH)`; shift;; +0) set x `(cd "$src"; echo *.SH)`; shift;; esac -if test ! -f $src/$1; then +if test ! -f "$src/$1"; then shift fi mkdir_p=' @@ -1606,7 +1626,7 @@ for file in $*; do */*) dir=`expr X$file : 'X\(.*\)/'` file=`expr X$file : 'X.*/\(.*\)'` - (cd $dir && . ./$file) + (cd "$dir" && . ./$file) ;; *) . ./$file @@ -1619,19 +1639,19 @@ for file in $*; do dir=`expr X$file : 'X\(.*\)/'` file=`expr X$file : 'X.*/\(.*\)'` (set x $dir; shift; eval $mkdir_p) - sh <$src/$dir/$file + sh <"$src/$dir/$file" ;; *) - sh <$src/$file + sh <"$src/$file" ;; esac ;; esac done -if test -f $src/config_h.SH; then +if test -f "$src/config_h.SH"; then if test ! -f config.h; then : oops, they left it out of MANIFEST, probably, so do it anyway. - . $src/config_h.SH + . "$src/config_h.SH" fi fi EOS @@ -1687,13 +1707,13 @@ rm -f .echotmp : Now test for existence of everything in MANIFEST echo " " -if test -f $rsrc/MANIFEST; then +if test -f "$rsrc/MANIFEST"; then echo "First let's make sure your kit is complete. Checking..." >&4 - awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50 + awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50) rm -f missing tmppwd=`pwd` for filelist in x??; do - (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing) + (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing") done if test -s missing; then cat missing >&4 @@ -2025,6 +2045,9 @@ for dir in \$*; do if test -f \$thisthing; then echo \$thisthing exit 0 + elif test "X$_exe" != X -a -f \$thisthing$_exe; then + echo \$thisthing + exit 0 elif test -f \$dir/\$thing.exe; then if test -n "$DJGPP"; then echo \$dir/\$thing.exe @@ -2069,6 +2092,7 @@ cpp csh date egrep +gmake gzip less ln @@ -2097,7 +2121,7 @@ for file in $loclist; do '') xxx=`./loc $file $file $pth`;; *) xxx=`./loc $xxx $xxx $pth`;; esac - eval $file=$xxx + eval $file=$xxx$_exe eval _$file=$xxx case "$xxx" in /*) @@ -2130,7 +2154,7 @@ for file in $trylist; do '') xxx=`./loc $file $file $pth`;; *) xxx=`./loc $xxx $xxx $pth`;; esac - eval $file=$xxx + eval $file=$xxx$_exe eval _$file=$xxx case "$xxx" in /*) @@ -2149,12 +2173,37 @@ case "$egrep" in egrep) echo "Substituting grep for egrep." egrep=$grep + _egrep=$grep ;; esac case "$ln" in ln) echo "Substituting cp for ln." ln=$cp + _ln=$cp + ;; +esac +case "$make" in +make) + case "$gmake" in + gmake) + echo "I can't find make or gmake, and my life depends on it." >&4 + echo "Go find a public domain implementation or fix your PATH setting!" >&4 + exit 1 + ;; + esac + ;; +esac +case "$gmake" in +gmake) ;; +*) # We can't have osname yet. + if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS + # Assume that gmake, if found, is definitely GNU make + # and prefer it over the system make. + echo "Substituting gmake for make." + make=$gmake + _make=$gmake + fi ;; esac case "$test" in @@ -2200,10 +2249,10 @@ FOO ;; esac -cat <checkcc +cat <trygcc $startsh EOS -cat <<'EOSC' >>checkcc +cat <<'EOSC' >>trygcc case "$cc" in '') ;; *) $rm -f try try.* @@ -2245,15 +2294,37 @@ EOM esac fi fi + fi + $rm -f try try.* + ;; +esac +EOSC + +cat <checkcc +$startsh +EOS +cat <<'EOSC' >>checkcc +case "$cc" in +'') ;; +*) $rm -f try try.* + $cat >try.c <&4 <&4 + fi + $cat >&4 <&4 $lns blurfl sym if $test "X$issymlink" = X; then @@ -2338,7 +2409,7 @@ $define|true|[yY]*) exit 1 ;; *) case "$lns:$issymlink" in - *"ln -s:"*"test -"?) + *"ln"*" -s:"*"test -"?) echo "Creating the symbolic links..." >&4 echo "(First creating the subdirectories...)" >&4 cd .. @@ -2776,7 +2847,7 @@ EOM $test -d /usr/apollo/bin && osname=apollo $test -f /etc/saf/_sactab && osname=svr4 $test -d /usr/include/minix && osname=minix - $test -d /system && osname=vos + $test -f /system/gnu_library/bin/ar.pm && osname=vos if $test -d /MachTen -o -d /MachTen_Folder; then osname=machten if $test -x /sbin/version; then @@ -3496,6 +3567,9 @@ esac rp="Use which C compiler?" . ./myread cc="$ans" + +: See if they have not cc but they do have gcc +. ./trygcc : Look for a hint-file generated 'call-back-unit'. Now that the : user has specified the compiler, we may need to set or change some : other defaults. @@ -4126,7 +4200,7 @@ so="$ans" : or the new name. case "$_exe" in '') case "$exe_ext" in - '') ;; + '') ;; *) _exe="$exe_ext" ;; esac ;; @@ -4211,7 +4285,7 @@ for thislib in $libswanted; do for thisdir in $libspath; do xxx='' if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then - xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1` + xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'` $test -f "$xxx" && eval $libscheck $test -f "$xxx" && libstyle=shared fi @@ -4840,6 +4914,10 @@ $rm -f try.* try : determine filename position in cpp output echo " " echo "Computing filename position in cpp output for #include directives..." >&4 +case "$osname" in +vos) testaccess=-e ;; +*) testaccess=-r ;; +esac echo '#include ' > foo.c $cat >fieldn <&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 @@ -5839,6 +5860,253 @@ EOCP 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 +#include +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 +#include +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 +#include +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 +#include +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 <try.c < +#include +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 <&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';; @@ -7075,7 +7343,7 @@ y*) usedl="$define" esac echo "The following dynamic loading files are available:" : Can not go over to $dldir because getfile has path hard-coded in. - tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir + tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir" rp="Source file to use for dynamic loading" fn="fne" gfpth="$src" @@ -7325,8 +7593,8 @@ true) linux*) # ld won't link with a bare -lperl otherwise. dflt=libperl.$so ;; - cygwin*) # include version - dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext + cygwin*) # ld links against an importlib + dflt=libperl$lib_ext ;; *) # Try to guess based on whether libc has major.minor. case "$libc" in @@ -7409,7 +7677,7 @@ if "$useshrplib"; then freebsd|netbsd) xxx="-Wl,-R$shrpdir" ;; - linux|irix*|dec_osf) + bsdos|linux|irix*|dec_osf) xxx="-Wl,-rpath,$shrpdir" ;; next) @@ -7796,6 +8064,9 @@ if $test "$cont"; then fi fi fi +case "$myhostname" in +'') myhostname=noname ;; +esac : you do not want to know about this set $myhostname myhostname=$1 @@ -7896,7 +8167,7 @@ case "$myhostname" in esac case "$dflt" in .) echo "(Lost all hope -- silly guess then)" - dflt='.uucp' + dflt='.nonet' ;; esac $rm -f hosts @@ -8337,192 +8608,80 @@ EOCP echo " " echo "(I can't seem to compile the test program. Guessing...)" rp="What is the size of your file offsets (in bytes)?" - . ./myread - lseeksize="$ans" - fi - case "$fpostype" in - *_t) zzz="$fpostype" ;; - *) zzz="fpos_t" ;; - esac - $echo $n "Rechecking the size of $zzz...$c" >&4 - $cat > try.c < -#include -int main() { - printf("%d\n", (int)sizeof($fpostype)); - exit(0); -} -EOCP - set try - if eval $compile_ok; then - yyy=`$run ./try` - dflt="$lseeksize" - case "$yyy" in - '') echo " " - echo "(I can't execute the test program--guessing $fpossize.)" >&4 - ;; - *) fpossize=$yyy - echo " $fpossize bytes." >&4 - ;; - esac - else - dflt="$fpossize" - echo " " - echo "(I can't compile the test program. Guessing...)" >&4 - rp="What is the size of your file positions (in bytes)?" - . ./myread - fpossize="$ans" - fi - $rm -f try.c try - fi - ;; -esac - -case "$vendorprefix" in -'') d_vendorbin="$undef" - vendorbin='' - vendorbinexp='' - ;; -*) d_vendorbin="$define" - : determine where vendor-supplied executables go. - case "$vendorbin" in - '') dflt=$vendorprefix/bin ;; - *) dflt="$vendorbin" ;; - esac - fn=d~+ - rp='Pathname for the vendor-supplied executables directory?' - . ./getfile - vendorbin="$ans" - vendorbinexp="$ansexp" - ;; -esac -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"` -else - installvendorbin="$vendorbinexp" -fi - -: see if qgcvt exists -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 -#include -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 -#include -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 -#include -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." - ;; + . ./myread + lseeksize="$ans" + fi + case "$fpostype" in + *_t) zzz="$fpostype" ;; + *) zzz="fpos_t" ;; esac - fi -fi - -if $test X"$sPRIfldbl" = X; then - $cat >try.c <<'EOCP' + $echo $n "Rechecking the size of $zzz...$c" >&4 + $cat > try.c < #include int main() { - long double d = 123.456; - printf("%.3lf\n", d); + printf("%d\n", (int)sizeof($fpostype)); + exit(0); } 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 + set try + if eval $compile_ok; then + yyy=`$run ./try` + dflt="$lseeksize" + case "$yyy" in + '') echo " " + echo "(I can't execute the test program--guessing $fpossize.)" >&4 + ;; + *) fpossize=$yyy + echo " $fpossize bytes." >&4 + ;; + esac + else + dflt="$fpossize" + echo " " + echo "(I can't compile the test program. Guessing...)" >&4 + rp="What is the size of your file positions (in bytes)?" + . ./myread + fpossize="$ans" + fi + $rm -f try.c try fi -fi + ;; +esac -if $test X"$sPRIfldbl" = X; then - echo "Cannot figure out how to print long doubles." >&4 +case "$vendorprefix" in +'') d_vendorbin="$undef" + vendorbin='' + vendorbinexp='' + ;; +*) d_vendorbin="$define" + : determine where vendor-supplied executables go. + case "$vendorbin" in + '') dflt=$vendorprefix/bin ;; + *) dflt="$vendorbin" ;; + esac + fn=d~+ + rp='Pathname for the vendor-supplied executables directory?' + . ./getfile + vendorbin="$ans" + vendorbinexp="$ansexp" + ;; +esac +: Change installation prefix, if necessary. +if $test X"$prefix" != X"$installprefix"; then + installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"` else - sSCNfldbl=$sPRIfldbl # expect consistency + installvendorbin="$vendorbinexp" fi -$rm -f try try.* +: see if qgcvt exists +set qgcvt d_qgcvt +eval $inlibc -fi # d_longdbl +: Check how to convert floats to strings. -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 +if test "X$d_Gconvert" = X; then -: Check how to convert floats to strings. echo " " echo "Checking for an efficient way to convert floats to strings." echo " " > try.c @@ -8550,9 +8709,13 @@ char *myname = "qgcvt"; #define DOUBLETYPE long double #endif #ifdef TRY_sprintf -#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl) +#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) +#ifdef HAS_PRIgldbl #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x)) #else +#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x)) +#endif +#else #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) #endif char *myname = "sprintf"; @@ -8595,6 +8758,21 @@ int main() Gconvert((DOUBLETYPE)0.1, 8, 0, buf); checkit("0.1", buf); + Gconvert((DOUBLETYPE)0.01, 8, 0, buf); + checkit("0.01", buf); + + Gconvert((DOUBLETYPE)0.001, 8, 0, buf); + checkit("0.001", buf); + + Gconvert((DOUBLETYPE)0.0001, 8, 0, buf); + checkit("0.0001", buf); + + Gconvert((DOUBLETYPE)0.00009, 8, 0, buf); + if (strlen(buf) > 5) + checkit("9e-005", buf); /* for Microsoft ?? */ + else + checkit("9e-05", buf); + Gconvert((DOUBLETYPE)1.0, 8, 0, buf); checkit("1", buf); @@ -8633,31 +8811,65 @@ int main() Gconvert((DOUBLETYPE)123.456, 8, 0, buf); checkit("123.456", buf); - /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */ - Gconvert((DOUBLETYPE)1e30, 8, 0, buf); - if (strlen(buf) > 5) - checkit("1e+030", buf); /* for Microsoft */ - else - checkit("1e+30", buf); + /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */ + Gconvert((DOUBLETYPE)1e34, 8, 0, buf); + /* 34 should be enough to scare even long double + * places into using the e notation. */ + if (strlen(buf) > 5) + checkit("1e+034", buf); /* for Microsoft */ + else + checkit("1e+34", buf); + + /* For Perl, if you add additional tests here, also add them to + * t/base/num.t for benefit of platforms not using Configure or + * overriding d_Gconvert */ exit(0); } EOP -case "$d_Gconvert" in -gconvert*) xxx_list='gconvert gcvt sprintf' ;; -gcvt*) xxx_list='gcvt gconvert sprintf' ;; -sprintf*) xxx_list='sprintf gconvert gcvt' ;; -*) xxx_list='gconvert gcvt sprintf' ;; -esac - -case "$d_longdbl$uselongdouble$d_PRIgldbl" in -"$define$define$define") - # for long doubles prefer first qgcvt, then sprintf - xxx_list="`echo $xxx_list|sed s/sprintf//`" - xxx_list="sprintf $xxx_list" - case "$d_qgcvt" in - "$define") xxx_list="qgcvt $xxx_list" ;; - esac +: first add preferred functions to our list +xxx_list="" +for xxx_convert in $gconvert_preference; do + case $xxx_convert in + gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;; + *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;; + esac +done +: then add any others +for xxx_convert in gconvert gcvt sprintf; do + case "$xxx_list" in + *$xxx_convert*) ;; + *) xxx_list="$xxx_list $xxx_convert" ;; + esac +done + +case "$d_longdbl$uselongdouble" in +"$define$define") + : again, add prefered functions to our list first + xxx_ld_list="" + for xxx_convert in $gconvert_ld_preference; do + case $xxx_convert in + qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;; + *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;; + esac + done + : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt + for xxx_convert in qgcvt sprintf $xxx_list; do + case "$xxx_ld_list" in + $xxx_convert*|*" $xxx_convert"*) ;; + *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;; + esac + done + : if sprintf cannot do long doubles, move it to the end + if test "$d_PRIgldbl" != "$define"; then + xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf" + fi + : if no qgcvt, remove it + if test "$d_qgcvt" != "$define"; then + xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`" + fi + : use the ld_list + xxx_list="$xxx_ld_list" ;; esac @@ -8672,12 +8884,19 @@ for xxx_convert in $xxx_list; do break; else echo "...But $xxx_convert didn't work as I expected." + xxx_convert='' fi else echo "$xxx_convert NOT found." >&4 fi done - + +if test X$xxx_convert = X; then + echo "*** WHOA THERE!!! ***" >&4 + echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4 + xxx_convert=sprintf +fi + case "$xxx_convert" in gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; @@ -8685,11 +8904,15 @@ qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;; *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in "$define$define$define") d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;; + "$define$define$undef") + d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;; *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; esac ;; esac +fi + : see if _fwalk exists set fwalk d__fwalk eval $inlibc @@ -9336,36 +9559,42 @@ eval $setvar : see if crypt exists echo " " -if set crypt val -f d_crypt; eval $csym; $val; then - echo 'crypt() found.' >&4 - val="$define" - cryptlib='' -else - cryptlib=`./loc Slibcrypt$_a "" $xlibpth` - if $test -z "$cryptlib"; then - cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` - else - cryptlib=-lcrypt - fi - if $test -z "$cryptlib"; then - cryptlib=`./loc Llibcrypt$_a "" $xlibpth` - else - cryptlib=-lcrypt - fi - if $test -z "$cryptlib"; then - cryptlib=`./loc libcrypt$_a "" $libpth` - else - cryptlib=-lcrypt - fi - if $test -z "$cryptlib"; then - echo 'crypt() NOT found.' >&4 - val="$undef" - else +set crypt d_crypt +eval $inlibc +case "$d_crypt" in +$define) cryptlib='' ;; +*) if set crypt val -f d_crypt; eval $csym; $val; then + echo 'crypt() found.' >&4 val="$define" + cryptlib='' + else + cryptlib=`./loc Slibcrypt$_a "" $xlibpth` + if $test -z "$cryptlib"; then + cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + cryptlib=`./loc Llibcrypt$_a "" $xlibpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + cryptlib=`./loc libcrypt$_a "" $libpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + echo 'crypt() NOT found.' >&4 + val="$undef" + else + val="$define" + fi fi -fi -set d_crypt -eval $setvar + set d_crypt + eval $setvar + ;; +esac : get csh whereabouts case "$csh" in @@ -9944,6 +10173,10 @@ case "$eagain" in #include #include #include +#$i_fcntl I_FCNTL +#ifdef I_FCNTL +#include +#endif #define MY_O_NONBLOCK $o_nonblock #ifndef errno /* XXX need better Configure test */ extern int errno; @@ -10004,7 +10237,7 @@ int main() ret = read(pd[0], buf, 1); /* Should read EOF */ alarm(0); sprintf(string, "%d\n", ret); - write(3, string, strlen(string)); + write(4, string, strlen(string)); exit(0); } @@ -10018,7 +10251,7 @@ EOCP set try if eval $compile_ok; then echo "$startsh" >mtry - echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry + echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry chmod +x mtry ./mtry >/dev/null 2>&1 case $? in @@ -10247,6 +10480,40 @@ EOCP esac $rm -f try.c try fi +: see if struct tm knows about tm_zone +case "$i_systime$i_time" in +*$define*) + echo " " + echo "Checking to see if your struct tm has tm_zone field..." >&4 + set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h + eval $hasfield + ;; +*) val="$undef" + set d_tm_tm_zone + eval $setvar + ;; +esac +case "$d_tm_tm_zone" in +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; +esac +: see if struct tm knows about tm_gmtoff +case "$i_systime$i_time" in +*$define*) + echo " " + echo "Checking to see if your struct tm has tm_gmtoff field..." >&4 + set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h + eval $hasfield + ;; +*) val="$undef" + set d_tm_tm_gmtoff + eval $setvar + ;; +esac +case "$d_tm_tm_gmtoff" in +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; +esac : check for fd_set items $cat <try.c < -#include -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 @@ -11597,9 +11805,33 @@ $rm -f reflect set d_procselfexe eval $setvar +: see whether the pthread_atfork exists +$cat >try.c < +#include +int main() { +#ifdef PTHREAD_ATFORK + pthread_atfork(NULL,NULL,NULL); +#endif +} +EOP + : see if pthread_atfork exists -set pthread_atfork d_pthread_atfork -eval $inlibc +set try -DPTHREAD_ATFORK +if eval $compile; then + val="$define" +else + val="$undef" +fi +case "$usethreads" in +$define) + case "$val" in + $define) echo 'pthread_atfork found.' >&4 ;; + *) echo 'pthread_atfork NOT found.' >&4 ;; + esac +esac +set d_pthread_atfork +eval $setvar : see whether the various POSIXish _yields exist @@ -13424,13 +13656,19 @@ $cat <try.c <try.c < #define U32 $u32type -#define BYTEORDER $byteorder +#define BYTEORDER 0x$byteorder +#define U8 $u8type +#include +#ifdef SIGBUS +$signal_t bletch(s) int s; { exit(4); } +#endif int main() { #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321 - U8 buf[] = "\0\0\0\1\0\0\0\0"; + U8 buf[8]; U32 *up; int i; @@ -13441,6 +13679,19 @@ int main() { fflush(stdout); +#ifdef SIGBUS + signal(SIGBUS, bletch); +#endif + + buf[0] = 0; + buf[1] = 0; + buf[2] = 0; + buf[3] = 1; + buf[5] = 0; + buf[6] = 0; + buf[7] = 0; + buf[8] = 1; + for (i = 0; i < 4; i++) { up = (U32*)(buf + i); if (! ((*up == 1 << (8*i)) || /* big-endian */ @@ -13473,7 +13724,7 @@ int main() { EOCP set try if eval $compile_ok; then - echo "(Testing for character data alignment may dump core.)" >&4 + echo "(Testing for character data alignment may crash the test. That's okay.)" >&4 $run ./try 2>&1 >/dev/null case "$?" in 0) cat >&4 <>signal_cmd <<'EOS' set signal if eval $compile_ok; then - $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst + $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst else echo "(I can't seem be able to compile the whole test program)" >&4 echo "(I'll try it in little pieces.)" >&4 @@ -15540,7 +15793,7 @@ EOCP done if $test -s signal.ls1; then $cat signal.nsg signal.ls1 | - $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst + $sort -n | $uniq | $awk -f signal.awk >signal.lst fi fi @@ -15992,6 +16245,20 @@ eval $inhdr : see if ndbm.h is available set ndbm.h t_ndbm eval $inhdr + +case "$t_ndbm" in +$undef) + # Some Linux distributions such as RedHat 7.1 put the + # ndbm.h header in /usr/include/gdbm/ndbm.h. + if $test -f /usr/include/gdbm/ndbm.h; then + echo ' found.' + ccflags="$ccflags -I/usr/include/gdbm" + cppflags="$cppflags -I/usr/include/gdbm" + t_ndbm=$define + fi + ;; +esac + case "$t_ndbm" in $define) : see if dbm_open exists @@ -16463,7 +16730,7 @@ find_extensions=' else if $test -d $xxx -a $# -lt 10; then set $1$xxx/ $*; - cd $xxx; + cd "$xxx"; eval $find_extensions; cd ..; shift; @@ -16473,21 +16740,23 @@ find_extensions=' esac; done' tdir=`pwd` -cd $rsrc/ext +cd "$rsrc/ext" set X shift eval $find_extensions # Special case: Add in threads/shared since it is not picked up by the # recursive find above (and adding in general recursive finding breaks # SDBM_File/sdbm). A.D. 10/25/2001. -known_extensions="$known_extensions threads/shared" +# Encode::XX need explicit mentions for the same reason. +# --jhi 2002-03-04 +known_extensions="$known_extensions threads/shared Encode/CN Encode/JP Encode/KR Encode/TW" set X $nonxs_extensions shift nonxs_extensions="$*" set X $known_extensions shift known_extensions="$*" -cd $tdir +cd "$tdir" : Now see which are supported on this system. avail_ext='' @@ -17202,6 +17471,8 @@ d_telldir='$d_telldir' d_telldirproto='$d_telldirproto' d_time='$d_time' d_times='$d_times' +d_tm_tm_gmtoff='$d_tm_tm_gmtoff' +d_tm_tm_zone='$d_tm_tm_zone' d_truncate='$d_truncate' d_tzname='$d_tzname' d_u32align='$d_u32align' @@ -17736,7 +18007,7 @@ echo " " exec 1>&4 pwd=`pwd` . ./UU/extract -cd $pwd +cd "$pwd" if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then dflt=y