#############################################################################

VERSION = 4.0.2
LICENSEFILES = README COPYING.LESSER
TARFILE = $(LIBNAME)-$(VERSION).tar.xz
TAROPTIONS = --xz

#############################################################################
CONFIGOPTIONS += --disable-thread-safe
# Compiling mpfr with thread local variables is incompatible with libgc, because
#   some libgc pointers are cached in the variables __gmpfr_cache_const_pi, 
#   __gmpfr_cache_const_log2, __gmpfr_cache_const_euler, __gmpfr_cache_const_catalan
# so for now we comment this out.  Detect the bug by running the tests in
# the package EllipticIntegrals, especially the following code:
#     i15 : scan(-4 .. 4, i -> scan(-4 .. 4, j -> (
#           	       assert( distance(E.exp ( .2p200 ), E.exp ( .2p200 + i * E.Period' + j * E.Period )) < 1e-50 );
#           	       assert( distance(E.exp ( .2p200+.3p200*ii ), E.exp ( .2p200+.3p200*ii + i * E.Period' + j * E.Period )) < 1e-50 );
#           	       )));
#     GC_debug_free: found previously deallocated (?) object at 0x10fc7da30 in or near object at 0x10fc7da40(<smashed>, appr. sz = 57)
#     stdio:27:16:(3):[2]: error: assertion failed
#############################################################################
# Debugging note: the INSTALL file of mpfr recommends getting the latest patches 
# from a file such as http://www.mpfr.org/mpfr-3.1.2/allpatches and applying them.
#############################################################################

RELAX = yes
# URL = http://www.mpfr.org/mpfr-$(VERSION)
URL = http://macaulay2.com/Downloads/OtherSourceCode

ifeq (@DEBUG@,yes)
CONFIGOPTIONS += --enable-assert
endif

CONFIGOPTIONS += --disable-shared

# ifeq (@SHARED@,no)
# CONFIGOPTIONS += --disable-shared
# endif

# PRECONFIGURE = autoreconf -i
include ../Makefile.library

BUILDOPTIONS += CPPFLAGS="$(CPPFLAGS)"
CHECKOPTIONS += CPPFLAGS="$(CPPFLAGS)"

Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/mpfr/Makefile
# Local Variables:
# compile-command: "make -C $M2BUILDDIR/libraries/mpfr "
# End:
