mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
m4: add check for pthread library
When we get rid of GNULIB, we need to check for -lpthread support. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
c7aac54bc1
commit
f691ec63b4
@ -18,20 +18,24 @@ dnl <http://www.gnu.org/licenses/>.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LIBVIRT_CHECK_PTHREAD], [
|
||||
old_LIBS="$LIBS"
|
||||
dnl Availability of pthread functions
|
||||
|
||||
dnl Availability of pthread functions. Because of $LIB_PTHREAD, we
|
||||
dnl cannot use AC_CHECK_FUNCS_ONCE. LIB_PTHREAD and LIBMULTITHREAD
|
||||
dnl were set during gl_INIT by gnulib.
|
||||
LIBS="$LIBS $LIB_PTHREAD $LIBMULTITHREAD"
|
||||
pthread_found=yes
|
||||
AC_CHECK_FUNCS([pthread_mutexattr_init])
|
||||
AC_CHECK_HEADER([pthread.h],,[pthread_found=no])
|
||||
AC_SEARCH_LIBS([pthread_mutexattr_init],[pthread ""])
|
||||
|
||||
if test "$ac_cv_func_pthread_mutexattr_init:$pthread_found" != "yes:yes"
|
||||
if test "$ac_cv_func_pthread_mutexattr_init" = "no"
|
||||
then
|
||||
AC_MSG_ERROR([A pthreads impl is required for building libvirt])
|
||||
AC_MSG_ERROR([libpthread is required for building libvirt])
|
||||
fi
|
||||
THREAD_LIBS=""
|
||||
if test "x$ac_cv_func_pthread_mutexattr_init" != "x"
|
||||
then
|
||||
THREAD_LIBS="-l$ac_cv_func_pthread_mutexattr_init"
|
||||
fi
|
||||
AC_SUBST([THREAD_LIBS])
|
||||
|
||||
AC_CHECK_HEADER([pthread.h],,[
|
||||
AC_MSG_ERROR([pthread.h is required for building libvirt])
|
||||
])
|
||||
|
||||
dnl At least mingw64-winpthreads #defines pthread_sigmask to 0,
|
||||
dnl which in turn causes compilation to complain about unused variables.
|
||||
@ -51,6 +55,4 @@ AC_DEFUN([LIBVIRT_CHECK_PTHREAD], [
|
||||
AC_DEFINE([FUNC_PTHREAD_SIGMASK_BROKEN], [1],
|
||||
[Define to 1 if pthread_sigmask is not a real function])
|
||||
fi
|
||||
|
||||
LIBS="$old_LIBS"
|
||||
])
|
||||
|
@ -130,8 +130,6 @@ include storage/Makefile.inc.am
|
||||
include remote/Makefile.inc.am
|
||||
|
||||
|
||||
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)
|
||||
|
||||
SECDRIVER_CFLAGS =
|
||||
SECDRIVER_LIBS =
|
||||
if WITH_SECDRIVER_SELINUX
|
||||
|
@ -1506,7 +1506,7 @@ libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
|
||||
|
||||
shunloadtest_SOURCES = \
|
||||
shunloadtest.c
|
||||
shunloadtest_LDADD = $(LIB_PTHREAD) $(DLOPEN_LIBS)
|
||||
shunloadtest_LDADD = $(THREAD_LIBS) $(DLOPEN_LIBS)
|
||||
shunloadtest_DEPENDENCIES = libshunload.la
|
||||
|
||||
sysinfotest_SOURCES = \
|
||||
|
Loading…
Reference in New Issue
Block a user