VPATH = @srcdir@
LICENSEFILES = README COPYING COPYING.LIB INSTALL
VERSION = 3.0.0
TAROPTIONS = --bzip2
TARFILE = $(LIBNAME)-$(VERSION).tar.bz2

# we had to patch acinclude.m4 to remove a bogus test preventing clang from compiling it:
# I tried "autoreconf -i" once, but it didn't work, resulting in a recursive definition MKDIR_P = $(MKDIR_P) in a Makefile
PRECONFIGURE = autoconf

# URL = http://www.mpir.org
URL = http://macaulay2.com/Downloads/OtherSourceCode

# do not need this patch with "vanilla gmp" code.
#PATCHFILE = @abs_srcdir@/patch-$(VERSION)

# increase the limit, because two of the tests run by mpir's "make check" will
# not run in just 400000:
TLIMIT = 250
VLIMIT = 600000
MLIMIT = 600000

CONFIGOPTIONS += --enable-gmpcompat --enable-cxx $(MPIR_CONFIGOPTIONS)

# this is supposed to work under x86_64, but doesn't:
# CONFIGOPTIONS +=  --enable-fat

# We enable the shared library because we want to use the version of libpari
# that uses libgmp, and the pari makefile refuses to make libpari.a, the
# static library.
# ifeq (@SHARED@,no)

# or, maybe now?

CONFIGOPTIONS += --disable-shared

# endif

include ../Makefile.library

ifeq (@host@,x86_64-w64-mingw32)
# to work around a bug, where yasm puts no global symbols in the *.o files
CONFIGOPTIONS += --host=none_64-w64-mingw32 RANLIB=@RANLIB@ AS=@AS@ STRIP=@STRIP@ AR=@AR@ DLLTOOL=@DLLTOOL@ OBJDUMP=@OBJDUMP@
endif

ifeq (@DEBUG@ @GCC@,yes yes)
CC := $(CC) -g
CXX := $(CXX) -g
endif

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

ifeq (@OS@-@ISSUE@,MicrosoftWindows-Cygwin)
LDFLAGS += -Wl,--enable-auto-import
endif
Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/mpir/Makefile

test test.o : LOADLIBES += -lmpir
test test.o : CFLAGS += -Werror -Wimplicit

# Local Variables:
# compile-command: "make -C $M2BUILDDIR/libraries/mpir "
# End:
