From 9bd7a50d91af224ea8befaa36f7e1400601267b2 Mon Sep 17 00:00:00 2001 From: ng0 Date: Sat, 26 Oct 2019 12:21:41 +0000 Subject: [PATCH] configure: Add --with-libpulse=PREFIX --- configure.ac | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index ba8fdb8c6..9580756f5 100644 --- a/configure.ac +++ b/configure.ac @@ -694,10 +694,42 @@ AS_IF([test "x$jansson" = x1], # check for libpulse(audio) library pulse=0 libpulse_msg="no" -CHECK_LIBHEADER(LIBPULSE, pulse, pa_stream_peek, pulse/simple.h,pulse=1,) -AS_IF([test "$pulse" = 1], +AC_MSG_CHECKING(for libpulse) +# TODO: --with-libpulse or --with-pulseaudio? What is more established +# TODO: in this context? +AC_ARG_WITH(libpulse, + [ --with-libpulse=PREFIX (base of libpulse installation)], + [AC_MSG_RESULT([$with_libpulse]) + AS_CASE([$with_libpulse], + [no],[], + [yes],[ + CHECK_LIBHEADER(LIBPULSE, + pulse, + pa_stream_peek, + pulse/simple.h, + pulse=1,) + ],[ + LDFLAGS="-L$with_libpulse/lib $LDFLAGS" + CPPFLAGS="-I$with_libpulse/include $CPPFLAGS" + AC_CHECK_HEADERS(pulse/simple.h, + AC_CHECK_LIB([pulse], + [pa_stream_peek], + EXT_LIB_PATH="-L$with_pulse/lib $EXT_LIB_PATH" + pulse=1)) + ]) + ], + [AC_MSG_RESULT([--with-libpulse not specified]) + CHECK_LIBHEADER(LIBPULSE, + pulse, + pa_stream_peek, + pulse/simple.h, + pulse=1,)]) +AM_CONDITIONAL(HAVE_PULSE, [test "$pulse" = 1]) +AS_IF([test x"$pulse" = x1], [AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library]) - libpulse_msg="yes"]) + libpulse_msg="yes"], + [AC_DEFINE([HAVE_PULSE],[0],[Lacking libpulse(audio) library]) + libpulse_msg="no"]) # check for libopus(audio) library opus=0 -- 2.25.1