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