configure.ac: bump version to 1.6.0
[platform/upstream/weston.git] / configure.ac
1 m4_define([weston_major_version], [1])
2 m4_define([weston_minor_version], [6])
3 m4_define([weston_micro_version], [0])
4 m4_define([weston_version],
5           [weston_major_version.weston_minor_version.weston_micro_version])
6
7 AC_PREREQ([2.64])
8 AC_INIT([weston],
9         [weston_version],
10         [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=weston_version],
11         [weston],
12         [http://wayland.freedesktop.org/])
13
14 AC_SUBST([WESTON_VERSION_MAJOR], [weston_major_version])
15 AC_SUBST([WESTON_VERSION_MINOR], [weston_minor_version])
16 AC_SUBST([WESTON_VERSION_MICRO], [weston_micro_version])
17 AC_SUBST([WESTON_VERSION], [weston_version])
18
19 AC_CONFIG_AUX_DIR([build-aux])
20 AC_CONFIG_HEADERS([config.h])
21 AC_CONFIG_MACRO_DIR([m4])
22
23 AC_USE_SYSTEM_EXTENSIONS
24 AC_SYS_LARGEFILE
25
26 AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects])
27
28 AM_SILENT_RULES([yes])
29
30 # Check for programs
31 AC_PROG_CC
32 AC_PROG_SED
33
34 # Initialize libtool
35 LT_PREREQ([2.2])
36 LT_INIT([disable-static])
37
38 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
39            [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
40 AC_ARG_VAR([WESTON_SHELL_CLIENT],
41            [Set the default desktop shell client to load if none is specified in weston.ini. @<:@default=weston-desktop-shell@:>@])
42
43 PKG_PROG_PKG_CONFIG()
44
45 AC_CHECK_FUNC([dlopen], [],
46               AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
47 AC_SUBST(DLOPEN_LIBS)
48
49 AC_CHECK_DECL(SFD_CLOEXEC,[],
50               [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
51               [[#include <sys/signalfd.h>]])
52 AC_CHECK_DECL(TFD_CLOEXEC,[],
53               [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")],
54               [[#include <sys/timerfd.h>]])
55 AC_CHECK_DECL(CLOCK_MONOTONIC,[],
56               [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
57               [[#include <time.h>]])
58 AC_CHECK_HEADERS([execinfo.h])
59
60 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
61
62 COMPOSITOR_MODULES="wayland-server >= 1.5.91 pixman-1 >= 0.25.2"
63
64 AC_ARG_ENABLE(egl, [  --disable-egl],,
65               enable_egl=yes)
66 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
67 if test x$enable_egl = xyes; then
68         AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
69         PKG_CHECK_MODULES(EGL, [egl >= 7.10 glesv2])
70         PKG_CHECK_MODULES([EGL_TESTS], [egl >= 7.10 glesv2 wayland-client wayland-egl])
71 fi
72
73 AC_ARG_ENABLE(xkbcommon,
74               AS_HELP_STRING([--disable-xkbcommon], [Disable libxkbcommon
75                               support: This is only useful in environments
76                               where you do not have a hardware keyboard. If
77                               libxkbcommon support is disabled clients will not
78                               be sent a keymap and and must know how to
79                               interpret the keycode sent for any key event.]),,
80               enable_xkbcommon=yes)
81 if test x$enable_xkbcommon = xyes; then
82         AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon support])
83         COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
84 fi
85
86 AC_ARG_ENABLE(setuid-install, [  --enable-setuid-install],,
87               enable_setuid_install=yes)
88 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
89
90
91 AC_ARG_ENABLE(xwayland, [  --enable-xwayland],,
92               enable_xwayland=yes)
93 AC_ARG_ENABLE(xwayland-test, [  --enable-xwayland-test],,
94               enable_xwayland_test=yes)
95 AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
96 AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes)
97 if test x$enable_xwayland = xyes; then
98   PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcb-composite xcursor cairo-xcb)
99   AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
100
101   AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
102               [Path to X server]), [XSERVER_PATH="$withval"],
103               [XSERVER_PATH="$bindir/Xwayland"])
104   AC_SUBST([XSERVER_PATH])
105   if test x$enable_xwayland_test = xyes; then
106     PKG_CHECK_MODULES([XWAYLAND_TEST], xcb xcb-dri2 libdrm)
107   fi
108 fi
109
110 PKG_CHECK_MODULES(LIBDRM, [libdrm],
111                   [AC_DEFINE(HAVE_LIBDRM, 1, [Define if libdrm is available]) have_libdrm=yes], have_libdrm=no)
112
113 AC_ARG_ENABLE(x11-compositor, [  --enable-x11-compositor],,
114               enable_x11_compositor=yes)
115 AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
116 if test x$enable_x11_compositor = xyes; then
117   PKG_CHECK_MODULES([XCB], xcb)
118   xcb_save_LIBS=$LIBS
119   xcb_save_CFLAGS=$CFLAGS
120   CFLAGS=$XCB_CFLAGS
121   LIBS=$XCB_LIBS
122   AC_CHECK_FUNCS([xcb_poll_for_queued_event])
123   LIBS=$xcb_save_LIBS
124   CFLAGS=$xcb_save_CFLAGS
125
126   X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
127
128   PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
129                     [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
130   if test "x$have_xcb_xkb" = xyes; then
131         # Most versions of XCB have totally broken XKB bindings, where the
132         # events don't work.  Make sure we can actually use them.
133         xcb_xkb_save_CFLAGS=$CFLAGS
134         CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
135         AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
136                         [], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
137         CFLAGS=$xcb_xkb_save_CFLAGS
138   fi
139   if test "x$have_xcb_xkb" = xyes; then
140         X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
141         AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
142   fi
143
144   PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
145   AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
146 fi
147
148
149 AC_ARG_ENABLE(drm-compositor, [  --enable-drm-compositor],,
150               enable_drm_compositor=yes)
151 AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes)
152 if test x$enable_drm_compositor = xyes; then
153   AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
154   PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
155 fi
156
157
158 AC_ARG_ENABLE(libinput-backend, [  --disable-libinput-backend],,
159               enable_libinput_backend=yes)
160 AM_CONDITIONAL([ENABLE_LIBINPUT_BACKEND], [test x$enable_libinput_backend = xyes])
161 if test x$enable_libinput_backend = xyes; then
162   AC_DEFINE([BUILD_LIBINPUT_BACKEND], [1], [Build the libinput input device backend])
163   PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.6.0])
164 fi
165
166
167 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
168
169 AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
170               enable_wayland_compositor=yes)
171 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
172                test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
173 if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
174   AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
175             [Build the Wayland (nested) compositor])
176   PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client >= 1.5.91 wayland-egl wayland-cursor])
177 fi
178
179
180 AC_ARG_ENABLE(headless-compositor, [  --enable-headless-compositor],,
181               enable_headless_compositor=yes)
182 AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
183                test x$enable_headless_compositor = xyes)
184
185
186 AC_ARG_ENABLE(rpi-compositor,
187               AS_HELP_STRING([--disable-rpi-compositor],
188                              [do not build the Raspberry Pi backend]),,
189               enable_rpi_compositor=yes)
190 AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes")
191 have_bcm_host="no"
192 if test "x$enable_rpi_compositor" = "xyes"; then
193   AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
194   PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
195   PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
196                     [have_bcm_host="yes"
197                      AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])],
198                     [AC_MSG_WARN([Raspberry Pi BCM host libraries not found, will use stubs instead.])])
199 fi
200 AM_CONDITIONAL(INSTALL_RPI_COMPOSITOR, test "x$have_bcm_host" = "xyes")
201
202
203 AC_ARG_ENABLE([fbdev-compositor], [  --enable-fbdev-compositor],,
204               enable_fbdev_compositor=yes)
205 AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
206                [test x$enable_fbdev_compositor = xyes])
207 AS_IF([test x$enable_fbdev_compositor = xyes], [
208   AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
209   PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0])
210 ])
211
212 AC_ARG_ENABLE([rdp-compositor], [  --enable-rdp-compositor],,
213               enable_rdp_compositor=no)
214 AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
215                [test x$enable_rdp_compositor = xyes])
216 if test x$enable_rdp_compositor = xyes; then
217   AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor])
218   PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
219
220   SAVED_CPPFLAGS="$CPPFLAGS"
221   CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS"
222   AC_CHECK_HEADERS([freerdp/version.h])
223   CPPFLAGS="$SAVED_CPPFLAGS"
224 fi
225
226 AC_ARG_ENABLE([screen-sharing], [  --enable-screen-sharing],,
227               enable_screen_sharing=no)
228 AM_CONDITIONAL([ENABLE_SCREEN_SHARING],
229                [test x$enable_screen_sharing = xyes])
230 if test x$enable_screen_sharing = xyes; then
231   PKG_CHECK_MODULES(SCREEN_SHARE, [wayland-client])
232
233   if test x$enable_rdp_compositor != xyes; then
234     AC_MSG_WARN([The screen-share.so module requires the RDP backend.])
235   fi
236 fi
237
238 AC_ARG_WITH(cairo,
239             AS_HELP_STRING([--with-cairo=@<:@image|gl|glesv2@:>@]
240                            [Which Cairo renderer to use for the clients]),
241                            [],[with_cairo="image"])
242
243 if test "x$with_cairo" = "ximage"; then
244         cairo_modules="cairo"
245 else
246 if test "x$with_cairo" = "xgl"; then
247         cairo_modules="cairo-gl"
248 else
249 if test "x$with_cairo" = "xglesv2"; then
250         cairo_modules="cairo-glesv2"
251 else
252         AC_ERROR([Unknown cairo renderer requested])
253 fi
254 fi
255 fi
256
257 # Included for legacy compat
258 AC_ARG_WITH(cairo-glesv2,
259             AS_HELP_STRING([--with-cairo-glesv2],
260                            [Use GLESv2 cairo]))
261 if test "x$with_cairo_glesv2" = "xyes"; then
262   cairo_modules="cairo-glesv2"
263   with_cairo="glesv2"
264 fi
265
266 if test "x$cairo_modules" = "xcairo-glesv2"; then
267 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
268 fi
269
270 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
271 PKG_CHECK_MODULES(PNG, [libpng])
272 PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
273 AS_IF([test "x$have_webp" = "xyes"],
274       [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
275
276 AC_ARG_ENABLE(vaapi-recorder, [  --enable-vaapi-recorder],,
277               enable_vaapi_recorder=auto)
278 if test x$enable_vaapi_recorder != xno; then
279   PKG_CHECK_MODULES(LIBVA, [libva >= 0.34.0 libva-drm >= 0.34.0],
280                     [have_libva=yes], [have_libva=no])
281   if test "x$have_libva" = "xno" -a "x$enable_vaapi_recorder" = "xyes"; then
282     AC_MSG_ERROR([vaapi-recorder explicitly enabled, but libva couldn't be found])
283   fi
284   AS_IF([test "x$have_libva" = "xyes"],
285         [AC_DEFINE([BUILD_VAAPI_RECORDER], [1], [Build the vaapi recorder])])
286 fi
287 AM_CONDITIONAL(ENABLE_VAAPI_RECORDER, test "x$have_libva" = xyes)
288
289
290 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
291 if test x$have_jpeglib = xyes; then
292   JPEG_LIBS="-ljpeg"
293 else
294   AC_ERROR([libjpeg not found])
295 fi
296 AC_SUBST(JPEG_LIBS)
297
298 PKG_CHECK_MODULES(CAIRO, [cairo])
299
300 PKG_CHECK_MODULES(TEST_CLIENT, [wayland-client])
301
302 AC_ARG_ENABLE(simple-clients,
303               AS_HELP_STRING([--disable-simple-clients],
304                              [do not build the simple wl_shm clients]),,
305               enable_simple_clients=yes)
306 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
307 if test x$enable_simple_clients = xyes; then
308   PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
309 fi
310
311 AC_ARG_ENABLE(simple-egl-clients,
312               AS_HELP_STRING([--disable-simple-egl-clients],
313                              [do not build the simple EGL clients]),,
314               enable_simple_egl_clients="$enable_egl")
315 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes")
316 if test x$enable_simple_egl_clients = xyes; then
317   PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
318                     [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
319 fi
320
321 AC_ARG_ENABLE(clients, [  --enable-clients],, enable_clients=yes)
322 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
323 if test x$enable_clients = xyes; then
324   AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
325
326   PKG_CHECK_MODULES(CLIENT, [wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor])
327   PKG_CHECK_MODULES(SERVER, [wayland-server])
328   PKG_CHECK_MODULES(WESTON_INFO, [wayland-client >= 1.5.91])
329
330   # Only check for cairo-egl if a GL or GLES renderer requested
331   AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
332     PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
333                       [have_cairo_egl=yes], [have_cairo_egl=no])
334     AS_IF([test "x$have_cairo_egl" = "xyes"],
335           [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
336           [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
337   [have_cairo_egl=no])
338
339   PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
340 fi
341
342 AC_ARG_ENABLE(resize-optimization,
343               AS_HELP_STRING([--disable-resize-optimization],
344                              [disable resize optimization allocating a big buffer in toytoolkit]),,
345               enable_resize_optimization=yes)
346 AS_IF([test "x$enable_resize_optimization" = "xyes"],
347       [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
348
349 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login >= 198],
350                   [have_systemd_login=yes], [have_systemd_login=no])
351 AS_IF([test "x$have_systemd_login" = "xyes"],
352       [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
353 AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
354
355 PKG_CHECK_MODULES(SYSTEMD_LOGIN_209, [libsystemd-login >= 209],
356                   [have_systemd_login_209=yes], [have_systemd_login_209=no])
357 AS_IF([test "x$have_systemd_login_209" = "xyes"],
358       [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
359
360 AC_ARG_ENABLE(weston-launch, [  --enable-weston-launch],, enable_weston_launch=yes)
361 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
362 if test x$enable_weston_launch == xyes; then
363   AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
364   if test x$have_pam == xno; then
365     AC_ERROR([weston-launch requires pam])
366   fi
367   PAM_LIBS=-lpam
368   AC_SUBST(PAM_LIBS)
369 fi
370
371 if test x$enable_egl = xyes; then
372   PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
373 fi
374 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
375
376 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
377
378 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
379                [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
380
381 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
382                test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
383
384 AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
385                [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
386
387 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
388
389 AC_ARG_ENABLE(fullscreen-shell,
390               AS_HELP_STRING([--disable-fullscreen-shell],
391                              [do not build fullscreen-shell server plugin]),,
392               enable_fullscreen_shell=yes)
393 AM_CONDITIONAL(ENABLE_FULLSCREEN_SHELL,
394                test "x$enable_fullscreen_shell" = "xyes")
395
396 # CMS modules
397 AC_ARG_ENABLE(colord,
398               AS_HELP_STRING([--disable-colord],
399                              [do not build colord CMS support]),,
400               enable_colord=auto)
401 if test "x$enable_colord" != "xno"; then
402         PKG_CHECK_MODULES(COLORD,
403                           colord >= 0.1.27,
404                           have_colord=yes,
405                           have_colord=no)
406         if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
407           AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
408         fi
409         if test "x$have_colord" = "xyes"; then
410              enable_colord=yes
411         fi
412 fi
413 AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
414
415 # dbus support
416 AC_ARG_ENABLE(dbus,
417               AS_HELP_STRING([--disable-dbus],
418                              [do not build with dbus support]),,
419               enable_dbus=auto)
420 if test "x$enable_dbus" != "xno"; then
421         PKG_CHECK_MODULES(DBUS,
422                           dbus-1 >= 1.6,
423                           have_dbus=yes,
424                           have_dbus=no)
425         if test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"; then
426                 AC_MSG_ERROR([dbus support explicitly requested, but libdbus couldn't be found])
427         fi
428         if test "x$have_dbus" = "xyes"; then
429                 enable_dbus=yes
430                 AC_DEFINE([HAVE_DBUS], [1], [Build with dbus support])
431         else
432                 enable_dbus=no
433         fi
434 fi
435 AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
436
437 AC_ARG_ENABLE(wcap-tools, [  --disable-wcap-tools],, enable_wcap_tools=yes)
438 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
439 if test x$enable_wcap_tools = xyes; then
440   AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
441   PKG_CHECK_MODULES(WCAP, [cairo])
442   WCAP_LIBS="$WCAP_LIBS -lm"
443 fi
444
445 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
446 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
447
448 if test "x$GCC" = "xyes"; then
449         GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
450                 -Wno-missing-field-initializers -g -fvisibility=hidden \
451                 -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare"
452 fi
453 AC_SUBST(GCC_CFLAGS)
454
455 AC_ARG_ENABLE(libunwind,
456               AS_HELP_STRING([--disable-libunwind],
457                              [Disable libunwind usage for backtraces]),,
458               enable_libunwind=auto)
459 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
460 if test "x$enable_libunwind" != "xno"; then
461         PKG_CHECK_MODULES(LIBUNWIND,
462                           libunwind,
463                           have_libunwind=yes,
464                           have_libunwind=no)
465         if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
466           AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
467         fi
468         if test "x$have_libunwind" = "xyes"; then
469              enable_libunwind=yes
470              AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
471         fi
472 fi
473
474
475 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
476         WESTON_NATIVE_BACKEND="drm-backend.so"
477 fi
478 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
479 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
480                    [The default backend to load, if not wayland nor x11.])
481
482 if test "x$WESTON_SHELL_CLIENT" = "x"; then
483         WESTON_SHELL_CLIENT="weston-desktop-shell"
484 fi
485 AC_MSG_NOTICE([Weston's default desktop shell client: $WESTON_SHELL_CLIENT])
486 AC_DEFINE_UNQUOTED([WESTON_SHELL_CLIENT], ["$WESTON_SHELL_CLIENT"],
487                    [The default desktop shell client to load.])
488
489 AC_ARG_ENABLE(demo-clients-install,
490               AS_HELP_STRING([--enable-demo-clients-install],
491                              [Install demo clients built with weston]),,
492                              enable_demo_clients_install=no)
493 AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"])
494
495 PKG_CHECK_MODULES(LCMS, lcms2,
496                   [have_lcms=yes], [have_lcms=no])
497 if test "x$have_lcms" = xyes; then
498        AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
499 fi
500 AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
501
502 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
503 if test x$wayland_scanner = x; then
504         AC_MSG_ERROR([wayland-scanner is needed to compile weston])
505 fi
506
507 PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner)
508
509 AC_CONFIG_FILES([Makefile src/version.h src/weston.pc])
510
511 AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
512
513 AC_OUTPUT
514
515 AC_MSG_RESULT([
516         Native Backend                  ${WESTON_NATIVE_BACKEND}
517         setuid Install                  ${enable_setuid_install}
518
519         Cairo Renderer                  ${with_cairo}
520         EGL                             ${enable_egl}
521         libxkbcommon                    ${enable_xkbcommon}
522         xcb_xkb                         ${have_xcb_xkb}
523         XWayland                        ${enable_xwayland}
524         dbus                            ${enable_dbus}
525
526         Build wcap utility              ${enable_wcap_tools}
527         Build Fullscreen Shell          ${enable_fullscreen_shell}
528
529         weston-launch utility           ${enable_weston_launch}
530         systemd-login support           ${have_systemd_login}
531
532         DRM Compositor                  ${enable_drm_compositor}
533         X11 Compositor                  ${enable_x11_compositor}
534         Wayland Compositor              ${enable_wayland_compositor}
535         Headless Compositor             ${enable_headless_compositor}
536         RPI Compositor                  ${enable_rpi_compositor}
537         FBDEV Compositor                ${enable_fbdev_compositor}
538         RDP Compositor                  ${enable_rdp_compositor}
539         Screen Sharing                  ${enable_screen_sharing}
540
541         libinput Backend                ${enable_libinput_backend}
542
543         Raspberry Pi BCM headers        ${have_bcm_host}
544
545         Build Clients                   ${enable_clients}
546         Build EGL Clients               ${have_cairo_egl}
547         Build Simple Clients            ${enable_simple_clients}
548         Build Simple EGL Clients        ${enable_simple_egl_clients}
549
550         Install Demo Clients            ${enable_demo_clients_install}
551
552         Colord Support                  ${have_colord}
553         GLU Support                     ${have_glu}
554         LCMS2 Support                   ${have_lcms}
555         libwebp Support                 ${have_webp}
556         libunwind Support               ${have_libunwind}
557         VA H.264 encoding Support       ${have_libva}
558 ])