summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-04-10 17:39:44 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-04-10 17:39:44 +0000
commit465abf0b8d77680a88c0e8e09a052e5e52e997bf (patch)
tree36db76236859610b57e0ad13d51748a3799e0c34
parentc1fb3499ac18d9b94f7fa9258908cf682cba67c5 (diff)
downloadmpv-465abf0b8d77680a88c0e8e09a052e5e52e997bf.tar.bz2
mpv-465abf0b8d77680a88c0e8e09a052e5e52e997bf.tar.xz
Move thread-related CFLAGS settings into pthread test.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29168 b3059339-0415-0410-9bf9-f77b7e298cf2
-rwxr-xr-xconfigure15
1 files changed, 7 insertions, 8 deletions
diff --git a/configure b/configure
index d7963b6d4f..b8a4477424 100755
--- a/configure
+++ b/configure
@@ -3288,6 +3288,11 @@ echores "$_dynamic_plugins"
def_threads='#define HAVE_THREADS 0'
echocheck "pthread"
+if linux ; then
+ THREAD_CFLAGS=-D_REENTRANT
+elif freebsd || netbsd || openbsd || bsdos ; then
+ THREAD_CFLAGS=-D_THREAD_SAFE
+fi
if test "$_pthreads" = auto ; then
cat > $TMPC << EOF
#include <pthread.h>
@@ -3298,7 +3303,7 @@ _pthreads=no
if ! hpux ; then
for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
# for crosscompilation, we cannot execute the program, be happy if we can link statically
- cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
+ cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
done
fi
fi
@@ -3306,6 +3311,7 @@ if test "$_pthreads" = yes ; then
test $_ld_pthread && _res_comment="using $_ld_pthread"
def_pthreads='#define HAVE_PTHREADS 1'
def_threads='#define HAVE_THREADS 1'
+ extra_cflags="$extra_cflags $THREAD_CFLAGS"
else
_res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
def_pthreads='#undef HAVE_PTHREADS'
@@ -8000,13 +8006,6 @@ libs_mplayer=$_ld_tmp
#############################################################################
-# Thread support
-if linux ; then
- CFLAGS="$CFLAGS -D_REENTRANT"
-elif freebsd || netbsd || openbsd || bsdos ; then
- # FIXME bsd needs this so maybe other OS'es
- CFLAGS="$CFLAGS -D_THREAD_SAFE"
-fi
# 64 bit file offsets?
if test "$_largefiles" = yes || freebsd ; then
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"