1
0
Fork 0

Prevent env:OPUSFILE_LIBS from enabling Opus

In the current code, we assess the --disable-opus-cdda argument,
and if it's not present we run pkg-config to get the Opus CFLAGS
and LIBS.  If it finds them, it sets the OPUSFILE_CFLAGS and
OPUSFILE_LIBS variables.  We finally check for the presense of
one of these before actually enabling Opus.

However, if the user directly sets OPUSFILE_LIBS, then this final
check will become true regardless if the user passed --disable-opus-cdda
to configure.

The obvious fix is to move the final Opus check inside the
prior checks (for example, moving AM_CONDITIONAL(USE_OPUS) inside
AS_IF(..), however that results in the OPUS_USE conditional not
existing if the AS_IF test fails its check.

Therefore, we set a new variable HAVE_OPUS, if the pkg-config
check passes, and look for that instead of OPUSFILE_LIBS.
(Of course, the user could export HAVE_OPUS=yes in their
environment as well, but at that point they're deliberately
circumenting configure, in which case they can have at it!).
This commit is contained in:
krcroft 2020-03-09 11:18:32 -07:00 committed by Patryk Obara
parent a67a52164e
commit abe95c195c

View file

@ -486,9 +486,9 @@ AC_ARG_ENABLE(opus-cdda,
AS_IF([test "x${enable_opus_cdda}" != "xno"],
[PKG_CHECK_MODULES([OPUSFILE],
[opusfile],
[LIBS="$LIBS $OPUSFILE_LIBS"])])
AM_CONDITIONAL([USE_OPUS],
[test "x${OPUSFILE_LIBS}" != "x"])
[LIBS="$LIBS $OPUSFILE_LIBS" HAVE_OPUS=yes])])
AM_CONDITIONAL(USE_OPUS, test "${HAVE_OPUS}" = "yes")
AH_TEMPLATE(C_OPENGL,[Define to 1 to use opengl display output support])
AC_CHECK_LIB(GL, main, have_gl_lib=yes, have_gl_lib=no , )