[MPlayer-cygwin] pthreads support for mingw32

Gianluigi Tiesi mplayer at netfarm.it
Sun Jun 5 04:13:13 CEST 2005


Sorry I've confused my sources, this patch enable pthreads on win32
using mingw and also adds the --disable-pthreads option

By
-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
diff -NubBr -xCVS -xhelp_mp.h -x'*.a' -x'*.exe' -x'*.o' -xconfigure.log -xconfig.mak -x.cvsignore -xconfig.h -xcodecs.conf.h -xversion.h -x.depend main/configure sherpya/configure
--- main/configure	2005-06-05 04:06:18.373892800 +0200
+++ sherpya/configure	2005-06-05 04:08:58.143630400 +0200
@@ -195,6 +195,7 @@
                             library [autodetect]
   --disable-ftp          Disable ftp support [enabled]
   --disable-vstream      Disable tivo vstream client support [autodetect]
+  --disable-pthreads     Disable Posix threads support [autodetect]
 
 Codecs:
   --enable-gif		 enable gif support [autodetect]
@@ -1472,6 +1473,7 @@
 _gethostbyname2=auto
 _ftp=yes
 _vstream=auto
+_pthreads=yes
 for ac_option do
   case "$ac_option" in
   # Skip 1st pass
@@ -1724,6 +1726,8 @@
   --disable-ftp)        _ftp=no         ;;
   --enable-vstream)     _vstream=yes    ;;
   --disable-vstream)    _vstream=no     ;;
+  --enable-pthreads)    _pthreads=yes   ;;
+  --disable-pthreads)   _pthreads=no    ;;
 
   --enable-fribidi)     _fribidi=yes    ;;
   --disable-fribidi)    _fribidi=no     ;;
@@ -2788,15 +2792,17 @@
 _def_threads='#undef HAVE_THREADS'
 
 echocheck "pthread"
+_ld_pthread=''
+if test "$_pthreads" != no ; then
 cat > $TMPC << EOF
 #include <pthread.h>
 void* func(void *arg) { return arg; }
 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
 EOF
-if mingw32 ; then
-  _ld_pthread=''
-elif hpux ; then
+if hpux ; then
   _ld_pthread=''
+elif ( cc_check -lpthreadGC2 && $TMPO ) ; then # mingw pthreads-win32
+  _ld_pthread='-lpthreadGC2'
 elif ( cc_check && $TMPO ) ; then              # QNX
   _ld_pthread=' ' # _ld_pthread='' would disable pthreads, but the test worked
 elif ( cc_check -lpthread && $TMPO ) ; then
@@ -2819,6 +2825,7 @@
     _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _macosx=no ; _win32=no
   fi
 fi
+fi
 if test "$_ld_pthread" != '' ; then
   echores "yes (using $_ld_pthread)"
   _pthreads='yes'


More information about the MPlayer-cygwin mailing list