Add configure check for std::thread
authorTom Tromey <tom@tromey.com>
Fri, 15 Mar 2019 23:38:06 +0000 (17:38 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 26 Nov 2019 21:02:57 +0000 (14:02 -0700)
commit5e03027845ecc877621ea71bc342a30ecf2999ff
treed336c27969b6e4c6ca9d14be8becb15ed7d4cfa2
parent5a79c10755d00b71b33b8715e5a665bfd78c9222
Add configure check for std::thread

This adds a configure check for std::thread.  This is needed because
std::thread is not available on some systems, like some versions of
mingw and DJGPP.

This also adds configury to make sure that a threaded gdb links
against the correct threading library (-lpthread or the like), and
passes the right flags (e.g., -pthread) to the compilations.

Note that this also links gdbserver against the thread library.  This
is not strictly necessary at this point in the series, but a later
patch will change gdbsupport to use pthread_sigmask, at which point
this will be needed.

gdb/ChangeLog
2019-11-26  Tom Tromey  <tom@tromey.com>

* acinclude.m4: Include ax_pthread.m4.
* Makefile.in (PTHREAD_CFLAGS, PTHREAD_LIBS): New variables.
(INTERNAL_CFLAGS_BASE): Use PTHREAD_CFLAGS.
(CLIBS): Use PTHREAD_LIBS.
(aclocal_m4_deps): Add ax_pthread.m4.
* config.in, configure: Rebuild.
* gdbsupport/common.m4 (GDB_AC_COMMON): Check for std::thread.

gdb/gdbserver/ChangeLog
2019-11-26  Tom Tromey  <tom@tromey.com>

* Makefile.in (PTHREAD_CFLAGS, PTHREAD_LIBS): New variables.
(INTERNAL_CFLAGS_BASE): Use PTHREAD_CFLAGS.
(GDBSERVER_LIBS): Use PTHREAD_LIBS.
* acinclude.m4: Include ax_pthread.m4.
* config.in, configure: Rebuild.

Change-Id: I00ec55db6077f2615421a93461fc3be57e916aa0
gdb/ChangeLog
gdb/Makefile.in
gdb/acinclude.m4
gdb/config.in
gdb/configure
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/acinclude.m4
gdb/gdbserver/config.in
gdb/gdbserver/configure
gdb/gdbsupport/common.m4