Skip to content

Commit

Permalink
BUILD: Try to link winpthread on MinGW builds
Browse files Browse the repository at this point in the history
This is needed for MinGW builds that implement <thread> using the
libwinpthread wrapper library.
  • Loading branch information
DrMcCoy committed Mar 16, 2019
1 parent 2ba78e0 commit 332d203
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions m4/ax_pthread.m4
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,16 @@ if test "x$ax_pthread_ok" = "xyes"; then
fi
fi
case "$target" in
*mingw*)
AC_CHECK_LIB(winpthread, nanosleep, has_winpthread=true, has_winpthread=false)
if test "x$has_winpthread" = xtrue; then
PTHREAD_LIBS="$PTHREAD_LIBS -lwinpthread"
fi
;;
*)
esac;
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
AC_SUBST([PTHREAD_LIBS])
Expand Down

0 comments on commit 332d203

Please sign in to comment.