[monitoring-plugins] configure.ac: Don't let pthread check depend on OS
Holger Weiss
git at monitoring-plugins.org
Tue Dec 2 01:10:08 CET 2014
Module: monitoring-plugins
Branch: check-disk-thread
Commit: 7082acceb5de96862e92481dfb3a75e0310513c2
Author: Holger Weiss <holger at zedat.fu-berlin.de>
Date: Tue Dec 2 01:03:57 2014 +0100
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=7082acc
configure.ac: Don't let pthread check depend on OS
Don't check the operating system environment to detect the correct
linker flags for using the POSIX thread library.
---
configure.ac | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6dacd4f..a90a9d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,12 @@ AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
AC_SUBST(SOCKETLIBS)
+dnl Check for POSIX thread libraries
+AC_CHECK_HEADERS(pthread.h)
+AC_CHECK_LIB(pthread,pthread_create,THRLIBS="-lpthread",
+ AC_CHECK_LIB(pthread,pthread_create,THRLIBS="-lpthread -lrt",-lrt))
+AC_SUBST(THRLIBS)
+
dnl
dnl check for math-related functions needing -lm
AC_CHECK_HEADERS(math.h)
@@ -544,18 +550,6 @@ else
with_gnutls="no"
fi
-dnl Check for POSIX thread libraries
-AC_CHECK_HEADERS(pthread.h)
-case $host in
- *sun* | *solaris*)
- AC_CHECK_LIB(pthread,pthread_create,THRLIBS="-lpthread -lrt")
- ;;
- *)
- AC_CHECK_LIB(pthread,pthread_create,THRLIBS="-lpthread")
- ;;
-esac
-AC_SUBST(THRLIBS)
-
dnl
dnl Checks for header files.
dnl
More information about the Commits
mailing list