aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/configure.ac
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@kugelworks.com>2010-02-23 19:16:16 +0000
committerMaxim Kuvyrkov <maxim@kugelworks.com>2010-02-23 19:16:16 +0000
commit193f13e68b77064505b955acb2fabf322475ca46 (patch)
tree00f6473d4d34a36f5054ffed7a7151f5a193d31f /gdb/gdbserver/configure.ac
parent56adecf405963c4b283d0b8297236525ab5f374a (diff)
downloadgdb-193f13e68b77064505b955acb2fabf322475ca46.zip
gdb-193f13e68b77064505b955acb2fabf322475ca46.tar.gz
gdb-193f13e68b77064505b955acb2fabf322475ca46.tar.bz2
* configure.ac: Check for libdl. If it is not available link against
static libthread_db. * configure: Regenerate.
Diffstat (limited to 'gdb/gdbserver/configure.ac')
-rw-r--r--gdb/gdbserver/configure.ac27
1 files changed, 20 insertions, 7 deletions
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 638c228..f862918 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -175,17 +175,27 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then
BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
fi
+dnl Check for libdl, but do not add it to LIBS as only gdbserver
+dnl needs it (and gdbreplay doesn't).
+old_LIBS="$LIBS"
+AC_CHECK_LIB(dl, dlopen)
+LIBS="$old_LIBS"
+
srv_thread_depfiles=
srv_libs=
USE_THREAD_DB=
if test "$srv_linux_thread_db" = "yes"; then
- srv_libs="-ldl"
- old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -rdynamic"
- AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])
- AC_SUBST(RDYNAMIC)
- LDFLAGS="$old_LDFLAGS"
+ if test "$ac_cv_lib_dl_dlopen" = "yes"; then
+ srv_libs="-ldl"
+ old_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -rdynamic"
+ AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])
+ AC_SUBST(RDYNAMIC)
+ LDFLAGS="$old_LDFLAGS"
+ else
+ srv_libs="-lthread_db"
+ fi
srv_thread_depfiles="thread-db.o proc-service.o"
USE_THREAD_DB="-DUSE_THREAD_DB"
@@ -201,10 +211,13 @@ fi
AC_ARG_WITH(libthread-db,
AS_HELP_STRING([--with-libthread-db=PATH], [use given libthread_db directly]),
[srv_libthread_db_path="${withval}"
- AC_DEFINE(USE_LIBTHREAD_DB_DIRECTLY, 1, [Define if we should use libthread_db directly.])
srv_libs="$srv_libthread_db_path"
])
+if test "$srv_libs" != "" -a "$srv_libs" != "-ldl"; then
+ AC_DEFINE(USE_LIBTHREAD_DB_DIRECTLY, 1, [Define if we should use libthread_db directly.])
+fi
+
if test "$srv_xmlfiles" != ""; then
srv_xmlbuiltin="xml-builtin.o"
AC_DEFINE(USE_XML, 1, [Define if an XML target description is available.])