# LIBNAME = flint2
HOMEPAGE = http://flintlib.org
# git://github.com/wbhart/flint2.git
URL = http://macaulay2.com/Downloads/OtherSourceCode
VERSION = 2.8.4
# PATCHFILE = @abs_srcdir@/patch-$(VERSION)
PARALLEL = yes

# Many other tests keep failing, so disable them all:
CHECKTARGET = .

LICENSEFILES = flint.h LICENSE
ifeq (@DEBUG@,yes)
CONFIGOPTIONS += --enable-assert
CFLAGS += -O0 -fno-unroll-loops 
endif
CFLAGS += -std=c90 -pedantic-errors
# the flint configure script does not accept CPPFLAGS
# CONFIGURECMD =  LIB_DIRS=$(LIBRARIESDIR)/lib ./configure  --with-gc --with-blas --disable-tls
CONFIGURECMD =  LIB_DIRS=$(LIBRARIESDIR)/lib ./configure --without-blas --disable-tls \
			--prefix='$(PREFIX)' --disable-shared CC='$(CC)' \
			CFLAGS='$(CFLAGS) $(CPPFLAGS)'

ifneq ($(VERBOSE),)
BUILDOPTIONS += AT= QUIET_CC= QUIET_CXX= QUIET_AR=
endif

include ../Makefile.library

# I can't figure out how to get flint compiled with mpir instead of gmp, so we adopt an artifice:
ifeq (@USING_MPIR@,1)
CPPFLAGS := -I@abs_top_srcdir@/include/M2/gmp-to-mpir $(CPPFLAGS)
endif

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