+# check for bluetooth library
+bluetooth=0
+AC_CHECK_LIB(bluetooth, ba2str,[AC_CHECK_HEADER([bluetooth/bluetooth.h],bluetooth=1)])
+if test "$bluetooth" = 1
+then
+ AM_CONDITIONAL(HAVE_LIBBLUETOOTH, true)
+ AC_DEFINE([HAVE_LIBBLUETOOTH],[1],[Have bluetooth library])
+else
+ AM_CONDITIONAL(HAVE_LIBBLUETOOTH, false)
+fi
+if test "$build_target" = "mingw"
+then
+ bluetooth=1
+fi
+
+# check for libpulse(audio) library
+pulse=0
+AC_CHECK_LIB(pulse,pa_stream_peek,
+ [AC_CHECK_HEADER([pulse/simple.h],pulse=1)])
+if test "$pulse" = 1
+then
+ AM_CONDITIONAL(HAVE_PULSE, true)
+ AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library])
+else
+ AM_CONDITIONAL(HAVE_PULSE, false)
+fi
+if test "$build_target" = "mingw"
+then
+ pulse=0
+fi
+
+# check for libopus(audio) library
+opus=0
+AC_CHECK_LIB(opus,opus_decode_float,
+ [AC_CHECK_HEADER([opus/opus.h],opus=1)])
+if test "$opus" = 1
+then
+ AM_CONDITIONAL(HAVE_OPUS, true)
+ AC_DEFINE([HAVE_OPUS],[1],[Have libopus library])
+else
+ AM_CONDITIONAL(HAVE_OPUS, false)
+fi
+
+