[FFmpeg-devel] [PATCH] Add log2 check to configure and equivalent to internal.h

Ramiro Polla ramiro.polla
Tue Jul 14 23:47:03 CEST 2009


On Sat, Jul 11, 2009 at 6:46 AM, M?ns Rullg?rd<mans at mansr.com> wrote:
> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
>> On Sat, Jul 11, 2009 at 12:18:03AM +0100, M?ns Rullg?rd wrote:
>>> Alex Converse <alex.converse at gmail.com> writes:
>>> > If someone on a system without log2 could test this, that would be great.
>>> >
>>> > Regards,
>>> > Alex Converse
>>> >
>>> > diff --git a/configure b/configure
>>> > index 7998273..48630f1 100755
>>> > --- a/configure
>>> > +++ b/configure
>>> > @@ -911,6 +911,7 @@ HAVE_LIST="
>>> > ? ? ?libdc1394_1
>>> > ? ? ?libdc1394_2
>>> > ? ? ?llrint
>>> > + ? ?log2
>>> > ? ? ?loongson
>>> > ? ? ?lrint
>>> > ? ? ?lrintf
>>> > @@ -2078,7 +2079,7 @@ check_lib math.h sin -lm
>>> > ?check_lib va/va.h vaInitialize -lva
>>> >
>>> > ?# test for C99 functions in math.h
>>> > -for func in llrint lrint lrintf round roundf truncf; do
>>> > +for func in log2 llrint lrint lrintf round roundf truncf; do
>>> > ? ? ?check_exec <<EOF && enable $func || disable $func
>>> > ?#include <math.h>
>>> > ?int main(void) { return ($func(3.999f) > 0)?0:1; }
>>>
>>> What's with that weird runtime check anyway? ?Looks pretty useless to
>>> me.
>>
>> Not sure if I understand you right, but if the compiler optimizes away
>> the function call it wouldn't be a good way to check if the function is
>> available...

This happens on cygwin with gcc 4.3.3. It uses a built-in log2 for the
check to pass, and fails to link aaccoder.o because of undefined
_log2.

> Why are these functions not checked with check_func, which seems to
> work for everything else?

I don't know why check_exec is being used, but I can confirm that
using check_func for log2 makes it work on cygwin gcc 4.3.3.

Ramiro Polla



More information about the ffmpeg-devel mailing list