X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/427d28ce7d87934492636e1b3d48f726edb64f4e..6b12f8a9d54e6f2263e24714393fecb3497bfe61:/Configure diff --git a/Configure b/Configure index 69dd589..6e7d8f1 100755 --- a/Configure +++ b/Configure @@ -11,10 +11,13 @@ # Yes, you may rip this off to use in other distribution packages. This # script belongs to the public domain and cannot be copyrighted. # -# Note: this Configure script was generated automatically. Rather than -# working with this copy of Configure, you may wish to get metaconfig. -# The dist package (which contains metaconfig) is available via SVN: -# svn co https://svn.code.sf.net/p/dist/code/trunk/dist +# Note: this Configure script was generated automatically by the tool +# called "metaconfig". Rather than working with this copy of Configure, +# you may wish to get metaconfig. Perl uses a modified version of this +# tool, available in the "dist" folder in the checkout of the git repo +# $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig +# The original dist package (including metaconfig) is available via SVN: +# $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist # # Though this script was generated by metaconfig from metaunits, it is # OK to send patches against Configure itself. It's up to the Configure @@ -26,7 +29,6 @@ # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig # # See Porting/pumpkin.pod for more information on metaconfig. -# # Generated using [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) @@ -373,12 +375,12 @@ d__fwalk='' d_access='' d_accessx='' d_acosh='' -d_asinh='' -d_atanh='' d_aintl='' d_alarm='' asctime_r_proto='' d_asctime_r='' +d_asinh='' +d_atanh='' d_attribute_deprecated='' d_attribute_format='' d_attribute_malloc='' @@ -467,10 +469,10 @@ d_fchmod='' d_fchown='' d_fcntl='' d_fcntl_can_lock='' -d_fdim='' d_fd_macros='' d_fd_set='' d_fds_bits='' +d_fdim='' d_fegetround='' d_fgetpos='' d_finite='' @@ -478,7 +480,6 @@ d_finitel='' d_flexfnam='' d_flock='' d_flockproto='' -d_fdim='' d_fma='' d_fmax='' d_fmin='' @@ -602,12 +603,14 @@ d_isfinite='' d_isfinitel='' d_isinf='' d_isinfl='' +d_isless='' d_isnan='' d_isnanl='' d_isnormal='' d_j0='' d_j0l='' d_killpg='' +d_lc_monetary_2008='' d_lchown='' d_ldbl_dig='' d_lgamma='' @@ -620,12 +623,11 @@ d_localtime_r='' d_localtime_r_needs_tzset='' localtime_r_proto='' d_locconv='' -d_lc_monetary_2008='' d_lockf='' -d_ldexpl='' d_log1p='' d_log2='' d_logb='' +d_ldexpl='' d_longdbl='' longdblkind='' longdblsize='' @@ -706,6 +708,9 @@ readdir_r_proto='' d_readlink='' d_readv='' d_recvmsg='' +d_re_comp='' +d_regcmp='' +d_regcomp='' d_remainder='' d_remquo='' d_rename='' @@ -808,6 +813,7 @@ d_srandom_r='' srandom_r_proto='' d_sresgproto='' d_sresuproto='' +d_stat='' d_statblks='' d_statfs_f_flags='' d_statfs_s='' @@ -856,6 +862,7 @@ d_system='' d_tcgetpgrp='' d_tcsetpgrp='' d_telldirproto='' +d_tgamma='' d_time='' timetype='' d_asctime64='' @@ -869,7 +876,6 @@ clocktype='' d_times='' d_tmpnam_r='' tmpnam_r_proto='' -d_tgamma='' d_trunc='' d_truncate='' d_truncl='' @@ -911,7 +917,6 @@ ld='' ld_can_script='' lddlflags='' usedl='' -doublekind='' doublesize='' ebcdic='' fflushNULL='' @@ -1086,6 +1091,7 @@ d_PRIeldbl='' d_PRIfldbl='' d_PRIgldbl='' d_SCNfldbl='' +doublekind='' sPRIEUldbl='' sPRIFUldbl='' sPRIGUldbl='' @@ -1298,7 +1304,6 @@ libswanted_uselargefiles='' uselargefiles='' uselongdouble='' usemorebits='' -usequadmath='' usemultiplicity='' nm_opt='' nm_so_opt='' @@ -1306,6 +1311,7 @@ runnm='' usenm='' usensgetexecutablepath='' useperlio='' +usequadmath='' usesocks='' d_oldpthreads='' use5005threads='' @@ -1444,8 +1450,8 @@ libswanted_uselargefiles='' : set usesocks on the Configure command line to enable socks. : List of libraries we want. : If anyone needs extra -lxxx, put those in a hint file. -libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun" -libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD" +libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld" +libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" : We probably want to search /usr/shlib before most other libraries. : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` @@ -2864,13 +2870,13 @@ $define|true|[yY]*) } { print "# dir = ", dir, "file = ", file - mf[dir] = mf[dir]" "src"/"dir"/"file; + mf[dir] = mf[dir]" "source"/"dir"/"file; } END { for (d in mf) { if (d != ".") { print("mkdir -p "d) } print("ln -sf "mf[d]" "d); } - }' src="$src" > UU/mksymlinks.$$ + }' source="$src" > UU/mksymlinks.$$ sh UU/mksymlinks.$$ rm UU/mksymlinks.$$ # Sanity check 1. @@ -3335,7 +3341,7 @@ EOM $test -f /bin/mips && /bin/mips && osname=mips $test -d /usr/apollo/bin && osname=apollo $test -f /etc/saf/_sactab && osname=svr4 - $test -d /usr/include/minix && osname=minix + $test -d /usr/include/minix && osname=minix && osvers=`$uname -r` $test -f /system/gnu_library/bin/ar.pm && osname=vos if $test -d /MachTen -o -d /MachTen_Folder; then osname=machten @@ -4487,14 +4493,6 @@ esac set usemultiplicity eval $setvar -: Check if usequadmath is requested -case "$usequadmath" in -"$define"|true|[yY]*) - usequadmath="$define" - ;; -*) usequadmath="$undef" ;; -esac - : Check if morebits is requested case "$usemorebits" in "$define"|true|[yY]*) @@ -5202,6 +5200,12 @@ EOM esac fi +: Check if quadmath is requested +case "$usequadmath" in +"$define"|true|[yY]*) usequadmath="$define" ;; +*) usequadmath="$undef" ;; +esac + : Looking for optional libraries echo " " echo "Checking for optional libraries..." >&4 @@ -6828,93 +6832,6 @@ $rm_try set float.h i_float eval $inhdr -echo " " -$echo "Checking the kind of doubles you have..." >&4 -$cat <try.c -#$i_stdlib I_STDLIB -#define DOUBLESIZE $doublesize -#ifdef I_STDLIB -#include -#endif -#include -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 for long doubles echo " " echo "Checking to see if you have long double..." >&4 @@ -6935,10 +6852,6 @@ eval $setvar set ldexpl d_ldexpl eval $inlibc -: see if this is a quadmath.h system -set quadmath.h i_quadmath -eval $inhdr - : check for length of long double case "${d_longdbl}${longdblsize}" in $define) @@ -6973,7 +6886,6 @@ EOCP esac $rm_try -echo " " $echo "Checking the kind of long doubles you have..." >&4 case "$d_longdbl" in define) @@ -6988,8 +6900,8 @@ $cat <try.c #ifdef I_STDLIB #include #endif -static const long double d = -0.1L; #include +static const long double d = -0.1L; int main() { unsigned const char* b = (unsigned const char*)(&d); #if DOUBLESIZE == LONGDBLSIZE @@ -7065,188 +6977,40 @@ case "$longdblkind" in esac $rm_try -: Check print/scan long double stuff +: determine the architecture name 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 +if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then + tarch=`arch`"-$osname" +elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then + if uname -m > tmparch 2>&1 ; then + tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ + -e 's/$/'"-$osname/" tmparch` + else + tarch="$osname" fi -fi - -if $test X"$sPRIfldbl" = X; then - echo "Cannot figure out how to print long doubles." >&4 + $rm -f tmparch else - sSCNfldbl=$sPRIfldbl # expect consistency + tarch="$osname" fi - -$rm_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"; +case "$myarchname" in +''|"$tarch") ;; +*) + echo "(Your architecture name used to be $myarchname.)" + archname='' ;; 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 < -#include -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 - -: determine the architecture name -echo " " -if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then - tarch=`arch`"-$osname" -elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then - if uname -m > tmparch 2>&1 ; then - tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ - -e 's/$/'"-$osname/" tmparch` - else - tarch="$osname" - fi - $rm -f tmparch -else - tarch="$osname" -fi -case "$myarchname" in -''|"$tarch") ;; -*) - echo "(Your architecture name used to be $myarchname.)" - archname='' - ;; -esac -case "$targetarch" in -'') ;; -*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; -esac -myarchname="$tarch" -case "$archname" in -'') dflt="$tarch";; -*) dflt="$archname";; -esac -rp='What is your architecture name' -. ./myread -archname="$ans" +case "$targetarch" in +'') ;; +*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; +esac +myarchname="$tarch" +case "$archname" in +'') dflt="$tarch";; +*) dflt="$archname";; +esac +rp='What is your architecture name' +. ./myread +archname="$ans" : optionally add API version to the architecture for versioned archlibs case "$useversionedarchname" in @@ -7261,40 +7025,40 @@ 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 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 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 case "$use64bitint$use64bitall" in @@ -7311,12 +7075,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 @@ -7329,12 +7093,12 @@ $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 ;; @@ -7343,12 +7107,12 @@ 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 + *-ld*) echo "...and architecture name already has -quadmath." >&4 ;; - esac + *) archname="$archname-quadmath" + echo "...setting architecture name to $archname." >&4 + ;; + esac ;; esac if $test -f archname.cbu; then @@ -8970,12 +8734,9 @@ if "$useshrplib"; then freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig) xxx="-Wl,-R$shrpdir" ;; - bsdos|linux|irix*|dec_osf|gnu*) + bsdos|linux|irix*|dec_osf|gnu*|haiku) xxx="-Wl,-rpath,$shrpdir" ;; - haiku) - # Haiku doesn't like the default, either. - ;; hpux*) # hpux doesn't like the default, either. tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" @@ -10262,6 +10023,239 @@ esac set qgcvt d_qgcvt eval $inlibc +: Check what kind of doubles your system has +$echo "Checking the kind of doubles you have..." >&4 +$cat >try.c < +#endif +#include +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 + /* 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 " " + +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_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 + +: 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 < +#include +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 + : Check how to convert floats to strings. if test "X$d_Gconvert" = X; then @@ -10561,6 +10555,10 @@ $rm -f access* set accessx d_accessx eval $inlibc +: see if acosh exists +set acosh d_acosh +eval $inlibc + : see if aintl exists set aintl d_aintl eval $inlibc @@ -10867,6 +10865,14 @@ case "$d_asctime_r" in ;; esac +: see if asinh exists +set asinh d_asinh +eval $inlibc + +: see if atanh exists +set atanh d_atanh +eval $inlibc + : see if atolf exists set atolf d_atolf eval $inlibc @@ -11593,7 +11599,7 @@ int main() EOCP set try if eval $compile_ok; then - $run ./try + $run ./try 2>/dev/null yyy=$? else echo "(I can't seem to compile the test program--assuming it can't)" @@ -11693,7 +11699,7 @@ int main() EOCP set try if eval $compile_ok; then - $run ./try + $run ./try 2>/dev/null castflags=$? else echo "(I can't seem to compile the test program--assuming it can't)" @@ -11711,6 +11717,10 @@ set d_castneg eval $setvar $rm_try +: see if cbrt exists +set cbrt d_cbrt +eval $inlibc + : see if vprintf exists echo " " if set vprintf val -f d_vprintf; eval $csym; $val; then @@ -12075,6 +12085,10 @@ fi set d_const eval $setvar +: see if copysign exists +set copysign d_copysign +eval $inlibc + : see if copysignl exists set copysignl d_copysignl eval $inlibc @@ -13182,146 +13196,6 @@ esac set i_sysfile eval $setvar -: see if acosh exists -set acosh d_acosh -eval $inlibc - -: see if asinh exists -set asinh d_asinh -eval $inlibc - -: see if atanh exists -set atanh d_atanh -eval $inlibc - -: see if cbrt exists -set cbrt d_cbrt -eval $inlibc - -: see if copysign exists -set copysign d_copysign -eval $inlibc - -: see if erf exists -set erf d_erf -eval $inlibc - -: see if erfc exists -set erfc d_erfc -eval $inlibc - -: see if exp2 exists -set exp2 d_exp2 -eval $inlibc - -: see if expm1 exists -set expm1 d_expm1 -eval $inlibc - -: see if fdim exists -set fdim d_fdim -eval $inlibc - -: see if fma exists -set fma d_fma -eval $inlibc - -: see if fmax exists -set fmax d_fmax -eval $inlibc - -: see if fmin exists -set fmin d_fmin -eval $inlibc - -: see if hypot exists -set hypot d_hypot -eval $inlibc - -: see if ilogb exists -set ilogb d_ilogb -eval $inlibc - -: see if lgamma exists -set lgamma d_lgamma -eval $inlibc - -: see if lgamma_r exists -set lgamma_r d_lgamma_r -eval $inlibc - -: see if llrint exists -set llrint d_llrint -eval $inlibc - -: see if llround exists -set llround d_llround -eval $inlibc - -: see if log1p exists -set log1p d_log1p -eval $inlibc - -: see if log2 exists -set log2 d_log2 -eval $inlibc - -: see if logb exists -set logb d_logb -eval $inlibc - -: see if lrint exists -set lrint d_lrint -eval $inlibc - -: see if lround exists -set lround d_lround -eval $inlibc - -: see if nan exists -set nan d_nan -eval $inlibc - -: see if nearbyint exists -set nearbyint d_nearbyint -eval $inlibc - -: see if nextafter exists -set nextafter d_nextafter -eval $inlibc - -: see if nexttoward exists -set nexttoward d_nexttoward -eval $inlibc - -: see if remainder exists -set remainder d_remainder -eval $inlibc - -: see if remquo exists -set remquo d_remquo -eval $inlibc - -: see if rint exists -set rint d_rint -eval $inlibc - -: see if round exists -set round d_round -eval $inlibc - -: see if scalbn exists -set scalbn d_scalbn -eval $inlibc - -: see if tgamma exists -set tgamma d_tgamma -eval $inlibc - -: see if trunc exists -set trunc d_trunc -eval $inlibc - : see if fcntl.h is there val='' set fcntl.h val @@ -13589,6 +13463,22 @@ EOCP esac $rm_try head.c mtry +: see if erf exists +set erf d_erf +eval $inlibc + +: see if erfc exists +set erfc d_erfc +eval $inlibc + +: see if exp2 exists +set exp2 d_exp2 +eval $inlibc + +: see if expm1 exists +set expm1 d_expm1 +eval $inlibc + : see if _ptr and _cnt from stdio act std echo " " @@ -14034,6 +13924,10 @@ EOM fi $rm_try +: see if fdim exists +set fdim d_fdim +eval $inlibc + : see if fegetround exists set fegetround d_fegetround eval $inlibc @@ -14059,6 +13953,18 @@ echo " " set d_flockproto flock $i_sysfile sys/file.h eval $hasproto +: see if fma exists +set fma d_fma +eval $inlibc + +: see if fmax exists +set fmax d_fmax +eval $inlibc + +: see if fmin exists +set fmin d_fmin +eval $inlibc + : see if fp_class exists set fp_class d_fp_class eval $inlibc @@ -15743,6 +15649,14 @@ esac set d_htonl eval $setvar +: see if hypot exists +set hypot d_hypot +eval $inlibc + +: see if ilogb exists +set ilogb d_ilogb +eval $inlibc + : see if ilogbl exists set ilogbl d_ilogbl eval $inlibc @@ -15974,6 +15888,31 @@ eval $inlibc set killpg d_killpg eval $inlibc +: see if localeconv exists +set localeconv d_locconv +eval $inlibc + +: see if libc has the POSIX.1-2008 currency locale rules +case "$d_locconv:$d_lc_monetary_2008" in +$define:) + $cat >try.c < +int main() { + struct lconv *lc = localeconv(); + char int_p_cs_precedes = lc->int_p_cs_precedes; + return 0; +} +EOCP + set try + if eval $compile; then + d_lc_monetary_2008="$define" + else + d_lc_monetary_2008="$undef" + fi; + $rm_try + ;; +esac + : see if lchown exists echo " " $cat > try.c <<'EOCP' @@ -16033,6 +15972,14 @@ $rm -f ldbl_dig.? set d_ldbl_dig eval $setvar +: see if lgamma exists +set lgamma d_lgamma +eval $inlibc + +: see if lgamma_r exists +set lgamma_r d_lgamma_r +eval $inlibc + : check to see if math.h defines _LIB_VERSION d_libm_lib_version="$undef" case $i_math in @@ -16061,102 +16008,18 @@ EOCP esac -: check for fpclassify -echo " " -echo "Checking to see if you have fpclassify..." >&4 -$cat >try.c < -#endif -int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; } -EOCP -set try -if eval $compile; then - val="$define" - echo "You have fpclassify." -else - val="$undef" - echo "You do not have fpclassify." -fi -$rm_try -set d_fpclassify -eval $setvar - -: check for isfinite -echo " " -echo "Checking to see if you have isfinite..." >&4 -$cat >try.c < -#endif -int main() { return isfinite(0.0); } -EOCP -set try -if eval $compile; then - val="$define" - echo "You have isfinite." -else - val="$undef" - echo "You do not have isfinite." -fi -$rm_try -set d_isfinite -eval $setvar - -: check for isinf -echo " " -echo "Checking to see if you have isinf..." >&4 -$cat >try.c < -#endif -int main() { return isinf(0.0); } -EOCP -set try -if eval $compile; then - val="$define" - echo "You have isinf." -else - val="$undef" - echo "You do not have isinf." -fi -$rm_try -set d_isinf -eval $setvar - -: check for isnan -echo " " -echo "Checking to see if you have isnan..." >&4 -$cat >try.c < -#endif -int main() { return isnan(0.0); } -EOCP -set try -if eval $compile; then - val="$define" - echo "You have isnan." -else - val="$undef" - echo "You do not have isnan." -fi -$rm_try -set d_isnan -eval $setvar - -: see if this is a quadmath.h system -set quadmath.h i_quadmath -eval $inhdr - : see if link exists set link d_link eval $inlibc +: see if llrint exists +set llrint d_llrint +eval $inlibc + +: see if llround exists +set llround d_llround +eval $inlibc + : see if localtime_r exists set localtime_r d_localtime_r eval $inlibc @@ -16276,33 +16139,28 @@ EOCP esac $rm_try -: see if localeconv exists -set localeconv d_locconv +: see if lockf exists +set lockf d_lockf eval $inlibc -: see if libc has the POSIX.1-2008 currency locale rules -case "$d_locconv:$d_lc_monetary_2008" in - $define:) - $cat >try.c < -int main() { - struct lconv *lc = localeconv(); - char int_p_cs_precedes = lc->int_p_cs_precedes; - return 0; -} -EOCP - set try - if eval $compile; then - d_lc_monetary_2008="$define" - else - d_lc_monetary_2008="$undef" - fi; - $rm_try - ;; -esac +: see if log1p exists +set log1p d_log1p +eval $inlibc -: see if lockf exists -set lockf d_lockf +: see if log2 exists +set log2 d_log2 +eval $inlibc + +: see if logb exists +set logb d_logb +eval $inlibc + +: see if lrint exists +set lrint d_lrint +eval $inlibc + +: see if lround exists +set lround d_lround eval $inlibc : see if prototype for lseek is available @@ -16610,6 +16468,22 @@ eval $inlibc set munmap d_munmap eval $inlibc +: see if nan exists +set nan d_nan +eval $inlibc + +: see if nearbyint exists +set nearbyint d_nearbyint +eval $inlibc + +: see if nextafter exists +set nextafter d_nextafter +eval $inlibc + +: see if nexttoward exists +set nexttoward d_nexttoward +eval $inlibc + : see if nice exists set nice d_nice eval $inlibc @@ -16622,6 +16496,10 @@ eval $inhdr set nl_langinfo d_nl_langinfo eval $inlibc +: see if this is a quadmath.h system +set quadmath.h i_quadmath +eval $inhdr + : check for volatile keyword echo " " echo 'Checking to see if your C compiler knows about "volatile"...' >&4 @@ -17586,14 +17464,56 @@ eval $inlibc set recvmsg d_recvmsg eval $inlibc +: see if regcomp, regcmp, or re_comp exist, for regular pattern matching +echo " " +if set regcomp val -f d_regcomp; eval $csym; $val; then + echo 'regcomp() found.' >&4 + d_regcomp="$define" + d_regcmp="$undef" + d_re_comp="$undef" +elif set regcmp val -f d_regcmp; eval $csym; $val; then + echo 'regcmp() found.' >&4 + d_regcmp="$define" + d_regcomp="$undef" + d_re_comp="$undef" +elif set re_comp val -f d_re_comp; eval $csym; $val; then + echo 're_comp() found, assuming re_exec() also exists.' >&4 + d_re_comp="$define" + d_regcomp="$undef" + d_regcmp="$undef" +else + $cat >&4 </dev/null` else echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4 fi @@ -21598,7 +21534,7 @@ int main (int argc, char *argv[]) EOCP set try if eval $compile; then - eval `$run ./try` + eval `$run ./try 2>/dev/null` else echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4 fi @@ -21730,7 +21666,7 @@ int main() { EOCP set try if eval $compile_ok; then - selectminbits=`$run ./try` + selectminbits=`$run ./try 2>/dev/null` case "$selectminbits" in '') cat >&4 <