[1/2] Check for gmp when checking for mpfr

Message ID 20180916184502.19617-2-tom@tromey.com
State New
Headers show
Series
  • two small configure patches
Related show

Commit Message

Tom Tromey Sept. 16, 2018, 6:45 p.m.
There was a report on irc that the gdb check for mpfr failed when only
static libraries are available.  The issue is that mpfr depends on
gmp, but this is not handled explicitly by gdb.

Ideally upstream would switch to pkg-config.  Or even more ideally, we
would incorporate pkg-config into the compiler and not mess with any
of this.

Meanwhile, this changes gdb's configure to add gmp to the link line
when checking for mpfr.

ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
	* configure.ac: Use gmp as a library dependency when checking for
	mpfr.
---
 gdb/ChangeLog    | 6 ++++++
 gdb/configure    | 2 +-
 gdb/configure.ac | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Joel Brobecker Sept. 17, 2018, 6:18 p.m. | #1
Hi Tom,

On Sun, Sep 16, 2018 at 12:45:01PM -0600, Tom Tromey wrote:
> There was a report on irc that the gdb check for mpfr failed when only

> static libraries are available.  The issue is that mpfr depends on

> gmp, but this is not handled explicitly by gdb.

> 

> Ideally upstream would switch to pkg-config.  Or even more ideally, we

> would incorporate pkg-config into the compiler and not mess with any

> of this.

> 

> Meanwhile, this changes gdb's configure to add gmp to the link line

> when checking for mpfr.

> 

> ChangeLog

> 2018-09-16  Tom Tromey  <tom@tromey.com>

> 

> 	* configure: Rebuild.

> 	* configure.ac: Use gmp as a library dependency when checking for

> 	mpfr.


Thanks for the patch. This looks good to me.

-- 
Joel

Patch

diff --git a/gdb/configure b/gdb/configure
index d92a256f1ff..e011b77414b 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -9837,7 +9837,7 @@  fi
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
-  names_next_round='mpfr '
+  names_next_round='mpfr gmp'
   while test -n "$names_next_round"; do
     names_this_round="$names_next_round"
     names_next_round=
diff --git a/gdb/configure.ac b/gdb/configure.ac
index e38604cb656..f658da84e32 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -682,7 +682,7 @@  if test "${with_mpfr}" = no; then
   AC_MSG_WARN([MPFR support disabled; some features may be unavailable.])
   HAVE_LIBMPFR=no
 else
-  AC_LIB_HAVE_LINKFLAGS([mpfr], [], [#include <mpfr.h>],
+  AC_LIB_HAVE_LINKFLAGS([mpfr], [gmp], [#include <mpfr.h>],
 			[mpfr_exp_t exp; mpfr_t x;
 			 mpfr_frexp (&exp, x, x, MPFR_RNDN);])
   if test "$HAVE_LIBMPFR" != yes; then