-
Notifications
You must be signed in to change notification settings - Fork 30
/
configure.ac
291 lines (239 loc) · 9.38 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
m4_define([mx_major], [1])
m4_define([mx_minor], [99])
m4_define([mx_micro], [5])
m4_define([mx_version], [mx_major.mx_minor.mx_micro])
m4_define([mx_api_version], [2.0])
m4_define([mx_api_version_am], [2\_0])
# increase the interface age of 2 for each release
# set to 0 if the API changes
m4_define([mx_interface_age], [0])
m4_define([mx_abi_offset], [0])
m4_define([mx_binary_age], [m4_eval(100 * mx_minor + mx_micro - mx_abi_offset)])
AC_INIT([mx], [mx_version])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([mx/mx.h])
AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-xz])
# enable quiet ("silent") builds, if available
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([config.h])
AC_ISC_POSIX
AC_HEADER_STDC
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
AM_PATH_GLIB_2_0([2.35.8],
[],
[AC_MSG_ERROR([glib-2.0 is required])],
[gobject gthread gmodule-no-export])
AC_CHECK_FUNCS([localtime_r])
MX_MAJOR_VERSION=mx_major
MX_MINOR_VERSION=mx_minor
MX_MICRO_VERSION=mx_micro
MX_VERSION=mx_version
MX_API_VERSION=mx_api_version
MX_API_VERSION_AM=mx_api_version_am
AC_SUBST(MX_MAJOR_VERSION)
AC_SUBST(MX_MINOR_VERSION)
AC_SUBST(MX_MICRO_VERSION)
AC_SUBST(MX_VERSION)
AC_SUBST(MX_API_VERSION)
AC_SUBST(MX_API_VERSION_AM)
m4_define([lt_current], [m4_eval(100 * mx_minor + mx_micro - mx_interface_age)])
m4_define([lt_revision], [mx_interface_age])
m4_define([lt_age], [m4_eval(mx_binary_age - mx_interface_age)])
MX_LT_CURRENT=lt_current
MX_LT_REV=lt_revision
MX_LT_AGE=lt_age
MX_LT_VERSION="$MX_LT_CURRENT:$MX_LT_REV:$MX_LT_AGE"
MX_LT_LDFLAGS="-no-undefined -version-info $MX_LT_VERSION"
AC_SUBST(MX_LT_VERSION)
AC_SUBST(MX_LT_LDFLAGS)
dnl = Enable debug level ===================================================
m4_define([debug_default],
[m4_if(m4_eval(mx_minor % 2), [1], [yes], [minimum])])
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
[Enables on debugging @<:@default=debug_default@:>@])],
[],
[enable_debug=debug_default])
AS_CASE([$enable_debug],
[yes],
[
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
MX_DEBUG_CFLAGS="-DMX_ENABLE_DEBUG"
],
[no],
[
MX_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
],
[minimum],
[
MX_DEBUG_CFLAGS="-DMX_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS -Wno-deprecated-declarations"
],
[AC_MSG_ERROR([Invalid value for --enable-debug])]
)
AC_SUBST(MX_DEBUG_CFLAGS)
dnl = Enable strict compiler flags =========================================
AC_ARG_ENABLE([maintainer-flags],
[AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],
[Use strict compiler flags @<:@default=maintainer_flags_default@:>@])],
[],
[enable_maintainer_flags=no])
AS_IF([test "x$enable_maintainer_flags" = "xyes"],
[
AS_COMPILER_FLAGS([MX_MAINTAINER_CFLAGS],
["-Wall -Wshadow -Wcast-align
-Wno-uninitialized -Wempty-body -Wformat-security
-Winit-self -Wmissing-declarations
-Wredundant-decls"])
],
[
AS_COMPILER_FLAGS([MX_MAINTAINER_CFLAGS],
["-Wall"])
]
)
AC_SUBST(MX_MAINTAINER_CFLAGS)
dnl = Enable tests =========================================================
AC_ARG_ENABLE([tests],
[AC_HELP_STRING([--enable-tests],
[enable building of tests])],
[],
[enable_tests=no])
AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
dnl = Enable tools =========================================================
AC_ARG_ENABLE([tools],
[AC_HELP_STRING([--enable-tools],
[enable building of tools])],
[],
[enable_tools=no])
AM_CONDITIONAL([ENABLE_TOOLS], [test "x$enable_tools" = "xyes"])
dnl = Disable default style ================================================
AC_ARG_ENABLE([default-style],
[AC_HELP_STRING([--disable-default-style],
[disable the default style])],
[],
[enable_default_style=yes])
AM_CONDITIONAL([ENABLE_DEFAULT_STYLE], [test "x$enable_default_style" = "xyes"])
AS_IF([test "x$enable_default_style" = "xyes"],
AC_DEFINE([HAVE_DEFAULT_STYLE], [1],
[Defined if the default style is enabled]))
dnl = Required Packages ====================================================
MX_REQUIRES="gdk-pixbuf-2.0"
CLUTTER_VERSION_REQUIRED="1.11.8"
dnl = Winsys ===============================================================
MX_WINSYS=x11
AC_ARG_WITH([winsys],
[AC_HELP_STRING([--with-winsys=@<:@none/x11@:>@],
[Select the window system backend])],
[MX_WINSYS=$with_winsys])
AS_CASE([$MX_WINSYS],
[x11],
[
SUPPORT_X11=yes
WINSYS_X11_REQUIRES="clutter-x11-1.0 >= $CLUTTER_VERSION_REQUIRED xrandr >= 1.2.0"
MX_REQUIRES="$MX_REQUIRES $WINSYS_X11_REQUIRES"
],
[wayland],
[
SUPPORT_WAYLAND=yes
WINSYS_WAYLAND_REQUIRES="clutter-wayland-1.0 wayland-client"
MX_REQUIRES="$MX_REQUIRES $WINSYS_WAYLAND_REQUIRES"
],
[none],
[
WINSYS_NONE_REQUIRES="clutter-1.0 >= $CLUTTER_VERSION_REQUIRED"
MX_REQUIRES="$MX_REQUIRES $WINSYS_NONE_REQUIRES"
],
[AC_MSG_ERROR([Invalid winsys: use 'x11' or 'none'])]
)
AS_IF([test "x$SUPPORT_X11" = "xyes"],
[AC_DEFINE([HAVE_X11], [1], [Mx supports the X11 window system])])
AM_CONDITIONAL([HAVE_X11], [test "x$SUPPORT_X11" = "xyes"])
AS_IF([test "x$SUPPORT_WAYLAND" = "xyes"],
[AC_DEFINE([HAVE_WAYLAND], [1], [Mx supports the WAYLAND window system])])
AM_CONDITIONAL([HAVE_WAYLAND], [test "x$SUPPORT_WAYLAND" = "xyes"])
AC_SUBST(MX_WINSYS)
dnl = Optional Packages ====================================================
AC_ARG_WITH([clutter-imcontext],
[AC_HELP_STRING([--without-clutter-imcontext],
[disable input method support])],
[],
[with_clutter_imcontext=auto])
AS_IF([test "x$with_clutter_imcontext" != xno],
[PKG_CHECK_EXISTS([clutter-imcontext-0.1],
[AC_DEFINE([HAVE_CLUTTER_IMCONTEXT], [1],
[Define you have clutter-imcontext])
MX_REQUIRES="$MX_REQUIRES clutter-imcontext-0.1"
with_clutter_imcontext=yes],
[AS_IF([test "x$with_clutter_imcontext" = xyes],AC_MSG_FAILURE([Could not find clutter-imcontext. Use --without-clutter-imcontext to disable input method support.]))
with_clutter_imcontext=no]]
))
AC_ARG_WITH([startup-notification],
[AC_HELP_STRING([--without-startup-notification],
[disable startup notification])],
[],
[with_startup_notification=auto])
AS_IF([test "x$with_startup_notification" != xno],
[PKG_CHECK_EXISTS([libstartup-notification-1.0 >= 0.9],
[AC_DEFINE([HAVE_STARTUP_NOTIFICATION], [1],
[Define if startup notification is enabled])
MX_REQUIRES="$MX_REQUIRES libstartup-notification-1.0 >= 0.9"
with_startup_notification=yes],
[AS_IF([test "x$with_startup_notification" = xyes],
AC_MSG_FAILURE([Could not find libstartup-notification. Use --without-startup-notification to disable startup notification support.]))
with_startup_notification=no]]
))
dnl ***************************************************************************
dnl Internationalization
dnl ***************************************************************************
AS_ALL_LINGUAS
IT_PROG_INTLTOOL([0.35.0])
GETTEXT_PACKAGE="mx-$MX_API_VERSION"
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
["$GETTEXT_PACKAGE"],
[Gettext domain name])
GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
AM_GLIB_GNU_GETTEXT
AM_PROG_LIBTOOL
PKG_CHECK_MODULES(MX, [$MX_REQUIRES])
PKG_CHECK_MODULES(MX_IMAGE_CACHE, [gdk-pixbuf-2.0])
# check for gtk-doc
# gtkdocize greps for ^GTK_DOC_CHECK and parses it, so you need to have
# it on it's own line.
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
])
GOBJECT_INTROSPECTION_CHECK([0.6.4])
VAPIGEN_CHECK()
AC_CONFIG_FILES([
Makefile
mx.pc
data/Makefile
data/style/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/libmx/Makefile
docs/reference/libmx/version.xml
mx/Makefile
mx/mx-version.h
po/Makefile.in
tests/Makefile
tools/Makefile
])
AC_OUTPUT
dnl === Summary ===
echo ""
echo " Mx Toolkit - $VERSION"
echo ""
echo " Features:"
echo " Clutter-Imcontext: $with_clutter_imcontext"
echo " Startup Notification: $with_startup_notification"
echo " Windowing system: $MX_WINSYS"
echo ""
echo " Documentation:"
echo " Build API Reference: $enable_gtk_doc"
echo ""
echo " Extra:"
echo " Build introspection data: $enable_introspection"
echo ""