git: Line endings of README.txt
[projects/chimara/chimara.git] / configure.ac
index 4b63d120c8e51a996573abca339be201246142f9..989feada94e79f51e3dea976b67ec0019b49922c 100644 (file)
@@ -2,7 +2,7 @@
 
 ### INITIALIZATION ############################################################
 
-AC_PREREQ([2.62]) # Oldest version of Autoconf that works with introspection
+AC_PREREQ([2.64]) # Newest feature: m4_map_args_w
 # Initialize Autoconf
 # Args: (human-readable package name, package version, bug report address, 
 # tarballname)
@@ -26,11 +26,9 @@ LT_VERSION_INFO="$CHIMARA_CURRENT:$CHIMARA_REVISION:$CHIMARA_AGE"
 AC_SUBST(LT_VERSION_INFO)
 
 ### REQUIREMENTS ##############################################################
-# Recommended GTK version: at least 2.12
-# Recommended Glib version: at least 2.16
-GTK_REQUIRED_VERSION=2.6
-GLIB_REQUIRED_VERSION=2.6
-GTK_DOC_REQUIRED_VERSION=1.9
+GTK_REQUIRED_VERSION=3.4
+GLIB_REQUIRED_VERSION=2.32
+GTK_DOC_REQUIRED_VERSION=1.12
 AC_SUBST(GTK_REQUIRED_VERSION)
 AC_SUBST(GLIB_REQUIRED_VERSION)
 AC_SUBST(GTK_DOC_REQUIRED_VERSION)
@@ -77,26 +75,6 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
 
 GOBJECT_INTROSPECTION_CHECK([0.6.7])
 
-### ILIAD #####################################################################
-AC_ARG_ENABLE([iliad],
-       [AS_HELP_STRING([--enable-iliad=@<:@yes/no@:>@],
-               [Compiles Chimara for the iLiad @<:@default=no@:>@])],
-       [],
-       [enable_iliad=no])
-AM_CONDITIONAL(TARGET_ILIAD, $TEST "x$enable_iliad" = xyes)
-
-### BUILD WITHOUT RECENT FILES MANAGER #########################################
-# (to work around a bug on OS X)
-AC_ARG_ENABLE([recent],
-       [AS_HELP_STRING([--disable-recent],
-               [Omit recent files menu (to work around a bug on OS X])],
-       [],
-       [enable_recent=yes])
-AS_IF([$TEST "x$enable_recent" = "xyes"],
-       [OPEN_RECENT_MENU_ITEM="<menuitem action=\"recent\"/>"],
-       [OPEN_RECENT_MENU_ITEM="<!--  <menuitem action=\"recent\"/>-->"])
-AC_SUBST(OPEN_RECENT_MENU_ITEM)
-
 ### RPM CONFIGURATION ##########################################################
 # --enable-rpm requires rpm and rpmbuild
 AC_PATH_PROG([RPMBUILD], [rpmbuild], [notfound])
@@ -111,14 +89,39 @@ AM_CONDITIONAL(BUILDING_RPM, $TEST "x$enable_rpm" = xyes)
 
 ### SOUND LIBRARY TO USE ######################################################
 
-AC_ARG_WITH([gstreamer],
-       [AS_HELP_STRING([--without-gstreamer], [Disable GStreamer sound])],
+AC_ARG_WITH([sound],
+       [AS_HELP_STRING([--with-sound=@<:@no/auto/gstreamer0.10/gstreamer1.0@:>@],
+               [Choose library with which to implement Glk sound])],
        [],
-       [with_gstreamer=yes])
+       [with_sound=auto])
+
+have_gstreamer0_10=no
+have_gstreamer1_0=no
+AS_IF([test "x$with_sound" != "xno"], [
+       PKG_CHECK_EXISTS([gstreamer-1.0], [have_gstreamer1_0=yes])
+       PKG_CHECK_EXISTS([gstreamer-0.10], [have_gstreamer0_10=yes])])
 SOUND_MODULE=
-AS_IF([$TEST "x$with_gstreamer" != xno], 
-       [AC_DEFINE([GSTREAMER_SOUND], [1], [Define to enable sound support with GStreamer])
-       SOUND_MODULE="gstreamer-0.10 >= 0.10.12"])
+# Autodetect sound library
+AS_IF([test "x$with_sound" = "xauto"], [
+       AC_MSG_CHECKING([which sound library to use])
+       AS_IF([test "x$have_gstreamer1_0" = "xyes"], [with_sound=gstreamer1.0], [
+               AS_IF([test "x$have_gstreamer0_10" = "xyes"],
+                       [with_sound=gstreamer0.10],
+                       [with_sound=no])])
+       AC_MSG_RESULT([$with_sound])])
+# Sound library to use in the end
+AS_CASE([$with_sound],
+       [gstreamer0.10], [
+               AC_DEFINE([GSTREAMER_0_10_SOUND], [1],
+                       [Define to enable sound support with GStreamer 0.10])
+               SOUND_MODULE="gstreamer-0.10 >= 0.10.12"],
+       [gstreamer1.0], [
+               AC_DEFINE([GSTREAMER_1_0_SOUND], [1],
+                       [Define to enable sound support with GStreamer 1.0])
+               SOUND_MODULE="gstreamer-1.0"],
+       [])
+AS_IF([test "x$with_sound" != "xno"],
+       [AC_DEFINE([HAVE_SOUND], [1], [Define if any sound support is enabled])])
 
 ### WHETHER TO GENERATE A .VAPI FILE ##########################################
 # Requires vapigen
@@ -130,7 +133,7 @@ AM_CONDITIONAL(BUILDING_VAPI, $TEST "x$VAPIGEN" != xnotfound)
 # Libraries needed to build Chimara library
 PKG_CHECK_MODULES([CHIMARA], [
        glib-2.0 >= $GLIB_REQUIRED_VERSION
-       gtk+-2.0 >= $GTK_REQUIRED_VERSION
+       gtk+-3.0 >= $GTK_REQUIRED_VERSION
        gthread-2.0 
        gmodule-2.0
        pango
@@ -141,35 +144,66 @@ AC_SUBST(CHIMARA_LIBS)
 # Libraries needed to build Chimara player
 PKG_CHECK_MODULES([PLAYER], [
        glib-2.0 >= $GLIB_REQUIRED_VERSION
-       gtk+-2.0 >= $GTK_REQUIRED_VERSION
+       gtk+-3.0 >= $GTK_REQUIRED_VERSION
        gmodule-2.0
-       libgda-4.0
-       libsoup-2.4
 ])
 # Libraries needed to build test programs
 PKG_CHECK_MODULES([TEST], [
-       gtk+-2.0 >= $GTK_REQUIRED_VERSION
+       gtk+-3.0 >= $GTK_REQUIRED_VERSION
        gmodule-2.0 >= $GLIB_REQUIRED_VERSION
 ])
 
 # GStreamer plugins needed to run library
-AS_IF([$TEST "x$with_gstreamer" != xno], [
-       m4_defun([AX_GST_REQUIRE_ELEMENT],
-               [AM_GST_ELEMENT_CHECK([$1],
-                       [],
-                       [AC_MSG_ERROR([GStreamer element $1 not found. You need to install gstreamer-plugins-m4_default([$2], [base]).])]
-               )]
-       )
-       AX_GST_REQUIRE_ELEMENT([giostreamsrc])
-       AX_GST_REQUIRE_ELEMENT([typefind])
-       AX_GST_REQUIRE_ELEMENT([audioconvert])
-       AX_GST_REQUIRE_ELEMENT([volume])
-       AX_GST_REQUIRE_ELEMENT([oggdemux])
-       AX_GST_REQUIRE_ELEMENT([vorbisdec])
-       AX_GST_REQUIRE_ELEMENT([autoaudiosink], [good])
-       AX_GST_REQUIRE_ELEMENT([aiffparse], [bad])
-       AX_GST_REQUIRE_ELEMENT([modplug], [bad])
-])
+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], [
+               have_all_elements=yes
+               m4_ifdef([GST_ELEMENT_CHECK], [
+                       m4_map_args_w([
+                               giostreamsrc
+                               typefind
+                               audioconvert
+                               volume
+                               oggdemux
+                               vorbisdec
+                               autoaudiosink
+                               aiffparse
+                               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
@@ -193,15 +227,16 @@ interpreters/frotz/Makefile
 interpreters/nitfol/Makefile
 interpreters/glulxe/Makefile
 interpreters/git/Makefile
+interpreters/bocfel/Makefile
 tests/Makefile
+tests/unit/Makefile
 player/Makefile
-player/chimara.menus
+player/config.py
 docs/Makefile
 docs/reference/Makefile
 docs/reference/version.xml
 docs/reference/build-selector-table.pl
 po/Makefile.in
-babel/Makefile
 ])
 
 # Do it