Re: [pushed/v2 1/9] gdb/configure: Add --with-libgmp-prefix option

Joel Brobecker
2020-11-16T04:24:08Z

Hi Bernd,

> I noticed that this does not allow to build gmp in-tree like it is
> possible for gcc. I tried to overcome this by the attached patch.

Indeed. It's not something I had considered.

> While doing so, I also noticed an incompatibility with the top level
> configure stript, which advertises, and passes -with-gmp-include
> and -with-gmp-lib if in-tree gmp is found.
>
> So the --with-libgmp-prefix is not that the top level configure
> script suggests:
>
> $ ./configure --help | grep gmp
> --with-gmp-dir=PATH this option has been REMOVED
> --with-gmp=PATH specify prefix directory for the installed GMP
> --with-gmp-include=PATH/include plus
> --with-gmp-lib=PATH/lib
> --with-gmp-include=PATH specify directory for installed GMP include files
> --with-gmp-lib=PATH specify directory for the installed GMP library
>
> What do you think, can we allow these traditional configure options
> additional to the new --with-libgmp-prefix?

Can you check if these options are actually used elsewhere in
the binutils-gdb project? The idea I have in the back of my mind
is to see whether we can use the same options as the ones we've been
using in GDB or not. The fact that we have an AC_LIB_HAVE_LINKFLAGS
macro which takes care of handling dependencies for us tells me
that we are transitioning away from the model above where we add
the options "by hand" in configure.ac, and instead rely on the new
macro.

One thing I did note is that GDB has some options for MPFR support
and in particular, it has --with-mpfr:

--with-mpfr include MPFR support (auto/yes/no)

As you can see, the --with-gmp option you propose is not consistent
with the above.

Unfortunately, in digging further, I found that toplevel configure
*also* has --with-mpfr, with a different meaning:

--with-mpfr=PATH specify prefix directory for installed MPFR package.
Equivalent to --with-mpfr-include=PATH/include plus
--with-mpfr-lib=PATH/lib

The way we expect people to configure GDB is to configure it as
part of the binutils-gdb project, so I don't see how GDB's --with-mpfr
could work, unless the top-level configury is more elaborate than
I remembered.

Depending on the above, perhaps it might be better to actually
to change the top-level configury to advertise the --with-gmp-prefix
options instead of adding parallel support for the old-style
options in GDB's configury. And while at it, perhaps start deprecating
the old-style ones in the top-level configury.

One more note: For me, I think we can handle the question of
in-tree building independently of the question of the configury's
options -- which is good, because I think the latterm might require
a bit of discussion.

> Can we the top level Makefile.def change in binutils-gdb or has this
> be checked-in first in gcc?

That's a good question. I *think* that binutils + GDB now have
ownership, but I might be wrong. Hopefully others know better.
If not, I will ask.

> 2020-11-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
>
> * Makefile.def: Prepare for GDB build with intree GMP.
> * Makefile.in: Regenerate.
>
> gdb:
> 2020-11-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
>
> * configure.ac: Add --with-gmp= --with-gmp-include= and --with-gmp-lib=
> for compatibility with top level configure script.
> * configure: Regenerate.

Looking at your patch, I'm wondering how this would all fit together...
Would it all work automatically (like it does for libiconv, I believe),
or where you planning on having to pass --with-gmp options ?

--
Joel