diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-19 11:36:03 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-19 11:36:03 +0000 |
commit | f98b4a0436d945f4ac2681fab436642e748ac853 (patch) | |
tree | 5dac7a4118eca9020871afcb378c6cfacc5a664d /configure.ac | |
parent | 0ec300131449794834163345ee533c6469c0ee89 (diff) | |
download | mpfr-f98b4a0436d945f4ac2681fab436642e748ac853.tar.gz |
[configure.ac] When using --with-mini-gmp, define GMP_NUMB_BITS if this
macro is not already defined in mini-gmp.h (this is done a bit like
with --enable-mini-gmp, but the handling in this option is buggy as
GMP_NUMB_BITS is defined with AC_DEFINE_UNQUOTED unconditionally,
though is most cases the contents of the macros are the same).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13225 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index dd0d8baad..2978b217c 100644 --- a/configure.ac +++ b/configure.ac @@ -583,11 +583,13 @@ GMP_C_ATTRIBUTE_MODE dnl -dnl Setup GMP detection +dnl Setup related to GMP / mini-gmp dnl if test -z "$mini_gmp_path" ; then +dnl Setup for GMP + dnl Avoid a configure failure with automatic dependency tracking due to dnl libminigmp_la_SOURCES = $(mini_gmp_path)/mini-gmp.h [...] dnl in src/Makefile.am; this failure comes from the fact that lines with @@ -808,9 +810,27 @@ AC_CHECK_FUNCS([__gmpn_rsblsh1_n]) MPFR_CHECK_MP_LIMB_T_VS_LONG MPFR_CHECK_MP_LIMB_T_VS_INTMAX -dnl End of the GMP checks (no mini-gmp) +else + +dnl Setup for mini-gmp + +dnl First check whether mini-gmp defines GMP_NUMB_BITS. +AC_MSG_CHECKING(for GMP_NUMB_BITS) +how="from mini-gmp.h" +AC_COMPUTE_INT(mini_gmp_numb_bits, [(GMP_NUMB_BITS)], + [#include <mini-gmp.h>], + [how="not in mini-gmp.h; guessed" + AC_COMPUTE_INT(mini_gmp_numb_bits, [(sizeof(unsigned long) * CHAR_BIT)], + [#include <limits.h>], + [AC_MSG_FAILURE([cannot define GMP_NUMB_BITS])]) + AC_DEFINE_UNQUOTED([GMP_NUMB_BITS], $mini_gmp_numb_bits, [number of bits in a limb]) + ]) +AC_MSG_RESULT([$mini_gmp_numb_bits bits ($how)]) + fi +dnl End of setup related to GMP / mini-gmp + dnl The getrusage function is needed for MPFR bench (cf tools/bench) AC_CHECK_FUNCS([getrusage]) |