This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix --enable-plugins --without-python
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 4 Nov 2010 15:51:49 -1000
- Subject: Re: [patch] Fix --enable-plugins --without-python
- References: <20101017104101.GA9276@host1.dyn.jankratochvil.net> <20101102184341.GF2492@adacore.com>
On Tue, 02 Nov 2010 08:43:41 -1000, Joel Brobecker wrote:
> Grumpf! It would be nice if BFD was telling us which libraries we need
> to link against bfd, just as Gtk+, Python, etc, do.
I agree we should port the sourceware tree to pkg-config. :-)
> I'm a little concern that this is a bit primitive, and good enough only
> on GNU/Linux or maybe Unix. Or rather, that this might break the build
> on some platforms such as Windows. But that's not the case, since
> the user would need to use --enable-plugins to enable plugins (it's
> not automatic), so I don't see a better solution that's actually
> worth the effort.
bfd/Makefile.am also just adds `-ldl' (into *_LIBADD) so while I do not
understand what everything is emulated on these non-UNIX platforms I guess it
is either broken for --enable-plugins already even for bfd/ or it should work
even in gdb/ .
> A comment explaining the dependency would be nice (likewise below).
Done.
Checked-in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2010-11/msg00028.html
--- src/gdb/ChangeLog 2010/11/05 01:40:27 1.12297
+++ src/gdb/ChangeLog 2010/11/05 01:50:17 1.12298
@@ -1,5 +1,11 @@
2010-11-05 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Fix configure --enable-plugins --without-python.
+ * configure.ac (for ELF support in BFD) <"$plugins" = "yes">: New.
+ * configure: Regenerate.
+
+2010-11-05 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* solib.c (solib_read_symbols): Call exception_fprintf even without
FROM_TTY. Print also so->so_name.
--- src/gdb/configure 2010/10/06 16:02:43 1.318
+++ src/gdb/configure 2010/11/05 01:50:17 1.319
@@ -14937,6 +14937,10 @@
CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
LDFLAGS="$LDFLAGS -L../bfd -L../libiberty"
intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
+# -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
+if test "$plugins" = "yes"; then
+ LIBS="-ldl $LIBS"
+fi
LIBS="-lbfd -liberty $intl $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5
$as_echo_n "checking for ELF support in BFD... " >&6; }
@@ -14972,6 +14976,10 @@
$as_echo "#define HAVE_ELF 1" >>confdefs.h
+ # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
+ if test "$plugins" = "yes"; then
+ OLD_LIBS="-ldl $OLD_LIBS"
+ fi
fi
CFLAGS=$OLD_CFLAGS
LDFLAGS=$OLD_LDFLAGS
--- src/gdb/configure.ac 2010/10/06 16:02:43 1.132
+++ src/gdb/configure.ac 2010/11/05 01:50:18 1.133
@@ -1838,6 +1838,10 @@
CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
LDFLAGS="$LDFLAGS -L../bfd -L../libiberty"
intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
+# -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
+if test "$plugins" = "yes"; then
+ LIBS="-ldl $LIBS"
+fi
LIBS="-lbfd -liberty $intl $LIBS"
AC_CACHE_CHECK([for ELF support in BFD], gdb_cv_var_elf,
[AC_TRY_LINK(
@@ -1851,6 +1855,10 @@
CONFIG_OBS="$CONFIG_OBS elfread.o"
AC_DEFINE(HAVE_ELF, 1,
[Define if ELF support should be included.])
+ # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
+ if test "$plugins" = "yes"; then
+ OLD_LIBS="-ldl $OLD_LIBS"
+ fi
fi
CFLAGS=$OLD_CFLAGS
LDFLAGS=$OLD_LDFLAGS