[FFmpeg-devel] [PATCH 2/2] Autodetect pthreads
David Conrad
lessen42
Mon Apr 19 14:52:05 CEST 2010
On Apr 19, 2010, at 8:41 AM, M?ns Rullg?rd wrote:
> David Conrad <lessen42 at gmail.com> writes:
>
>> On Apr 19, 2010, at 7:30 AM, M?ns Rullg?rd wrote:
>>
>>> David Conrad <lessen42 at gmail.com> writes:
>>>
>>>> ---
>>>> configure | 38 +++++++++++++++++++++++++++-----------
>>>> 1 files changed, 27 insertions(+), 11 deletions(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index 9b9ae51..0005416 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -93,7 +93,7 @@ Configuration options:
>>>> --enable-avfilter-lavf video filters dependent on avformat [no]
>>>> --enable-beosthreads use BeOS threads [no]
>>>> --enable-os2threads use OS/2 threads [no]
>>>> - --enable-pthreads use pthreads [no]
>>>> + --enable-pthreads use pthreads [autodetect]
>>>> --enable-w32threads use Win32 threads [no]
>>>> --enable-x11grab enable X11 grabbing [no]
>>>> --disable-network disable network support [no]
>>>> @@ -2565,9 +2565,24 @@ fi
>>>> disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
>>>> disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
>>>>
>>>> +pthreads_deps="!w32threads !beosthreads !os2threads"
>>>> +pthreads_if_any='
>>>> + dnxhd_decoder
>>>> + dnxhd_encoder
>>>> + dvvideo_decoder
>>>> + dvvideo_encoder
>>>> + h263_encoder
>>>> + h264_decoder
>>>> + libx264_encoder
>>>> + mpeg1video_decoder
>>>> + mpeg1video_encoder
>>>> + mpeg2video_decoder
>>>> + mpeg2video_encoder
>>>> +'
>>>> +
>>>> # check for some common methods of building with pthread support
>>>> # do this before the optional library checks as some of them require pthreads
>>>> -if enabled pthreads; then
>>>> +if ! disabled pthreads; then
>>>> if check_func pthread_create; then
>>>> :
>>>> elif check_func pthread_create -pthread; then
>>>> @@ -2579,18 +2594,10 @@ if enabled pthreads; then
>>>> elif check_func pthread_create -lpthreadGC2; then
>>>> add_extralibs -lpthreadGC2
>>>> elif ! check_lib pthread.h pthread_create -lpthread; then
>>>> - die "ERROR: can't find pthreads library"
>>>> + disable pthreads
>>>> fi
>>>> fi
>>>
>>> This will cause libpthread to be linked in even if it's not used.
>>
>> Fixed by requiring pthreads to be enabled before checking which
>> unfortunately requires checking for that both before checking
>> external libs and after check_deps. So it still requires an explicit
>> --enable-pthread for external libs that need pthreads...
>
> So what's the point of this exercise?
I figured that should go in a separate patch...
> Also, why are you replying off-list?
Oops, it looks like reply-to wasn't set for some reason and I didn't notce?
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: textmate stdin N6X30m.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100419/4fa77d41/attachment.txt>
More information about the ffmpeg-devel
mailing list