[vlc-commits] Fix thread library check

Rafaël Carré git at videolan.org
Tue Nov 29 01:14:41 CET 2011


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Nov 28 19:12:10 2011 -0500| [7778302ef843ff938e957ce175048c27f4738f85] | committer: Rafaël Carré

Fix thread library check

Don't use ac_cv_search cached value because it could contain
"no" or "none required" which aren't valid link flags

AC_CHECK_LIB(main, xxx) did not exactly search for main symbol, it
searched for the presence of the library.
Instead we look for a required symbol.

We don't use e.g. pthread_mutex_lock because some pthread symbols
are available in glibc, but not all.

Not finding pthread library is not an error, because at least OS/2 and
symbian don't need it. (We skip the check on Windows already)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7778302ef843ff938e957ce175048c27f4738f85
---

 configure.ac |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index bf6e47c..b37e897 100644
--- a/configure.ac
+++ b/configure.ac
@@ -633,11 +633,11 @@ VLC_ADD_LIBS([realvideo lua],[$LIBDL])
 
 dnl Check for thread library
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
+
   VLC_SAVE_FLAGS
-  AC_SEARCH_LIBS(main, pthread pthreads c_r, [
-    VLC_ADD_LIBS([libvlccore libvlc vlc plugin],[${ac_cv_search_main}])
-  ], [
-    AC_CHECK_FUNCS(pthread_mutex_lock)
+  LIBS=""
+  AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
+    VLC_ADD_LIBS([libvlccore libvlc vlc plugin],[${LIBS}])
   ])
   VLC_RESTORE_FLAGS
 



More information about the vlc-commits mailing list