Browse Source

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.
Holger Weiss 11 years ago
parent
commit
d8aa54fe65
1 changed files with 6 additions and 12 deletions
  1. 6 12
      configure.ac

+ 6 - 12
configure.ac

@@ -161,6 +161,12 @@ AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
 AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
 AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
 AC_SUBST(SOCKETLIBS)
 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
 dnl check for math-related functions needing -lm
 dnl check for math-related functions needing -lm
 AC_CHECK_HEADERS(math.h)
 AC_CHECK_HEADERS(math.h)
@@ -560,18 +566,6 @@ else
 	with_gnutls="no"
 	with_gnutls="no"
 fi
 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
 dnl Checks for header files.
 dnl Checks for header files.
 dnl
 dnl