configure.ac: use AC_CHECK_FUNCS for pthread_setname_np()

Don't assume "-lpthread".  Just use PTHREAD_CFLAGS, as determined by
AX_PTHREAD.
This commit is contained in:
Max Kellermann 2014-12-09 20:15:35 +01:00
parent 7a1e026bb5
commit 8583689fa4
1 changed files with 2 additions and 6 deletions

View File

@ -198,12 +198,8 @@ LIBS="$PTHREAD_LIBS $LIBS"
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
AM_CXXFLAGS="$AM_CXXFLAGS $PTHREAD_CFLAGS" AM_CXXFLAGS="$AM_CXXFLAGS $PTHREAD_CFLAGS"
AC_CHECK_LIB([pthread], [pthread_setname_np], MPD_WITH_LIBRARY([PTHREAD],
[have_pthread_setname_np=yes], [AC_CHECK_FUNCS([pthread_setname_np])])
[have_pthread_setname_np=no])
if test x$have_pthread_setname_np = xyes; then
AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [Is pthread_setname_np() available?])
fi
AC_SEARCH_LIBS([clock_gettime], [rt]) AC_SEARCH_LIBS([clock_gettime], [rt])