If thread-safety-constructor is enabled, link against pthreads not stubs

Only really makes a difference if pthreads is not in libc.

Fixes: #162

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Alan Coopersmith 2022-09-26 16:01:40 -07:00
parent bfe5d2dd98
commit 1f8fd7ff1c
2 changed files with 9 additions and 3 deletions

View file

@ -222,9 +222,6 @@ xyes)
;;
esac
AC_CHECK_LIB(c, pthread_self, [thrstubs="no"], [thrstubs="yes"])
AM_CONDITIONAL(THRSTUBS, test x$thrstubs = xyes)
# XXX incomplete, please fill this in
if test x$xthreads = xyes ; then
case $host_os in
@ -245,6 +242,14 @@ fi
AC_SUBST(XTHREADLIB)
AC_SUBST(XTHREAD_CFLAGS)
if test "x$USE_THREAD_SAFETY_CONSTRUCTOR" = "xyes"; then
USE_THREAD_LIBS="$XTHREADLIB"
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])], )
#

View file

@ -371,6 +371,7 @@ libX11_la_LIBADD = \
$(USE_I18N_LIBS) \
$(USE_XCMS_LIBS) \
$(USE_XKB_LIBS) \
$(USE_THREAD_LIBS) \
$(X11_LIBS)
preprocess: $(patsubst %.c,%.ii,$(libX11_la_SOURCES))