diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-10-01 13:51:10 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-10-01 13:51:10 +0000 |
commit | af8513fb5f2cb41c63ae931d9e8abc0650e4d2d9 (patch) | |
tree | d9e94e921a005c184c15796a922a374a41ffd009 /configure.ac | |
parent | fb95b53dd9facbef4d99626311fd800422bc054b (diff) | |
download | mpfr-af8513fb5f2cb41c63ae931d9e8abc0650e4d2d9.tar.gz |
[configure.ac,src/Makefile.am] Avoid a "make" failure due to a bug in
Automake 1.15 automatic dependency tracking: instead of using mini-gmp
directly in an external directory with a $(mini_gmp_path) variable in
src/Makefile.am, make the configure script add symbolic links to the
mini-gmp sources in the build directory, and use these symbolic links
for the MPFR build (as if they were plain files).
Tested under various conditions: static and shared; separate source and
build directories; changing the mini-gmp version without "make clean".
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13235 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index efdd01259..e8e170b06 100644 --- a/configure.ac +++ b/configure.ac @@ -132,7 +132,9 @@ AC_ARG_WITH(mini_gmp, test -z "$use_gmp_build"; then 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" +dnl Once the Automake 1.15 bug with automatic dependency tracking has become +dnl obsolete and the src/Makefile.am changes have been reverted, one should +dnl add back: CPPFLAGS="$CPPFLAGS -I$withval" mini_gmp_path="$withval" AC_SUBST(mini_gmp_path) else @@ -783,6 +785,11 @@ 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" +dnl With the code working with Automake 1.15 (see --with-mini-gmp code +dnl above), CPPFLAGS has not been modified, thus one needs a temporary +dnl one to find the mini-gmp.h header file. +saved_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I$mini_gmp_path" AC_COMPUTE_INT(mini_gmp_numb_bits, [(GMP_NUMB_BITS)], [#include <mini-gmp.h>], [how="not in mini-gmp.h; guessed" @@ -791,8 +798,21 @@ AC_COMPUTE_INT(mini_gmp_numb_bits, [(GMP_NUMB_BITS)], [AC_MSG_FAILURE([cannot define GMP_NUMB_BITS])]) AC_DEFINE_UNQUOTED([GMP_NUMB_BITS], $mini_gmp_numb_bits, [number of bits in a limb]) ]) +CPPFLAGS="$saved_CPPFLAGS" AC_MSG_RESULT([$mini_gmp_numb_bits bits ($how)]) +dnl Also added for the code avoiding the Automake 1.15 bug: +dnl Let us make the configure script clean up the mini-gmp.* files +dnl and add the symbolic links to mini-gmp.{c,h} instead of relying +dnl on timestamp-based make rules, which may not work when testing +dnl several mini-gmp versions (whose source can go back in time). +mkdir -p "$ac_top_build_prefix"src +rm -f -- "$ac_top_build_prefix"src/mini-gmp.* +for i in c h +do + ln -s -- "$mini_gmp_path/mini-gmp.$i" "$ac_top_build_prefix"src/mini-gmp.$i +done + fi dnl End of setup related to GMP / mini-gmp |