[PATCH] faad2 configure fix for a new tree (was: [MPlayer-dev-eng] [PATCH] to be applied)

Bernd Ernesti mplayer at lists.veego.de
Wed Sep 10 09:23:08 CEST 2003


On Mon, Sep 08, 2003 at 11:34:42AM +0200, Moritz Bunkus wrote:
> Hi,
> 
> applied both.

It was a good idea to make a configure check if faad2 would compile,
unfortunally this doesn't work on a new checked out tree:

- there is no config.h while configure runs for the first time

configure output:

Checking for faad2 (AAC) support ... no (broken gcc)

configure.log contains this:

============ Checking for faad2 (AAC) support ============
gcc -c -O4 -march=i686 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer  -I//work/libfaad2 -I/usr/pkg/include /work/libfaad2/cfft.c -o /tmp/mplayer-conf--27297.o
In file included from /work/libfaad2/cfft.c:37:
/work/libfaad2/common.h:35: ../config.h: No such file or directory
Result is: no (broken gcc)
##########################################

Oh, btw, this is with a gcc 2.95.3.

Runing configure a second time fixed it, but thats not a real solution.

What about the attached patch, which creates a temporarily config.h during
the faad compile check and removes it later if it wasn't there before.

Another solution would be too always create config.h at the beginig of the
configure script, but I'm not sure about the downsides that could cause.

Bernd

-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.766
diff -u -r1.766 configure
--- configure	8 Sep 2003 10:09:02 -0000	1.766
+++ configure	10 Sep 2003 07:33:06 -0000
@@ -4309,6 +4309,13 @@
 else
   _inc_faad="-I`pwd`/libfaad2"
   _faad=yes
+  # the faad check needs a config.h file
+  if test -f "config.h" ; then
+    _rm_config_h=no
+  else
+    _rm_config_h=yes
+    echo "" > config.h
+  fi
   # internal faad: check if our dear gcc is able to compile it...
   echo "$_cc -c -O4 $_march $_mcpu -pipe -ffast-math -fomit-frame-pointer $CFLAGS $_inc_faad $_inc_extra `pwd`/libfaad2/cfft.c -o $TMPO" >> "$TMPLOG"
   if ( $_cc -c -O4 $_march $_mcpu -pipe -ffast-math -fomit-frame-pointer $CFLAGS $_inc_faad $_inc_extra "`pwd`/libfaad2/cfft.c" -o "$TMPO" ) >> "$TMPLOG" 2>&1 ; then
@@ -4316,6 +4323,10 @@
   else
     _faad=no
     echores "no (broken gcc)"
+  fi
+  # remove a temporarily config.h, which was needed for the faad compile check
+  if test "$_rm_config_h" = yes; then
+    rm config.h
   fi
 fi
 fi


More information about the MPlayer-dev-eng mailing list