- [AS_HELP_STRING([--enable-rpm],[Configure for building RPM package [no] (requires rpm and rpmbuild)])],
- [AS_CASE([${enableval}],
- [yes], [AS_IF(
- [$TEST "x$RPMBUILD" = xnotfound],
- [AC_MSG_ERROR([rpmbuild is required for --enable-rpm])],
- [rpm=true])],
- [no], [rpm=false],
- [AC_MSG_ERROR([bad value ${enableval} for --enable-rpm])]
- )],
- [rpm=false]
-)
-AM_CONDITIONAL([BUILDING_RPM], [$TEST "x$rpm" = xtrue])
-# The user can specify the RPM release number in the environment (e.g. '1')
-AC_ARG_VAR([RPM_RELEASE], [Release number to build RPMs with [1]])
-AS_IF([$TEST "x$RPM_RELEASE" = x], [RPM_RELEASE=1])
+ [AS_HELP_STRING([--enable-rpm=@<:@yes/no@:>@],
+ [Configure for building RPM package @<:@default=no@:>@ (requires rpm and rpmbuild)])],
+ [AS_IF([$TEST "x$enable_rpm" = xyes],
+ [AS_IF([$TEST "x$RPMBUILD" = xnotfound],
+ [AC_MSG_ERROR([rpmbuild is required for --enable-rpm])])])],
+ [enable_rpm=no])
+AM_CONDITIONAL(BUILDING_RPM, $TEST "x$enable_rpm" = xyes)
+
+### SOUND LIBRARY TO USE ######################################################
+
+AC_ARG_WITH([sound],
+ [AS_HELP_STRING([--with-sound=@<:@no/auto/gstreamer0.10/gstreamer1.0@:>@],
+ [Choose library with which to implement Glk sound])],
+ [],
+ [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=
+# 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
+AC_PATH_PROG([VAPIGEN], [vapigen], [notfound])
+AM_CONDITIONAL(BUILDING_VAPI, $TEST "x$VAPIGEN" != xnotfound)