[PATCH] configure: remove dependencies on gmp and mpfr when gdb is disabled
Clément Chigot
chigot@adacore.com
Tue Jan 3 16:26:15 GMT 2023
On Tue, Jan 3, 2023 at 5:24 PM Andrew Pinski <pinskia@gmail.com> wrote:
>
> On Tue, Jan 3, 2023 at 8:21 AM Clément Chigot <chigot@adacore.com> wrote:
> >
> > Hi Andrew,
> >
> > On Tue, Jan 3, 2023 at 4:59 PM Andrew Pinski <pinskia@gmail.com> wrote:
> > >
> > > On Tue, Jan 3, 2023 at 5:53 AM Clément Chigot <chigot@adacore.com> wrote:
> > > >
> > > > Since 991180627851801f1999d1ebbc0e569a17e47c74, the configure checks
> > > > about GMP and MPFR for gdb builds have been moved to the toplevel
> > > > configure.
> > > > However, it doesn't take into account the --disable-gdb option. Meaning
> > > > that a build without gdb will require these libraries even if not
> > > > needed.
> > >
> > > Here is a much simpler patch and disables the whole check for gmp/mpfr
> > > rather than just disables the error message, it is like the gdbserver
> > > check earlier:
> > > diff --git a/configure.ac b/configure.ac
> > > index 3a1eb0357e5..c184dc27201 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -1585,7 +1585,9 @@ if test -d ${srcdir}/gcc ; then
> > > require_mpc=yes
> > > fi
> > > if test -d ${srcdir}/gdb ; then
> > > - require_gmp=yes
> > > + if test x$enable_gdb = x; then
> > > + require_gmp=yes
> > > + fi
> > > fi
> > >
> > > gmplibs="-lmpfr -lgmp"
> >
> > Indeed, thanks for that.
> >
> > However, it should be "test x$enable_gdb != xno". Otherwise,
> > require_gmp is also disabled when gdb is explicitly enable (with
> > --enable-gdb).
> > But as all the similar patterns are similar to yours, I'm wondering if
> > there isn't something wrong here.
>
> Yes it should be "!= xno". Looking at the other uses of "!= x" they
> are there to test if overriding the other check if they should be
> enabled or disabled so those uses are ok. I just missed that.
Ok thanks for confirming.
Send v2.
Clément
More information about the Binutils
mailing list