summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Grunt <pgrunt@redhat.com>2015-06-15 13:53:30 +0200
committerPavel Grunt <pgrunt@redhat.com>2015-06-15 16:36:08 +0200
commitf77dd55b39486960fcf9259ebb5d869c93a1f19d (patch)
treeaa0234548921b0d76efc12f93de5627f1512a26e
parentef2c79854cc4c7a50c3949bfeebf8870b40c197f (diff)
downloadspice-gtk-f77dd55b39486960fcf9259ebb5d869c93a1f19d.tar.gz
spice-gtk-f77dd55b39486960fcf9259ebb5d869c93a1f19d.tar.xz
spice-gtk-f77dd55b39486960fcf9259ebb5d869c93a1f19d.zip
configure: Try gstreamer audio backend if pulse is not available
Disable audio if no backend is available and configure is used with the option '--with-audio=auto'
-rw-r--r--configure.ac35
1 files changed, 18 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 1d8f4d0..4b0af64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,23 +296,28 @@ AC_ARG_WITH([audio],
[],
[with_audio="auto"])
-AS_IF([test "x$with_audio" = "xauto"], [
- AS_IF([test "x$os_win32" = "xyes"], [with_audio=gstreamer], [with_audio=pulse])
-])
-
case "$with_audio" in
- gstreamer|pulse|no*)
+ gstreamer|pulse|auto*)
+ PKG_CHECK_MODULES(GST, gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-audio-1.0, [have_gst=yes], [have_gst=no])
+ PKG_CHECK_MODULES(PULSE, libpulse libpulse-mainloop-glib, [have_pulse=yes], [have_pulse=no])
+ ;;
+ no*)
;;
*) AC_MSG_ERROR(Unsupported audio backend)
esac
-AS_IF([test "x$with_audio" = "xpulse"],
- [PKG_CHECK_MODULES(PULSE, libpulse libpulse-mainloop-glib, [have_pulse=yes], [have_pulse=no])],
- [have_pulse=no])
+AS_IF([test "x$with_audio" = "xauto" && test "x$have_pulse" = "xyes"],
+ [with_audio=pulse])
-AS_IF([test "x$have_pulse" = "xyes"],
- [AC_DEFINE([WITH_PULSE], 1, [Have pulseaudio?])],
- [AS_IF([test "x$with_audio" = "xpulse"],
+AS_IF([test "x$with_audio" = "xauto" && test "x$have_gst" = "xyes"],
+ [with_audio=gstreamer])
+
+AS_IF([test "x$with_audio" = "xauto"],
+ [with_audio=no])
+
+AS_IF([test "x$with_audio" = "xpulse"],
+ [AS_IF([test "x$have_pulse" = "xyes"],
+ [AC_DEFINE([WITH_PULSE], 1, [Have pulseaudio?])],
[AC_MSG_ERROR([PulseAudio requested but not found])
])
])
@@ -321,12 +326,8 @@ AC_SUBST(PULSE_CFLAGS)
AC_SUBST(PULSE_LIBS)
AS_IF([test "x$with_audio" = "xgstreamer"],
- [PKG_CHECK_MODULES(GST, gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-audio-1.0, [have_gst=yes], [have_gst=no])],
- [have_gst=no])
-
-AS_IF([test "x$have_gst" = "xyes"],
- [AC_DEFINE([WITH_GSTAUDIO], 1, [Have GStreamer 1.0?])],
- [AS_IF([test "x$with_audio" = "xgstreamer"],
+ [AS_IF([test "x$have_gst" = "xyes"],
+ [AC_DEFINE([WITH_GSTAUDIO], 1, [Have GStreamer 1.0?])],
[AC_MSG_ERROR([GStreamer 1.0 requested but not found])
])
])