summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-14 13:59:11 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-14 13:59:11 +0000
commit5e571c619842bca39f0e12d0b1eee2c1064d9f90 (patch)
tree3c9f3f74abae7299c224d7715ab9b0d9e10e9ee3
parente5ba7f4b3911f14a8f9ad76ec0230571a99e3003 (diff)
downloadmpfr-5e571c619842bca39f0e12d0b1eee2c1064d9f90.tar.gz
Completed --with-mini-gmp support (not fully tested).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/with-mini-gmp@13196 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--configure.ac11
-rw-r--r--src/Makefile.am9
2 files changed, 16 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index a8ceafa9d..8c6c2b4a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,9 @@ dnl Older Automake versions than 1.13 may still be supported, but no longer
dnl tested, and many things have changed in 1.13. Moreover the INSTALL file
dnl and MPFR manual assume that MPFR has been built using Automake 1.13+
dnl (due to parallel tests, introduced by default in Automake 1.13).
-AM_INIT_AUTOMAKE([1.13 no-define dist-bzip2 dist-xz dist-zip])
+dnl The subdir-objects option is needed due to configuration related to
+dnl mini-gmp, which has sources in an external directory.
+AM_INIT_AUTOMAKE([1.13 no-define dist-bzip2 dist-xz dist-zip subdir-objects])
AM_MAINTAINER_MODE(enable)
AC_CONFIG_MACRO_DIR([m4])
@@ -130,7 +132,8 @@ AC_ARG_WITH(mini_gmp,
if test -f "$withval/mini-gmp.c" && test -f "$withval/mini-gmp.h"; then
AC_DEFINE([MPFR_USE_MINI_GMP],1,[Use mini-gmp])
CPPFLAGS="$CPPFLAGS -I$withval"
- use_mini_gmp=yes
+ mini_gmp_path="$withval"
+ AC_SUBST(mini_gmp_path)
else
AC_MSG_FAILURE([mini-gmp.{c,h} not found in $withval])
fi
@@ -223,7 +226,7 @@ AC_ARG_ENABLE(tune-for-coverage,
esac])
dnl Makefile.am files can use "if MINI_GMP" / ... / "endif".
-AM_CONDITIONAL([MINI_GMP], [test "$use_mini_gmp" = yes])
+AM_CONDITIONAL([MINI_GMP], [test -n "$mini_gmp_path"])
dnl
@@ -640,7 +643,7 @@ dnl
dnl Setup GMP detection (continued)
dnl
-if test "$use_mini_gmp" != yes ; then
+if test -z "$mini_gmp_path" ; then
dnl Check minimal GMP version
dnl We only guarantee that with a *functional* and recent enough GMP version,
diff --git a/src/Makefile.am b/src/Makefile.am
index 496cc53ad..886a70d2e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -91,6 +91,15 @@ libmpfr_la_LDFLAGS = $(MPFR_LDFLAGS) $(LIBMPFR_LDFLAGS) -version-info 6:0:0
$(srcdir)/get_patches.c: $(top_srcdir)/PATCHES $(top_srcdir)/tools/get_patches.sh
(cd $(top_srcdir) && ./tools/get_patches.sh) > $@ || rm -f $@
+if MINI_GMP
+# FIXME: The noinst_ below may be wrong. The idea was to avoid a libminigmp
+# installation in case of static build only, but this is probably incorrect
+# in case of an installation of a dynamic build. To be decided later...
+noinst_LTLIBRARIES = libminigmp.la
+libminigmp_la_SOURCES = $(mini_gmp_path)/mini-gmp.h $(mini_gmp_path)/mini-gmp.c
+libmpfr_la_LIBADD += libminigmp.la
+endif
+
# For check-gmp-symbols
GMPC = $(top_builddir)/src/gmp.c
GMPI = $(top_builddir)/src/gmp.i