changeset 10842:3e9bbf83bd6e

Cleanup of faad detection and a new test if gcc can compile the internal faad. Patch by Arpi.
author mosu
date Mon, 08 Sep 2003 10:09:02 +0000
parents d4cf5407d7c6
children 60f58eadd666
files configure
diffstat 1 files changed, 38 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Mon Sep 08 10:07:52 2003 +0000
+++ b/configure	Mon Sep 08 10:09:02 2003 +0000
@@ -1078,7 +1078,7 @@
 _theora=auto
 _matroska=auto
 _tremor=no
-_faad=yes
+_faad=auto
 _faad_local=yes
 _xmms=no
 _css=auto
@@ -4290,37 +4290,38 @@
 fi
 echores "$_matroska"
 
-
 echocheck "faad2 (AAC) support"
+if test "$_faad" = no ; then
+  echores "no (disabled)"
+else
 if test "$_faad_local" = no ; then
-  _faad=no
-  cat > $TMPC << EOF
+  _ld_faad='-lfaad'
+  # external faad: check if it's really faad2 :)
+  if test "$_faad" = auto ; then
+    _faad=no
+    cat > $TMPC << EOF
 #include <faad.h>
 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); return 0; }
 EOF
-  cc_check -lfaad -lm && _faad=yes
-else
-  # dunno if 3.2.2 fails or not (some reports say it fails, some not)
-  if test "$_faad_local" = yes && test "$_cc_major" -eq "3" &&
-    test "$_cc_minor" -eq "2" ; then 
-    _faad=no
+    cc_check $_inc_faad $_ld_faad -lm && _faad=yes
   fi
-fi
-
-if test "$_faad" = yes ; then
-  _def_faad='#define HAVE_FAAD 1'
-  if test "$_faad_local" = yes ; then
-    _inc_faad="-I`pwd`/libfaad2"
+  echores "$_faad (external)"
+else
+  _inc_faad="-I`pwd`/libfaad2"
+  _faad=yes
+  # 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
+    echores "$_faad (internal)"
   else
-    _ld_faad='-lfaad'
-   fi
-  _codecmodules="faad2 $_codecmodules"
-else
-  _def_faad='#undef HAVE_FAAD'
-  _nocodecmodules="faad2 $_nocodecmodules"
+    _faad=no
+    echores "no (broken gcc)"
+  fi
+fi
 fi
 
 if test "$_faad" = yes; then
+echocheck "faad2 version"
 cat > $TMPC <<EOF
 #include <faad.h>
 #ifndef FAAD_MIN_STREAMSIZE
@@ -4339,18 +4340,24 @@
     _faad_version=`"$TMPO"`
     _faad_tempversion=`"$TMPO" | sed -e 's/^\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\1\2/'`
     _def_faad_version="#define FAADVERSION $_faad_tempversion"
-    echores "yes ($_faad_version)"
+    echores "$_faad_version"
   else
     _faad=no
-    echores "no (failed to get version)"
+    echores "failed to get version"
   fi
-else
-  if test "$_faad_local" = yes ; then
-    echores "no (buggy gcc fails compiling)"
-  else
-     echores "$_faad"
-  fi
-fi
+fi
+
+if test "$_faad" = yes ; then
+  _def_faad='#define HAVE_FAAD 1'
+  _codecmodules="faad2 $_codecmodules"
+else
+  _def_faad='#undef HAVE_FAAD'
+  _nocodecmodules="faad2 $_nocodecmodules"
+  _inc_faad=
+  _ld_faad=
+fi
+
+
 
 if test "$_win32" = auto ; then
   if x86 ; then