]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Stop 'configure --enable-threading' if std::thread doesn't work
authorPedro Alves <pedro@palves.net>
Tue, 14 May 2024 14:43:41 +0000 (15:43 +0100)
committerPedro Alves <pedro@palves.net>
Thu, 16 May 2024 12:03:58 +0000 (13:03 +0100)
commit3e09762b7d1243d7d75c885537f67fa66416bb8b
tree7e62d0c08c6d4bff3003345f106a0a140d05f231
parentf01ae0392ed9e7012ae33fdcf972ee4508fb7db2
Stop 'configure --enable-threading' if std::thread doesn't work

Currently, if you configure gdb with explicit --enable-threading, but
then configure detects std::thread does not work, configure silently
disables threading support and continues configuring.

This patch makes that scenario cause a configuration error, like so:

 $ /home/pedro/gdb/src/configure --enable-threading && make
 ...
 configure: error: std::thread does not work; disable threading
 make[1]: *** [Makefile:11225: configure-gdbsupport] Error 1
 make[1]: Leaving directory '/home/pedro/gdb/build-windows-threads'
 make: *** [Makefile:1041: all] Error 2
 $

Additionally, if you don't explicitly pass --enable-threading, and
std::thread does not work, we will now get a warning (and the build
continues):

 $ /home/pedro/gdb/src/configure && make
 ...
 configure: WARNING: std::thread does not work; disabling threading
 ...

This is similar to how we handle --enable-tui and missing curses.  The
code and error/warning messages were borrowed from there.

Change-Id: I73a8b580d1e2a796b23136920c0e181408ae1b22
Approved-By: Tom Tromey <tom@tromey.com>
gdb/configure
gdbserver/configure
gdbsupport/common.m4
gdbsupport/configure