X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=acinclude.m4;fp=acinclude.m4;h=9e02d6d922ca24d65225018f111eacaad9acc766;hp=3cff28226989e6287a97b19fe7ec74249b6a7767;hb=53c872512f27bfa786f713fdf858724d6a32feeb;hpb=e1470031b15c6af1dcc78cba7110f0ae04869bec diff --git a/acinclude.m4 b/acinclude.m4 index 3cff282..9e02d6d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -289,6 +289,12 @@ if test "x$acx_pthread_ok" = xyes; then case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) x_rflag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) x_rflag="-D_REENTRANT";; + *-linux*) + if test x"$PTHREAD_CFLAGS" = "x-pthread"; then + # For Linux/gcc "-pthread" implies "-lpthread". We need, however, to make this explicit + # in PTHREAD_LIBS such that a shared library to be built properly depends on libpthread. + PTHREAD_LIBS="-lpthread $PTHREAD_LIBS" + fi;; esac AC_MSG_RESULT(${x_rflag}) if test "x$x_rflag" != xno; then