wok rev 6929

Up: mpfr to 3.0.0p4. Added a EXTRAVERSION since i patching it with p4 patch.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Oct 22 23:13:10 2010 +0000 (2010-10-22)
parents 8346e7a4c25f
children 6b13333e1ad0
files mpfr-dev/receipt mpfr/receipt mpfr/stuff/mpfr-3.0.0-p3.patch mpfr/stuff/mpfr-3.0.0-p4.patch
line diff
     1.1 --- a/mpfr-dev/receipt	Fri Oct 22 22:36:22 2010 +0000
     1.2 +++ b/mpfr-dev/receipt	Fri Oct 22 23:13:10 2010 +0000
     1.3 @@ -7,6 +7,7 @@
     1.4  MAINTAINER="pankso@slitaz.org"
     1.5  WANTED="mpfr"
     1.6  WEB_SITE="http://gmplib.org/"
     1.7 +EXTRAVERSION="p4"
     1.8  
     1.9  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.10  genpkg_rules()
     2.1 --- a/mpfr/receipt	Fri Oct 22 22:36:22 2010 +0000
     2.2 +++ b/mpfr/receipt	Fri Oct 22 23:13:10 2010 +0000
     2.3 @@ -6,16 +6,17 @@
     2.4  SHORT_DESC="C library for multiple-precision floating-point computations."
     2.5  MAINTAINER="pankso@slitaz.org"
     2.6  DEPENDS="make gmp"
     2.7 -BUILD_DEPENDS="glibc-dev make gmp-dev gmp"
     2.8 +BUILD_DEPENDS="glibc-dev make gmp-dev gmp automake autoconf"
     2.9  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    2.10  WEB_SITE="http://www.mpfr.org/"
    2.11  WGET_URL="http://www.mpfr.org/mpfr-current/$TARBALL"
    2.12 +EXTRAVERSION=p4
    2.13  
    2.14  # Rules to configure and make the package.
    2.15  compile_rules()
    2.16  {	
    2.17  	cd $src
    2.18 -	patch -Np1 -i ../stuff/mpfr-3.0.0-p3.patch 
    2.19 +	patch -Np1 -i ../stuff/mpfr-3.0.0-p4.patch 
    2.20  	./configure \
    2.21  		--prefix=/usr \
    2.22  		--infodir=/usr/share/info \
     3.1 --- a/mpfr/stuff/mpfr-3.0.0-p3.patch	Fri Oct 22 22:36:22 2010 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,685 +0,0 @@
     3.4 -diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
     3.5 ---- mpfr-3.0.0-a/PATCHES	2010-06-23 11:02:49.000000000 +0000
     3.6 -+++ mpfr-3.0.0-b/PATCHES	2010-06-23 11:03:36.000000000 +0000
     3.7 -@@ -0,0 +1 @@
     3.8 -+mpfr_out_str
     3.9 -diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
    3.10 ---- mpfr-3.0.0-a/VERSION	2010-06-10 11:00:14.000000000 +0000
    3.11 -+++ mpfr-3.0.0-b/VERSION	2010-06-23 11:03:20.000000000 +0000
    3.12 -@@ -1 +1 @@
    3.13 --3.0.0
    3.14 -+3.0.0-p1
    3.15 -diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
    3.16 ---- mpfr-3.0.0-a/mpfr.h	2010-06-10 11:00:14.000000000 +0000
    3.17 -+++ mpfr-3.0.0-b/mpfr.h	2010-06-23 11:03:20.000000000 +0000
    3.18 -@@ -27,7 +27,7 @@
    3.19 - #define MPFR_VERSION_MAJOR 3
    3.20 - #define MPFR_VERSION_MINOR 0
    3.21 - #define MPFR_VERSION_PATCHLEVEL 0
    3.22 --#define MPFR_VERSION_STRING "3.0.0"
    3.23 -+#define MPFR_VERSION_STRING "3.0.0-p1"
    3.24 - 
    3.25 - /* Macros dealing with MPFR VERSION */
    3.26 - #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
    3.27 -diff -Naurd mpfr-3.0.0-a/mpfr.texi mpfr-3.0.0-b/mpfr.texi
    3.28 ---- mpfr-3.0.0-a/mpfr.texi	2010-06-10 11:00:14.000000000 +0000
    3.29 -+++ mpfr-3.0.0-b/mpfr.texi	2010-06-23 11:03:12.000000000 +0000
    3.30 -@@ -2050,7 +2050,7 @@
    3.31 - are printed. If @var{base} is greater than 10, @samp{@@} will be used
    3.32 - instead of @samp{e} as exponent delimiter.
    3.33 - 
    3.34 --Return the number of bytes written, or if an error occurred, return 0.
    3.35 -+Return the number of characters written, or if an error occurred, return 0.
    3.36 - @end deftypefun
    3.37 - 
    3.38 - @deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mpfr_rnd_t @var{rnd})
    3.39 -diff -Naurd mpfr-3.0.0-a/out_str.c mpfr-3.0.0-b/out_str.c
    3.40 ---- mpfr-3.0.0-a/out_str.c	2010-06-10 11:00:14.000000000 +0000
    3.41 -+++ mpfr-3.0.0-b/out_str.c	2010-06-23 11:03:12.000000000 +0000
    3.42 -@@ -22,6 +22,16 @@
    3.43 - 
    3.44 - #include "mpfr-impl.h"
    3.45 - 
    3.46 -+/* Warning! S should not contain "%". */
    3.47 -+#define OUT_STR_RET(S)                          \
    3.48 -+  do                                            \
    3.49 -+    {                                           \
    3.50 -+      int r;                                    \
    3.51 -+      r = fprintf (stream, (S));                \
    3.52 -+      return r < 0 ? 0 : r;                     \
    3.53 -+    }                                           \
    3.54 -+  while (0)
    3.55 -+
    3.56 - size_t
    3.57 - mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
    3.58 -               mpfr_rnd_t rnd_mode)
    3.59 -@@ -29,6 +39,7 @@
    3.60 -   char *s, *s0;
    3.61 -   size_t l;
    3.62 -   mpfr_exp_t e;
    3.63 -+  int err;
    3.64 - 
    3.65 -   MPFR_ASSERTN (base >= 2 && base <= 62);
    3.66 - 
    3.67 -@@ -36,37 +47,16 @@
    3.68 -   if (stream == NULL)
    3.69 -     stream = stdout;
    3.70 - 
    3.71 --  if (MPFR_IS_NAN(op))
    3.72 --    {
    3.73 --      fprintf (stream, "@NaN@");
    3.74 --      return 3;
    3.75 --    }
    3.76 --
    3.77 --  if (MPFR_IS_INF(op))
    3.78 --    {
    3.79 --      if (MPFR_SIGN(op) > 0)
    3.80 --        {
    3.81 --          fprintf (stream, "@Inf@");
    3.82 --          return 3;
    3.83 --        }
    3.84 --      else
    3.85 --        {
    3.86 --          fprintf (stream, "-@Inf@");
    3.87 --          return 4;
    3.88 --        }
    3.89 --    }
    3.90 --
    3.91 --  if (MPFR_IS_ZERO(op))
    3.92 -+  if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (op)))
    3.93 -     {
    3.94 --      if (MPFR_SIGN(op) > 0)
    3.95 --        {
    3.96 --          fprintf(stream, "0");
    3.97 --          return 1;
    3.98 --        }
    3.99 -+      if (MPFR_IS_NAN (op))
   3.100 -+        OUT_STR_RET ("@NaN@");
   3.101 -+      else if (MPFR_IS_INF (op))
   3.102 -+        OUT_STR_RET (MPFR_IS_POS (op) ? "@Inf@" : "-@Inf@");
   3.103 -       else
   3.104 -         {
   3.105 --          fprintf(stream, "-0");
   3.106 --          return 2;
   3.107 -+          MPFR_ASSERTD (MPFR_IS_ZERO (op));
   3.108 -+          OUT_STR_RET (MPFR_IS_POS (op) ? "0" : "-0");
   3.109 -         }
   3.110 -     }
   3.111 - 
   3.112 -@@ -77,21 +67,31 @@
   3.113 - 
   3.114 -   l = strlen (s) + 1; /* size of allocated block returned by mpfr_get_str
   3.115 -                          - may be incorrect, as only an upper bound? */
   3.116 --  if (*s == '-')
   3.117 --    fputc (*s++, stream);
   3.118 - 
   3.119 --  /* outputs mantissa */
   3.120 --  fputc (*s++, stream); e--; /* leading digit */
   3.121 --  fputc ((unsigned char) MPFR_DECIMAL_POINT, stream);
   3.122 --  fputs (s, stream);         /* rest of mantissa */
   3.123 -+  /* outputs possible sign and significand */
   3.124 -+  err = (*s == '-' && fputc (*s++, stream) == EOF)
   3.125 -+    || fputc (*s++, stream) == EOF  /* leading digit */
   3.126 -+    || fputc ((unsigned char) MPFR_DECIMAL_POINT, stream) == EOF
   3.127 -+    || fputs (s, stream) == EOF;     /* trailing significand */
   3.128 -   (*__gmp_free_func) (s0, l);
   3.129 -+  if (MPFR_UNLIKELY (err))
   3.130 -+    return 0;
   3.131 -+
   3.132 -+  e--;  /* due to the leading digit */
   3.133 - 
   3.134 -   /* outputs exponent */
   3.135 -   if (e)
   3.136 -     {
   3.137 -+      int r;
   3.138 -+
   3.139 -       MPFR_ASSERTN(e >= LONG_MIN);
   3.140 -       MPFR_ASSERTN(e <= LONG_MAX);
   3.141 --      l += fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
   3.142 -+
   3.143 -+      r = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
   3.144 -+      if (MPFR_UNLIKELY (r < 0))
   3.145 -+        return 0;
   3.146 -+
   3.147 -+      l += r;
   3.148 -     }
   3.149 - 
   3.150 -   return l;
   3.151 -diff -Naurd mpfr-3.0.0-a/tests/tout_str.c mpfr-3.0.0-b/tests/tout_str.c
   3.152 ---- mpfr-3.0.0-a/tests/tout_str.c	2010-06-10 11:00:13.000000000 +0000
   3.153 -+++ mpfr-3.0.0-b/tests/tout_str.c	2010-06-23 11:03:12.000000000 +0000
   3.154 -@@ -46,22 +46,54 @@
   3.155 - special (void)
   3.156 - {
   3.157 -   mpfr_t x;
   3.158 -+  unsigned int n;
   3.159 - 
   3.160 -   mpfr_init (x);
   3.161 - 
   3.162 -   mpfr_set_nan (x);
   3.163 --  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.164 -+  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.165 -+  if (n != 5)
   3.166 -+    {
   3.167 -+      printf ("Error: mpfr_out_str (file, 10, 0, NaN, MPFR_RNDN) wrote %u "
   3.168 -+              "characters instead of 5.\n", n);
   3.169 -+      exit (1);
   3.170 -+    }
   3.171 - 
   3.172 -   mpfr_set_inf (x, 1);
   3.173 --  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.174 -+  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.175 -+  if (n != 5)
   3.176 -+    {
   3.177 -+      printf ("Error: mpfr_out_str (file, 10, 0, +Inf, MPFR_RNDN) wrote %u "
   3.178 -+               "characters instead of 5.\n", n);
   3.179 -+      exit (1);
   3.180 -+    }
   3.181 - 
   3.182 -   mpfr_set_inf (x, -1);
   3.183 --  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.184 -+  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.185 -+  if (n != 6)
   3.186 -+    {
   3.187 -+      printf ("Error: mpfr_out_str (file, 10, 0, -Inf, MPFR_RNDN) wrote %u "
   3.188 -+               "characters instead of 6.\n", n);
   3.189 -+      exit (1);
   3.190 -+    }
   3.191 - 
   3.192 -   mpfr_set_ui (x, 0, MPFR_RNDN);
   3.193 --  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.194 -+  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.195 -+  if (n != 1)
   3.196 -+    {
   3.197 -+      printf ("Error: mpfr_out_str (file, 10, 0, +0, MPFR_RNDN) wrote %u "
   3.198 -+               "characters instead of 1.\n", n);
   3.199 -+      exit (1);
   3.200 -+    }
   3.201 -+
   3.202 -   mpfr_neg (x, x, MPFR_RNDN);
   3.203 --  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.204 -+  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   3.205 -+  if (n != 2)
   3.206 -+    {
   3.207 -+      printf ("Error: mpfr_out_str (file, 10, 0, -0, MPFR_RNDN) wrote %u "
   3.208 -+               "characters instead of 2.\n", n);
   3.209 -+      exit (1);
   3.210 -+    }
   3.211 - 
   3.212 -   mpfr_clear (x);
   3.213 - }
   3.214 -diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   3.215 ---- mpfr-3.0.0-a/version.c	2010-06-10 11:00:14.000000000 +0000
   3.216 -+++ mpfr-3.0.0-b/version.c	2010-06-23 11:03:20.000000000 +0000
   3.217 -@@ -25,5 +25,5 @@
   3.218 - const char *
   3.219 - mpfr_get_version (void)
   3.220 - {
   3.221 --  return "3.0.0";
   3.222 -+  return "3.0.0-p1";
   3.223 - }
   3.224 -diff -Naurd mpfr-3.0.0-a/Makefile.in mpfr-3.0.0-b/Makefile.in
   3.225 ---- mpfr-3.0.0-a/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   3.226 -+++ mpfr-3.0.0-b/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   3.227 -@@ -239,6 +239,7 @@
   3.228 - distuninstallcheck_listfiles = find . -type f -print
   3.229 - distcleancheck_listfiles = find . -type f -print
   3.230 - ACLOCAL = @ACLOCAL@
   3.231 -+ALLOCA = @ALLOCA@
   3.232 - AMTAR = @AMTAR@
   3.233 - AR = @AR@
   3.234 - AS = @AS@
   3.235 -diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   3.236 ---- mpfr-3.0.0-a/PATCHES	2010-06-23 11:03:36.000000000 +0000
   3.237 -+++ mpfr-3.0.0-b/PATCHES	2010-06-25 13:23:13.000000000 +0000
   3.238 -@@ -0,0 +1 @@
   3.239 -+alloca
   3.240 -diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   3.241 ---- mpfr-3.0.0-a/VERSION	2010-06-23 11:03:20.000000000 +0000
   3.242 -+++ mpfr-3.0.0-b/VERSION	2010-06-25 13:23:13.000000000 +0000
   3.243 -@@ -1 +1 @@
   3.244 --3.0.0-p1
   3.245 -+3.0.0-p2
   3.246 -diff -Naurd mpfr-3.0.0-a/acinclude.m4 mpfr-3.0.0-b/acinclude.m4
   3.247 ---- mpfr-3.0.0-a/acinclude.m4	2010-06-10 11:00:14.000000000 +0000
   3.248 -+++ mpfr-3.0.0-b/acinclude.m4	2010-06-10 11:00:14.000000000 +0000
   3.249 -@@ -59,6 +59,9 @@
   3.250 - dnl sys/fpu.h - MIPS specific
   3.251 - AC_CHECK_HEADERS([sys/time.h sys/fpu.h])
   3.252 - 
   3.253 -+dnl Check how to get `alloca'
   3.254 -+AC_FUNC_ALLOCA
   3.255 -+
   3.256 - dnl SIZE_MAX macro
   3.257 - gl_SIZE_MAX
   3.258 - 
   3.259 -diff -Naurd mpfr-3.0.0-a/configure mpfr-3.0.0-b/configure
   3.260 ---- mpfr-3.0.0-a/configure	2010-06-10 11:00:51.000000000 +0000
   3.261 -+++ mpfr-3.0.0-b/configure	2010-06-25 13:23:05.000000000 +0000
   3.262 -@@ -783,6 +783,7 @@
   3.263 - OBJDUMP
   3.264 - DLLTOOL
   3.265 - AS
   3.266 -+ALLOCA
   3.267 - MPFR_LIBM
   3.268 - ANSI2KNR
   3.269 - U
   3.270 -@@ -5622,6 +5623,197 @@
   3.271 - done
   3.272 - 
   3.273 - 
   3.274 -+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
   3.275 -+# for constant arguments.  Useless!
   3.276 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
   3.277 -+$as_echo_n "checking for working alloca.h... " >&6; }
   3.278 -+if test "${ac_cv_working_alloca_h+set}" = set; then :
   3.279 -+  $as_echo_n "(cached) " >&6
   3.280 -+else
   3.281 -+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   3.282 -+/* end confdefs.h.  */
   3.283 -+#include <alloca.h>
   3.284 -+int
   3.285 -+main ()
   3.286 -+{
   3.287 -+char *p = (char *) alloca (2 * sizeof (int));
   3.288 -+			  if (p) return 0;
   3.289 -+  ;
   3.290 -+  return 0;
   3.291 -+}
   3.292 -+_ACEOF
   3.293 -+if ac_fn_c_try_link "$LINENO"; then :
   3.294 -+  ac_cv_working_alloca_h=yes
   3.295 -+else
   3.296 -+  ac_cv_working_alloca_h=no
   3.297 -+fi
   3.298 -+rm -f core conftest.err conftest.$ac_objext \
   3.299 -+    conftest$ac_exeext conftest.$ac_ext
   3.300 -+fi
   3.301 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
   3.302 -+$as_echo "$ac_cv_working_alloca_h" >&6; }
   3.303 -+if test $ac_cv_working_alloca_h = yes; then
   3.304 -+
   3.305 -+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
   3.306 -+
   3.307 -+fi
   3.308 -+
   3.309 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
   3.310 -+$as_echo_n "checking for alloca... " >&6; }
   3.311 -+if test "${ac_cv_func_alloca_works+set}" = set; then :
   3.312 -+  $as_echo_n "(cached) " >&6
   3.313 -+else
   3.314 -+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   3.315 -+/* end confdefs.h.  */
   3.316 -+#ifdef __GNUC__
   3.317 -+# define alloca __builtin_alloca
   3.318 -+#else
   3.319 -+# ifdef _MSC_VER
   3.320 -+#  include <malloc.h>
   3.321 -+#  define alloca _alloca
   3.322 -+# else
   3.323 -+#  ifdef HAVE_ALLOCA_H
   3.324 -+#   include <alloca.h>
   3.325 -+#  else
   3.326 -+#   ifdef _AIX
   3.327 -+ #pragma alloca
   3.328 -+#   else
   3.329 -+#    ifndef alloca /* predefined by HP cc +Olibcalls */
   3.330 -+char *alloca ();
   3.331 -+#    endif
   3.332 -+#   endif
   3.333 -+#  endif
   3.334 -+# endif
   3.335 -+#endif
   3.336 -+
   3.337 -+int
   3.338 -+main ()
   3.339 -+{
   3.340 -+char *p = (char *) alloca (1);
   3.341 -+				    if (p) return 0;
   3.342 -+  ;
   3.343 -+  return 0;
   3.344 -+}
   3.345 -+_ACEOF
   3.346 -+if ac_fn_c_try_link "$LINENO"; then :
   3.347 -+  ac_cv_func_alloca_works=yes
   3.348 -+else
   3.349 -+  ac_cv_func_alloca_works=no
   3.350 -+fi
   3.351 -+rm -f core conftest.err conftest.$ac_objext \
   3.352 -+    conftest$ac_exeext conftest.$ac_ext
   3.353 -+fi
   3.354 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
   3.355 -+$as_echo "$ac_cv_func_alloca_works" >&6; }
   3.356 -+
   3.357 -+if test $ac_cv_func_alloca_works = yes; then
   3.358 -+
   3.359 -+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
   3.360 -+
   3.361 -+else
   3.362 -+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
   3.363 -+# that cause trouble.  Some versions do not even contain alloca or
   3.364 -+# contain a buggy version.  If you still want to use their alloca,
   3.365 -+# use ar to extract alloca.o from them instead of compiling alloca.c.
   3.366 -+
   3.367 -+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
   3.368 -+
   3.369 -+$as_echo "#define C_ALLOCA 1" >>confdefs.h
   3.370 -+
   3.371 -+
   3.372 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
   3.373 -+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
   3.374 -+if test "${ac_cv_os_cray+set}" = set; then :
   3.375 -+  $as_echo_n "(cached) " >&6
   3.376 -+else
   3.377 -+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   3.378 -+/* end confdefs.h.  */
   3.379 -+#if defined CRAY && ! defined CRAY2
   3.380 -+webecray
   3.381 -+#else
   3.382 -+wenotbecray
   3.383 -+#endif
   3.384 -+
   3.385 -+_ACEOF
   3.386 -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   3.387 -+  $EGREP "webecray" >/dev/null 2>&1; then :
   3.388 -+  ac_cv_os_cray=yes
   3.389 -+else
   3.390 -+  ac_cv_os_cray=no
   3.391 -+fi
   3.392 -+rm -f conftest*
   3.393 -+
   3.394 -+fi
   3.395 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
   3.396 -+$as_echo "$ac_cv_os_cray" >&6; }
   3.397 -+if test $ac_cv_os_cray = yes; then
   3.398 -+  for ac_func in _getb67 GETB67 getb67; do
   3.399 -+    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
   3.400 -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
   3.401 -+eval as_val=\$$as_ac_var
   3.402 -+   if test "x$as_val" = x""yes; then :
   3.403 -+
   3.404 -+cat >>confdefs.h <<_ACEOF
   3.405 -+#define CRAY_STACKSEG_END $ac_func
   3.406 -+_ACEOF
   3.407 -+
   3.408 -+    break
   3.409 -+fi
   3.410 -+
   3.411 -+  done
   3.412 -+fi
   3.413 -+
   3.414 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
   3.415 -+$as_echo_n "checking stack direction for C alloca... " >&6; }
   3.416 -+if test "${ac_cv_c_stack_direction+set}" = set; then :
   3.417 -+  $as_echo_n "(cached) " >&6
   3.418 -+else
   3.419 -+  if test "$cross_compiling" = yes; then :
   3.420 -+  ac_cv_c_stack_direction=0
   3.421 -+else
   3.422 -+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   3.423 -+/* end confdefs.h.  */
   3.424 -+$ac_includes_default
   3.425 -+int
   3.426 -+find_stack_direction ()
   3.427 -+{
   3.428 -+  static char *addr = 0;
   3.429 -+  auto char dummy;
   3.430 -+  if (addr == 0)
   3.431 -+    {
   3.432 -+      addr = &dummy;
   3.433 -+      return find_stack_direction ();
   3.434 -+    }
   3.435 -+  else
   3.436 -+    return (&dummy > addr) ? 1 : -1;
   3.437 -+}
   3.438 -+
   3.439 -+int
   3.440 -+main ()
   3.441 -+{
   3.442 -+  return find_stack_direction () < 0;
   3.443 -+}
   3.444 -+_ACEOF
   3.445 -+if ac_fn_c_try_run "$LINENO"; then :
   3.446 -+  ac_cv_c_stack_direction=1
   3.447 -+else
   3.448 -+  ac_cv_c_stack_direction=-1
   3.449 -+fi
   3.450 -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   3.451 -+  conftest.$ac_objext conftest.beam conftest.$ac_ext
   3.452 -+fi
   3.453 -+
   3.454 -+fi
   3.455 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
   3.456 -+$as_echo "$ac_cv_c_stack_direction" >&6; }
   3.457 -+cat >>confdefs.h <<_ACEOF
   3.458 -+#define STACK_DIRECTION $ac_cv_c_stack_direction
   3.459 -+_ACEOF
   3.460 -+
   3.461 -+
   3.462 -+fi
   3.463 -+
   3.464 -+
   3.465 - 
   3.466 -   for ac_header in stdint.h
   3.467 - do :
   3.468 -@@ -7564,13 +7756,13 @@
   3.469 - else
   3.470 -   lt_cv_nm_interface="BSD nm"
   3.471 -   echo "int some_variable = 0;" > conftest.$ac_ext
   3.472 --  (eval echo "\"\$as_me:7567: $ac_compile\"" >&5)
   3.473 -+  (eval echo "\"\$as_me:7759: $ac_compile\"" >&5)
   3.474 -   (eval "$ac_compile" 2>conftest.err)
   3.475 -   cat conftest.err >&5
   3.476 --  (eval echo "\"\$as_me:7570: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   3.477 -+  (eval echo "\"\$as_me:7762: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   3.478 -   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   3.479 -   cat conftest.err >&5
   3.480 --  (eval echo "\"\$as_me:7573: output\"" >&5)
   3.481 -+  (eval echo "\"\$as_me:7765: output\"" >&5)
   3.482 -   cat conftest.out >&5
   3.483 -   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
   3.484 -     lt_cv_nm_interface="MS dumpbin"
   3.485 -@@ -8772,7 +8964,7 @@
   3.486 -   ;;
   3.487 - *-*-irix6*)
   3.488 -   # Find out which ABI we are using.
   3.489 --  echo '#line 8775 "configure"' > conftest.$ac_ext
   3.490 -+  echo '#line 8967 "configure"' > conftest.$ac_ext
   3.491 -   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   3.492 -   (eval $ac_compile) 2>&5
   3.493 -   ac_status=$?
   3.494 -@@ -10032,11 +10224,11 @@
   3.495 -    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   3.496 -    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   3.497 -    -e 's:$: $lt_compiler_flag:'`
   3.498 --   (eval echo "\"\$as_me:10035: $lt_compile\"" >&5)
   3.499 -+   (eval echo "\"\$as_me:10227: $lt_compile\"" >&5)
   3.500 -    (eval "$lt_compile" 2>conftest.err)
   3.501 -    ac_status=$?
   3.502 -    cat conftest.err >&5
   3.503 --   echo "$as_me:10039: \$? = $ac_status" >&5
   3.504 -+   echo "$as_me:10231: \$? = $ac_status" >&5
   3.505 -    if (exit $ac_status) && test -s "$ac_outfile"; then
   3.506 -      # The compiler can only warn and ignore the option if not recognized
   3.507 -      # So say no if there are warnings other than the usual output.
   3.508 -@@ -10371,11 +10563,11 @@
   3.509 -    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   3.510 -    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   3.511 -    -e 's:$: $lt_compiler_flag:'`
   3.512 --   (eval echo "\"\$as_me:10374: $lt_compile\"" >&5)
   3.513 -+   (eval echo "\"\$as_me:10566: $lt_compile\"" >&5)
   3.514 -    (eval "$lt_compile" 2>conftest.err)
   3.515 -    ac_status=$?
   3.516 -    cat conftest.err >&5
   3.517 --   echo "$as_me:10378: \$? = $ac_status" >&5
   3.518 -+   echo "$as_me:10570: \$? = $ac_status" >&5
   3.519 -    if (exit $ac_status) && test -s "$ac_outfile"; then
   3.520 -      # The compiler can only warn and ignore the option if not recognized
   3.521 -      # So say no if there are warnings other than the usual output.
   3.522 -@@ -10476,11 +10668,11 @@
   3.523 -    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   3.524 -    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   3.525 -    -e 's:$: $lt_compiler_flag:'`
   3.526 --   (eval echo "\"\$as_me:10479: $lt_compile\"" >&5)
   3.527 -+   (eval echo "\"\$as_me:10671: $lt_compile\"" >&5)
   3.528 -    (eval "$lt_compile" 2>out/conftest.err)
   3.529 -    ac_status=$?
   3.530 -    cat out/conftest.err >&5
   3.531 --   echo "$as_me:10483: \$? = $ac_status" >&5
   3.532 -+   echo "$as_me:10675: \$? = $ac_status" >&5
   3.533 -    if (exit $ac_status) && test -s out/conftest2.$ac_objext
   3.534 -    then
   3.535 -      # The compiler can only warn and ignore the option if not recognized
   3.536 -@@ -10531,11 +10723,11 @@
   3.537 -    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   3.538 -    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   3.539 -    -e 's:$: $lt_compiler_flag:'`
   3.540 --   (eval echo "\"\$as_me:10534: $lt_compile\"" >&5)
   3.541 -+   (eval echo "\"\$as_me:10726: $lt_compile\"" >&5)
   3.542 -    (eval "$lt_compile" 2>out/conftest.err)
   3.543 -    ac_status=$?
   3.544 -    cat out/conftest.err >&5
   3.545 --   echo "$as_me:10538: \$? = $ac_status" >&5
   3.546 -+   echo "$as_me:10730: \$? = $ac_status" >&5
   3.547 -    if (exit $ac_status) && test -s out/conftest2.$ac_objext
   3.548 -    then
   3.549 -      # The compiler can only warn and ignore the option if not recognized
   3.550 -@@ -12915,7 +13107,7 @@
   3.551 -   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   3.552 -   lt_status=$lt_dlunknown
   3.553 -   cat > conftest.$ac_ext <<_LT_EOF
   3.554 --#line 12918 "configure"
   3.555 -+#line 13110 "configure"
   3.556 - #include "confdefs.h"
   3.557 - 
   3.558 - #if HAVE_DLFCN_H
   3.559 -@@ -13011,7 +13203,7 @@
   3.560 -   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   3.561 -   lt_status=$lt_dlunknown
   3.562 -   cat > conftest.$ac_ext <<_LT_EOF
   3.563 --#line 13014 "configure"
   3.564 -+#line 13206 "configure"
   3.565 - #include "confdefs.h"
   3.566 - 
   3.567 - #if HAVE_DLFCN_H
   3.568 -diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   3.569 ---- mpfr-3.0.0-a/mpfr.h	2010-06-23 11:03:20.000000000 +0000
   3.570 -+++ mpfr-3.0.0-b/mpfr.h	2010-06-25 13:23:13.000000000 +0000
   3.571 -@@ -27,7 +27,7 @@
   3.572 - #define MPFR_VERSION_MAJOR 3
   3.573 - #define MPFR_VERSION_MINOR 0
   3.574 - #define MPFR_VERSION_PATCHLEVEL 0
   3.575 --#define MPFR_VERSION_STRING "3.0.0-p1"
   3.576 -+#define MPFR_VERSION_STRING "3.0.0-p2"
   3.577 - 
   3.578 - /* Macros dealing with MPFR VERSION */
   3.579 - #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   3.580 -diff -Naurd mpfr-3.0.0-a/tests/Makefile.in mpfr-3.0.0-b/tests/Makefile.in
   3.581 ---- mpfr-3.0.0-a/tests/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   3.582 -+++ mpfr-3.0.0-b/tests/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   3.583 -@@ -960,6 +960,7 @@
   3.584 - red=; grn=; lgn=; blu=; std=
   3.585 - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   3.586 - ACLOCAL = @ACLOCAL@
   3.587 -+ALLOCA = @ALLOCA@
   3.588 - AMTAR = @AMTAR@
   3.589 - AR = @AR@
   3.590 - AS = @AS@
   3.591 -diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   3.592 ---- mpfr-3.0.0-a/version.c	2010-06-23 11:03:20.000000000 +0000
   3.593 -+++ mpfr-3.0.0-b/version.c	2010-06-25 13:23:13.000000000 +0000
   3.594 -@@ -25,5 +25,5 @@
   3.595 - const char *
   3.596 - mpfr_get_version (void)
   3.597 - {
   3.598 --  return "3.0.0-p1";
   3.599 -+  return "3.0.0-p2";
   3.600 - }
   3.601 -diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   3.602 ---- mpfr-3.0.0-a/PATCHES	2010-07-10 00:11:19.000000000 +0000
   3.603 -+++ mpfr-3.0.0-b/PATCHES	2010-07-10 00:12:50.000000000 +0000
   3.604 -@@ -0,0 +1 @@
   3.605 -+gamma_underflow
   3.606 -diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   3.607 ---- mpfr-3.0.0-a/VERSION	2010-06-25 13:23:13.000000000 +0000
   3.608 -+++ mpfr-3.0.0-b/VERSION	2010-07-10 00:11:53.000000000 +0000
   3.609 -@@ -1 +1 @@
   3.610 --3.0.0-p2
   3.611 -+3.0.0-p3
   3.612 -diff -Naurd mpfr-3.0.0-a/gamma.c mpfr-3.0.0-b/gamma.c
   3.613 ---- mpfr-3.0.0-a/gamma.c	2010-06-10 11:00:14.000000000 +0000
   3.614 -+++ mpfr-3.0.0-b/gamma.c	2010-07-10 00:11:46.000000000 +0000
   3.615 -@@ -274,7 +274,7 @@
   3.616 -       /* we want an upper bound for x * [log(2-x)-1].
   3.617 -          since x < 0, we need a lower bound on log(2-x) */
   3.618 -       mpfr_ui_sub (xp, 2, x, MPFR_RNDD);
   3.619 --      mpfr_log (xp, xp, MPFR_RNDD);
   3.620 -+      mpfr_log2 (xp, xp, MPFR_RNDD);
   3.621 -       mpfr_sub_ui (xp, xp, 1, MPFR_RNDD);
   3.622 -       mpfr_mul (xp, xp, x, MPFR_RNDU);
   3.623 - 
   3.624 -@@ -303,8 +303,8 @@
   3.625 -         {
   3.626 -           mpfr_sub (tmp, tmp, tmp2, MPFR_RNDZ); /* low bnd on |sin(Pi*(2-x))| */
   3.627 -           mpfr_ui_div (tmp, 12, tmp, MPFR_RNDU); /* upper bound */
   3.628 --          mpfr_log (tmp, tmp, MPFR_RNDU);
   3.629 --          mpfr_add (tmp, tmp, xp, MPFR_RNDU);
   3.630 -+          mpfr_log2 (tmp, tmp, MPFR_RNDU);
   3.631 -+          mpfr_add (xp, tmp, xp, MPFR_RNDU);
   3.632 -           underflow = mpfr_cmp_si (xp, expo.saved_emin - 2) <= 0;
   3.633 -         }
   3.634 - 
   3.635 -diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   3.636 ---- mpfr-3.0.0-a/mpfr.h	2010-06-25 13:23:13.000000000 +0000
   3.637 -+++ mpfr-3.0.0-b/mpfr.h	2010-07-10 00:11:53.000000000 +0000
   3.638 -@@ -27,7 +27,7 @@
   3.639 - #define MPFR_VERSION_MAJOR 3
   3.640 - #define MPFR_VERSION_MINOR 0
   3.641 - #define MPFR_VERSION_PATCHLEVEL 0
   3.642 --#define MPFR_VERSION_STRING "3.0.0-p2"
   3.643 -+#define MPFR_VERSION_STRING "3.0.0-p3"
   3.644 - 
   3.645 - /* Macros dealing with MPFR VERSION */
   3.646 - #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   3.647 -diff -Naurd mpfr-3.0.0-a/tests/tgamma.c mpfr-3.0.0-b/tests/tgamma.c
   3.648 ---- mpfr-3.0.0-a/tests/tgamma.c	2010-06-10 11:00:13.000000000 +0000
   3.649 -+++ mpfr-3.0.0-b/tests/tgamma.c	2010-07-10 00:11:46.000000000 +0000
   3.650 -@@ -461,6 +461,20 @@
   3.651 -   mpfr_clear (x);
   3.652 - }
   3.653 - 
   3.654 -+/* bug found by Stathis, only occurs on 32-bit machines */
   3.655 -+static void
   3.656 -+test20100709 (void)
   3.657 -+{
   3.658 -+  mpfr_t x;
   3.659 -+  int inex;
   3.660 -+
   3.661 -+  mpfr_init2 (x, 100);
   3.662 -+  mpfr_set_str (x, "-4.6308260837372266e+07", 10, MPFR_RNDN);
   3.663 -+  inex = mpfr_gamma (x, x, MPFR_RNDN);
   3.664 -+  MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
   3.665 -+  mpfr_clear (x);
   3.666 -+}
   3.667 -+
   3.668 - int
   3.669 - main (int argc, char *argv[])
   3.670 - {
   3.671 -@@ -471,6 +485,7 @@
   3.672 -   test_generic (2, 100, 2);
   3.673 -   gamma_integer ();
   3.674 -   test20071231 ();
   3.675 -+  test20100709 ();
   3.676 - 
   3.677 -   data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
   3.678 - 
   3.679 -diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   3.680 ---- mpfr-3.0.0-a/version.c	2010-06-25 13:23:13.000000000 +0000
   3.681 -+++ mpfr-3.0.0-b/version.c	2010-07-10 00:11:53.000000000 +0000
   3.682 -@@ -25,5 +25,5 @@
   3.683 - const char *
   3.684 - mpfr_get_version (void)
   3.685 - {
   3.686 --  return "3.0.0-p2";
   3.687 -+  return "3.0.0-p3";
   3.688 - }
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/mpfr/stuff/mpfr-3.0.0-p4.patch	Fri Oct 22 23:13:10 2010 +0000
     4.3 @@ -0,0 +1,924 @@
     4.4 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
     4.5 +--- mpfr-3.0.0-a/PATCHES	2010-06-23 11:02:49.000000000 +0000
     4.6 ++++ mpfr-3.0.0-b/PATCHES	2010-06-23 11:03:36.000000000 +0000
     4.7 +@@ -0,0 +1 @@
     4.8 ++mpfr_out_str
     4.9 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
    4.10 +--- mpfr-3.0.0-a/VERSION	2010-06-10 11:00:14.000000000 +0000
    4.11 ++++ mpfr-3.0.0-b/VERSION	2010-06-23 11:03:20.000000000 +0000
    4.12 +@@ -1 +1 @@
    4.13 +-3.0.0
    4.14 ++3.0.0-p1
    4.15 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
    4.16 +--- mpfr-3.0.0-a/mpfr.h	2010-06-10 11:00:14.000000000 +0000
    4.17 ++++ mpfr-3.0.0-b/mpfr.h	2010-06-23 11:03:20.000000000 +0000
    4.18 +@@ -27,7 +27,7 @@
    4.19 + #define MPFR_VERSION_MAJOR 3
    4.20 + #define MPFR_VERSION_MINOR 0
    4.21 + #define MPFR_VERSION_PATCHLEVEL 0
    4.22 +-#define MPFR_VERSION_STRING "3.0.0"
    4.23 ++#define MPFR_VERSION_STRING "3.0.0-p1"
    4.24 + 
    4.25 + /* Macros dealing with MPFR VERSION */
    4.26 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
    4.27 +diff -Naurd mpfr-3.0.0-a/mpfr.texi mpfr-3.0.0-b/mpfr.texi
    4.28 +--- mpfr-3.0.0-a/mpfr.texi	2010-06-10 11:00:14.000000000 +0000
    4.29 ++++ mpfr-3.0.0-b/mpfr.texi	2010-06-23 11:03:12.000000000 +0000
    4.30 +@@ -2050,7 +2050,7 @@
    4.31 + are printed. If @var{base} is greater than 10, @samp{@@} will be used
    4.32 + instead of @samp{e} as exponent delimiter.
    4.33 + 
    4.34 +-Return the number of bytes written, or if an error occurred, return 0.
    4.35 ++Return the number of characters written, or if an error occurred, return 0.
    4.36 + @end deftypefun
    4.37 + 
    4.38 + @deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mpfr_rnd_t @var{rnd})
    4.39 +diff -Naurd mpfr-3.0.0-a/out_str.c mpfr-3.0.0-b/out_str.c
    4.40 +--- mpfr-3.0.0-a/out_str.c	2010-06-10 11:00:14.000000000 +0000
    4.41 ++++ mpfr-3.0.0-b/out_str.c	2010-06-23 11:03:12.000000000 +0000
    4.42 +@@ -22,6 +22,16 @@
    4.43 + 
    4.44 + #include "mpfr-impl.h"
    4.45 + 
    4.46 ++/* Warning! S should not contain "%". */
    4.47 ++#define OUT_STR_RET(S)                          \
    4.48 ++  do                                            \
    4.49 ++    {                                           \
    4.50 ++      int r;                                    \
    4.51 ++      r = fprintf (stream, (S));                \
    4.52 ++      return r < 0 ? 0 : r;                     \
    4.53 ++    }                                           \
    4.54 ++  while (0)
    4.55 ++
    4.56 + size_t
    4.57 + mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
    4.58 +               mpfr_rnd_t rnd_mode)
    4.59 +@@ -29,6 +39,7 @@
    4.60 +   char *s, *s0;
    4.61 +   size_t l;
    4.62 +   mpfr_exp_t e;
    4.63 ++  int err;
    4.64 + 
    4.65 +   MPFR_ASSERTN (base >= 2 && base <= 62);
    4.66 + 
    4.67 +@@ -36,37 +47,16 @@
    4.68 +   if (stream == NULL)
    4.69 +     stream = stdout;
    4.70 + 
    4.71 +-  if (MPFR_IS_NAN(op))
    4.72 +-    {
    4.73 +-      fprintf (stream, "@NaN@");
    4.74 +-      return 3;
    4.75 +-    }
    4.76 +-
    4.77 +-  if (MPFR_IS_INF(op))
    4.78 +-    {
    4.79 +-      if (MPFR_SIGN(op) > 0)
    4.80 +-        {
    4.81 +-          fprintf (stream, "@Inf@");
    4.82 +-          return 3;
    4.83 +-        }
    4.84 +-      else
    4.85 +-        {
    4.86 +-          fprintf (stream, "-@Inf@");
    4.87 +-          return 4;
    4.88 +-        }
    4.89 +-    }
    4.90 +-
    4.91 +-  if (MPFR_IS_ZERO(op))
    4.92 ++  if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (op)))
    4.93 +     {
    4.94 +-      if (MPFR_SIGN(op) > 0)
    4.95 +-        {
    4.96 +-          fprintf(stream, "0");
    4.97 +-          return 1;
    4.98 +-        }
    4.99 ++      if (MPFR_IS_NAN (op))
   4.100 ++        OUT_STR_RET ("@NaN@");
   4.101 ++      else if (MPFR_IS_INF (op))
   4.102 ++        OUT_STR_RET (MPFR_IS_POS (op) ? "@Inf@" : "-@Inf@");
   4.103 +       else
   4.104 +         {
   4.105 +-          fprintf(stream, "-0");
   4.106 +-          return 2;
   4.107 ++          MPFR_ASSERTD (MPFR_IS_ZERO (op));
   4.108 ++          OUT_STR_RET (MPFR_IS_POS (op) ? "0" : "-0");
   4.109 +         }
   4.110 +     }
   4.111 + 
   4.112 +@@ -77,21 +67,31 @@
   4.113 + 
   4.114 +   l = strlen (s) + 1; /* size of allocated block returned by mpfr_get_str
   4.115 +                          - may be incorrect, as only an upper bound? */
   4.116 +-  if (*s == '-')
   4.117 +-    fputc (*s++, stream);
   4.118 + 
   4.119 +-  /* outputs mantissa */
   4.120 +-  fputc (*s++, stream); e--; /* leading digit */
   4.121 +-  fputc ((unsigned char) MPFR_DECIMAL_POINT, stream);
   4.122 +-  fputs (s, stream);         /* rest of mantissa */
   4.123 ++  /* outputs possible sign and significand */
   4.124 ++  err = (*s == '-' && fputc (*s++, stream) == EOF)
   4.125 ++    || fputc (*s++, stream) == EOF  /* leading digit */
   4.126 ++    || fputc ((unsigned char) MPFR_DECIMAL_POINT, stream) == EOF
   4.127 ++    || fputs (s, stream) == EOF;     /* trailing significand */
   4.128 +   (*__gmp_free_func) (s0, l);
   4.129 ++  if (MPFR_UNLIKELY (err))
   4.130 ++    return 0;
   4.131 ++
   4.132 ++  e--;  /* due to the leading digit */
   4.133 + 
   4.134 +   /* outputs exponent */
   4.135 +   if (e)
   4.136 +     {
   4.137 ++      int r;
   4.138 ++
   4.139 +       MPFR_ASSERTN(e >= LONG_MIN);
   4.140 +       MPFR_ASSERTN(e <= LONG_MAX);
   4.141 +-      l += fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
   4.142 ++
   4.143 ++      r = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
   4.144 ++      if (MPFR_UNLIKELY (r < 0))
   4.145 ++        return 0;
   4.146 ++
   4.147 ++      l += r;
   4.148 +     }
   4.149 + 
   4.150 +   return l;
   4.151 +diff -Naurd mpfr-3.0.0-a/tests/tout_str.c mpfr-3.0.0-b/tests/tout_str.c
   4.152 +--- mpfr-3.0.0-a/tests/tout_str.c	2010-06-10 11:00:13.000000000 +0000
   4.153 ++++ mpfr-3.0.0-b/tests/tout_str.c	2010-06-23 11:03:12.000000000 +0000
   4.154 +@@ -46,22 +46,54 @@
   4.155 + special (void)
   4.156 + {
   4.157 +   mpfr_t x;
   4.158 ++  unsigned int n;
   4.159 + 
   4.160 +   mpfr_init (x);
   4.161 + 
   4.162 +   mpfr_set_nan (x);
   4.163 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.164 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.165 ++  if (n != 5)
   4.166 ++    {
   4.167 ++      printf ("Error: mpfr_out_str (file, 10, 0, NaN, MPFR_RNDN) wrote %u "
   4.168 ++              "characters instead of 5.\n", n);
   4.169 ++      exit (1);
   4.170 ++    }
   4.171 + 
   4.172 +   mpfr_set_inf (x, 1);
   4.173 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.174 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.175 ++  if (n != 5)
   4.176 ++    {
   4.177 ++      printf ("Error: mpfr_out_str (file, 10, 0, +Inf, MPFR_RNDN) wrote %u "
   4.178 ++               "characters instead of 5.\n", n);
   4.179 ++      exit (1);
   4.180 ++    }
   4.181 + 
   4.182 +   mpfr_set_inf (x, -1);
   4.183 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.184 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.185 ++  if (n != 6)
   4.186 ++    {
   4.187 ++      printf ("Error: mpfr_out_str (file, 10, 0, -Inf, MPFR_RNDN) wrote %u "
   4.188 ++               "characters instead of 6.\n", n);
   4.189 ++      exit (1);
   4.190 ++    }
   4.191 + 
   4.192 +   mpfr_set_ui (x, 0, MPFR_RNDN);
   4.193 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.194 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.195 ++  if (n != 1)
   4.196 ++    {
   4.197 ++      printf ("Error: mpfr_out_str (file, 10, 0, +0, MPFR_RNDN) wrote %u "
   4.198 ++               "characters instead of 1.\n", n);
   4.199 ++      exit (1);
   4.200 ++    }
   4.201 ++
   4.202 +   mpfr_neg (x, x, MPFR_RNDN);
   4.203 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.204 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   4.205 ++  if (n != 2)
   4.206 ++    {
   4.207 ++      printf ("Error: mpfr_out_str (file, 10, 0, -0, MPFR_RNDN) wrote %u "
   4.208 ++               "characters instead of 2.\n", n);
   4.209 ++      exit (1);
   4.210 ++    }
   4.211 + 
   4.212 +   mpfr_clear (x);
   4.213 + }
   4.214 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   4.215 +--- mpfr-3.0.0-a/version.c	2010-06-10 11:00:14.000000000 +0000
   4.216 ++++ mpfr-3.0.0-b/version.c	2010-06-23 11:03:20.000000000 +0000
   4.217 +@@ -25,5 +25,5 @@
   4.218 + const char *
   4.219 + mpfr_get_version (void)
   4.220 + {
   4.221 +-  return "3.0.0";
   4.222 ++  return "3.0.0-p1";
   4.223 + }
   4.224 +diff -Naurd mpfr-3.0.0-a/Makefile.in mpfr-3.0.0-b/Makefile.in
   4.225 +--- mpfr-3.0.0-a/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   4.226 ++++ mpfr-3.0.0-b/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   4.227 +@@ -239,6 +239,7 @@
   4.228 + distuninstallcheck_listfiles = find . -type f -print
   4.229 + distcleancheck_listfiles = find . -type f -print
   4.230 + ACLOCAL = @ACLOCAL@
   4.231 ++ALLOCA = @ALLOCA@
   4.232 + AMTAR = @AMTAR@
   4.233 + AR = @AR@
   4.234 + AS = @AS@
   4.235 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   4.236 +--- mpfr-3.0.0-a/PATCHES	2010-06-23 11:03:36.000000000 +0000
   4.237 ++++ mpfr-3.0.0-b/PATCHES	2010-06-25 13:23:13.000000000 +0000
   4.238 +@@ -0,0 +1 @@
   4.239 ++alloca
   4.240 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   4.241 +--- mpfr-3.0.0-a/VERSION	2010-06-23 11:03:20.000000000 +0000
   4.242 ++++ mpfr-3.0.0-b/VERSION	2010-06-25 13:23:13.000000000 +0000
   4.243 +@@ -1 +1 @@
   4.244 +-3.0.0-p1
   4.245 ++3.0.0-p2
   4.246 +diff -Naurd mpfr-3.0.0-a/acinclude.m4 mpfr-3.0.0-b/acinclude.m4
   4.247 +--- mpfr-3.0.0-a/acinclude.m4	2010-06-10 11:00:14.000000000 +0000
   4.248 ++++ mpfr-3.0.0-b/acinclude.m4	2010-06-10 11:00:14.000000000 +0000
   4.249 +@@ -59,6 +59,9 @@
   4.250 + dnl sys/fpu.h - MIPS specific
   4.251 + AC_CHECK_HEADERS([sys/time.h sys/fpu.h])
   4.252 + 
   4.253 ++dnl Check how to get `alloca'
   4.254 ++AC_FUNC_ALLOCA
   4.255 ++
   4.256 + dnl SIZE_MAX macro
   4.257 + gl_SIZE_MAX
   4.258 + 
   4.259 +diff -Naurd mpfr-3.0.0-a/configure mpfr-3.0.0-b/configure
   4.260 +--- mpfr-3.0.0-a/configure	2010-06-10 11:00:51.000000000 +0000
   4.261 ++++ mpfr-3.0.0-b/configure	2010-06-25 13:23:05.000000000 +0000
   4.262 +@@ -783,6 +783,7 @@
   4.263 + OBJDUMP
   4.264 + DLLTOOL
   4.265 + AS
   4.266 ++ALLOCA
   4.267 + MPFR_LIBM
   4.268 + ANSI2KNR
   4.269 + U
   4.270 +@@ -5622,6 +5623,197 @@
   4.271 + done
   4.272 + 
   4.273 + 
   4.274 ++# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
   4.275 ++# for constant arguments.  Useless!
   4.276 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
   4.277 ++$as_echo_n "checking for working alloca.h... " >&6; }
   4.278 ++if test "${ac_cv_working_alloca_h+set}" = set; then :
   4.279 ++  $as_echo_n "(cached) " >&6
   4.280 ++else
   4.281 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   4.282 ++/* end confdefs.h.  */
   4.283 ++#include <alloca.h>
   4.284 ++int
   4.285 ++main ()
   4.286 ++{
   4.287 ++char *p = (char *) alloca (2 * sizeof (int));
   4.288 ++			  if (p) return 0;
   4.289 ++  ;
   4.290 ++  return 0;
   4.291 ++}
   4.292 ++_ACEOF
   4.293 ++if ac_fn_c_try_link "$LINENO"; then :
   4.294 ++  ac_cv_working_alloca_h=yes
   4.295 ++else
   4.296 ++  ac_cv_working_alloca_h=no
   4.297 ++fi
   4.298 ++rm -f core conftest.err conftest.$ac_objext \
   4.299 ++    conftest$ac_exeext conftest.$ac_ext
   4.300 ++fi
   4.301 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
   4.302 ++$as_echo "$ac_cv_working_alloca_h" >&6; }
   4.303 ++if test $ac_cv_working_alloca_h = yes; then
   4.304 ++
   4.305 ++$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
   4.306 ++
   4.307 ++fi
   4.308 ++
   4.309 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
   4.310 ++$as_echo_n "checking for alloca... " >&6; }
   4.311 ++if test "${ac_cv_func_alloca_works+set}" = set; then :
   4.312 ++  $as_echo_n "(cached) " >&6
   4.313 ++else
   4.314 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   4.315 ++/* end confdefs.h.  */
   4.316 ++#ifdef __GNUC__
   4.317 ++# define alloca __builtin_alloca
   4.318 ++#else
   4.319 ++# ifdef _MSC_VER
   4.320 ++#  include <malloc.h>
   4.321 ++#  define alloca _alloca
   4.322 ++# else
   4.323 ++#  ifdef HAVE_ALLOCA_H
   4.324 ++#   include <alloca.h>
   4.325 ++#  else
   4.326 ++#   ifdef _AIX
   4.327 ++ #pragma alloca
   4.328 ++#   else
   4.329 ++#    ifndef alloca /* predefined by HP cc +Olibcalls */
   4.330 ++char *alloca ();
   4.331 ++#    endif
   4.332 ++#   endif
   4.333 ++#  endif
   4.334 ++# endif
   4.335 ++#endif
   4.336 ++
   4.337 ++int
   4.338 ++main ()
   4.339 ++{
   4.340 ++char *p = (char *) alloca (1);
   4.341 ++				    if (p) return 0;
   4.342 ++  ;
   4.343 ++  return 0;
   4.344 ++}
   4.345 ++_ACEOF
   4.346 ++if ac_fn_c_try_link "$LINENO"; then :
   4.347 ++  ac_cv_func_alloca_works=yes
   4.348 ++else
   4.349 ++  ac_cv_func_alloca_works=no
   4.350 ++fi
   4.351 ++rm -f core conftest.err conftest.$ac_objext \
   4.352 ++    conftest$ac_exeext conftest.$ac_ext
   4.353 ++fi
   4.354 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
   4.355 ++$as_echo "$ac_cv_func_alloca_works" >&6; }
   4.356 ++
   4.357 ++if test $ac_cv_func_alloca_works = yes; then
   4.358 ++
   4.359 ++$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
   4.360 ++
   4.361 ++else
   4.362 ++  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
   4.363 ++# that cause trouble.  Some versions do not even contain alloca or
   4.364 ++# contain a buggy version.  If you still want to use their alloca,
   4.365 ++# use ar to extract alloca.o from them instead of compiling alloca.c.
   4.366 ++
   4.367 ++ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
   4.368 ++
   4.369 ++$as_echo "#define C_ALLOCA 1" >>confdefs.h
   4.370 ++
   4.371 ++
   4.372 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
   4.373 ++$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
   4.374 ++if test "${ac_cv_os_cray+set}" = set; then :
   4.375 ++  $as_echo_n "(cached) " >&6
   4.376 ++else
   4.377 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   4.378 ++/* end confdefs.h.  */
   4.379 ++#if defined CRAY && ! defined CRAY2
   4.380 ++webecray
   4.381 ++#else
   4.382 ++wenotbecray
   4.383 ++#endif
   4.384 ++
   4.385 ++_ACEOF
   4.386 ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   4.387 ++  $EGREP "webecray" >/dev/null 2>&1; then :
   4.388 ++  ac_cv_os_cray=yes
   4.389 ++else
   4.390 ++  ac_cv_os_cray=no
   4.391 ++fi
   4.392 ++rm -f conftest*
   4.393 ++
   4.394 ++fi
   4.395 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
   4.396 ++$as_echo "$ac_cv_os_cray" >&6; }
   4.397 ++if test $ac_cv_os_cray = yes; then
   4.398 ++  for ac_func in _getb67 GETB67 getb67; do
   4.399 ++    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
   4.400 ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
   4.401 ++eval as_val=\$$as_ac_var
   4.402 ++   if test "x$as_val" = x""yes; then :
   4.403 ++
   4.404 ++cat >>confdefs.h <<_ACEOF
   4.405 ++#define CRAY_STACKSEG_END $ac_func
   4.406 ++_ACEOF
   4.407 ++
   4.408 ++    break
   4.409 ++fi
   4.410 ++
   4.411 ++  done
   4.412 ++fi
   4.413 ++
   4.414 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
   4.415 ++$as_echo_n "checking stack direction for C alloca... " >&6; }
   4.416 ++if test "${ac_cv_c_stack_direction+set}" = set; then :
   4.417 ++  $as_echo_n "(cached) " >&6
   4.418 ++else
   4.419 ++  if test "$cross_compiling" = yes; then :
   4.420 ++  ac_cv_c_stack_direction=0
   4.421 ++else
   4.422 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   4.423 ++/* end confdefs.h.  */
   4.424 ++$ac_includes_default
   4.425 ++int
   4.426 ++find_stack_direction ()
   4.427 ++{
   4.428 ++  static char *addr = 0;
   4.429 ++  auto char dummy;
   4.430 ++  if (addr == 0)
   4.431 ++    {
   4.432 ++      addr = &dummy;
   4.433 ++      return find_stack_direction ();
   4.434 ++    }
   4.435 ++  else
   4.436 ++    return (&dummy > addr) ? 1 : -1;
   4.437 ++}
   4.438 ++
   4.439 ++int
   4.440 ++main ()
   4.441 ++{
   4.442 ++  return find_stack_direction () < 0;
   4.443 ++}
   4.444 ++_ACEOF
   4.445 ++if ac_fn_c_try_run "$LINENO"; then :
   4.446 ++  ac_cv_c_stack_direction=1
   4.447 ++else
   4.448 ++  ac_cv_c_stack_direction=-1
   4.449 ++fi
   4.450 ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   4.451 ++  conftest.$ac_objext conftest.beam conftest.$ac_ext
   4.452 ++fi
   4.453 ++
   4.454 ++fi
   4.455 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
   4.456 ++$as_echo "$ac_cv_c_stack_direction" >&6; }
   4.457 ++cat >>confdefs.h <<_ACEOF
   4.458 ++#define STACK_DIRECTION $ac_cv_c_stack_direction
   4.459 ++_ACEOF
   4.460 ++
   4.461 ++
   4.462 ++fi
   4.463 ++
   4.464 ++
   4.465 + 
   4.466 +   for ac_header in stdint.h
   4.467 + do :
   4.468 +@@ -7564,13 +7756,13 @@
   4.469 + else
   4.470 +   lt_cv_nm_interface="BSD nm"
   4.471 +   echo "int some_variable = 0;" > conftest.$ac_ext
   4.472 +-  (eval echo "\"\$as_me:7567: $ac_compile\"" >&5)
   4.473 ++  (eval echo "\"\$as_me:7759: $ac_compile\"" >&5)
   4.474 +   (eval "$ac_compile" 2>conftest.err)
   4.475 +   cat conftest.err >&5
   4.476 +-  (eval echo "\"\$as_me:7570: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   4.477 ++  (eval echo "\"\$as_me:7762: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   4.478 +   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   4.479 +   cat conftest.err >&5
   4.480 +-  (eval echo "\"\$as_me:7573: output\"" >&5)
   4.481 ++  (eval echo "\"\$as_me:7765: output\"" >&5)
   4.482 +   cat conftest.out >&5
   4.483 +   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
   4.484 +     lt_cv_nm_interface="MS dumpbin"
   4.485 +@@ -8772,7 +8964,7 @@
   4.486 +   ;;
   4.487 + *-*-irix6*)
   4.488 +   # Find out which ABI we are using.
   4.489 +-  echo '#line 8775 "configure"' > conftest.$ac_ext
   4.490 ++  echo '#line 8967 "configure"' > conftest.$ac_ext
   4.491 +   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   4.492 +   (eval $ac_compile) 2>&5
   4.493 +   ac_status=$?
   4.494 +@@ -10032,11 +10224,11 @@
   4.495 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   4.496 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   4.497 +    -e 's:$: $lt_compiler_flag:'`
   4.498 +-   (eval echo "\"\$as_me:10035: $lt_compile\"" >&5)
   4.499 ++   (eval echo "\"\$as_me:10227: $lt_compile\"" >&5)
   4.500 +    (eval "$lt_compile" 2>conftest.err)
   4.501 +    ac_status=$?
   4.502 +    cat conftest.err >&5
   4.503 +-   echo "$as_me:10039: \$? = $ac_status" >&5
   4.504 ++   echo "$as_me:10231: \$? = $ac_status" >&5
   4.505 +    if (exit $ac_status) && test -s "$ac_outfile"; then
   4.506 +      # The compiler can only warn and ignore the option if not recognized
   4.507 +      # So say no if there are warnings other than the usual output.
   4.508 +@@ -10371,11 +10563,11 @@
   4.509 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   4.510 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   4.511 +    -e 's:$: $lt_compiler_flag:'`
   4.512 +-   (eval echo "\"\$as_me:10374: $lt_compile\"" >&5)
   4.513 ++   (eval echo "\"\$as_me:10566: $lt_compile\"" >&5)
   4.514 +    (eval "$lt_compile" 2>conftest.err)
   4.515 +    ac_status=$?
   4.516 +    cat conftest.err >&5
   4.517 +-   echo "$as_me:10378: \$? = $ac_status" >&5
   4.518 ++   echo "$as_me:10570: \$? = $ac_status" >&5
   4.519 +    if (exit $ac_status) && test -s "$ac_outfile"; then
   4.520 +      # The compiler can only warn and ignore the option if not recognized
   4.521 +      # So say no if there are warnings other than the usual output.
   4.522 +@@ -10476,11 +10668,11 @@
   4.523 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   4.524 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   4.525 +    -e 's:$: $lt_compiler_flag:'`
   4.526 +-   (eval echo "\"\$as_me:10479: $lt_compile\"" >&5)
   4.527 ++   (eval echo "\"\$as_me:10671: $lt_compile\"" >&5)
   4.528 +    (eval "$lt_compile" 2>out/conftest.err)
   4.529 +    ac_status=$?
   4.530 +    cat out/conftest.err >&5
   4.531 +-   echo "$as_me:10483: \$? = $ac_status" >&5
   4.532 ++   echo "$as_me:10675: \$? = $ac_status" >&5
   4.533 +    if (exit $ac_status) && test -s out/conftest2.$ac_objext
   4.534 +    then
   4.535 +      # The compiler can only warn and ignore the option if not recognized
   4.536 +@@ -10531,11 +10723,11 @@
   4.537 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   4.538 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   4.539 +    -e 's:$: $lt_compiler_flag:'`
   4.540 +-   (eval echo "\"\$as_me:10534: $lt_compile\"" >&5)
   4.541 ++   (eval echo "\"\$as_me:10726: $lt_compile\"" >&5)
   4.542 +    (eval "$lt_compile" 2>out/conftest.err)
   4.543 +    ac_status=$?
   4.544 +    cat out/conftest.err >&5
   4.545 +-   echo "$as_me:10538: \$? = $ac_status" >&5
   4.546 ++   echo "$as_me:10730: \$? = $ac_status" >&5
   4.547 +    if (exit $ac_status) && test -s out/conftest2.$ac_objext
   4.548 +    then
   4.549 +      # The compiler can only warn and ignore the option if not recognized
   4.550 +@@ -12915,7 +13107,7 @@
   4.551 +   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   4.552 +   lt_status=$lt_dlunknown
   4.553 +   cat > conftest.$ac_ext <<_LT_EOF
   4.554 +-#line 12918 "configure"
   4.555 ++#line 13110 "configure"
   4.556 + #include "confdefs.h"
   4.557 + 
   4.558 + #if HAVE_DLFCN_H
   4.559 +@@ -13011,7 +13203,7 @@
   4.560 +   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   4.561 +   lt_status=$lt_dlunknown
   4.562 +   cat > conftest.$ac_ext <<_LT_EOF
   4.563 +-#line 13014 "configure"
   4.564 ++#line 13206 "configure"
   4.565 + #include "confdefs.h"
   4.566 + 
   4.567 + #if HAVE_DLFCN_H
   4.568 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   4.569 +--- mpfr-3.0.0-a/mpfr.h	2010-06-23 11:03:20.000000000 +0000
   4.570 ++++ mpfr-3.0.0-b/mpfr.h	2010-06-25 13:23:13.000000000 +0000
   4.571 +@@ -27,7 +27,7 @@
   4.572 + #define MPFR_VERSION_MAJOR 3
   4.573 + #define MPFR_VERSION_MINOR 0
   4.574 + #define MPFR_VERSION_PATCHLEVEL 0
   4.575 +-#define MPFR_VERSION_STRING "3.0.0-p1"
   4.576 ++#define MPFR_VERSION_STRING "3.0.0-p2"
   4.577 + 
   4.578 + /* Macros dealing with MPFR VERSION */
   4.579 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   4.580 +diff -Naurd mpfr-3.0.0-a/tests/Makefile.in mpfr-3.0.0-b/tests/Makefile.in
   4.581 +--- mpfr-3.0.0-a/tests/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   4.582 ++++ mpfr-3.0.0-b/tests/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   4.583 +@@ -960,6 +960,7 @@
   4.584 + red=; grn=; lgn=; blu=; std=
   4.585 + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   4.586 + ACLOCAL = @ACLOCAL@
   4.587 ++ALLOCA = @ALLOCA@
   4.588 + AMTAR = @AMTAR@
   4.589 + AR = @AR@
   4.590 + AS = @AS@
   4.591 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   4.592 +--- mpfr-3.0.0-a/version.c	2010-06-23 11:03:20.000000000 +0000
   4.593 ++++ mpfr-3.0.0-b/version.c	2010-06-25 13:23:13.000000000 +0000
   4.594 +@@ -25,5 +25,5 @@
   4.595 + const char *
   4.596 + mpfr_get_version (void)
   4.597 + {
   4.598 +-  return "3.0.0-p1";
   4.599 ++  return "3.0.0-p2";
   4.600 + }
   4.601 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   4.602 +--- mpfr-3.0.0-a/PATCHES	2010-07-10 00:11:19.000000000 +0000
   4.603 ++++ mpfr-3.0.0-b/PATCHES	2010-07-10 00:12:50.000000000 +0000
   4.604 +@@ -0,0 +1 @@
   4.605 ++gamma_underflow
   4.606 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   4.607 +--- mpfr-3.0.0-a/VERSION	2010-06-25 13:23:13.000000000 +0000
   4.608 ++++ mpfr-3.0.0-b/VERSION	2010-07-10 00:11:53.000000000 +0000
   4.609 +@@ -1 +1 @@
   4.610 +-3.0.0-p2
   4.611 ++3.0.0-p3
   4.612 +diff -Naurd mpfr-3.0.0-a/gamma.c mpfr-3.0.0-b/gamma.c
   4.613 +--- mpfr-3.0.0-a/gamma.c	2010-06-10 11:00:14.000000000 +0000
   4.614 ++++ mpfr-3.0.0-b/gamma.c	2010-07-10 00:11:46.000000000 +0000
   4.615 +@@ -274,7 +274,7 @@
   4.616 +       /* we want an upper bound for x * [log(2-x)-1].
   4.617 +          since x < 0, we need a lower bound on log(2-x) */
   4.618 +       mpfr_ui_sub (xp, 2, x, MPFR_RNDD);
   4.619 +-      mpfr_log (xp, xp, MPFR_RNDD);
   4.620 ++      mpfr_log2 (xp, xp, MPFR_RNDD);
   4.621 +       mpfr_sub_ui (xp, xp, 1, MPFR_RNDD);
   4.622 +       mpfr_mul (xp, xp, x, MPFR_RNDU);
   4.623 + 
   4.624 +@@ -303,8 +303,8 @@
   4.625 +         {
   4.626 +           mpfr_sub (tmp, tmp, tmp2, MPFR_RNDZ); /* low bnd on |sin(Pi*(2-x))| */
   4.627 +           mpfr_ui_div (tmp, 12, tmp, MPFR_RNDU); /* upper bound */
   4.628 +-          mpfr_log (tmp, tmp, MPFR_RNDU);
   4.629 +-          mpfr_add (tmp, tmp, xp, MPFR_RNDU);
   4.630 ++          mpfr_log2 (tmp, tmp, MPFR_RNDU);
   4.631 ++          mpfr_add (xp, tmp, xp, MPFR_RNDU);
   4.632 +           underflow = mpfr_cmp_si (xp, expo.saved_emin - 2) <= 0;
   4.633 +         }
   4.634 + 
   4.635 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   4.636 +--- mpfr-3.0.0-a/mpfr.h	2010-06-25 13:23:13.000000000 +0000
   4.637 ++++ mpfr-3.0.0-b/mpfr.h	2010-07-10 00:11:53.000000000 +0000
   4.638 +@@ -27,7 +27,7 @@
   4.639 + #define MPFR_VERSION_MAJOR 3
   4.640 + #define MPFR_VERSION_MINOR 0
   4.641 + #define MPFR_VERSION_PATCHLEVEL 0
   4.642 +-#define MPFR_VERSION_STRING "3.0.0-p2"
   4.643 ++#define MPFR_VERSION_STRING "3.0.0-p3"
   4.644 + 
   4.645 + /* Macros dealing with MPFR VERSION */
   4.646 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   4.647 +diff -Naurd mpfr-3.0.0-a/tests/tgamma.c mpfr-3.0.0-b/tests/tgamma.c
   4.648 +--- mpfr-3.0.0-a/tests/tgamma.c	2010-06-10 11:00:13.000000000 +0000
   4.649 ++++ mpfr-3.0.0-b/tests/tgamma.c	2010-07-10 00:11:46.000000000 +0000
   4.650 +@@ -461,6 +461,20 @@
   4.651 +   mpfr_clear (x);
   4.652 + }
   4.653 + 
   4.654 ++/* bug found by Stathis, only occurs on 32-bit machines */
   4.655 ++static void
   4.656 ++test20100709 (void)
   4.657 ++{
   4.658 ++  mpfr_t x;
   4.659 ++  int inex;
   4.660 ++
   4.661 ++  mpfr_init2 (x, 100);
   4.662 ++  mpfr_set_str (x, "-4.6308260837372266e+07", 10, MPFR_RNDN);
   4.663 ++  inex = mpfr_gamma (x, x, MPFR_RNDN);
   4.664 ++  MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
   4.665 ++  mpfr_clear (x);
   4.666 ++}
   4.667 ++
   4.668 + int
   4.669 + main (int argc, char *argv[])
   4.670 + {
   4.671 +@@ -471,6 +485,7 @@
   4.672 +   test_generic (2, 100, 2);
   4.673 +   gamma_integer ();
   4.674 +   test20071231 ();
   4.675 ++  test20100709 ();
   4.676 + 
   4.677 +   data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
   4.678 + 
   4.679 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   4.680 +--- mpfr-3.0.0-a/version.c	2010-06-25 13:23:13.000000000 +0000
   4.681 ++++ mpfr-3.0.0-b/version.c	2010-07-10 00:11:53.000000000 +0000
   4.682 +@@ -25,5 +25,5 @@
   4.683 + const char *
   4.684 + mpfr_get_version (void)
   4.685 + {
   4.686 +-  return "3.0.0-p2";
   4.687 ++  return "3.0.0-p3";
   4.688 + }
   4.689 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   4.690 +--- mpfr-3.0.0-a/PATCHES	2010-09-07 08:44:01.000000000 +0000
   4.691 ++++ mpfr-3.0.0-b/PATCHES	2010-09-07 08:48:46.000000000 +0000
   4.692 +@@ -0,0 +1 @@
   4.693 ++mpfr_cmp/set_ui/si
   4.694 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   4.695 +--- mpfr-3.0.0-a/VERSION	2010-07-10 00:11:53.000000000 +0000
   4.696 ++++ mpfr-3.0.0-b/VERSION	2010-09-07 08:46:06.000000000 +0000
   4.697 +@@ -1 +1 @@
   4.698 +-3.0.0-p3
   4.699 ++3.0.0-p4
   4.700 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   4.701 +--- mpfr-3.0.0-a/mpfr.h	2010-07-10 00:11:53.000000000 +0000
   4.702 ++++ mpfr-3.0.0-b/mpfr.h	2010-09-07 08:46:06.000000000 +0000
   4.703 +@@ -27,7 +27,7 @@
   4.704 + #define MPFR_VERSION_MAJOR 3
   4.705 + #define MPFR_VERSION_MINOR 0
   4.706 + #define MPFR_VERSION_PATCHLEVEL 0
   4.707 +-#define MPFR_VERSION_STRING "3.0.0-p3"
   4.708 ++#define MPFR_VERSION_STRING "3.0.0-p4"
   4.709 + 
   4.710 + /* Macros dealing with MPFR VERSION */
   4.711 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   4.712 +@@ -798,35 +798,45 @@
   4.713 +      anyway. Checking with other ICC versions is needed. Possibly detect
   4.714 +      whether warnings are produced or not with a configure test.
   4.715 +    + Remove C++ too, since it complains too much. */
   4.716 ++/* Added casts to improve robustness in case of undefined behavior and
   4.717 ++   compiler extensions based on UB (in particular -fwrapv). MPFR doesn't
   4.718 ++   use such extensions, but these macros will be used by 3rd-party code,
   4.719 ++   where such extensions may be required.
   4.720 ++   Moreover casts to unsigned long have been added to avoid warnings in
   4.721 ++   programs that use MPFR and are compiled with -Wconversion; such casts
   4.722 ++   are OK since if X is a constant expression, then (unsigned long) X is
   4.723 ++   also a constant expression, so that the optimizations still work. */
   4.724 + #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
   4.725 + #if (__GNUC__ >= 2)
   4.726 + #undef mpfr_cmp_ui
   4.727 +-/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
   4.728 +-#define mpfr_cmp_ui(_f,_u)                 \
   4.729 +- (__builtin_constant_p (_u) && (_u) == 0 ? \
   4.730 +-   mpfr_sgn (_f) :                         \
   4.731 +-   mpfr_cmp_ui_2exp ((_f),(_u),0))
   4.732 ++/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0.
   4.733 ++   But warning! mpfr_sgn is specified as a macro in the API, thus the macro
   4.734 ++   mustn't be used if side effects are possible, like here. */
   4.735 ++#define mpfr_cmp_ui(_f,_u)                                      \
   4.736 ++  (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ?     \
   4.737 ++   (mpfr_sgn) (_f) :                                            \
   4.738 ++   mpfr_cmp_ui_2exp ((_f), (unsigned long) (_u), 0))
   4.739 + #undef mpfr_cmp_si
   4.740 +-#define mpfr_cmp_si(_f,_s)                 \
   4.741 +- (__builtin_constant_p (_s) && (_s) >= 0 ? \
   4.742 +-   mpfr_cmp_ui ((_f), (_s)) :              \
   4.743 +-   mpfr_cmp_si_2exp ((_f), (_s), 0))
   4.744 ++#define mpfr_cmp_si(_f,_s)                              \
   4.745 ++  (__builtin_constant_p (_s) && (long) (_s) >= 0 ?      \
   4.746 ++   mpfr_cmp_ui ((_f), (unsigned long) (long) (_s)) :    \
   4.747 ++   mpfr_cmp_si_2exp ((_f), (long) (_s), 0))
   4.748 + #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
   4.749 + #undef mpfr_set_ui
   4.750 +-#define mpfr_set_ui(_f,_u,_r)              \
   4.751 +- (__builtin_constant_p (_u) && (_u) == 0 ? \
   4.752 +-   __extension__ ({                        \
   4.753 +-     mpfr_ptr _p = (_f);                   \
   4.754 +-     _p->_mpfr_sign = 1;                   \
   4.755 +-     _p->_mpfr_exp = __MPFR_EXP_ZERO;      \
   4.756 +-     (void) (_r); 0; }) :                  \
   4.757 +-   mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
   4.758 ++#define mpfr_set_ui(_f,_u,_r)                                   \
   4.759 ++  (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ?     \
   4.760 ++   __extension__ ({                                             \
   4.761 ++       mpfr_ptr _p = (_f);                                      \
   4.762 ++       _p->_mpfr_sign = 1;                                      \
   4.763 ++       _p->_mpfr_exp = __MPFR_EXP_ZERO;                         \
   4.764 ++       (void) (_r); 0; }) :                                     \
   4.765 ++   mpfr_set_ui_2exp ((_f), (unsigned long) (_u), 0, (_r)))
   4.766 + #endif
   4.767 + #undef mpfr_set_si
   4.768 +-#define mpfr_set_si(_f,_s,_r)              \
   4.769 +- (__builtin_constant_p (_s) && (_s) >= 0 ? \
   4.770 +-   mpfr_set_ui ((_f), (_s), (_r)) :        \
   4.771 +-   mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
   4.772 ++#define mpfr_set_si(_f,_s,_r)                                   \
   4.773 ++  (__builtin_constant_p (_s) && (long) (_s) >= 0 ?              \
   4.774 ++   mpfr_set_ui ((_f), (unsigned long) (long) (_s), (_r)) :      \
   4.775 ++   mpfr_set_si_2exp ((_f), (long) (_s), 0, (_r)))
   4.776 + #endif
   4.777 + #endif
   4.778 + 
   4.779 +diff -Naurd mpfr-3.0.0-a/tests/tcmp_ui.c mpfr-3.0.0-b/tests/tcmp_ui.c
   4.780 +--- mpfr-3.0.0-a/tests/tcmp_ui.c	2010-06-10 11:00:13.000000000 +0000
   4.781 ++++ mpfr-3.0.0-b/tests/tcmp_ui.c	2010-09-07 08:45:12.000000000 +0000
   4.782 +@@ -88,6 +88,126 @@
   4.783 +   mpfr_clear (x);
   4.784 + }
   4.785 + 
   4.786 ++/* Since mpfr_cmp_ui and mpfr_cmp_si are also implemented by a macro
   4.787 ++   with __builtin_constant_p for GCC, check that side effects are
   4.788 ++   handled correctly. */
   4.789 ++static void
   4.790 ++check_macros (void)
   4.791 ++{
   4.792 ++  mpfr_t x;
   4.793 ++  int c;
   4.794 ++
   4.795 ++  mpfr_init2 (x, 32);
   4.796 ++
   4.797 ++  c = 0;
   4.798 ++  mpfr_set_ui (x, 17, MPFR_RNDN);
   4.799 ++  if (mpfr_cmp_ui (x, 17) != 0)
   4.800 ++    {
   4.801 ++      printf ("Error 1 on mpfr_cmp_ui(x,17) in check_macros\n");
   4.802 ++      exit (1);
   4.803 ++    }
   4.804 ++  if (mpfr_cmp_ui (x, (c++, 17)) != 0)
   4.805 ++    {
   4.806 ++      printf ("Error 2 on mpfr_cmp_ui(x,17) in check_macros\n");
   4.807 ++      exit (1);
   4.808 ++    }
   4.809 ++  if (c != 1)
   4.810 ++    {
   4.811 ++      printf ("Error 3 on mpfr_cmp_ui(x,17) in check_macros\n"
   4.812 ++              "(c = %d instead of 1)\n", c);
   4.813 ++      exit (1);
   4.814 ++    }
   4.815 ++  if (mpfr_cmp_si (x, 17) != 0)
   4.816 ++    {
   4.817 ++      printf ("Error 1 on mpfr_cmp_si(x,17) in check_macros\n");
   4.818 ++      exit (1);
   4.819 ++    }
   4.820 ++  if (mpfr_cmp_si (x, (c++, 17)) != 0)
   4.821 ++    {
   4.822 ++      printf ("Error 2 on mpfr_cmp_si(x,17) in check_macros\n");
   4.823 ++      exit (1);
   4.824 ++    }
   4.825 ++  if (c != 2)
   4.826 ++    {
   4.827 ++      printf ("Error 3 on mpfr_cmp_si(x,17) in check_macros\n"
   4.828 ++              "(c = %d instead of 2)\n", c);
   4.829 ++      exit (1);
   4.830 ++    }
   4.831 ++
   4.832 ++  c = 0;
   4.833 ++  mpfr_set_ui (x, 0, MPFR_RNDN);
   4.834 ++  if (mpfr_cmp_ui (x, 0) != 0)
   4.835 ++    {
   4.836 ++      printf ("Error 1 on mpfr_cmp_ui(x,0) in check_macros\n");
   4.837 ++      exit (1);
   4.838 ++    }
   4.839 ++  if (mpfr_cmp_ui (x, (c++, 0)) != 0)
   4.840 ++    {
   4.841 ++      printf ("Error 2 on mpfr_cmp_ui(x,0) in check_macros\n");
   4.842 ++      exit (1);
   4.843 ++    }
   4.844 ++  if (c != 1)
   4.845 ++    {
   4.846 ++      printf ("Error 3 on mpfr_cmp_ui(x,0) in check_macros\n"
   4.847 ++              "(c = %d instead of 1)\n", c);
   4.848 ++      exit (1);
   4.849 ++    }
   4.850 ++  if (mpfr_cmp_si (x, 0) != 0)
   4.851 ++    {
   4.852 ++      printf ("Error 1 on mpfr_cmp_si(x,0) in check_macros\n");
   4.853 ++      exit (1);
   4.854 ++    }
   4.855 ++  if (mpfr_cmp_si (x, (c++, 0)) != 0)
   4.856 ++    {
   4.857 ++      printf ("Error 2 on mpfr_cmp_si(x,0) in check_macros\n");
   4.858 ++      exit (1);
   4.859 ++    }
   4.860 ++  if (c != 2)
   4.861 ++    {
   4.862 ++      printf ("Error 3 on mpfr_cmp_si(x,0) in check_macros\n"
   4.863 ++              "(c = %d instead of 2)\n", c);
   4.864 ++      exit (1);
   4.865 ++    }
   4.866 ++
   4.867 ++  mpfr_clear (x);
   4.868 ++}
   4.869 ++
   4.870 ++/* Bug in r7114 */
   4.871 ++static void
   4.872 ++test_macros (void)
   4.873 ++{
   4.874 ++  mpfr_t x[3];
   4.875 ++  mpfr_ptr p;
   4.876 ++
   4.877 ++  mpfr_inits (x[0], x[1], x[2], (mpfr_ptr) 0);
   4.878 ++  mpfr_set_ui (x[0], 0, MPFR_RNDN);
   4.879 ++  p = x[0];
   4.880 ++  if (mpfr_cmp_ui (p++, 0) != 0)
   4.881 ++    {
   4.882 ++      printf ("Error in mpfr_cmp_ui macro: result should be 0.\n");
   4.883 ++      exit (1);
   4.884 ++    }
   4.885 ++  if (p != x[1])
   4.886 ++    {
   4.887 ++      printf ("Error in mpfr_cmp_ui macro: p - x[0] = %d (expecting 1)\n",
   4.888 ++              (int) (p - x[0]));
   4.889 ++      exit (1);
   4.890 ++    }
   4.891 ++  p = x[0];
   4.892 ++  if (mpfr_cmp_si (p++, 0) != 0)
   4.893 ++    {
   4.894 ++      printf ("Error in mpfr_cmp_si macro: result should be 0.\n");
   4.895 ++      exit (1);
   4.896 ++    }
   4.897 ++  if (p != x[1])
   4.898 ++    {
   4.899 ++      printf ("Error in mpfr_cmp_si macro: p - x[0] = %d (expecting 1)\n",
   4.900 ++              (int) (p - x[0]));
   4.901 ++      exit (1);
   4.902 ++    }
   4.903 ++  mpfr_clears (x[0], x[1], x[2], (mpfr_ptr) 0);
   4.904 ++}
   4.905 ++
   4.906 + int
   4.907 + main (void)
   4.908 + {
   4.909 +@@ -216,6 +336,8 @@
   4.910 +   mpfr_clear (x);
   4.911 + 
   4.912 +   check_nan ();
   4.913 ++  check_macros ();
   4.914 ++  test_macros ();
   4.915 + 
   4.916 +   tests_end_mpfr ();
   4.917 +   return 0;
   4.918 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   4.919 +--- mpfr-3.0.0-a/version.c	2010-07-10 00:11:53.000000000 +0000
   4.920 ++++ mpfr-3.0.0-b/version.c	2010-09-07 08:46:06.000000000 +0000
   4.921 +@@ -25,5 +25,5 @@
   4.922 + const char *
   4.923 + mpfr_get_version (void)
   4.924 + {
   4.925 +-  return "3.0.0-p3";
   4.926 ++  return "3.0.0-p4";
   4.927 + }