Browse Source

Export -lpthread link flag

So that STARPU_PTHREAD_CREATE etc. can link if applications use them.
Samuel Thibault 4 years ago
parent
commit
f4f0356e2d
1 changed files with 5 additions and 2 deletions
  1. 5 2
      configure.ac

+ 5 - 2
configure.ac

@@ -738,7 +738,10 @@ if test x"$enable_native_winthreads" = xyes ; then
 		AC_DEFINE(STARPU_NATIVE_WINTHREADS,[1],[Using native windows threads]),
 		AC_DEFINE(STARPU_NATIVE_WINTHREADS,[1],[Using native windows threads]),
 		AC_MSG_ERROR([pthread_create unavailable]))
 		AC_MSG_ERROR([pthread_create unavailable]))
 else
 else
-    AC_CHECK_LIB([pthread], [pthread_create])
+    AC_CHECK_LIB([pthread], [pthread_create], [
+        LIBS="$LIBS -lpthread"
+        STARPU_EXPORTED_LIBS="$STARPU_EXPORTED_LIBS -lpthread"
+    ])
 fi
 fi
 
 
 AC_SEARCH_LIBS([sqrt],[m],,AC_MSG_ERROR([math library unavailable]))
 AC_SEARCH_LIBS([sqrt],[m],,AC_MSG_ERROR([math library unavailable]))
@@ -3486,7 +3489,7 @@ if test "x$enable_shared" = xno; then
         # No .so, so application will unexpected have to know which -l to
         # No .so, so application will unexpected have to know which -l to
         # use. Give them in .pc file.
         # use. Give them in .pc file.
 	AC_DEFINE(STARPU_STATIC_ONLY, [1], [Only static compilation was made])
 	AC_DEFINE(STARPU_STATIC_ONLY, [1], [Only static compilation was made])
-	STARPU_EXPORTED_LIBS="$LDFLAGS $LIBS $LIBSTARPU_LDFLAGS"
+	STARPU_EXPORTED_LIBS="$STARPU_EXPORTED_LIBS $LDFLAGS $LIBS $LIBSTARPU_LDFLAGS"
 fi
 fi
 AC_SUBST(STARPU_EXPORTED_LIBS)
 AC_SUBST(STARPU_EXPORTED_LIBS)