Added a Python player!
[projects/chimara/chimara.git] / configure.ac
1 # configure.ac with sensible comments
2
3 ### INITIALIZATION ############################################################
4
5 AC_PREREQ([2.62]) # Oldest version of Autoconf that works with introspection
6 # Initialize Autoconf
7 # Args: (human-readable package name, package version, bug report address, 
8 # tarballname)
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])
14 # Initialize Automake
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])])
18
19 ### LIBRARY VERSIONING ########################################################
20 # Only update immediately before a public release
21
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)
27
28 ### REQUIREMENTS ##############################################################
29 # Recommended GTK version: at least 2.12
30 # Recommended Glib version: at least 2.16
31 GTK_REQUIRED_VERSION=2.6
32 GLIB_REQUIRED_VERSION=2.6
33 GTK_DOC_REQUIRED_VERSION=1.9
34 AC_SUBST(GTK_REQUIRED_VERSION)
35 AC_SUBST(GLIB_REQUIRED_VERSION)
36 AC_SUBST(GTK_DOC_REQUIRED_VERSION)
37
38 ### DECLARE COMPILERS #########################################################
39
40 AC_USE_SYSTEM_EXTENSIONS     # Define _GNU_SOURCE if using GCC
41 AC_PROG_CC                   # C compiler
42 AM_PROG_CC_C_O               # Automake requires this for per-target CFLAGS
43 AC_C_INLINE                  # Define inline keyword 
44 AC_PROG_YACC                 # Building nitfol requires yacc
45
46 ### DECLARE PROGRAMS ##########################################################
47
48 AC_PROG_INSTALL              # Install
49 LT_INIT([dlopen])            # Libtool 2.2.6 and up
50 LT_PREREQ([2.2.6])
51 AM_GNU_GETTEXT([external])   # Gettext, link to system libintl
52 IT_PROG_INTLTOOL([0.40.0])   # Intltool
53 PKG_PROG_PKG_CONFIG          # pkg_config
54 GTK_DOC_CHECK($GTK_DOC_REQUIRED_VERSION) 
55 GLIB_GSETTINGS               # GSettings
56 # Other utilities used in this package's various make scripts
57 AC_PROG_AWK
58 AC_PATH_PROG([PERL], [perl]) # Perl
59 AC_PATH_PROG([TEST], [test]) # Test
60 AC_PATH_PROG([ECHO], [echo]) # Echo
61
62 ### TYPES #####################################################################
63
64 AC_TYPE_UINT8_T
65 AC_TYPE_UINT16_T
66 AC_TYPE_INT32_T
67 AC_TYPE_UINT32_T
68
69 ### INTERNATIONALIZATION ######################################################
70
71 AM_GNU_GETTEXT_VERSION([0.17])
72 GETTEXT_PACKAGE=chimara
73 AC_SUBST(GETTEXT_PACKAGE)
74 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
75
76 ### INTROSPECTION ##############################################################
77
78 GOBJECT_INTROSPECTION_CHECK([0.6.7])
79
80 ### ILIAD #####################################################################
81 AC_ARG_ENABLE([iliad],
82         [AS_HELP_STRING([--enable-iliad=@<:@yes/no@:>@],
83                 [Compiles Chimara for the iLiad @<:@default=no@:>@])],
84         [],
85         [enable_iliad=no])
86 AM_CONDITIONAL(TARGET_ILIAD, $TEST "x$enable_iliad" = xyes)
87
88 ### BUILD WITHOUT RECENT FILES MANAGER #########################################
89 # (to work around a bug on OS X)
90 AC_ARG_ENABLE([recent],
91         [AS_HELP_STRING([--disable-recent],
92                 [Omit recent files menu (to work around a bug on OS X])],
93         [],
94         [enable_recent=yes])
95 AS_IF([$TEST "x$enable_recent" = "xyes"],
96         [OPEN_RECENT_MENU_ITEM="<menuitem action=\"recent\"/>"],
97         [OPEN_RECENT_MENU_ITEM="<!--  <menuitem action=\"recent\"/>-->"])
98 AC_SUBST(OPEN_RECENT_MENU_ITEM)
99
100 ### RPM CONFIGURATION ##########################################################
101 # --enable-rpm requires rpm and rpmbuild
102 AC_PATH_PROG([RPMBUILD], [rpmbuild], [notfound])
103 AC_ARG_ENABLE([rpm],
104         [AS_HELP_STRING([--enable-rpm=@<:@yes/no@:>@],
105                 [Configure for building RPM package @<:@default=no@:>@ (requires rpm and rpmbuild)])],
106         [AS_IF([$TEST "x$enable_rpm" = xyes],
107                 [AS_IF([$TEST "x$RPMBUILD" = xnotfound],
108                         [AC_MSG_ERROR([rpmbuild is required for --enable-rpm])])])],
109         [enable_rpm=no])
110 AM_CONDITIONAL(BUILDING_RPM, $TEST "x$enable_rpm" = xyes)
111
112 ### SOUND LIBRARY TO USE ######################################################
113
114 AC_ARG_WITH([gstreamer],
115         [AS_HELP_STRING([--without-gstreamer], [Disable GStreamer sound])],
116         [],
117         [with_gstreamer=yes])
118 SOUND_MODULE=
119 AS_IF([$TEST "x$with_gstreamer" != xno], 
120         [AC_DEFINE([GSTREAMER_SOUND], [1], [Define to enable sound support with GStreamer])
121         SOUND_MODULE="gstreamer-0.10 >= 0.10.12"])
122
123 ### WHETHER TO GENERATE A .VAPI FILE ##########################################
124 # Requires vapigen
125 AC_PATH_PROG([VAPIGEN], [vapigen], [notfound])
126 AM_CONDITIONAL(BUILDING_VAPI, $TEST "x$VAPIGEN" != xnotfound)
127
128 ### CHECK FOR LIBRARIES #######################################################
129
130 # Libraries needed to build Chimara library
131 PKG_CHECK_MODULES([CHIMARA], [
132         glib-2.0 >= $GLIB_REQUIRED_VERSION
133         gtk+-2.0 >= $GTK_REQUIRED_VERSION
134         gthread-2.0 
135         gmodule-2.0
136         pango
137         $SOUND_MODULE
138 ])
139 CHIMARA_LIBS="$CHIMARA_LIBS -lm"
140 AC_SUBST(CHIMARA_LIBS)
141 # Libraries needed to build Chimara player
142 PKG_CHECK_MODULES([PLAYER], [
143         glib-2.0 >= $GLIB_REQUIRED_VERSION
144         gtk+-2.0 >= $GTK_REQUIRED_VERSION
145         gmodule-2.0
146         libgda-4.0
147         libsoup-2.4
148 ])
149 # Libraries needed to build test programs
150 PKG_CHECK_MODULES([TEST], [
151         gtk+-2.0 >= $GTK_REQUIRED_VERSION
152         gmodule-2.0 >= $GLIB_REQUIRED_VERSION
153 ])
154
155 # GStreamer plugins needed to run library
156 AS_IF([$TEST "x$with_gstreamer" != xno], [
157         m4_defun([AX_GST_REQUIRE_ELEMENT],
158                 [AM_GST_ELEMENT_CHECK([$1],
159                         [],
160                         [AC_MSG_ERROR([GStreamer element $1 not found. You need to install gstreamer-plugins-m4_default([$2], [base]).])]
161                 )]
162         )
163         AX_GST_REQUIRE_ELEMENT([giostreamsrc])
164         AX_GST_REQUIRE_ELEMENT([typefind])
165         AX_GST_REQUIRE_ELEMENT([audioconvert])
166         AX_GST_REQUIRE_ELEMENT([volume])
167         AX_GST_REQUIRE_ELEMENT([oggdemux])
168         AX_GST_REQUIRE_ELEMENT([vorbisdec])
169         AX_GST_REQUIRE_ELEMENT([autoaudiosink], [good])
170         AX_GST_REQUIRE_ELEMENT([aiffparse], [bad])
171         AX_GST_REQUIRE_ELEMENT([modplug], [bad])
172 ])
173
174 # Plugin flags; include '-module' in each Makefile.am, because AC_SUBSTed
175 # variables are black boxes to Automake, so it has to know about it being a
176 # module in the makefile itself.
177 PLUGIN_LIBTOOL_FLAGS='-avoid-version -shared -export-symbols-regex "^glk"'
178 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
179
180 ### OUTPUT ####################################################################
181
182 # Output platform-specific definitions to config.h
183 AC_CONFIG_HEADERS([config.h])
184 # List of other files for Autoconf to output
185 AC_CONFIG_FILES([
186 Makefile
187 chimara.pc
188 chimara-plugin.pc
189 chimara.spec
190 libchimara/Makefile
191 interpreters/Makefile
192 interpreters/frotz/Makefile
193 interpreters/nitfol/Makefile
194 interpreters/glulxe/Makefile
195 interpreters/git/Makefile
196 tests/Makefile
197 player/Makefile
198 player/chimara.menus
199 player/config.py
200 docs/Makefile
201 docs/reference/Makefile
202 docs/reference/version.xml
203 docs/reference/build-selector-table.pl
204 po/Makefile.in
205 babel/Makefile
206 ])
207
208 # Do it
209 AC_OUTPUT
210