Skip to content

Commit

Permalink
autoconf: Add --without-flac option
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpapersonic authored Dec 6, 2022
1 parent 36e39ba commit e4ba48a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit e4ba48a

Please sign in to comment.