diff options
Diffstat (limited to 'gdb/configure.ac')
-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 # --------------------- # |