diff options
Diffstat (limited to 'm4/odp_pthread.m4')
-rw-r--r-- | m4/odp_pthread.m4 | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/m4/odp_pthread.m4 b/m4/odp_pthread.m4 index ad65f4d1a..ad1ecdff4 100644 --- a/m4/odp_pthread.m4 +++ b/m4/odp_pthread.m4 @@ -9,11 +9,15 @@ AC_DEFUN([ODP_PTHREAD], [ AC_MSG_CHECKING([for pthread support in -pthread]) AC_LANG_PUSH([C]) - PTHEAD_CFLAGS="-pthread" - CFLAGS="$CFLAGS $PTHEAD_CFLAGS" + saved_cflags="$CFLAGS" + saved_ldflags="$LDFLAGS" + PTHREAD_CFLAGS="-pthread" + CFLAGS="$AM_CFLAGS $CFLAGS $PTHREAD_CFLAGS" PTHREAD_LIBS="-pthread" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS" + LDFLAGS="$AM_LDFLAGS $LDFLAGS $PTHREAD_LIBS" AC_TRY_LINK_FUNC([pthread_create], [pthread=yes]) + CFLAGS="$saved_cflags" + LDFLAGS="$saved_ldflags" if test x"$pthread" != "xyes"; then AC_MSG_FAILURE([pthread is not supported]) fi |