gdb: use libtool in GDB_AC_CHECK_BFD
The GDB_AC_CHECK_BFD macro defined in gdb/acinclude.m4 uses the
AC_LINK_IFELSE autoconf macro in order to link a simple program to
check features of libbfd.
If libbfd's link dependencies change, it was necessary to reflect them
either in the definition of the macro, or as a consequence of checking
for them with an autoconf macro resulting in an addition to LIBS.
This patch modifies the definition of the GDB_CHECK_BFD macro in order
to use libtool to perform the test link. This makes it possible to
not have to list dependencies of libbfd (which are indirect to GDB) at
all.
After this patch:
configure:28553: checking for ELF support in BFD
configure:28573: ./libtool --quiet --mode=link gcc -o conftest \
-I../../gdb/../include -I../bfd \
-I../../gdb/../bfd -g -O2 \
-L../bfd -L../libiberty conftest.c -lbfd -liberty \
-lncursesw -lm -ldl >&5
configure:28573: $? = 0
configure:28583: result: yes
Tests performed:
- Configure --with-system-zlib and --without-system-zlib.
- Check link dependencies of installed GDB with both --enable-shared
and --disable-shared.
- Run installed GDB in both cases.
Approved-By: Simon Marchi <simon.marchi@efficios.com>