Fix autoconf nuances with AM_CONDITIONAL
This commit is contained in:
parent
f6060a5148
commit
ec8fcb4af2
2 changed files with 17 additions and 15 deletions
21
configure.ac
21
configure.ac
|
@ -462,20 +462,23 @@ fi
|
|||
dnl Ogg Opus handling
|
||||
dnl -----------------
|
||||
dnl We want Opus tracks supported by default, and we also want the user
|
||||
dnl to be aware if there's a problem finding the Opus dependencies.
|
||||
dnl If there's a problem, we want the user to either a) install the opus
|
||||
dnl library or b) explicitly disable Opus.
|
||||
dnl to be aware if there's a problem finding the Opus dependencies so
|
||||
dnl they can either a) install the opusfile library or b) explicitly
|
||||
dnl disable Opus.
|
||||
|
||||
dnl To achieve this, we provide a --disable-opus-cdda configure option
|
||||
dnl but by default we look for Opus and fail if we can't find it.
|
||||
dnl We only skip supporting Opus if the user explicitly passes the
|
||||
dnl --disable-opus-cdda argument.
|
||||
|
||||
AC_ARG_ENABLE([opus-cdda], AS_HELP_STRING([--disable-opus-cdda],
|
||||
[Disable support for Opus-compressed CD-Audio tracks]))
|
||||
AS_IF([test "x$enable_opus_cdda" != "xno"],
|
||||
[PKG_CHECK_MODULES([OPUSFILE], [opusfile], [HAVE_OPUSFILE=1])])
|
||||
AM_CONDITIONAL([USE_OPUS], [test "$HAVE_OPUSFILE" == "1"])
|
||||
AC_ARG_ENABLE(opus-cdda,
|
||||
AS_HELP_STRING([--disable-opus-cdda],
|
||||
[Disable Opus CD audio track support]))
|
||||
AS_IF([test "x${enable_opus_cdda}" != "xno"],
|
||||
[PKG_CHECK_MODULES([OPUSFILE],
|
||||
[opusfile],
|
||||
[LIBS+=" $OPUSFILE_LIBS"])])
|
||||
AM_CONDITIONAL([USE_OPUS],
|
||||
[test "x${OPUSFILE_LIBS}" != "x"])
|
||||
|
||||
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 , )
|
||||
|
|
|
@ -20,12 +20,6 @@ libdecoders_a_SOURCES = \
|
|||
xxhash.c \
|
||||
xxhash.h
|
||||
|
||||
if USE_OPUS
|
||||
libdecoders_a_SOURCES += opus.c
|
||||
AM_CFLAGS += -DUSE_OPUS $(OPUSFILE_CFLAGS)
|
||||
LDADD += $(OPUSFILE_LIBS)
|
||||
endif
|
||||
|
||||
libdecoders_a_CXXFLAGS = \
|
||||
$(AM_CXXFLAGS) \
|
||||
$(CXXFLAGS) \
|
||||
|
@ -37,3 +31,8 @@ libdecoders_a_CFLAGS = \
|
|||
$(CFLAGS) \
|
||||
-Wpedantic \
|
||||
-Wall
|
||||
|
||||
if USE_OPUS
|
||||
libdecoders_a_SOURCES += opus.c
|
||||
libdecoders_a_CFLAGS += -DUSE_OPUS $(OPUSFILE_CFLAGS)
|
||||
endif
|
||||
|
|
Loading…
Add table
Reference in a new issue