-PKG_CHECK_MODULES([TEST], [gtk+-2.0 >= 2.8 gmodule-2.0])
-AC_SUBST(TEST_CFLAGS)
-AC_SUBST(TEST_LIBS)
-
-##################################################
-# Check for gtk-doc.
-##################################################
-AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
-if test "x$with_html_dir" = "x" ; then
- HTML_DIR='${datadir}/gtk-doc/html'
-else
- HTML_DIR=$with_html_dir
-fi
-AC_SUBST(HTML_DIR)
-
-gtk_doc_min_version=1.0
-AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
-if pkg-config --atleast-version=$gtk_doc_min_version gtk-doc; then
- AC_MSG_RESULT(yes)
- GTKDOC=true
-else
- AC_MSG_RESULT(no)
- GTKDOC=false
-fi
-dnl Let people disable the gtk-doc stuff.
-AC_ARG_ENABLE(gtk-doc,
- [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]],
- enable_gtk_doc="$enableval", enable_gtk_doc=auto)
-if test x$enable_gtk_doc = xauto ; then
- if test x$GTKDOC = xtrue ; then
- enable_gtk_doc=yes
- else
- enable_gtk_doc=no
- fi
-fi
-AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
-
-AC_OUTPUT([
+# Libraries needed to build Chimara player
+PKG_CHECK_MODULES([PLAYER], [
+ glib-2.0 >= $GLIB_REQUIRED_VERSION
+ gtk+-3.0 >= $GTK_REQUIRED_VERSION
+ gmodule-2.0
+])
+# Libraries needed to build test programs
+PKG_CHECK_MODULES([TEST], [
+ gtk+-3.0 >= $GTK_REQUIRED_VERSION
+ gmodule-2.0 >= $GLIB_REQUIRED_VERSION
+])
+
+# GStreamer plugins needed to run library
+AS_CASE([$with_sound],
+ [gstreamer0.10], [
+ have_all_elements=yes
+ m4_ifdef([AM_GST_ELEMENT_CHECK], [
+ m4_map_args_w([
+ giostreamsrc
+ typefind
+ audioconvert
+ volume
+ oggdemux
+ vorbisdec
+ autoaudiosink
+ aiffparse
+ modplug],
+ [AM_GST_ELEMENT_CHECK(], [, [], [have_all_elements=no])])
+ AS_IF([test "x$have_all_elements" = "xno"],
+ [AC_MSG_ERROR([One or more required GStreamer elements were not found.
+You will have to install your system's "base", "good", and "bad" plugins
+pacakges. Try looking for names such as: gstreamer-plugins-base,
+gstreamer-plugins-good, gstreamer-plugins-bad-free,
+gstreamer-plugins-bad-free-extras, gstreamer0.10-plugins-base,
+gstreamer0.10-plugins-good, gstreamer0.10-plugins-bad])])],
+ [AC_MSG_ERROR([AM_GST_ELEMENT_CHECK not found. Install the development package
+for GStreamer 0.10 and rerun autogen.sh.])])
+ ],
+ [gstreamer1.0], [dnl aiffparse is currently broken in Fedora 19
+ have_all_elements=yes
+ m4_ifdef([GST_ELEMENT_CHECK], [
+ m4_map_args_w([
+ giostreamsrc
+ typefind
+ audioconvert
+ volume
+ oggdemux
+ vorbisdec
+ autoaudiosink
+ modplug],
+ [GST_ELEMENT_CHECK(], [, [1.0], [], [have_all_elements=no])])
+ AS_IF([test "x$have_all_elements" = "xno"],
+ [AC_MSG_ERROR([One or more required GStreamer elements were not found.
+You will have to install your system's "base", "good", and "bad" plugins
+packages. Try looking for names such as: gstreamer1-plugins-base,
+gstreamer1-plugins-good, gstreamer1-plugins-bad-free,
+gstreamer1-plugins-bad-free-extras, gstreamer1.0-plugins-base,
+gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad])])],
+ [AC_MSG_ERROR([GST_ELEMENT_CHECK not found. Install the development package
+for GStreamer 1.0 and rerun autogen.sh.])])
+ ],
+ [])
+
+# Plugin flags; include '-module' in each Makefile.am, because AC_SUBSTed
+# variables are black boxes to Automake, so it has to know about it being a
+# module in the makefile itself.
+PLUGIN_LIBTOOL_FLAGS='-avoid-version -shared -export-symbols-regex "^glk"'
+AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
+
+### OUTPUT ####################################################################
+
+# Output platform-specific definitions to config.h
+AC_CONFIG_HEADERS([config.h])
+# List of other files for Autoconf to output
+AC_CONFIG_FILES([