Fedora mingw seems to require it's own pthread library which causes build
conflicts with our pthread lib. So this patch distinguishes whether
libpthread or libpthreadGC2 is already installed on the system and uses
the appropriate system lib when found.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6766
b64f7644-9d1e-0410-96f1-
a4d463321fa5
else ifeq ($(BUILD.system),linux)
LIBHB.GCC.D += SYS_LINUX _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64
else ifeq ($(BUILD.system),mingw)
- LIBHB.GCC.D += SYS_MINGW PTW32_STATIC_LIB
+ LIBHB.GCC.D += SYS_MINGW
+ifeq ($(HAS.pthreadGC2),1)
+ LIBHB.GCC.D += PTW32_STATIC_LIB
+endif
LIBHB.GCC.args.extra.dylib++ += -Wl,--enable-auto-import -static
else ifeq ($(BUILD.system),solaris)
LIBHB.GCC.D += SYS_SunOS _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 _POSIX_C_SOURCE=200112L __EXTENSIONS__
LIBHB.GCC.l += fribidi
endif
-ifneq ($(HAS.pthread),1)
+ifeq ($(HAS.pthread),1)
+ LIBHB.GCC.l += pthread
+else ifneq ($(HAS.pthreadGC2),1)
LIBHB.dll.libs += $(CONTRIB.build/)lib/libpthreadGC2.a
else
LIBHB.GCC.l += pthreadGC2
#if defined( SYS_CYGWIN )
return (uint64_t)t->thread;
#elif defined( _WIN32 ) || defined( __MINGW32__ )
+ #if defined(PTW32_STATIC_LIB)
return (uint64_t)(ptrdiff_t)t->thread.p;
+ #else
+ return (uint64_t)t->thread;
+ #endif
#elif defined( SYS_DARWIN )
return (unsigned long)t->thread;
#else
return 0;
}
"""
- pthread = LDProbe( 'static pthread', '%s -static' % Tools.gcc.pathname, '-lpthreadGC2', pthread_test )
+ pthreadGC2 = LDProbe( 'static pthread', '%s -static' % Tools.gcc.pathname, '-lpthreadGC2', pthread_test )
+ pthread = LDProbe( 'static pthread', '%s -static' % Tools.gcc.pathname, '-lpthread', pthread_test )
pthread.run()
bz2_test = """
doc.add( 'HAS.dlfcn', 1 )
if not pthread.fail:
doc.add( 'HAS.pthread', 1 )
+ if not pthreadGC2.fail:
+ doc.add( 'HAS.pthreadGC2', 1 )
if not bz2.fail:
doc.add( 'HAS.bz2', 1 )
if not libz.fail:
ifneq (,$(filter $(BUILD.system),mingw))
ifneq ($(HAS.pthread),1)
+ifneq ($(HAS.pthreadGC2),1)
MODULES += contrib/pthreadw32
endif
endif
+endif
ifeq (1,$(FEATURE.qsv))
MODULES += contrib/libmfx
ifeq (1,$(FEATURE.hwd))
TEST.GCC.D += USE_HWD
endif
- TEST.GCC.l += pthreadGC2 iconv ws2_32 regex
+ifeq (1,$(HAS.pthread))
+ TEST.GCC.l += pthread
+else
+ TEST.GCC.l += pthreadGC2
+endif
+ TEST.GCC.l += iconv ws2_32 regex
TEST.GCC.D += PTW32_STATIC_LIB
TEST.GCC.args.extra.exe++ += -static
endif # (1-mingw,$(BUILD.cross)-$(BUILD.system))