diff options
author | Christoph Muellner <christoph.muellner@theobroma-systems.com> | 2019-01-07 17:09:23 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-03-13 11:03:27 +0100 |
commit | 7ab8e6953ac1e0ece4132bb6684e8c8e46caae0b (patch) | |
tree | 0c85bf9620053f22c0b1cc413073afe263b311e9 | |
parent | 899016d49d289757372459f72d642a4c6b3b7732 (diff) |
gdb: Allow to provide path via --with-mpfr.
The configure file in gdb/ allows to specify if mpfr should be used or
not by setting --with-mpfr to either 'yes' or 'no'. If enabled, it
relies on AC_LIB_HAVE_LINKFLAGS() to do the right thing.
However, in certain environments we don't want to rely on that.
Instead we want to explicitly specify the lib and include path
for MPFR (and its dependency GMP).
This patch allows to specify the relevant paths via --with-mpfr=PATH
and --with-gmp=PATH just like the toplevel configure does.
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
-rw-r--r-- | gdb/configure.ac | 71 |
1 files changed, 64 insertions, 7 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac index ca0da7980c..2e39ffa062 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -660,16 +660,28 @@ else fi fi -AC_ARG_WITH(mpfr, - AS_HELP_STRING([--with-mpfr], [include MPFR support (auto/yes/no)]), - [], [with_mpfr=auto]) -AC_MSG_CHECKING([whether to use MPFR]) -AC_MSG_RESULT([$with_mpfr]) -if test "${with_mpfr}" = no; then +# Check for MPFR (and its dependency GMP) +mpfrlibs= +mpfrinc= + +AC_ARG_WITH(mpfr, +[AS_HELP_STRING([--with-mpfr=PATH], + [specify prefix directory for installed MPFR package. + Equivalent to --with-mpfr-include=PATH/include + plus --with-mpfr-lib=PATH/lib])]) +AC_ARG_WITH(mpfr-include, +[AS_HELP_STRING([--with-mpfr-include=PATH], + [specify directory for installed MPFR include files])]) +AC_ARG_WITH(mpfr-lib, +[AS_HELP_STRING([--with-mpfr-lib=PATH], + [specify directory for the installed MPFR library])]) + +#For backwards-compatiblity we also support --with-mpfr={no|yes|auto} +if test "x$with_mpfr" = xno; then AC_MSG_WARN([MPFR support disabled; some features may be unavailable.]) HAVE_LIBMPFR=no -else +elif test "x$with_mpfr" = xyes -o "x$with_mpfr" = xauto -o "x$with_mpfr" = x -o "x$with_mpfr" = x; then AC_LIB_HAVE_LINKFLAGS([mpfr], [gmp], [#include <mpfr.h>], [mpfr_exp_t exp; mpfr_t x; mpfr_frexp (&exp, x, x, MPFR_RNDN);]) @@ -680,6 +692,51 @@ else AC_MSG_WARN([MPFR is missing or unusable; some features may be unavailable.]) fi fi +elif test "x$with_mpfr" != x; then + mpfrlib="-L$with_mpfr/lib -lmpfr" + mpfrinc="-I$with_mpfr/include" +fi + +if test "x$with_mpfr_include" != x; then + mpfrlib="-lmpfr" + mpfrinc="-I$with_mpfr_include" +fi +if test "x$with_mpfr_lib" != x; then + mpfrlib="-L$with_mpfr_lib -lmpfr" +fi + +AC_ARG_WITH(gmp, +[AS_HELP_STRING([--with-gmp=PATH], + [specify prefix directory for the installed GMP package. + Equivalent to --with-gmp-include=PATH/include + plus --with-gmp-lib=PATH/lib])]) +AC_ARG_WITH(gmp-include, +[AS_HELP_STRING([--with-gmp-include=PATH], + [specify directory for installed GMP include files])]) +AC_ARG_WITH(gmp-lib, +[AS_HELP_STRING([--with-gmp-lib=PATH], + [specify directory for the installed GMP library])]) + + +if test "x$with_gmp" != x; then + mpfrlib="$mpfrlib -L$with_gmp/lib -lgmp" + mpfrinc="$mpfrinc -I$with_gmp/include" +fi +if test "x$with_gmp_include" != x; then + mpfrlib="$mpfrlib -lgmp" + mpfrinc="$mpfrinc -I$with_gmp_include" +fi +if test "x$with_gmp_lib" != x; then + mpfrlib="$mpfrlib -L$with_gmp_lib -lgmp" +fi + +if test "x$mpfrlib" != x; then + HAVE_LIBMPFR=yes + AC_SUBST(HAVE_LIBMPFR) + AC_DEFINE(HAVE_LIBMPFR, 1) + LIBMPFR="$mpfrlib" + AC_SUBST(LIBMPFR) + CPPFLAGS="$CPPFLAGS $mpfrinc" fi # --------------------- # |