-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.ac
298 lines (272 loc) · 9.58 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
dnl Process this file with autoconf to produce configure
# Copyright 2014 Endless Mobile, Inc.
dnl ------------
dnl configure.ac
dnl ------------
dnl Please keep this file well-commented. Autotools involve a lot of magical
dnl incantations, and it is easy to mess things up if you don't know what you
dnl are doing.
# Version numbers
# ---------------
# API name and version for pkg-config; increment when breaking API/ABI.
# This version number is also the major version number.
m4_define([_EKN_API_VERSION_MACRO], [0])
# Minor and micro versions: increment micro version when making a release. Minor
# version is even for a stable release and odd for a development release.
# When making any release, if the API changes, set the interface age to 0.
m4_define([_EKN_MINOR_VERSION_MACRO], [4])
m4_define([_EKN_MICRO_VERSION_MACRO], [0])
m4_define([_EKN_INTERFACE_AGE_MACRO], [0])
# Full version, for use in AC_INIT
m4_define([_EKN_VERSION_MACRO],
[_EKN_API_VERSION_MACRO._EKN_MINOR_VERSION_MACRO._EKN_MICRO_VERSION_MACRO])
# Initialization
# --------------
# Initialize Autoconf: package name, version, bug report address, tarball name,
# website
AC_INIT([Endless OS Knowledge GUI Library], [_EKN_VERSION_MACRO],
[], [eos-knowledge], [http://endlessm.com])
# Verify that the source directory can be found
AC_CONFIG_SRCDIR([lib/eosknowledgeprivate/ekn-util.h])
# Initialize Automake: enable all warnings and do not insist on GNU standards
# no-portability suppresses warnings about syntax specific to GNU make
# parallel-tests specifies that we use the new parallel-running test harness.
# Unlike serial-tests, this option is accepted by Automake 1.11
# tar-ustar is required because there may be files whose entire paths exceed
# 99 characters.
# subdir-objects is for forward compatibility with Automake 2.0 and can be
# removed when we upgrade to that version.
AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.11 parallel-tests tar-ustar subdir-objects])
# Avoid spewing garbage over the terminal ('make V=1' to see the garbage)
AM_SILENT_RULES([yes])
# Initialize Libtool; don't build static libraries
LT_INIT([disable-static])
# Keep Autotools macros local to this source tree
AC_CONFIG_MACRO_DIR([m4])
AC_CACHE_SAVE
# Gettext package name
AC_SUBST([GETTEXT_PACKAGE], ["$PACKAGE"])
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"],
[Package name for Gettext])
# Detect which languages are available
AS_ALL_LINGUAS
# Required build tools
# --------------------
# Make sure we can create directory hierarchies
AC_PROG_MKDIR_P
# C compiler
AC_PROG_CC
AC_PROG_CC_C99
# Make sure the C compiler supports per-target CFLAGS
AM_PROG_CC_C_O
# Library configuration tool
PKG_PROG_PKG_CONFIG
# Gettext
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.1])
# GObject Introspection
GOBJECT_INTROSPECTION_REQUIRE([1.30])
# Documentation
HOTDOC_CHECK([0.8.90], [hotdoc_modular_framework])
# Various tools
AC_PROG_AWK # needed for TAP driver
AC_PROG_SED # needed for finding files for coverage
AC_REQUIRE_AUX_FILE([tap-driver.sh])
AC_SUBST([GLIB_COMPILE_RESOURCES], [`$PKG_CONFIG --variable glib_compile_resources gio-2.0`])
AC_PATH_PROG([SCSS], [sassc], [notfound])
AS_IF([test x$SCSS = xnotfound], [AC_MSG_ERROR([Sass compiler not found.
Try installing "sassc" or its equivalent package.])])
AC_ARG_VAR([SCSS], [Path to SCSS compiler])
# --with-eos-hotdoc-theme-dir: Use eos-hotdoc-theme from a location besides the default /usr/share
AC_ARG_WITH([eos-hotdoc-theme-dir], AS_HELP_STRING([--with-eos-hotdoc-theme-dir],
[Use eos-hotdoc-theme from a location besides the default /usr/share]),
[EOS_HOTDOC_THEME_DIR=$withval],
[EOS_HOTDOC_THEME_DIR=/usr/share/eos-hotdoc-theme])
AC_MSG_CHECKING([for eos-hotdoc-theme directory])
if test -d $EOS_HOTDOC_THEME_DIR; then
AC_MSG_RESULT([yes])
AC_SUBST([EOS_HOTDOC_THEME_DIR])
else
AC_MSG_ERROR([Cannot find eos-hotdoc-theme directory])
fi
AS_IF([test x$enable_documentation = xyes],
[AC_CHECK_FILE([$EOS_HOTDOC_THEME_DIR],,
[AC_MSG_ERROR([eos-hotdoc-theme is required for --enable-documentation.])])])
AC_CACHE_SAVE
# Check that the compiler really supports C99
AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [AC_MSG_ERROR([C99 is required.])])
# Configure options
# -----------------
# --enable-strict-flags: Compile with strict compiler flags. Done automatically
# during 'make distcheck'.
AC_ARG_ENABLE([strict-flags],
[AS_HELP_STRING([--enable-strict-flags=@<:@no/yes/error@:>@],
[Use strict compiler flags @<:@default=no@:>@])],
[],
[enable_strict_flags=no])
# Emmanuele's list of flags
STRICT_COMPILER_FLAGS="$STRICT_COMPILER_FLAGS
-Wall
-Wcast-align
-Wuninitialized
-Wno-strict-aliasing
-Werror=pointer-arith
-Werror=missing-declarations
-Werror=redundant-decls
-Werror=empty-body
-Werror=format
-Werror=format-security
-Werror=format-nonliteral
-Werror=init-self"
AS_CASE([$enable_strict_flags],
[yes],
[AS_COMPILER_FLAGS([STRICT_CFLAGS], [$STRICT_COMPILER_FLAGS])],
[no],
[],
[error],
[
STRICT_COMPILER_FLAGS="$STRICT_COMPILER_FLAGS -Werror"
AS_COMPILER_FLAGS([STRICT_CFLAGS], [$STRICT_COMPILER_FLAGS])
],
[AC_MSG_ERROR([Invalid option for --enable-strict-flags])])
AC_SUBST([STRICT_CFLAGS])
# --enable-inspector: Allow opening the WebKit inspector in the webviews by
# right-clicking
AC_ARG_ENABLE([inspector], AS_HELP_STRING([--enable-inspector],
[Allow activating WebKit inspector on HTML pages (default=no)]))
AS_IF([test "x$enable_inspector" != "xyes"], [inspector=false], [inspector=true])
AC_SUBST([inspector])
# --disable-metrics: Don't send metrics to Endless, and don't require the
# optional eos-metrics dependency
AC_ARG_ENABLE([metrics], AS_HELP_STRING([--disable-metrics],
[Sending metrics requires eos-metrics dependency (default=yes)]))
AS_IF([test "x$enable_metrics" != "xno"], [metrics=true], [metrics=false])
AC_SUBST([metrics])
# --with-mathjax-dir: Use mathjax from a location besides the default /usr/share
AC_ARG_WITH([mathjax-dir], AS_HELP_STRING([--with-mathjax-dir],
[Use mathjax from a location besides the default /usr/share]),
[MATHJAXDIR=$withval],
[MATHJAXDIR=/usr/share/javascript/mathjax])
AC_MSG_CHECKING([for mathjax javsacript library])
if test -d $MATHJAXDIR; then
AC_MSG_RESULT([yes])
AC_SUBST([MATHJAXDIR])
else
AC_MSG_ERROR([Cannot find mathjax package])
fi
# JASMINE_JUNIT_REPORTS_DIR: Where to put test reports
AC_MSG_CHECKING([where to put test reports])
AC_ARG_VAR([JASMINE_JUNIT_REPORTS_DIR], [Where to put test reports])
AS_IF([test -n "$JASMINE_JUNIT_REPORTS_DIR"],
[JASMINE_REPORT_ARGUMENT="--junit $JASMINE_JUNIT_REPORTS_DIR/\$\${log/%.log/.js.xml}"
AC_MSG_RESULT([in $JASMINE_JUNIT_REPORTS_DIR])],
[JASMINE_REPORT_ARGUMENT=
AC_MSG_RESULT([nowhere])])
AC_SUBST([JASMINE_REPORT_ARGUMENT])
# Hotdoc extra options (for git-upload extension)
AC_ARG_VAR([FRAMEWORK_EXTRA_HOTDOC_FLAGS],
[Extra Hotdoc options for building docs/framework (e.g. for git-upload)])
# Required libraries
# ------------------
# Update these whenever you use a function that requires a certain API version
PKG_CHECK_MODULES([EOS_KNOWLEDGE_PRIVATE], [
glib-2.0
gobject-2.0
gio-2.0
gtk+-3.0 >= 3.22
webkit2gtk-4.0
gstreamer-1.0 >= 1.10
gstreamer-audio-1.0 >= 1.10
gstreamer-video-1.0 >= 1.10
epoxy
])
PKG_CHECK_MODULES([GRESOURCE_PLUGIN], [
eknr-0,
gio-2.0
glib-2.0
gmodule-2.0
webkit2gtk-4.0
])
PKG_CHECK_MODULES([TOOLTIP_PLUGIN], [
glib-2.0
gmodule-2.0
gio-2.0
webkit2gtk-4.0
javascriptcoregtk-4.0
])
PKG_CHECK_MODULES([SCROLL_PLUGIN], [
glib-2.0
gmodule-2.0
gio-2.0
webkit2gtk-4.0
])
# Check installed GIRs for Javascript overrides
EOS_CHECK_GJS_GIR([DModel], [0])
EOS_CHECK_GJS_GIR([Eknr], [0])
EOS_CHECK_GJS_GIR([Emeus], [1.0])
EOS_CHECK_GJS_GIR([Endless], [0])
EOS_CHECK_GJS_GIR([EosShard], [0])
EOS_CHECK_GJS_GIR([EvinceDocument], [3.0])
EOS_CHECK_GJS_GIR([EvinceView], [3.0])
EOS_CHECK_GJS_GIR([Gdk], [3.0])
EOS_CHECK_GJS_GIR([GLib], [2.0])
EOS_CHECK_GJS_GIR([GObject], [2.0])
EOS_CHECK_GJS_GIR([Gtk], [3.0])
EOS_CHECK_GJS_GIR([Maxwell], [0.1])
EOS_CHECK_GJS_GIR([Pango], [1.0])
EOS_CHECK_GJS_GIR([Rsvg], [2.0])
EOS_CHECK_GJS_GIR([WebKit2], [4.0])
EOS_CHECK_GJS_GIR_API([Gdk], [Rectangle])
AS_IF([test "x$enable_metrics" != "xno"],
[EOS_CHECK_GJS_GIR([EosMetrics], [0])])
# GStreamer plugins needed for EknMediaBin widget
m4_pattern_allow([AM_GST_ELEMENT_CHECK])
m4_ifndef([GST_ELEMENT_CHECK], [
AC_MSG_ERROR([GST_ELEMENT_CHECK not found. Install the development package
for GStreamer 1.0 and rerun autogen.sh.])
])
have_all_elements=yes
m4_map_args_w([
playbin3
glsinkbin
gtksink
gtkglsink
giosrc
giostreamsrc
audioconvert
videoconvert
volume
vorbisdec
opusdec
theoradec
matroskademux
matroskaparse
vp8dec
vp9dec
v4l2src
oggdemux
oggparse
pulsesink],
[GST_ELEMENT_CHECK(], [, [1.10.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.0-plugins-base,
gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad])])
# Code Coverage
# -------------
EOS_COVERAGE_REPORT([c js])
AC_CACHE_SAVE
# Output
# ------
dnl List files here that the configure script should output
AC_CONFIG_FILES([
Makefile
data/eos-knowledge-0.pc
docs/Makefile
po/Makefile.in
js/framework/config.js.in
])
AC_CONFIG_HEADERS([config.h]) dnl Header with system-dependent #defines
# Do the output
AC_OUTPUT