diff --git a/configure.ac b/configure.ac index 3a12a1a..a4474fa 100644 --- a/configure.ac +++ b/configure.ac @@ -31,8 +31,16 @@ fi PKG_CONFIG_LIBS= +ac_save_LIBS="$LIBS" +case "$host" in +*-*-freebsd*) + # pthread_condattr_{init,destroy} is provided from libthr + LIBS="-lthr" + ;; +esac AC_CHECK_FUNCS([pthread_self pthread_mutex_init pthread_mutex_destroy pthread_mutex_lock pthread_mutex_unlock pthread_cond_init pthread_cond_destroy pthread_condattr_init pthread_condattr_destroy pthread_cond_wait pthread_cond_timedwait pthread_cond_signal pthread_cond_broadcast pthread_equal pthread_exit], [], [PKG_CONFIG_LIBS='-L${libdir} -lpthread-stubs']) +LIBS="$ac_save_LIBS" AC_SUBST([PKG_CONFIG_LIBS]) AM_CONDITIONAL(BUILD_LIB, test "x$PKG_CONFIG_LIBS" != x)