forked from ptomato/inform7-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
362 lines (329 loc) · 13.7 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
### configure.ac with sensible comments ########################################
### INITIALIZATION #############################################################
# Initialize autoconf
# Args: (human-readable package name, package version, bug report address,
# tarballname)
AC_INIT([Inform 7], [6M62], [http://inform7.com/mantis], [gnome-inform7])
# Require Autoconf 2.64; I think the newest feature is m4_map_args_w...
AC_PREREQ([2.64])
# Sanity check to make sure we are running Autoconf from the right directory
AC_CONFIG_SRCDIR(src/main.c)
# Tell where to put the libtool macros
AC_CONFIG_MACRO_DIR([m4])
# Initialize automake; pkglibexecdir and silent rules introduced in 1.11
# foreign: Don't require GNU docs such as NEWS
# subdir-objects: forwards compatibility with 2.0
# dist-xz/no-dist-gzip: distribute .tar.xz instead of .tar.gz
AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects dist-xz no-dist-gzip])
# Configure with --enable-silent-rules to cut down on clutter
AM_SILENT_RULES([yes])
# Allow "AM_GST_ELEMENT_CHECK" for building without GStreamer development files
m4_pattern_allow([^AM_GST_ELEMENT_CHECK$])
### CHECK FOR PROPER NI EXECUTABLE #############################################
# Grep is required for these tests.
AC_PROG_GREP
AC_PROG_EGREP
AC_CHECK_FILE([${srcdir}/src/ni/ni], [NI=${srcdir}/src/ni/ni], [
AC_MSG_ERROR([ni not found in ${srcdir}/src/ni.
IMPORTANT NOTE! You must download version $VERSION of the appropriate
compiler package from inform7.org and put the file `ni' into the
directory `${srcdir}/src/ni'.
(Try http://inform7.com/download/content/$VERSION/I7_${VERSION}_Linux_all.tar.gz)])
])
AC_MSG_CHECKING([the version of ${NI}])
AS_IF([${NI} | $GREP $VERSION > /dev/null], [AC_MSG_RESULT([$VERSION])], [
AC_MSG_ERROR([You have version
[$(${NI} | $EGREP -o '[0-9][A-Z][0-9]{2}')] of ni in src/ni. This version of Inform 7 will only work with
version $VERSION.
IMPORTANT NOTE! You must download version $VERSION of the appropriate
compiler package from inform7.com and put the file `ni' into the
directory `${srcdir}/src/ni'.
(Try http://inform7.com/download/content/$VERSION/I7_${VERSION}_Linux_all.tar.gz)])
])
### DECLARE OPTIONS ############################################################
# Test is required for these option checks
AC_PATH_PROG([TEST], [test])
# Optional programs
AC_PATH_PROG([PDFTEX], [pdftex], [notfound])
AC_PATH_PROG([EVINCE], [evince], [notfound])
# Check for pdftex and evince even though they are not required; in any case it
# will fill in the proper paths in inweb-configuration.txt.
AC_PATH_PROG([RPMBUILD], [rpmbuild], [notfound])
AC_PATH_PROG([RPM], [rpm], [notfound])
AC_PATH_PROG([DEBUILD], [dpkg-buildpackage], [notfound])
# --enable-rpm copies the ni executable and the spec file to the dist package,
# for use in building RPM packages. Requires rpm and rpmbuild.
AC_ARG_ENABLE([rpm],
[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])],
[$TEST "x$RPM" = xnotfound],
[AC_MSG_ERROR([rpm is required for --enable-rpm])])])],
[enable_rpm=no])
AM_CONDITIONAL(BUILDING_RPM, $TEST "x$enable_rpm" = xyes)
# --enable-deb copies only the ni executable to the dist package, for use in
# building DEB packages.
AC_ARG_ENABLE([deb],
[AS_HELP_STRING([--enable-deb=@<:@yes/no@:>@],
[Configure for building Debian package @<:@default=no@:>@ (requires dpkg-buildpackage)])],
[AS_IF([$TEST "x$enable_deb" = xyes],
[AS_IF([$TEST "x$DEBUILD" = xnotfound],
[AC_MSG_ERROR([dpkg-buildpackage is required for --enable-deb])],
[$TEST "x$enable_rpm" = xyes],
[AC_MSG_ERROR([--enable-rpm and --enable-deb are mutually exclusive])])])],
[enable_deb=no])
AM_CONDITIONAL([BUILDING_DEB], [$TEST "x$enable_deb" = xyes])
# --enable-distcheck does the same thing as --enable-deb, but doesn't require
# dpkg-buildpackage. This is because the tarball for distcheck needs to have
# the ni binary in it, otherwise configuring it will fail.
AC_ARG_ENABLE([distcheck],
[AS_HELP_STRING([--enable-distcheck=@<:@yes/no@:>@],
[Configure for make distcheck @<:@default=no@:>@])])
AM_CONDITIONAL([DISTCHECK], [$TEST "x$enable_distcheck" = xyes])
# --enable-manuals builds the inweb and cBlorb manuals in HTML format. PDF is
# also possible, but requires more build dependencies, so you'll have to do that
# manually.
AC_ARG_ENABLE([manuals],
[AS_HELP_STRING([--enable-manuals=@<:@yes/sections/no@:>@],
[Build the inweb and cBlorb manuals @<:@default=no@:>@])],
[],
[enable_manuals=no])
AM_CONDITIONAL([MANUALS], [$TEST "x$enable_manuals" != xno])
AM_CONDITIONAL([MANUALS_SECTIONS], [$TEST "x$enable_manuals" = xsections])
### DECLARE PROGRAMS ##########################################################
# Programs that Autoconf has built-in checks for
AC_PROG_CC # C compiler
AC_PROG_CC_C99 # ...and put it in C99 mode
AM_PROG_CC_C_O # Automake requires this for per-target CFLAGS
AC_PROG_INSTALL # Install
AC_PROG_SED # Sed
AC_PROG_MKDIR_P # mkdir -p
AM_PROG_AR # ar
LT_INIT([dlopen]) # Libtool 2.2.6 and up
LT_PREREQ([2.2.6])
# Other tools used in this package's various make scripts
AC_PATH_PROG([PERL], [perl]) # Perl
AC_PATH_PROG([TAR], [tar gtar]) # tar
AC_PATH_PROG([XARGS], [xargs]) # xargs
AC_PATH_PROG([CHMOD], [chmod]) # chmod
AC_PATH_PROG([CAT], [cat]) # cat
AC_PATH_PROG([ECHO], [echo]) # echo
AC_PATH_PROG([CP], [cp]) # cp
AC_PATH_PROG([DATE], [date]) # date
AC_PATH_PROG([MV], [mv]) # mv
# Other programs
AM_GNU_GETTEXT([external]) # Gettext, link to system libintl
PKG_PROG_PKG_CONFIG # pkg_config
GLIB_GSETTINGS # used for GSettings
AC_PATH_PROG([UNLZMA], [unlzma], [notfound]) # nonGNU tar doesn't have --lzma
AS_IF([$TEST "x$UNLZMA" = xnotfound],
[AC_MSG_ERROR([The unlzma program is required to install Inform 7.
Try installing it from your package manager.])])
# ITS tool not needed for tarball build, so only error out if a git clone
AC_PATH_PROG([ITSTOOL], [itstool], [itstool-notfound])
AS_IF([$TEST "x$ITSTOOL" = xitstool-notfound -a -d .git],
[AC_MSG_ERROR([ITS Tool is needed to compile Inform 7 from a Git checkout.
Try installing it from your package manager.])])
### INTERNATIONALIZATION #######################################################
AM_GNU_GETTEXT_VERSION([0.19.2])
# 0.18.3 required for Glade files; but use last point release from supported
# distros (currently openSUSE 13.2 has this version, Debian stable has .3)
GETTEXT_PACKAGE=gnome-inform7
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
### CHECK FOR LIBRARIES ########################################################
# Decide which UUID library to use
# Prefer e2fsprogs, and switch to OSSP if that doesn't exist
PKG_CHECK_EXISTS([uuid],
[AC_DEFINE([E2FS_UUID], [1], [Define if uuid header is from e2fsprogs])
UUID_MODULE=uuid],
[PKG_CHECK_EXISTS([ossp-uuid],
[UUID_MODULE=ossp-uuid],
[AC_MSG_ERROR([Either OSSP UUID or e2fsprogs UUID required.])]
)]
)
# Also, check which header is used
AC_CHECK_HEADERS([uuid.h ossp/uuid.h uuid/uuid.h])
# Decide which sound library to use
AC_ARG_WITH([sound],
[AS_HELP_STRING([--with-sound=@<:@no/gstreamer@:>@],
[Choose library with which to implement Glk sound])],
[],
[with_sound=gstreamer])
SOUND_MODULE=
# Autodetect sound library
AS_IF([test "x$with_sound" = "xgstreamer"], [
AC_MSG_CHECKING([which version of GStreamer is used in WebKit])
WEBKIT_LIBDIR=$(pkg-config --variable=libdir webkit-1.0)
# Get -lwebkit-blah and remove -l
WEBKIT_LIBNAME=$(pkg-config --libs webkit-1.0 | sed -e 's/ /\n/g' | $GREP webkit | cut -c3-)
WEBKIT_LIBRARY="$WEBKIT_LIBDIR/lib$WEBKIT_LIBNAME.so"
with_sound=$(ldd $WEBKIT_LIBRARY | $GREP -E -o "gstreamer-@<:@0-9@:>@\\.@<:@0-9@:>@+" | uniq)
# with_sound is now gstreamer-1.0, gstreamer-0.10, or empty
AS_IF([test -z "$with_sound"], [with_sound=no])
AC_MSG_RESULT([$with_sound])])
# Sound library to use in the end
AS_CASE([$with_sound],
[gstreamer-0.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"],
[gstreamer-1.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])])
# If webkit-1.0 is a later version than 1.6.0, then we need to pull in
# javascriptcoregtk-1.0 as well
PKG_CHECK_EXISTS([webkit-1.0 >= 1.6.0],
[JAVASCRIPTCORE_MODULE=javascriptcoregtk-1.0],
[JAVASCRIPTCORE_MODULE=]
)
# Libraries for main program
PKG_CHECK_MODULES([INFORM7], [
gdk-2.0 >= 2.2
glib-2.0 >= 2.32
gtk+-2.0 >= 2.24
gio-2.0 >= 2.30
gtksourceview-2.0 >= 2.2
webkit-1.0 >= 1.0
$JAVASCRIPTCORE_MODULE
gtkspell-2.0
libxml-2.0
goocanvas
$UUID_MODULE
])
PKG_CHECK_MODULES([OSXCART], [
glib-2.0 >= 2.16
gdk-2.0
gdk-pixbuf-2.0 >= 2.6
gtk+-2.0 >= 2.10
])
PKG_CHECK_MODULES([CHIMARA], [
glib-2.0 >= 2.16
gtk+-2.0 >= 2.12
gthread-2.0
gmodule-2.0
pango
$SOUND_MODULE
])
# GStreamer plugins needed to run library
AS_CASE([$with_sound],
[gstreamer-0.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.])])
],
[gstreamer-1.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.])])
],
[])
### WHETHER TO RUN TESTS IN VIRTUAL X SERVER ###################################
# Requires xvfb
AC_ARG_WITH([xvfb-tests],
AS_HELP_STRING([--with-xvfb-tests],
[Use xvfb to run tests, e.g. on build servers @<:@default=no@:>@]))
AS_IF([test "x$with_xvfb_tests" != "xno"],
[AC_PATH_PROG([XVFB], [xvfb-run], [notfound])])
AS_IF([test "x$XVFB" != "xnotfound"],
[AC_SUBST([XVFB_RUN], ["$XVFB "])], dnl can add other xvfb-run args here
[AS_IF([test "x$with_vfb_tests" = "yes"],
[AC_MSG_ERROR([XVFB tests requested, but xvfb-run not found])])])
### DEFINE OTHER VARIABLES #####################################################
# Inform 6 version that goes along with this release
AC_DEFINE_UNQUOTED([INFORM6_COMPILER_VERSION],
["6.33"], [Version of Inform 6 compiler.])
# 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)
# Get current year for updating copyrights
AC_SUBST(COPYRIGHT_YEAR, [`$DATE +%Y`])
AC_DEFINE_UNQUOTED([COPYRIGHT_YEAR], ["$COPYRIGHT_YEAR"], [Year this program was built.])
# Compiler flags
# Justification for -Wno-unused-parameter: GLib signal handling code has many
# callback types with certain signatures, and more often than not we don't need
# to use all the parameters passed to a callback.
AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wno-unused-parameter], [WARNINGFLAGS])
AC_SUBST([WARNINGFLAGS])
AX_APPEND_COMPILE_FLAGS([-Wno-unused-result], [INWEB_EXTRAFLAGS])
AC_SUBST([INWEB_EXTRAFLAGS])
AX_APPEND_COMPILE_FLAGS([-Wno-pointer-to-int-cast], [INFORM6_EXTRAFLAGS])
AC_SUBST([INFORM6_EXTRAFLAGS])
AX_APPEND_COMPILE_FLAGS([-Wno-tautological-compare], [CHIMARA_EXTRAFLAGS])
AC_SUBST([CHIMARA_EXTRAFLAGS])
AX_APPEND_COMPILE_FLAGS([-Wno-implicit-function-declaration],
[FROTZ_EXTRAFLAGS])
AC_SUBST([FROTZ_EXTRAFLAGS])
AX_APPEND_COMPILE_FLAGS([-Wno-pointer-sign], [GIT_EXTRAFLAGS])
AC_SUBST([GIT_EXTRAFLAGS])
### OUTPUT #####################################################################
# Output platform-specific definitions to config.h
AC_CONFIG_HEADERS([config.h])
# List of other files for Autoconf to output
AC_CONFIG_FILES([
Makefile
src/Makefile
src/inform6/Makefile
src/inlib/Makefile
src/inweb/Makefile
src/inweb/Materials/inweb-configuration.txt
src/cBlorb/Makefile
src/ni/Makefile
po/Makefile.in
data/Makefile
data/ui/Makefile
data/licenses/Makefile
data/licenses/license.html
data/highlighting/Makefile
data/mime/Makefile
data/styles/Makefile
pixmaps/Makefile
])
# Do it
AC_OUTPUT