* acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area. Reset
[external/binutils.git] / gdb / gdbserver / acinclude.m4
1 dnl gdb/gdbserver/configure.in uses BFD_HAVE_SYS_PROCFS_TYPE.
2 sinclude(../../bfd/acinclude.m4)
3
4 AC_DEFUN([SRV_CHECK_THREAD_DB],
5 [AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db],
6  [old_LIBS="$LIBS"
7   LIBS="$LIBS -lthread_db"
8   AC_TRY_LINK(
9   [void ps_pglobal_lookup() {}
10    void ps_pdread() {}
11    void ps_pdwrite() {}
12    void ps_lgetregs() {}
13    void ps_lsetregs() {}
14    void ps_lgetfpregs() {}
15    void ps_lsetfpregs() {}
16    void ps_get_thread_area() {}
17    void ps_getpid() {}],
18   [td_ta_new();],
19   [srv_cv_thread_db="-lthread_db"],
20   [srv_cv_thread_db=no
21
22  if test "$prefix" = "/usr" || test "$prefix" = "NONE"; then
23   thread_db="/lib/libthread_db.so.1"
24  else
25   thread_db='$prefix/lib/libthread_db.so.1'
26  fi
27  LIBS="$old_LIBS `eval echo "$thread_db"`"
28  AC_TRY_LINK(
29   [void ps_pglobal_lookup() {}
30    void ps_pdread() {}
31    void ps_pdwrite() {}
32    void ps_lgetregs() {}
33    void ps_lsetregs() {}
34    void ps_lgetfpregs() {}
35    void ps_lsetfpregs() {}
36    void ps_get_thread_area() {}
37    void ps_getpid() {}],
38   [td_ta_new();],
39   [srv_cv_thread_db="$thread_db"],
40   [srv_cv_thread_db=no])
41   ]])
42  LIBS="$old_LIBS"
43 )])