1 # configure.ac with sensible comments
3 ### INITIALIZATION ############################################################
5 AC_PREREQ([2.64]) # Newest feature: m4_map_args_w
7 # Args: (human-readable package name, package version, bug report address,
9 AC_INIT([chimara], [0.9])
10 # Sanity check to make sure we are running Autoconf from the right directory
11 AC_CONFIG_SRCDIR(libchimara/chimara-glk.c)
12 # Put m4 macros in their own directory
13 AC_CONFIG_MACRO_DIR([m4])
15 AM_INIT_AUTOMAKE([-Wall -Wno-portability])
16 # Configure with --enable-silent-rules to cut down on clutter
17 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
19 ### LIBRARY VERSIONING ########################################################
20 # Only update immediately before a public release
22 CHIMARA_CURRENT=0 # Increment if interface changes
23 CHIMARA_REVISION=0 # Increment if source changes; set 0 if interface changes
24 CHIMARA_AGE=0 # Increment if interfaces added; set 0 if removed
25 LT_VERSION_INFO="$CHIMARA_CURRENT:$CHIMARA_REVISION:$CHIMARA_AGE"
26 AC_SUBST(LT_VERSION_INFO)
28 ### REQUIREMENTS ##############################################################
29 GTK_REQUIRED_VERSION=2.18
30 GLIB_REQUIRED_VERSION=2.32
31 GTK_DOC_REQUIRED_VERSION=1.12
32 AC_SUBST(GTK_REQUIRED_VERSION)
33 AC_SUBST(GLIB_REQUIRED_VERSION)
34 AC_SUBST(GTK_DOC_REQUIRED_VERSION)
36 ### DECLARE COMPILERS #########################################################
38 AC_USE_SYSTEM_EXTENSIONS # Define _GNU_SOURCE if using GCC
39 AC_PROG_CC # C compiler
40 AM_PROG_CC_C_O # Automake requires this for per-target CFLAGS
41 AC_C_INLINE # Define inline keyword
42 AC_PROG_YACC # Building nitfol requires yacc
44 ### DECLARE PROGRAMS ##########################################################
46 AC_PROG_INSTALL # Install
47 LT_INIT([dlopen]) # Libtool 2.2.6 and up
49 AM_GNU_GETTEXT([external]) # Gettext, link to system libintl
50 IT_PROG_INTLTOOL([0.40.0]) # Intltool
51 PKG_PROG_PKG_CONFIG # pkg_config
52 GTK_DOC_CHECK($GTK_DOC_REQUIRED_VERSION)
53 GLIB_GSETTINGS # GSettings
54 # Other utilities used in this package's various make scripts
56 AC_PATH_PROG([PERL], [perl]) # Perl
57 AC_PATH_PROG([TEST], [test]) # Test
58 AC_PATH_PROG([ECHO], [echo]) # Echo
60 ### TYPES #####################################################################
67 ### INTERNATIONALIZATION ######################################################
69 AM_GNU_GETTEXT_VERSION([0.17])
70 GETTEXT_PACKAGE=chimara
71 AC_SUBST(GETTEXT_PACKAGE)
72 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
74 ### INTROSPECTION ##############################################################
76 GOBJECT_INTROSPECTION_CHECK([0.6.7])
78 ### RPM CONFIGURATION ##########################################################
79 # --enable-rpm requires rpm and rpmbuild
80 AC_PATH_PROG([RPMBUILD], [rpmbuild], [notfound])
82 [AS_HELP_STRING([--enable-rpm=@<:@yes/no@:>@],
83 [Configure for building RPM package @<:@default=no@:>@ (requires rpm and rpmbuild)])],
84 [AS_IF([$TEST "x$enable_rpm" = xyes],
85 [AS_IF([$TEST "x$RPMBUILD" = xnotfound],
86 [AC_MSG_ERROR([rpmbuild is required for --enable-rpm])])])],
88 AM_CONDITIONAL(BUILDING_RPM, $TEST "x$enable_rpm" = xyes)
90 ### SOUND LIBRARY TO USE ######################################################
93 [AS_HELP_STRING([--with-sound=@<:@no/auto/gstreamer0.10/gstreamer1.0@:>@],
94 [Choose library with which to implement Glk sound])],
100 AS_IF([test "x$with_sound" != "xno"], [
101 PKG_CHECK_EXISTS([gstreamer-1.0], [have_gstreamer1_0=yes])
102 PKG_CHECK_EXISTS([gstreamer-0.10], [have_gstreamer0_10=yes])])
104 # Autodetect sound library
105 AS_IF([test "x$with_sound" = "xauto"], [
106 AC_MSG_CHECKING([which sound library to use])
107 AS_IF([test "x$have_gstreamer1_0" = "xyes"], [with_sound=gstreamer1.0], [
108 AS_IF([test "x$have_gstreamer0_10" = "xyes"],
109 [with_sound=gstreamer0.10],
111 AC_MSG_RESULT([$with_sound])])
112 # Sound library to use in the end
113 AS_CASE([$with_sound],
115 AC_DEFINE([GSTREAMER_0_10_SOUND], [1],
116 [Define to enable sound support with GStreamer 0.10])
117 SOUND_MODULE="gstreamer-0.10 >= 0.10.12"],
119 AC_DEFINE([GSTREAMER_1_0_SOUND], [1],
120 [Define to enable sound support with GStreamer 1.0])
121 SOUND_MODULE="gstreamer-1.0"],
123 AS_IF([test "x$with_sound" != "xno"],
124 [AC_DEFINE([HAVE_SOUND], [1], [Define if any sound support is enabled])])
126 ### WHETHER TO GENERATE A .VAPI FILE ##########################################
128 AC_PATH_PROG([VAPIGEN], [vapigen], [notfound])
129 AM_CONDITIONAL(BUILDING_VAPI, $TEST "x$VAPIGEN" != xnotfound)
131 ### CHECK FOR LIBRARIES #######################################################
133 # Libraries needed to build Chimara library
134 PKG_CHECK_MODULES([CHIMARA], [
135 glib-2.0 >= $GLIB_REQUIRED_VERSION
136 gtk+-2.0 >= $GTK_REQUIRED_VERSION
142 CHIMARA_LIBS="$CHIMARA_LIBS -lm"
143 AC_SUBST(CHIMARA_LIBS)
144 # Libraries needed to build Chimara player
145 PKG_CHECK_MODULES([PLAYER], [
146 glib-2.0 >= $GLIB_REQUIRED_VERSION
147 gtk+-2.0 >= $GTK_REQUIRED_VERSION
150 # Libraries needed to build test programs
151 PKG_CHECK_MODULES([TEST], [
152 gtk+-2.0 >= $GTK_REQUIRED_VERSION
153 gmodule-2.0 >= $GLIB_REQUIRED_VERSION
156 # GStreamer plugins needed to run library
157 AS_CASE([$with_sound],
159 have_all_elements=yes
160 m4_ifdef([AM_GST_ELEMENT_CHECK], [
171 [AM_GST_ELEMENT_CHECK(], [, [], [have_all_elements=no])])
172 AS_IF([test "x$have_all_elements" = "xno"],
173 [AC_MSG_ERROR([One or more required GStreamer elements were not found.
174 You will have to install your system's "base", "good", and "bad" plugins
175 pacakges. Try looking for names such as: gstreamer-plugins-base,
176 gstreamer-plugins-good, gstreamer-plugins-bad-free,
177 gstreamer-plugins-bad-free-extras, gstreamer0.10-plugins-base,
178 gstreamer0.10-plugins-good, gstreamer0.10-plugins-bad])])],
179 [AC_MSG_ERROR([AM_GST_ELEMENT_CHECK not found. Install the development package
180 for GStreamer 0.10 and rerun autogen.sh.])])
182 [gstreamer1.0], [dnl aiffparse is currently broken in Fedora 19
183 have_all_elements=yes
184 m4_ifdef([GST_ELEMENT_CHECK], [
194 [GST_ELEMENT_CHECK(], [, [1.0], [], [have_all_elements=no])])
195 AS_IF([test "x$have_all_elements" = "xno"],
196 [AC_MSG_ERROR([One or more required GStreamer elements were not found.
197 You will have to install your system's "base", "good", and "bad" plugins
198 packages. Try looking for names such as: gstreamer1-plugins-base,
199 gstreamer1-plugins-good, gstreamer1-plugins-bad-free,
200 gstreamer1-plugins-bad-free-extras, gstreamer1.0-plugins-base,
201 gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad])])],
202 [AC_MSG_ERROR([GST_ELEMENT_CHECK not found. Install the development package
203 for GStreamer 1.0 and rerun autogen.sh.])])
207 # Plugin flags; include '-module' in each Makefile.am, because AC_SUBSTed
208 # variables are black boxes to Automake, so it has to know about it being a
209 # module in the makefile itself.
210 PLUGIN_LIBTOOL_FLAGS='-avoid-version -shared -export-symbols-regex "^glk"'
211 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
213 ### OUTPUT ####################################################################
215 # Output platform-specific definitions to config.h
216 AC_CONFIG_HEADERS([config.h])
217 # List of other files for Autoconf to output
224 interpreters/Makefile
225 interpreters/frotz/Makefile
226 interpreters/nitfol/Makefile
227 interpreters/glulxe/Makefile
228 interpreters/git/Makefile
229 interpreters/bocfel/Makefile
235 docs/reference/Makefile
236 docs/reference/version.xml
237 docs/reference/build-selector-table.pl