+# Checks for packages.
+case $want_gstdecode,$want_gstreamer in
+ yes,no) AC_MSG_ERROR([gstdecode requires GStreamer]) ;;
+ whatever,no) want_gstdecode=no ;;
+ no,*) want_gstreamer=no ;;
+ *,yes) want_gstreamer="1.0 0.10" ;;
+esac
+
+AH_TEMPLATE([HAVE_GSTREAMER_0_10],
+ [Define if building against GStreamer 0.10])
+AH_TEMPLATE([HAVE_GSTREAMER_1_0],
+ [Define if building against GStreamer 1.0])
+
+mdw_gstreamer_version=nil
+for i in $want_gstreamer; do
+ case $i in
+ 0.10) v=0.10 V=0_10 ;;
+ 1.0) v=1.0 V=1_0 ;;
+ *) AC_MSG_ERROR([unrecognized GStreamer version]) ;;
+ esac
+ PKG_CHECK_MODULES([GSTREAMER],
+ [gstreamer-$v gstreamer-app-$v gstreamer-audio-$v gstreamer-pbutils-$v],
+ [have_gstreamer=$v], [have_gstreamer=no])
+ case $have_gstreamer in no) continue ;; esac
+ AC_DEFINE_UNQUOTED([HAVE_GSTREAMER_$V], [1])
+ mdw_gstreamer_version=$v
+ break
+done
+
+case $want_gstdecode,$have_gstreamer,$have_gst_plugins_base in
+ whatever,no,* | whatever,*,no)
+ want_gstdecode=no
+ ;;
+ yes,no,* | yes,*,no)
+ case $have_gstreamer in
+ no) missing_libraries="$missing_libraries gstreamer" ;;
+ esac
+ ;;
+ *)
+ want_gstdecode=yes
+ ;;
+esac
+
+mdw_SAVE_CFLAGS=$CFLAGS
+mdw_SAVE_LIBS=$LIBS
+CFLAGS="$CFLAGS $GSTREAMER_CFLAGS"
+LIBS="$LIBS $GSTREAMER_LIBS"
+AC_CHECK_FUNCS([gst_audio_info_from_caps])
+CFLAGS=$mdw_SAVE_CFLAGS
+LIBS=$mdw_SAVE_LIBS
+