From b25840c3b2239ba1e1beb20adf7ada2db1227153 Mon Sep 17 00:00:00 2001 From: ng0 Date: Sat, 26 Oct 2019 12:38:32 +0000 Subject: [PATCH] configure: Add --with-libopus=PREFIX --- configure.ac | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 9580756f5..0d19ae2f3 100644 --- a/configure.ac +++ b/configure.ac @@ -734,14 +734,50 @@ AS_IF([test x"$pulse" = x1], # check for libopus(audio) library opus=0 libopus_msg="no" -CHECK_LIBHEADER(LIBOPUS, - opus, - opus_decode_float, - opus/opus.h, - AC_CHECK_DECL([OPUS_SET_GAIN],[opus=1],[],[[#include ]])) +AC_MSG_CHECKING(for libopus) +AC_ARG_WITH(libopus, + [ --with-libopus=PREFIX (base of libopus installation)], + [AC_MSG_RESULT([$with_libopus]) + AS_CASE([$with_libopus], + [no],[], + [yes],[ + CHECK_LIBHEADER(LIBOPUS, + opus, + opus_decode_float, + opus/opus.h, + AC_CHECK_DECL([OPUS_SET_GAIN], + [opus=1], + [], + [[ + #include + ]])) + ],[ + LDFLAGS="-L$with_libopus/lib $LDFLAGS" + CPPFLAGS="-I$with_libopus/include $CPPFLAGS" + AC_CHECK_HEADERS(opus/opus.h, + AC_CHECK_LIB([opus], + [OPUS_SET_GAIN], + EXT_LIB_PATH="-L$with_libopus/lib $EXT_LIB_PATH" + opus=1)) + ]) + ], + [AC_MSG_RESULT([--with-libopus not specified]) + CHECK_LIBHEADER(LIBOPUS, + opus, + opus_decode_float, + opus/opus.h, + AC_CHECK_DECL([OPUS_SET_GAIN], + [opus=1], + [], + [[ + #include + ]]))]) +AM_CONDITIONAL(HAVE_OPUS, [test "$opus" = 1]) AS_IF([test "x$opus" = x1], [AC_DEFINE([HAVE_OPUS],[1],[Have libopus library]) - libopus_msg="yes"]) + libopus_msg="yes"], + [AC_DEFINE([HAVE_OPUS],[0],[Lacking libopus library]) + libopus_msg="no"]) # libogg AC_CHECK_LIB(ogg, ogg_stream_flush_fill, -- 2.25.1