PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
endif
+if NEED_GET_MEMORY_FUNCTIONS
+GET_MEMORY_FUNCTIONS=mp_get_memory_functions.c
+endif
+
libisl_la_SOURCES = \
$(ISL_PIPLIB) \
$(ISL_POLYLIB) \
+ $(GET_MEMORY_FUNCTIONS) \
isl_affine_hull.c \
isl_blk.c \
isl_constraint.c \
GMP_CPPFLAGS="-I$with_gmp_prefix/include"
GMP_LDFLAGS="-L$with_gmp_prefix/lib"
fi
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
+need_get_memory_functions=false
+AC_CHECK_DECLS(mp_get_memory_functions,[],[
+ need_get_memory_functions=true
+],[#include <gmp.h>])
+CPPFLAGS="$SAVE_CPPFLAGS"
+AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue)
AC_DEFUN([ISL_SUBMODULE],[
AC_ARG_WITH($1_prefix,
extern "C" {
#endif
+#ifndef mp_get_memory_functions
+void mp_get_memory_functions(
+ void *(**alloc_func_ptr) (size_t),
+ void *(**realloc_func_ptr) (void *, size_t, size_t),
+ void (**free_func_ptr) (void *, size_t));
+#endif
+
/* isl_int is the basic integer type. It currently always corresponds
* to a gmp mpz_t, but in the future, different types such as long long
* or cln::cl_I will be supported.
--- /dev/null
+#include <gmp.h>
+
+void mp_get_memory_functions(
+ void *(**alloc_func_ptr) (size_t),
+ void *(**realloc_func_ptr) (void *, size_t, size_t),
+ void (**free_func_ptr) (void *, size_t))
+{
+ if (alloc_func_ptr)
+ *alloc_func_ptr = __gmp_allocate_func;
+ if (realloc_func_ptr)
+ *realloc_func_ptr = __gmp_reallocate_func;
+ if (free_func_ptr)
+ *free_func_ptr = __gmp_free_func;
+}