LDFLAGS="$LDFLAGS $flac_libs"
fi
AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
-AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
+AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], [
+ # nope, try again with -logg
+ AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [],
+ have_flac=no, -lm -logg)
+ ], -lm)
if test "$have_flac" = "yes"; then
AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
AC_SUBST(flac_cppflags)