diff --git a/configure b/configure index 6d30b631f..c93508aa1 100755 --- a/configure +++ b/configure @@ -12028,12 +12028,15 @@ else pthread_ok=no fi +ismingw=no +case "$target_os" in + mingw*) ismingw=yes;; +esac if test $pthread_ok = yes ; then LIBS="$LIBS -lpthread" else - case "$target_os" in - mingw*) - echo "$as_me:$LINENO: checking for pthread_join in -lpthreadGC2" >&5 + if test $ismingw = yes ; then + echo "$as_me:$LINENO: checking for pthread_join in -lpthreadGC2" >&5 echo $ECHO_N "checking for pthread_join in -lpthreadGC2... $ECHO_C" >&6 if test "${ac_cv_lib_pthreadGC2_pthread_join+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12102,11 +12105,11 @@ if test $ac_cv_lib_pthreadGC2_pthread_join = yes; then else pthread_ok=no fi -;; - if test $pthread_ok = yes ; then - LIBS="$LIBS -lpthreadGC2" - fi - esac + + if test $pthread_ok = yes ; then + LIBS="$LIBS -lpthreadGC2" + fi + fi fi if test $pthread_ok = no ; then { { echo "$as_me:$LINENO: error: Unable to find pthread library (needed for thread support)." >&5 diff --git a/configure.ac b/configure.ac index 8ca560587..d3c1507e6 100644 --- a/configure.ac +++ b/configure.ac @@ -838,16 +838,19 @@ if test $ac_cv_header_pthread_h = no ; then AC_MSG_ERROR([Unable to find pthread.h (needed for thread support).]) fi AC_CHECK_LIB(pthread, pthread_join, pthread_ok=yes, pthread_ok=no) +ismingw=no +case "$target_os" in + mingw*) ismingw=yes;; +esac if test $pthread_ok = yes ; then LIBS="$LIBS -lpthread" else - case "$target_os" in - mingw*) - AC_CHECK_LIB(pthreadGC2, pthread_join, pthread_ok=yes, pthread_ok=no);; - if test $pthread_ok = yes ; then - LIBS="$LIBS -lpthreadGC2" - fi - esac + if test $ismingw = yes ; then + AC_CHECK_LIB(pthreadGC2, pthread_join, pthread_ok=yes, pthread_ok=no) + if test $pthread_ok = yes ; then + LIBS="$LIBS -lpthreadGC2" + fi + fi fi if test $pthread_ok = no ; then AC_MSG_ERROR([Unable to find pthread library (needed for thread support).])