Use -pthread flag and simplify pthread build logic

Sometimes -lpthread is not enough. This has caused build failures on
Gentoo Linux in the past.

The logic also seems needlessly complex. We check for HAVE_PTHREAD on
UNIX platforms even though CMake errors out if pthreads are not
found. Similarly, we have a fallback for HAVE_PTHREAD_SIGNAL being
false even though we always set it to true.
This commit is contained in:
James Le Cuirot
2020-03-10 21:10:48 +00:00
parent e8d7cd3f10
commit a0b3124f80
4 changed files with 5 additions and 29 deletions

View File

@@ -55,12 +55,6 @@
/* Define if you have a POSIX `sigwait` function. */
#cmakedefine HAVE_POSIX_SIGWAIT ${HAVE_POSIX_SIGWAIT}
/* Define if you have POSIX threads libraries and header files. */
#cmakedefine HAVE_PTHREAD ${HAVE_PTHREAD}
/* Define if you have `pthread_sigmask` and `pthread_kill` functions. */
#cmakedefine HAVE_PTHREAD_SIGNAL ${HAVE_PTHREAD_SIGNAL}
/* Define if your compiler defines socklen_t. */
#cmakedefine HAVE_SOCKLEN_T ${HAVE_SOCKLEN_T}