diff --git a/configure b/configure index 34398bc18cda..e2e98c37d1e5 100755 --- a/configure +++ b/configure @@ -8833,9 +8833,14 @@ fi # build of the Rust frontend in case a dep is missing. missing_rust_dynlibs=none -save_LIBS="$LIBS" -LIBS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +case "${target}" in + *-*-mingw*) + CRAB1_LIBS="-lkernel32 -luser32 -lmsvcrt -lmingwex -lmingw32 -lmingwex" + ;; + *) + save_LIBS="$LIBS" + LIBS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 @@ -8891,7 +8896,7 @@ if test "$ac_res" != no; then : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } if ${ac_cv_search_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 @@ -8947,8 +8952,10 @@ if test "$ac_res" != no; then : fi -CRAB1_LIBS="$LIBS" -LIBS="$save_LIBS" + CRAB1_LIBS="$LIBS" + LIBS="$save_LIBS" + ;; +esac if test "$ac_cv_search_dlopen" = no; then missing_rust_dynlibs="libdl" diff --git a/configure.ac b/configure.ac index 98c73a4f3534..dfea441a40f2 100644 --- a/configure.ac +++ b/configure.ac @@ -2042,12 +2042,19 @@ AC_SUBST(PICFLAG) # build of the Rust frontend in case a dep is missing. missing_rust_dynlibs=none -save_LIBS="$LIBS" -LIBS= -AC_SEARCH_LIBS([dlopen], [dl]) -AC_SEARCH_LIBS([pthread_create], [pthread]) -CRAB1_LIBS="$LIBS" -LIBS="$save_LIBS" +case "${target}" in + *-*-mingw*) + CRAB1_LIBS="-lkernel32 -luser32 -lmsvcrt -lmingwex -lmingw32 -lmingwex" + ;; + *) + save_LIBS="$LIBS" + LIBS= + AC_SEARCH_LIBS([dlopen], [dl]) + AC_SEARCH_LIBS([pthread_create], [pthread]) + CRAB1_LIBS="$LIBS" + LIBS="$save_LIBS" + ;; +esac if test "$ac_cv_search_dlopen" = no; then missing_rust_dynlibs="libdl"