+ if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
+ then
+ mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
+ mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
+ fi
+
+ # Check whether --with-mad-tree or --without-mad-tree was given.
+if test "${with_mad_tree+set}" = set; then
+ withval="$with_mad_tree"
+ :
+fi
+
+ if test "x$with_mad_tree" != "xno" -a "x$with_mad_tree" != "x"
+ then
+ real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
+ if test "x$real_mad_tree" = x
+ then
+ echo "$ac_t""no" 1>&6
+ { echo "configure: error: ${with_mad_tree} directory doesn't exist" 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking for mad.h in ${real_mad_tree}/libmad""... $ac_c" 1>&6
+echo "configure:6301: checking for mad.h in ${real_mad_tree}/libmad" >&5
+ if test -f ${real_mad_tree}/libmad/mad.h
+ then
+ echo "$ac_t""yes" 1>&6
+ mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
+ mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS=$mad_LDFLAGS
+ echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
+echo "configure:6310: checking for mad_bit_init in -lmad" >&5
+ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lmad $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6318 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char mad_bit_init();
+
+int main() {
+mad_bit_init()
+; return 0; }
+EOF
+if { (eval echo configure:6329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ BUILTINS="${BUILTINS} mad"
+ mad_LDFLAGS="${mad_LDFLAGS} -lmad"
+
+else
+ echo "$ac_t""no" 1>&6
+ { echo "configure: error: the specified tree hasn't been compiled " 1>&2; exit 1; }
+
+fi
+
+ LDFLAGS=$save_LDFLAGS
+ else
+ echo "$ac_t""no" 1>&6
+ { echo "configure: error: the specified tree doesn't have mad.h" 1>&2; exit 1; }
+ fi
+ else
+ save_CFLAGS=$CFLAGS
+ save_LDFLAGS=$LDFLAGS
+ CFLAGS="$CFLAGS $mad_CFLAGS"
+ LDFLAGS="$LDFLAGS $mad_LDFLAGS"
+ for ac_hdr in mad.h