[MPlayer-dev-eng] [PATCH] fix configure check for faad2 on systems which have a different prototype for lrintf

Bernd Ernesti mplayer-dev-eng at lists.veego.de
Sat Jun 25 19:46:20 CEST 2005


Hi,

here is a patch to fix a problem with the following configure test:

  Checking for internal FAAD2 (AAC) support

This will fail if you run configure for the first time after a new checkout,
because at this point a correct config.h doesn't exists, which would have an
#define HAVE_LRINTF 1
if the configure script found a working lrintf on that system.

Now, the faad2 check tries to compile libfaad2/common.h while including config.h,
which has a different asumption on how the lrintf function should be called:

static INLINE int lrintf(float f)

which will fail on NetBSD because we have the follwing in <math.h>:

long int lrint(double);

The work around this problem is to not only create an empty config.h, but
to print the value of $_def_lrintf to it, so the faad2 check would not longer
fail with this:

cc  -I/usr/pkg/include    -L/usr/pkg/lib -Wl,-R/usr/pkg/lib /tmp/mplayer-conf--3548.c -o /tmp/mplayer-conf--3548.o -c -O4 -march=pentium3 -mcpu=pentium3 -pipe -ffast-math -fomit-frame-pointer -I/work/libfaad2
In file included from /work/libfaad2/common.h:373,
                 from /tmp/mplayer-conf--3548.c:37:
/usr/include/math.h:313: error: conflicting types for `lrintf'
/work/libfaad2/common.h:348: error: previous declaration of `lrintf'

Bernd

P.S. Diego, that was the problem which i mentioned today to you.
 I had a different patch where I just did an
-    static INLINE int lrintf(float f)
+    static long INLINE int lrintf(float f)
in libfaad2/common.h, but I don't know if that would work on other systems
and so I made the attached patch.

-------------- next part --------------
--- configure.orig	2005-06-25 18:40:17.000000000 +0200
+++ configure	2005-06-25 19:20:28.000000000 +0200
@@ -5486,7 +5486,10 @@
 if test "$_faad_internal" = auto ; then
   # the faad check needs a config.h file
   if not test -f "config.h" ; then
-    > config.h
+    cat > config.h << EOF
+/* C99 lrintf function available */
+$_def_lrintf
+EOF
   fi
   # internal faad: check if our dear gcc is able to compile it...
   cp "`pwd`/libfaad2/cfft.c" $TMPC


More information about the MPlayer-dev-eng mailing list