Bug 27762 - configure does not honor --with-mpfr=
Summary: configure does not honor --with-mpfr=
Status: RESOLVED DUPLICATE of bug 28500
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: 10.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2021-04-21 15:26 UTC by Mario Klebsch
Modified: 2022-03-06 16:09 UTC (History)
1 user (show)

See Also:
Last reconfirmed: 2022-03-06 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Mario Klebsch 2021-04-21 15:26:51 UTC
I built mpc and libmpr as static libraries and installed them into a temprary location.

I passed --with-mpfr=/... and  --with-mpc=/... to configure.

I expected the build process to pick up the static libraries provided at the given locations.

But the resulting binary uses the shared libraries insalled in /lib64. 

gdb/Makefile was written with this line:

LIBMPFR = -lmpfr -lgmp

I configured and build gcc with the same options, and gcc uses the static libraries. In the gcc build directory gcc/Makefile contains the following line:

GMPLIBS = -L/.../lib -L/.../lib -L/.../lib -lmpc -lmpfr -lgmp

The difference is, that gcc's configure added -L options with the path of the static libraries.

The config.log does contain a setting with -L options:
gmplibs='-L/.../lib -L/.../lib -L/.../lib -lmpc -lmpfr -lgmp'

but this setting is not used when building gdb. :-(

I just found, that there also is a config.log in the gdb subdirectory. I see, that  '--with-gmp=/...' '--with-mpfr=/...' were passed tot he sub-configure.

But I see, that this path is not used:

configure:10086: checking whether to use MPFR
configure:10088: result: /...
configure:10521: checking for libmpfr
configure:10541: gcc -o conftest -g -O2    conftest.c -ltinfow -lncursesw -lm -ldl  -lmpfr -lgmp >&5
configure:10541: $? = 0
configure:10551: result: yes
configure:10558: checking how to link with libmpfr
configure:10560: result: -lmpfr -lgmp

It just detects the system-supplied mpfr and don't use the one, that I selected on configures command line. :-(
Comment 1 Tom Tromey 2022-03-06 16:00:48 UTC
I don't think gdb uses mpc.

For mpfr, it seems to be the same issue as bug#28500: gdb
has a different set of options from the top level.

prentzel. ./configure --help|grep mpfr
  --with-mpfr-dir=PATH    this option has been REMOVED
  --with-mpfr=PATH        specify prefix directory for installed MPFR package.
                          Equivalent to --with-mpfr-include=PATH/include plus
  --with-mpfr-lib=PATH    specify directory for the installed MPFR library
prentzel. ./gdb/configure --help|grep mpfr
  --with-mpfr             include MPFR support (auto/yes/no)
  --with-libmpfr-prefix[=DIR]  search for libmpfr in DIR/include and DIR/lib
  --without-libmpfr-prefix     don't search for libmpfr in includedir and libdir
  --with-libmpfr-type=TYPE     type of library to search for (auto/static/shared)

Try using the ones reported by gdb - I think that may work.
I tend to think standardizing the options here would be good,
but there are some caveats & problems in this thread

Comment 2 Tom Tromey 2022-03-06 16:09:31 UTC
I'm arbitrarily picking one bug as the canonical one.

*** This bug has been marked as a duplicate of bug 28500 ***