From 701e9e9afb88bdc68c84a4611adc533400a3df36 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 4 Oct 2022 11:24:57 -0700 Subject: Use same pthread-stubs as libxcb Avoid conflicts when libX11 calls libxcb and gets its pthread functions overriding our ancient stubs. v2: Keep linking with real threads libraries when thread safety constructor is enabled. Signed-off-by: Alan Coopersmith --- configure.ac | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 31fe60b3..3cf7f602 100644 --- a/configure.ac +++ b/configure.ac @@ -243,13 +243,16 @@ AC_SUBST(XTHREADLIB) AC_SUBST(XTHREAD_CFLAGS) if test "x$USE_THREAD_SAFETY_CONSTRUCTOR" = "xyes"; then - USE_THREAD_LIBS="$XTHREADLIB" + USE_THREAD_LIBS="$XTHREADLIB" +else + # This should be kept in sync with libxcb + case $host_os in + linux*|darwin*|solaris*) ;; + *) X11_REQUIRES="$X11_REQUIRES pthread-stubs" ;; + esac fi AC_SUBST(USE_THREAD_LIBS) -AC_CHECK_LIB(c, pthread_self, [thrstubs="no"], [thrstubs="yes"], [$USE_THREAD_LIBS]) -AM_CONDITIONAL(THRSTUBS, test x$thrstubs = xyes) - AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], ) # @@ -443,7 +446,6 @@ echo " Loadable xcursor library support: "$XLIB_LOADABLE_XCURSOR echo " Threading support: "$xthreads echo " Use Threads safe API: "$mtsafeapi echo " Use thread safety constructor: "$USE_THREAD_SAFETY_CONSTRUCTOR -echo " Threads stubs in libX11: "$thrstubs echo " XCMS: "$XCMS echo " Internationalization support: "$XLOCALE echo " XF86BigFont support: "$XF86BIGFONT -- cgit v1.2.1