Re: [PATCH v2] Enable GDB build with in-tree GMP and MPFR

Tom Tromey
2020-12-14T21:35:12Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> So with this patch, we now have:

Simon> --with-gmp-include=DIR GMP include directory
Simon> --with-gmp-lib=DIR GMP lib directory
Simon> --with-gmp=DIR GMP install directory
Simon> --with-libgmp-prefix[=DIR] search for libgmp in DIR/include and DIR/lib
Simon> --without-libgmp-prefix don't search for libgmp in includedir and libdir

Simon> I think that's getting a bit confusing. That's too many ways to set gmp
Simon> paths, with -with-libgmp-prefix and --with-gmp doing the same thing.

FWIW we have the same situation with MPFR.

Simon> It might mean that we have to stop using AC_LIB_HAVE_LINKFLAGS
Simon> though, or customize it.

Yes. Perhaps alternatively we could promote its use to the top level.
It's maybe a pain to do that.

Simon> An alternative to downloading the pre-requisites would be to check them
Simon> in the repo. We do it for readline already: there is a copy in the
Simon> repo, which is used by default, but you can specify
Simon> --with-system-readline if you want to use the system's readline. We
Simon> could do the same with gmp and mpfr. The downside is that we deviate a
Simon> bit from how gcc does, the the upside is that it's simpler, IMO.

For me the main difference here is that, historically, we've had to
patch readline. In cases where GDB has never needed to patch a
dependency (libiconv comes to mind), we've haven't bothered.

Tom