This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ExtUtils::Miniperl - Restore a missing line of POD
[perl5.git] / Configure
index da0b9d0..6e7d8f1 100755 (executable)
--- a/Configure
+++ b/Configure
 # 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)
@@ -377,6 +379,8 @@ d_aintl=''
 d_alarm=''
 asctime_r_proto=''
 d_asctime_r=''
+d_asinh=''
+d_atanh=''
 d_attribute_deprecated=''
 d_attribute_format=''
 d_attribute_malloc=''
@@ -396,6 +400,7 @@ d_c99_variadic_macros=''
 d_casti32=''
 castflags=''
 d_castneg=''
+d_cbrt=''
 d_chown=''
 d_chroot=''
 d_chsize=''
@@ -405,6 +410,7 @@ d_closedir=''
 d_void_closedir=''
 d_cmsghdr_s=''
 d_const=''
+d_copysign=''
 d_copysignl=''
 d_cplusplus=''
 cryptlib=''
@@ -453,6 +459,10 @@ endpwent_r_proto=''
 d_endsent=''
 d_endservent_r=''
 endservent_r_proto=''
+d_erf=''
+d_erfc=''
+d_exp2=''
+d_expm1=''
 d_faststdio=''
 d_fchdir=''
 d_fchmod=''
@@ -462,6 +472,7 @@ d_fcntl_can_lock=''
 d_fd_macros=''
 d_fd_set=''
 d_fds_bits=''
+d_fdim=''
 d_fegetround=''
 d_fgetpos=''
 d_finite=''
@@ -469,6 +480,9 @@ d_finitel=''
 d_flexfnam=''
 d_flock=''
 d_flockproto=''
+d_fma=''
+d_fmax=''
+d_fmin=''
 d_fork=''
 d_fp_class=''
 d_fp_classl=''
@@ -576,6 +590,8 @@ d_gnulibc=''
 gnulibc_version=''
 d_hasmntopt=''
 d_htonl=''
+d_hypot=''
+d_ilogb=''
 d_ilogbl=''
 d_inetaton=''
 d_inetntop=''
@@ -587,26 +603,38 @@ 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=''
+d_lgamma_r=''
 d_libm_lib_version=''
 d_link=''
+d_llrint=''
+d_llround=''
 d_localtime_r=''
 d_localtime_r_needs_tzset=''
 localtime_r_proto=''
 d_locconv=''
 d_lockf=''
+d_log1p=''
+d_log2=''
+d_logb=''
 d_ldexpl=''
 d_longdbl=''
 longdblkind=''
 longdblsize=''
 d_longlong=''
 longlongsize=''
+d_lrint=''
+d_lround=''
 d_lseekproto=''
 d_lstat=''
 d_madvise=''
@@ -640,6 +668,10 @@ d_msgrcv=''
 d_msgsnd=''
 d_msync=''
 d_munmap=''
+d_nan=''
+d_nearbyint=''
+d_nextafter=''
+d_nexttoward=''
 d_nice=''
 d_nl_langinfo=''
 d_off64_t=''
@@ -676,12 +708,20 @@ readdir_r_proto=''
 d_readlink=''
 d_readv=''
 d_recvmsg=''
+d_re_comp=''
+d_regcmp=''
+d_regcomp=''
+d_remainder=''
+d_remquo=''
 d_rename=''
+d_rint=''
 d_rmdir=''
+d_round=''
 d_safebcpy=''
 d_safemcpy=''
 d_sanemcmp=''
 d_sbrkproto=''
+d_scalbn=''
 d_scalbnl=''
 d_select=''
 d_sem=''
@@ -773,6 +813,7 @@ d_srandom_r=''
 srandom_r_proto=''
 d_sresgproto=''
 d_sresuproto=''
+d_stat=''
 d_statblks=''
 d_statfs_f_flags=''
 d_statfs_s=''
@@ -821,6 +862,7 @@ d_system=''
 d_tcgetpgrp=''
 d_tcsetpgrp=''
 d_telldirproto=''
+d_tgamma=''
 d_time=''
 timetype=''
 d_asctime64=''
@@ -834,6 +876,7 @@ clocktype=''
 d_times=''
 d_tmpnam_r=''
 tmpnam_r_proto=''
+d_trunc=''
 d_truncate=''
 d_truncl=''
 d_ttyname_r=''
@@ -957,6 +1000,7 @@ d_pwgecos=''
 d_pwpasswd=''
 d_pwquota=''
 i_pwd=''
+i_quadmath=''
 i_shadow=''
 i_socks=''
 i_stdbool=''
@@ -1047,6 +1091,7 @@ d_PRIeldbl=''
 d_PRIfldbl=''
 d_PRIgldbl=''
 d_SCNfldbl=''
+doublekind=''
 sPRIEUldbl=''
 sPRIFUldbl=''
 sPRIGUldbl=''
@@ -1266,6 +1311,7 @@ runnm=''
 usenm=''
 usensgetexecutablepath=''
 useperlio=''
+usequadmath=''
 usesocks=''
 d_oldpthreads=''
 use5005threads=''
@@ -1404,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 ! !'`
@@ -2812,38 +2858,41 @@ $define|true|[yY]*)
        *)      case "$lns:$issymlink" in
                *"ln"*" -s:"*"test -"?)
                        echo "Creating the symbolic links..." >&4
-                       echo "(First creating the subdirectories...)" >&4
                        cd ..
-                       awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
-                               read directory
-                               test -z "$directory" && break
-                               mkdir -p $directory
-                       done
+                       awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
+                       awk 'NF == 1 {
+                               dir=".";
+                               file=$1 "";
+                            }
+                            NF == 2 {
+                               dir=$1 "";
+                               file=$2 "";
+                            }
+                            {
+                                print "# dir = ", dir, "file = ", 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);
+                                }
+                            }' source="$src" > UU/mksymlinks.$$
+                       sh UU/mksymlinks.$$
+                       rm UU/mksymlinks.$$
                        # Sanity check 1.
                        if test ! -d t/base; then
                                echo "Failed to create the subdirectories.  Aborting." >&4
                                exit 1
                        fi
-                       echo "(Then creating the symlinks...)" >&4
-                       awk '{print $1}' $src/MANIFEST | while true; do
-                               read filename
-                               test -z "$filename" && break
-                               if test -f $filename; then
-                                       if $issymlink $filename; then
-                                               rm -f $filename
-                                       fi
-                               fi
-                               if test -f $filename; then
-                                       echo "$filename already exists, not symlinking."
-                               else
-                                       ln -s $src/$filename $filename
-                               fi
-                       done
                        # Sanity check 2.
                        if test ! -f t/base/lex.t; then
                                echo "Failed to create the symlinks (t/base/lex.t missing).  Aborting." >&4
                                exit 1
                        fi
+                       if test ! -f win32/win32.c; then
+                               echo "Failed to create the symlinks (win32/win32.c missing).  Aborting." >&4
+                               exit 1
+                       fi
                        cd UU
                        ;;
                *)      echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
@@ -3292,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
@@ -5151,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
@@ -5167,6 +5222,9 @@ esac
 case "$usecbacktrace" in
 "$define") libswanted="$libswanted bfd" ;;
 esac
+case "$usequadmath" in
+"$define") libswanted="$libswanted quadmath" ;;
+esac
 libsfound=''
 libsfiles=''
 libsdirs=''
@@ -5384,8 +5442,15 @@ default|recommended)
        # as that way the compiler can do the right implementation dependant
        # thing. (NWC)
        case "$gccversion" in
-       ?*)     set stack-protector -fstack-protector
+       ?*)     set stack-protector-strong -fstack-protector-strong
                eval $checkccflag
+               case "$dflt" in
+               *-fstack-protector-strong*) ;; # It got added.
+               *) # Try the plain/older -fstack-protector.
+                  set stack-protector -fstack-protector
+                  eval $checkccflag
+                  ;;
+               esac
                ;;
        esac
        ;;
@@ -5528,6 +5593,12 @@ case "$ldflags" in
 esac
 # See note above about -fstack-protector
 case "$ccflags" in
+*-fstack-protector-strong*)
+       case "$dflt" in
+       *-fstack-protector-strong*) ;; # Don't add it again
+       *) dflt="$dflt -fstack-protector-strong" ;;
+       esac
+       ;;
 *-fstack-protector*)
        case "$dflt" in
        *-fstack-protector*) ;; # Don't add it again
@@ -6822,6 +6893,7 @@ $cat <<EOP >try.c
 #$i_float I_FLOAT
 #$i_stdlib I_STDLIB
 #define LONGDBLSIZE $longdblsize
+#define DOUBLESIZE $doublesize
 #ifdef I_FLOAT
 #include <float.h>
 #endif
@@ -6832,7 +6904,11 @@ $cat <<EOP >try.c
 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");
@@ -6844,6 +6920,8 @@ int main() {
     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)
@@ -6858,8 +6936,9 @@ int main() {
     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 */
@@ -6891,11 +6970,13 @@ case "$longdblkind" in
 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
 
-
 : determine the architecture name
 echo " "
 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
@@ -6944,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
@@ -6994,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
@@ -7012,12 +7093,24 @@ $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
+       ;;
+esac
+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
        ;;
@@ -8399,6 +8492,12 @@ EOM
        esac
 
        case "$ldflags" in
+           *-fstack-protector-strong*)
+               case "$dflt" in
+                   *-fstack-protector-strong*) ;; # Don't add it again
+                   *) dflt="$dflt -fstack-protector-strong" ;;
+               esac
+               ;;
            *-fstack-protector*)
                case "$dflt" in
                    *-fstack-protector*) ;; # Don't add it again
@@ -8635,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}\""
@@ -9927,6 +10023,91 @@ 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 <<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
+  /* 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 " "
 
@@ -9949,7 +10130,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
-                       sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
+                       sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
                        echo "We will use %f."
                        ;;
                esac
@@ -9971,7 +10152,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
-                       sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
+                       sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
                        echo "We will use %Lf."
                        ;;
                esac
@@ -9993,7 +10174,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
-                       sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
+                       sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
                        echo "We will use %llf."
                        ;;
                esac
@@ -10015,7 +10196,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
-                       sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
+                       sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
                        echo "We will use %lf."
                        ;;
                esac
@@ -10043,6 +10224,38 @@ case "$sPRIfldbl" in
        ;;
 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
+
 : Check how to convert floats to strings.
 
 if test "X$d_Gconvert" = X; then
@@ -10652,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
@@ -11378,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)"
@@ -11478,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)"
@@ -11496,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
 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
@@ -13234,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 " "
 
@@ -13679,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
@@ -13704,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
@@ -15388,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
@@ -15540,6 +15809,27 @@ eval $setvar
 set isinfl d_isinfl
 eval $inlibc
 
+: 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
+
 : check for isnan
 echo "Checking to see if you have isnan..." >&4
 $cat >try.c <<EOCP
@@ -15565,6 +15855,27 @@ eval $setvar
 set isnanl d_isnanl
 eval $inlibc
 
+: 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
+
 : see if j0 exists
 set j0 d_j0
 eval $inlibc
@@ -15577,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 <<EOCP
+#include <locale.h>
+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'
@@ -15636,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
@@ -15668,6 +16012,14 @@ EOCP
 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
@@ -15787,14 +16139,30 @@ EOCP
 esac
 $rm_try
 
-: see if localeconv exists
-set localeconv d_locconv
-eval $inlibc
-
 : see if lockf exists
 set lockf d_lockf
 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 prototype for lseek is available
 echo " "
 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
@@ -16100,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
@@ -16112,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
@@ -16171,6 +16559,48 @@ define:define)
        ;;
 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)"
@@ -17034,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 <<EOM
+No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
+EOM
+       d_regcmp="$undef"
+       d_re_comp="$undef"
+       d_regcomp="$undef"
+fi
+
+: see if remainder exists
+set remainder d_remainder
+eval $inlibc
+
+: see if remquo exists
+set remquo d_remquo
+eval $inlibc
+
 : see if rename exists
 set rename d_rename
 eval $inlibc
 
+: see if rint exists
+set rint d_rint
+eval $inlibc
+
 : see if rmdir exists
 set rmdir d_rmdir
 eval $inlibc
 
+: see if round exists
+set round d_round
+eval $inlibc
+
 : see if memory.h is available.
 val=''
 set memory.h val
@@ -17277,6 +17749,10 @@ echo " "
 set d_sbrkproto sbrk $i_unistd unistd.h
 eval $hasproto
 
+: see if scalbn exists
+set scalbn d_scalbn
+eval $inlibc
+
 : see if select exists
 set select d_select
 eval $inlibc
@@ -18375,6 +18851,10 @@ echo " "
 set d_sresuproto setresuid $i_unistd unistd.h
 eval $hasproto
 
+: see if stat exists
+set stat d_stat
+eval $inlibc
+
 : see if sys/stat.h is available
 set sys/stat.h i_sysstat
 eval $inhdr
@@ -18997,6 +19477,10 @@ echo " "
 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
 eval $hasproto
 
+: see if tgamma exists
+set tgamma d_tgamma
+eval $inlibc
+
 : see if time exists
 echo " "
 if test "X$d_time" = X -o X"$timetype" = X; then
@@ -19082,6 +19566,10 @@ case "$d_tmpnam_r" in
        ;;
 esac
 
+: see if trunc exists
+set trunc d_trunc
+eval $inlibc
+
 : see if truncate exists
 set truncate d_truncate
 eval $inlibc
@@ -20472,20 +20960,29 @@ else
        fi
 fi
 
-if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
+if $test X"$usequadmath" = X"$define"; then
+    nveformat='"Qe"'
+    nvfformat='"Qf"'
+    nvgformat='"Qg"'
+    nvEUformat='"QE"'
+    nvFUformat='"QF"'
+    nvGUformat='"QG"'
+else
+    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
+    else
        nveformat='"e"'
        nvfformat='"f"'
        nvgformat='"g"'
        nvEUformat='"E"'
        nvFUformat='"F"'
        nvGUformat='"G"'
+    fi
 fi
 
 case "$ivdformat" in
@@ -20948,7 +21445,7 @@ int check_min ()
 
 int main (int argc, char *argv[])
 {
-    fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
+    /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
     check_max ();
     check_min ();
     return (0);
@@ -20956,7 +21453,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 sGMTIME_max and sGMTIME_min." >&4
            fi
@@ -21037,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
@@ -21169,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 <<EOM
 Cannot figure out on how many bits at a time your select() operates.
@@ -23263,6 +23760,8 @@ d_alarm='$d_alarm'
 d_archlib='$d_archlib'
 d_asctime64='$d_asctime64'
 d_asctime_r='$d_asctime_r'
+d_asinh='$d_asinh'
+d_atanh='$d_atanh'
 d_atolf='$d_atolf'
 d_atoll='$d_atoll'
 d_attribute_deprecated='$d_attribute_deprecated'
@@ -23285,6 +23784,7 @@ d_bzero='$d_bzero'
 d_c99_variadic_macros='$d_c99_variadic_macros'
 d_casti32='$d_casti32'
 d_castneg='$d_castneg'
+d_cbrt='$d_cbrt'
 d_charvspr='$d_charvspr'
 d_chown='$d_chown'
 d_chroot='$d_chroot'
@@ -23294,6 +23794,7 @@ d_clearenv='$d_clearenv'
 d_closedir='$d_closedir'
 d_cmsghdr_s='$d_cmsghdr_s'
 d_const='$d_const'
+d_copysign='$d_copysign'
 d_copysignl='$d_copysignl'
 d_cplusplus='$d_cplusplus'
 d_crypt='$d_crypt'
@@ -23333,7 +23834,11 @@ d_endpwent_r='$d_endpwent_r'
 d_endsent='$d_endsent'
 d_endservent_r='$d_endservent_r'
 d_eofnblk='$d_eofnblk'
+d_erf='$d_erf'
+d_erfc='$d_erfc'
 d_eunice='$d_eunice'
+d_exp2='$d_exp2'
+d_expm1='$d_expm1'
 d_faststdio='$d_faststdio'
 d_fchdir='$d_fchdir'
 d_fchmod='$d_fchmod'
@@ -23342,6 +23847,7 @@ d_fcntl='$d_fcntl'
 d_fcntl_can_lock='$d_fcntl_can_lock'
 d_fd_macros='$d_fd_macros'
 d_fd_set='$d_fd_set'
+d_fdim='$d_fdim'
 d_fds_bits='$d_fds_bits'
 d_fegetround='$d_fegetround'
 d_fgetpos='$d_fgetpos'
@@ -23350,6 +23856,9 @@ d_finitel='$d_finitel'
 d_flexfnam='$d_flexfnam'
 d_flock='$d_flock'
 d_flockproto='$d_flockproto'
+d_fma='$d_fma'
+d_fmax='$d_fmax'
+d_fmin='$d_fmin'
 d_fork='$d_fork'
 d_fp_class='$d_fp_class'
 d_fp_classify='$d_fp_classify'
@@ -23436,6 +23945,8 @@ d_gnulibc='$d_gnulibc'
 d_grpasswd='$d_grpasswd'
 d_hasmntopt='$d_hasmntopt'
 d_htonl='$d_htonl'
+d_hypot='$d_hypot'
+d_ilogb='$d_ilogb'
 d_ilogbl='$d_ilogbl'
 d_inc_version_list='$d_inc_version_list'
 d_index='$d_index'
@@ -23453,24 +23964,36 @@ d_isfinite='$d_isfinite'
 d_isfinitel='$d_isfinitel'
 d_isinf='$d_isinf'
 d_isinfl='$d_isinfl'
+d_isless='$d_isless'
 d_isnan='$d_isnan'
 d_isnanl='$d_isnanl'
+d_isnormal='$d_isnormal'
 d_j0='$d_j0'
 d_j0l='$d_j0l'
 d_killpg='$d_killpg'
+d_lc_monetary_2008='$d_lc_monetary_2008'
 d_lchown='$d_lchown'
 d_ldbl_dig='$d_ldbl_dig'
 d_ldexpl='$d_ldexpl'
+d_lgamma='$d_lgamma'
+d_lgamma_r='$d_lgamma_r'
 d_libm_lib_version='$d_libm_lib_version'
 d_libname_unique='$d_libname_unique'
 d_link='$d_link'
+d_llrint='$d_llrint'
+d_llround='$d_llround'
 d_localtime64='$d_localtime64'
 d_localtime_r='$d_localtime_r'
 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
 d_locconv='$d_locconv'
 d_lockf='$d_lockf'
+d_log1p='$d_log1p'
+d_log2='$d_log2'
+d_logb='$d_logb'
 d_longdbl='$d_longdbl'
 d_longlong='$d_longlong'
+d_lrint='$d_lrint'
+d_lround='$d_lround'
 d_lseekproto='$d_lseekproto'
 d_lstat='$d_lstat'
 d_madvise='$d_madvise'
@@ -23510,8 +24033,12 @@ d_msgsnd='$d_msgsnd'
 d_msync='$d_msync'
 d_munmap='$d_munmap'
 d_mymalloc='$d_mymalloc'
+d_nan='$d_nan'
 d_ndbm='$d_ndbm'
 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
+d_nearbyint='$d_nearbyint'
+d_nextafter='$d_nextafter'
+d_nexttoward='$d_nexttoward'
 d_nice='$d_nice'
 d_nl_langinfo='$d_nl_langinfo'
 d_nv_preserves_uv='$d_nv_preserves_uv'
@@ -23548,19 +24075,27 @@ d_pwquota='$d_pwquota'
 d_qgcvt='$d_qgcvt'
 d_quad='$d_quad'
 d_random_r='$d_random_r'
+d_re_comp='$d_re_comp'
 d_readdir64_r='$d_readdir64_r'
 d_readdir='$d_readdir'
 d_readdir_r='$d_readdir_r'
 d_readlink='$d_readlink'
 d_readv='$d_readv'
 d_recvmsg='$d_recvmsg'
+d_regcmp='$d_regcmp'
+d_regcomp='$d_regcomp'
+d_remainder='$d_remainder'
+d_remquo='$d_remquo'
 d_rename='$d_rename'
 d_rewinddir='$d_rewinddir'
+d_rint='$d_rint'
 d_rmdir='$d_rmdir'
+d_round='$d_round'
 d_safebcpy='$d_safebcpy'
 d_safemcpy='$d_safemcpy'
 d_sanemcmp='$d_sanemcmp'
 d_sbrkproto='$d_sbrkproto'
+d_scalbn='$d_scalbn'
 d_scalbnl='$d_scalbnl'
 d_sched_yield='$d_sched_yield'
 d_scm_rights='$d_scm_rights'
@@ -23632,6 +24167,7 @@ d_srand48_r='$d_srand48_r'
 d_srandom_r='$d_srandom_r'
 d_sresgproto='$d_sresgproto'
 d_sresuproto='$d_sresuproto'
+d_stat='$d_stat'
 d_statblks='$d_statblks'
 d_statfs_f_flags='$d_statfs_f_flags'
 d_statfs_s='$d_statfs_s'
@@ -23674,12 +24210,14 @@ d_tcgetpgrp='$d_tcgetpgrp'
 d_tcsetpgrp='$d_tcsetpgrp'
 d_telldir='$d_telldir'
 d_telldirproto='$d_telldirproto'
+d_tgamma='$d_tgamma'
 d_time='$d_time'
 d_timegm='$d_timegm'
 d_times='$d_times'
 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
 d_tm_tm_zone='$d_tm_tm_zone'
 d_tmpnam_r='$d_tmpnam_r'
+d_trunc='$d_trunc'
 d_truncate='$d_truncate'
 d_truncl='$d_truncl'
 d_ttyname_r='$d_ttyname_r'
@@ -23722,6 +24260,7 @@ db_version_patch='$db_version_patch'
 direntrytype='$direntrytype'
 dlext='$dlext'
 dlsrc='$dlsrc'
+doublekind='$doublekind'
 doublesize='$doublesize'
 drand01='$drand01'
 drand48_r_proto='$drand48_r_proto'
@@ -23850,6 +24389,7 @@ i_poll='$i_poll'
 i_prot='$i_prot'
 i_pthread='$i_pthread'
 i_pwd='$i_pwd'
+i_quadmath='$i_quadmath'
 i_rpcsvcdbm='$i_rpcsvcdbm'
 i_sgtty='$i_sgtty'
 i_shadow='$i_shadow'
@@ -24228,6 +24768,7 @@ usensgetexecutablepath='$usensgetexecutablepath'
 useopcode='$useopcode'
 useperlio='$useperlio'
 useposix='$useposix'
+usequadmath='$usequadmath'
 usereentrant='$usereentrant'
 userelocatableinc='$userelocatableinc'
 useshrplib='$useshrplib'