diff --git a/configure.ac b/configure.ac index 2f8c1be6a..eb2e13d54 100644 --- a/configure.ac +++ b/configure.ac @@ -137,15 +137,6 @@ else AM_CONDITIONAL([USE_WIN32], false) fi -dnl FLAC stuff -AC_CHECK_HEADER(FLAC/stream_decoder.h, libflac_found=yes, libflac_found=no) -if test x"$libflac_found" = "xyes"; then - AM_CONDITIONAL([USE_FLAC], true) - CFLAGS="" - LIBS="$LIBS -lFLAC" -else - AM_CONDITIONAL([USE_FLAC], false) -fi dnl Wii crap AC_CHECK_LIB(ogc, IOS_ReloadIOS, libogc_found=yes, libogc_found=no, [-mrvl -L${DEVKITPRO}/libogc/lib/wii]) @@ -310,6 +301,11 @@ AC_ARG_ENABLE(fortify-source, ADD_FORTIFY=$enableval, ADD_FORTIFY=no) +AC_ARG_WITH([flac], + [AS_HELP_STRING([--without-flac],[Build without FLAC support @<:@default=no@:>@])], + [], + [with_flac=yes]) + dnl fortify needs -O; do this early so ADD_OPT can override with higher -O level if test x$ADD_FORTIFY \!= xno; then CFLAGS="$CFLAGS -O -D_FORTIFY_SOURCE=2" @@ -330,6 +326,14 @@ if test x$ADD_LUDICROUS \!= xno; then CFLAGS="$CFLAGS -Werror" fi +AM_CONDITIONAL([USE_FLAC], false) +if test "x$with_flac" = "xyes"; then + AC_CHECK_HEADER(FLAC/stream_decoder.h, libflac_found=yes, libflac_found=no) + if test x"$libflac_found" = "xyes"; then + AM_CONDITIONAL([USE_FLAC], true) + fi +fi + dnl ... but put the warnings first, to make it possible to quiet certain dnl warnings if necessary, while still providing most of the benefit if test x$ADD_WARN \!= xno; then