Pārlūkot izejas kodu

configure.ac: really fix pthread detection

Nathalie Furmento 12 gadi atpakaļ
vecāks
revīzija
fe8427423b
1 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 8 1
      configure.ac

+ 8 - 1
configure.ac

@@ -146,8 +146,15 @@ esac
 if test x"$enable_native_winthreads" = xyes
 then
     CPPFLAGS+=" -I$STARPU_SRC_DIR/include/pthread_win32 "
+    AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+    	        #include <pthread.h>
+	  	]],
+		[[ pthread_t t; pthread_create(&t, NULL, NULL, NULL); ]])]
+		,,AC_MSG_ERROR([pthread_create unavailable]))
+else
+    AC_CHECK_LIB([pthread], [pthread_create])
 fi
-AC_SEARCH_LIBS([pthread_create],[pthread],,AC_MSG_ERROR([pthread library unavailable]))
 
 AC_SEARCH_LIBS([sqrt],[m],,AC_MSG_ERROR([math library unavailable]))
 AC_HAVE_LIBRARY([ws2_32])