From 12dce926a1dd924788a8f40b4a360e453a914d66 Mon Sep 17 00:00:00 2001
From: Tim Wickberg <tim@schedmd.com>
Date: Mon, 28 Jan 2019 23:58:47 -0700
Subject: [PATCH] Skip ACX_PTHREAD tests on macOS.

macOS always has these available without setting -pthread, and ACX_PTHREAD
does not work properly on macOS at the moment.
---
 configure    |  6 ++++++
 configure.ac | 10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 697f8910d24..ec5bb133459 100755
--- a/configure
+++ b/configure
@@ -19704,6 +19704,10 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+case "$host" in
+*-darwin*)
+	;;
+*)
 
 
 ac_ext=c
@@ -20115,6 +20119,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+	;;
+esac
 
 LDFLAGS="$LDFLAGS "
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
diff --git a/configure.ac b/configure.ac
index 9bd6f56caf3..852ac37df04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,7 +181,15 @@ AC_CHECK_FUNCS( \
 
 AC_CHECK_DECLS([hstrerror, strsignal, sys_siglist])
 
-ACX_PTHREAD([], AC_MSG_ERROR([Error: Cannot figure out how to use pthreads!]))
+dnl Skip pthread checks on macOS as support is always enabled,
+dnl and ACX_PTHREAD will inject flags that will throw spurious warnings.
+case "$host" in
+*-darwin*)
+	;;
+*)
+	ACX_PTHREAD([], AC_MSG_ERROR([Error: Cannot figure out how to use pthreads!]))
+	;;
+esac
 
 LDFLAGS="$LDFLAGS "
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-- 
GitLab