1 m4_define([weston_major_version], [4])
2 m4_define([weston_minor_version], [0])
3 m4_define([weston_micro_version], [90])
4 m4_define([weston_version],
5 [weston_major_version.weston_minor_version.weston_micro_version])
6 m4_define([libweston_major_version], [5])
7 m4_define([libweston_minor_version], [0])
8 m4_define([libweston_patch_version], [0])
13 [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=weston_version],
15 [http://wayland.freedesktop.org])
17 WAYLAND_PREREQ_VERSION="1.12.0"
19 AC_SUBST([WESTON_VERSION_MAJOR], [weston_major_version])
20 AC_SUBST([WESTON_VERSION_MINOR], [weston_minor_version])
21 AC_SUBST([WESTON_VERSION_MICRO], [weston_micro_version])
22 AC_SUBST([WESTON_VERSION], [weston_version])
23 AC_SUBST([LIBWESTON_MAJOR], [libweston_major_version])
24 # We use minor as current and age since on ABI/API break/removal we bump major
25 # so minor will be reset to 0.
26 m4_define([lt_current], [libweston_minor_version])
27 m4_define([lt_revision], [libweston_patch_version])
28 m4_define([lt_age], [libweston_minor_version])
29 AC_SUBST([LT_VERSION_INFO], [lt_current:lt_revision:lt_age])
31 AC_CONFIG_AUX_DIR([build-aux])
32 AC_CONFIG_HEADERS([config.h])
33 AC_CONFIG_MACRO_DIR([m4])
35 AC_USE_SYSTEM_EXTENSIONS
39 export CFLAGS="$CFLAGS -Werror"
43 AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects])
45 AM_SILENT_RULES([yes])
47 # Check Weston and libweston version consistency
48 m4_if(m4_cmp(weston_micro_version, [90]), [-1],
51 dnl A final or stable release, not a pre-release:
52 dnl Weston and libweston versions must match.
53 m4_if(weston_version, libweston_major_version[.]libweston_minor_version[.]libweston_patch_version,
55 [AC_MSG_ERROR([Weston and libweston version mismatch for a final release])])
59 dnl libweston must be equal or greater than weston.
60 m4_case(m4_list_cmp([weston_major_version, weston_minor_version, weston_micro_version],
61 [libweston_major_version, libweston_minor_version, libweston_patch_version]),
63 dnl weston < libweston
64 dnl libweston must be weston_major+1.0.0
65 m4_if(m4_eval(weston_major_version+1)[.0.0],
66 libweston_major_version[.]libweston_minor_version[.]libweston_patch_version,
68 [AC_MSG_ERROR([libweston version is greater but not (weston_major+1).0.0])])
71 dnl weston == libweston, all ok
74 dnl weston > libweston, wrong
75 AC_MSG_ERROR([Weston version is greater than libweston.])
85 LT_INIT([disable-static])
87 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
88 [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
89 AC_ARG_VAR([WESTON_SHELL_CLIENT],
90 [Set the default desktop shell client to load if none is specified in weston.ini. @<:@default=weston-desktop-shell@:>@])
94 # Check for dlsym instead of dlopen because ASAN hijacks the latter
95 WESTON_SEARCH_LIBS([DL], [dl], [dlsym])
97 # In old glibc versions (< 2.17) clock_gettime() and clock_getres() are in librt
98 WESTON_SEARCH_LIBS([CLOCK_GETTIME], [rt], [clock_gettime])
99 WESTON_SEARCH_LIBS([CLOCK_GETRES], [rt], [clock_getres])
101 AC_CHECK_DECL(SFD_CLOEXEC,[],
102 [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
103 [[#include <sys/signalfd.h>]])
104 AC_CHECK_DECL(TFD_CLOEXEC,[],
105 [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")],
106 [[#include <sys/timerfd.h>]])
107 AC_CHECK_DECL(CLOCK_MONOTONIC,[],
108 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
109 [[#include <time.h>]])
110 AC_CHECK_HEADERS([execinfo.h])
112 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
114 # check for libdrm as a build-time dependency only
115 # libdrm 2.4.30 introduced drm_fourcc.h.
116 PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.30], [], [AC_MSG_ERROR([
117 libdrm is a hard build-time dependency for libweston core,
118 but a sufficient version was not found. However, libdrm
119 is not a runtime dependency unless you have features
120 enabled that require it.])])
122 COMPOSITOR_MODULES="wayland-server >= $WAYLAND_PREREQ_VERSION pixman-1 >= 0.25.2"
124 AC_CONFIG_FILES([doc/doxygen/tools.doxygen doc/doxygen/tooldev.doxygen])
126 AC_ARG_ENABLE(devdocs,
127 AS_HELP_STRING([--disable-devdocs],
128 [do not enable building of developer documentation]),,
130 if test "x$enable_devdocs" != "xno"; then
131 AC_CHECK_PROGS([DOXYGEN], [doxygen])
132 if test "x$DOXYGEN" = "x" -a "x$enable_devdocs" = "xyes"; then
133 AC_MSG_ERROR([Developer documentation explicitly requested, but Doxygen couldn't be found])
135 if test "x$DOXYGEN" != "x"; then
141 AM_CONDITIONAL(ENABLE_DEVDOCS, test "x$enable_devdocs" = "xyes")
143 AC_ARG_ENABLE(egl, [ --disable-egl],,
145 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
146 if test x$enable_egl = xyes; then
147 AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
148 PKG_CHECK_MODULES(EGL, [egl glesv2])
149 PKG_CHECK_MODULES([EGL_TESTS], [egl glesv2 wayland-client wayland-egl])
150 AC_CHECK_HEADERS([linux/sync_file.h])
153 COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
155 PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
156 [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
157 [Define if xkbcommon is 0.5.0 or newer])],true)
159 AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
160 enable_setuid_install=yes)
161 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
164 AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
166 AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],,
167 enable_xwayland_test=yes)
168 AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
169 AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes)
170 if test x$enable_xwayland = xyes; then
171 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcb-composite xcb-shape xcursor cairo-xcb)
172 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
174 AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
175 [Path to X server]), [XSERVER_PATH="$withval"],
176 [XSERVER_PATH="/usr/bin/Xwayland"])
177 AC_SUBST([XSERVER_PATH])
178 if test x$enable_xwayland_test = xyes; then
179 PKG_CHECK_MODULES([XWAYLAND_TEST], x11)
183 AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
184 enable_x11_compositor=yes)
185 AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
187 if test x$enable_x11_compositor = xyes; then
188 PKG_CHECK_MODULES([XCB], xcb >= 1.8)
189 X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
191 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb >= 1.9],
192 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
193 if test "x$have_xcb_xkb" = xyes; then
194 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
195 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
198 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
199 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
203 AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
204 enable_drm_compositor=yes)
205 AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes)
206 if test x$enable_drm_compositor = xyes; then
207 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
208 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm])
209 PKG_CHECK_MODULES(DRM_COMPOSITOR_ATOMIC, [libdrm >= 2.4.78],
210 [AC_DEFINE([HAVE_DRM_ATOMIC], 1, [libdrm supports atomic API])],
211 [AC_MSG_WARN([libdrm does not support atomic modesetting, will omit that capability])])
212 PKG_CHECK_MODULES(DRM_COMPOSITOR_GBM, [gbm >= 10.2],
213 [AC_DEFINE([HAVE_GBM_FD_IMPORT], 1, [gbm supports dmabuf import])],
214 [AC_MSG_WARN([gbm does not support dmabuf import, will omit that capability])])
218 PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
219 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
221 PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.13],
222 [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
223 AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
225 AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
226 enable_wayland_compositor=yes)
227 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
228 test x$enable_wayland_compositor = xyes)
229 if test x$enable_wayland_compositor = xyes; then
230 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
231 [Build the Wayland (nested) compositor])
232 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client >= $WAYLAND_PREREQ_VERSION wayland-cursor])
233 if test x$enable_egl = xyes; then
234 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR_EGL, [wayland-egl])
239 AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
240 enable_headless_compositor=yes)
241 AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
242 test x$enable_headless_compositor = xyes)
243 if test x$enable_headless_compositor = xyes; then
244 AC_DEFINE([BUILD_HEADLESS_COMPOSITOR], [1], [Build the headless compositor])
248 AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],,
249 enable_fbdev_compositor=yes)
250 AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
251 [test x$enable_fbdev_compositor = xyes])
252 AS_IF([test x$enable_fbdev_compositor = xyes], [
253 AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
254 PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136])
257 AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],,
258 enable_rdp_compositor=no)
259 AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
260 [test x$enable_rdp_compositor = xyes])
261 if test x$enable_rdp_compositor = xyes; then
262 AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor])
263 PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp2 >= 2.0.0],
265 [PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0],[])]
268 SAVED_CPPFLAGS="$CPPFLAGS"
269 CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS"
270 AC_CHECK_HEADERS([freerdp/version.h])
271 CPPFLAGS="$SAVED_CPPFLAGS"
274 AC_ARG_ENABLE([screen-sharing], [ --enable-screen-sharing],,
275 enable_screen_sharing=no)
276 AM_CONDITIONAL([ENABLE_SCREEN_SHARING],
277 [test x$enable_screen_sharing = xyes])
278 if test x$enable_screen_sharing = xyes; then
279 PKG_CHECK_MODULES(SCREEN_SHARE, [wayland-client])
281 if test x$enable_rdp_compositor != xyes; then
282 AC_MSG_WARN([The screen-share.so module requires the RDP backend.])
287 AS_HELP_STRING([--with-cairo=@<:@image|gl|glesv2@:>@]
288 [Which Cairo renderer to use for the clients]),
289 [],[with_cairo="image"])
291 if test "x$with_cairo" = "ximage"; then
292 cairo_modules="cairo"
294 if test "x$with_cairo" = "xgl"; then
295 cairo_modules="cairo-gl"
296 AC_MSG_WARN([The --with-cairo=gl option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs.])
298 if test "x$with_cairo" = "xglesv2"; then
299 cairo_modules="cairo-glesv2"
300 AC_MSG_WARN([The --with-cairo=gles2 option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs.])
302 AC_ERROR([Unknown cairo renderer requested])
307 # Included for legacy compat
308 AC_ARG_WITH(cairo-glesv2,
309 AS_HELP_STRING([--with-cairo-glesv2],
311 if test "x$with_cairo_glesv2" = "xyes"; then
312 cairo_modules="cairo-glesv2"
316 if test "x$cairo_modules" = "xcairo-glesv2"; then
317 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
320 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
321 PKG_CHECK_MODULES(PNG, [libpng])
324 AS_HELP_STRING([--without-jpeg],
325 [Use jpeglib for JPEG decoding support [default=auto]]))
326 AS_IF([test "x$with_jpeg" != "xno"],
327 [WESTON_SEARCH_LIBS([JPEG], [jpeg], [jpeg_CreateDecompress], [have_jpeglib=yes], [have_jpeglib=no])],
329 AS_IF([test "x$have_jpeglib" = "xyes"],
330 [AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])],
331 [AS_IF([test "x$with_jpeg" = "xyes"],
332 [AC_MSG_ERROR([JPEG support explicitly requested, but jpeglib couldn't be found])])])
335 AS_HELP_STRING([--without-webp],
336 [Use libwebp for WebP decoding support [default=auto]]))
337 AS_IF([test "x$with_webp" != "xno"],
338 [PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])],
340 AS_IF([test "x$have_webp" = "xyes"],
341 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])],
342 [AS_IF([test "x$with_webp" = "xyes"],
343 [AC_MSG_ERROR([WebP support explicitly requested, but libwebp couldn't be found])])])
345 AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],,
346 enable_vaapi_recorder=auto)
348 if test x$enable_vaapi_recorder != xno; then
349 PKG_CHECK_MODULES(LIBVA, [libva >= 0.34.0 libva-drm >= 0.34.0],
350 [have_libva=yes], [have_libva=no])
351 if test "x$have_libva" = "xno" -a "x$enable_vaapi_recorder" = "xyes"; then
352 AC_MSG_ERROR([vaapi-recorder explicitly enabled, but libva couldn't be found])
354 AS_IF([test "x$have_libva" = "xyes"],
355 [AC_DEFINE([BUILD_VAAPI_RECORDER], [1], [Build the vaapi recorder])])
357 AM_CONDITIONAL(ENABLE_VAAPI_RECORDER, test "x$have_libva" = xyes)
359 PKG_CHECK_MODULES(CAIRO, [cairo])
361 PKG_CHECK_MODULES(TEST_CLIENT, [wayland-client >= $WAYLAND_PREREQ_VERSION pixman-1])
363 AC_ARG_ENABLE(simple-clients,
364 AS_HELP_STRING([--disable-simple-clients],
365 [do not build the simple wl_shm clients]),,
366 enable_simple_clients=yes)
367 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
368 if test x$enable_simple_clients = xyes; then
369 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
372 AC_ARG_ENABLE(simple-egl-clients,
373 AS_HELP_STRING([--disable-simple-egl-clients],
374 [do not build the simple EGL clients]),,
375 enable_simple_egl_clients="$enable_egl")
376 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes")
377 if test x$enable_simple_egl_clients = xyes; then
378 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
379 [egl glesv2 wayland-client wayland-egl wayland-cursor])
382 AC_ARG_ENABLE(simple-dmabuf-drm-client,
383 AS_HELP_STRING([--disable-simple-dmabuf-drm-client],
384 [do not build the simple dmabuf drm client]),,
385 enable_simple_dmabuf_drm_client="auto")
386 if ! test "x$enable_simple_dmabuf_drm_client" = "xno"; then
387 PKG_CHECK_MODULES(SIMPLE_DMABUF_DRM_CLIENT, [wayland-client libdrm egl], [have_simple_dmabuf_libs=yes],
388 [have_simple_dmabuf_libs=no])
390 PKG_CHECK_MODULES(LIBDRM_PLATFORM_FREEDRENO, [libdrm_freedreno],
391 AC_DEFINE([HAVE_LIBDRM_FREEDRENO], [1], [Build freedreno dmabuf client]) have_simple_dmabuf_drm_client=yes,
393 PKG_CHECK_MODULES(LIBDRM_PLATFORM_INTEL, [libdrm_intel],
394 AC_DEFINE([HAVE_LIBDRM_INTEL], [1], [Build intel dmabuf client]) have_simple_dmabuf_drm_client=yes,
397 if test "x$have_simple_dmabuf_drm_client" != "xyes" -o \
398 "x$have_simple_dmabuf_libs" = "xno" && \
399 test "x$enable_simple_dmabuf_drm_client" = "xyes"; then
400 AC_MSG_ERROR([DRM dmabuf client explicitly enabled, but libdrm_intel or libdrm_freedreno not found])
403 if test "x$have_simple_dmabuf_drm_client" = "xyes" -a "x$have_simple_dmabuf_libs" = "xyes"; then
404 enable_simple_dmabuf_drm_client="yes"
407 AM_CONDITIONAL(BUILD_SIMPLE_DMABUF_DRM_CLIENT, test "x$enable_simple_dmabuf_drm_client" = "xyes")
409 AC_ARG_ENABLE(simple-dmabuf-v4l-client,
410 AS_HELP_STRING([--disable-simple-dmabuf-v4l-client],
411 [do not build the simple dmabuf v4l client]),,
412 enable_simple_dmabuf_v4l_client="auto")
413 if ! test "x$enable_simple_dmabuf_v4l_client" = "xno"; then
414 PKG_CHECK_MODULES(SIMPLE_DMABUF_V4L_CLIENT, [wayland-client libdrm],
415 have_simple_dmabuf_v4l_client=yes, have_simple_dmabuf_v4l_client=no)
416 if test "x$have_simple_dmabuf_v4l_client" = "xno" -a "x$enable_simple_dmabuf_v4l_client" = "xyes"; then
417 AC_MSG_ERROR([V4L dmabuf client explicitly enabled, but libdrm couldn't be found])
419 enable_simple_dmabuf_v4l_client="$have_simple_dmabuf_v4l_client"
421 AM_CONDITIONAL(BUILD_SIMPLE_DMABUF_V4L_CLIENT, test "x$enable_simple_dmabuf_v4l_client" = "xyes")
423 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
424 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
426 if test x$enable_clients = xyes; then
427 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
429 PKG_CHECK_MODULES(CLIENT, [wayland-client >= $WAYLAND_PREREQ_VERSION cairo >= 1.10.0 xkbcommon wayland-cursor])
430 PKG_CHECK_MODULES(SERVER, [wayland-server])
431 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client >= $WAYLAND_PREREQ_VERSION])
433 # Only check for cairo-egl if a GL or GLES renderer requested
434 AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
435 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl cairo-egl >= 1.11.3 $cairo_modules],
436 [have_cairo_egl=yes], [have_cairo_egl=no])
437 AS_IF([test "x$have_cairo_egl" = "xyes"],
438 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
439 [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
442 PKG_CHECK_MODULES(PANGO, [pangocairo pango glib-2.0 >= 2.36], [have_pango=yes], [have_pango=no])
445 AC_ARG_ENABLE(resize-optimization,
446 AS_HELP_STRING([--disable-resize-optimization],
447 [disable resize optimization allocating a big buffer in toytoolkit]),,
448 enable_resize_optimization=yes)
449 AS_IF([test "x$enable_resize_optimization" = "xyes"],
450 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
452 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
453 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
454 if test x$enable_weston_launch = xyes; then
455 WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
456 if test x$have_pam = xno; then
457 AC_ERROR([weston-launch requires pam])
461 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
462 if test "x$have_pango" = "xyes"; then
463 AC_DEFINE([HAVE_PANGO], [1], [Have pango])
466 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
467 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
469 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
470 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
472 AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
473 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
475 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
477 AC_ARG_ENABLE(fullscreen-shell,
478 AS_HELP_STRING([--disable-fullscreen-shell],
479 [do not build fullscreen-shell server plugin]),,
480 enable_fullscreen_shell=yes)
481 AM_CONDITIONAL(ENABLE_FULLSCREEN_SHELL,
482 test "x$enable_fullscreen_shell" = "xyes")
485 AC_ARG_ENABLE(colord,
486 AS_HELP_STRING([--disable-colord],
487 [do not build colord CMS support]),,
490 if test "x$enable_colord" != "xno"; then
491 PKG_CHECK_MODULES(COLORD,
495 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
496 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
498 if test "x$have_colord" = "xyes"; then
502 AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
506 AS_HELP_STRING([--disable-dbus],
507 [do not build with dbus support]),,
510 if test "x$enable_dbus" != "xno"; then
511 PKG_CHECK_MODULES(DBUS,
515 if test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"; then
516 AC_MSG_ERROR([dbus support explicitly requested, but libdbus couldn't be found])
518 if test "x$have_dbus" = "xyes"; then
520 AC_DEFINE([HAVE_DBUS], [1], [Build with dbus support])
525 AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
527 # systemd-login support
528 AC_ARG_ENABLE(systemd-login,
529 AS_HELP_STRING([--enable-systemd-login],
530 [Enable logind support]),,
531 enable_systemd_login=auto)
532 if test x$enable_systemd_login != xno -a x$have_dbus != xno; then
533 PKG_CHECK_MODULES(SYSTEMD_LOGIN,
535 [have_systemd_login_209=yes;have_systemd_login=yes],
536 [have_systemd_login_209=no;have_systemd_login=no])
538 # Older versions of systemd package systemd-login separately. Fall back on that
539 AS_IF([test x$have_systemd_login != xyes],[
540 PKG_CHECK_MODULES(SYSTEMD_LOGIN,
541 [libsystemd-login >= 198],
542 [have_systemd_login=yes],
543 [have_systemd_login=no])
546 have_systemd_login=no
549 if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
550 AC_MSG_ERROR([systemd-login support explicitly enabled, but can't find libsystemd>=209, libsystemd-login or dbus])
553 AS_IF([test "x$have_systemd_login" = "xyes"],
554 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
555 AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
557 AS_IF([test "x$have_systemd_login_209" = "xyes"],
558 [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
561 # Note that other features might want libxml2, or this feature might use
562 # alternative xml libraries at some point. Therefore the feature and
563 # pre-requisite concepts are split.
564 AC_ARG_ENABLE(junit_xml,
565 AS_HELP_STRING([--disable-junit-xml],
566 [do not build with JUnit XML output]),,
567 enable_junit_xml=auto)
568 if test "x$enable_junit_xml" != "xno"; then
569 PKG_CHECK_MODULES(LIBXML2,
573 if test "x$have_libxml2" = "xno" -a "x$enable_junit_xml" = "xyes"; then
574 AC_MSG_ERROR([JUnit XML support explicitly requested, but libxml2 couldn't be found])
576 if test "x$have_libxml2" = "xyes"; then
578 AC_DEFINE(ENABLE_JUNIT_XML, [1], [Build Weston with JUnit output support])
583 AM_CONDITIONAL(ENABLE_JUNIT_XML, test "x$enable_junit_xml" = "xyes")
586 AC_ARG_ENABLE(ivi-shell,
587 AS_HELP_STRING([--disable-ivi-shell],
588 [do not build ivi-shell server plugin and client]),,
589 enable_ivi_shell=yes)
590 AM_CONDITIONAL(ENABLE_IVI_SHELL, test "x$enable_ivi_shell" = "xyes")
592 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
593 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
594 if test x$enable_wcap_tools = xyes; then
595 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
596 PKG_CHECK_MODULES(WCAP, [cairo])
597 WCAP_LIBS="$WCAP_LIBS -lm"
600 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
601 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
603 if test "x$GCC" = "xyes"; then
604 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
605 -Wno-shift-negative-value -Wno-missing-field-initializers \
606 -g -fvisibility=hidden \
607 -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare"
612 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
613 WESTON_NATIVE_BACKEND="drm-backend.so"
615 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
616 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
617 [The default backend to load, if not wayland nor x11.])
619 if test "x$WESTON_SHELL_CLIENT" = "x"; then
620 WESTON_SHELL_CLIENT="weston-desktop-shell"
622 AC_MSG_NOTICE([Weston's default desktop shell client: $WESTON_SHELL_CLIENT])
623 AC_DEFINE_UNQUOTED([WESTON_SHELL_CLIENT], ["$WESTON_SHELL_CLIENT"],
624 [The default desktop shell client to load.])
626 AC_ARG_ENABLE(demo-clients-install,
627 AS_HELP_STRING([--enable-demo-clients-install],
628 [Install demo clients built with weston]),,
629 enable_demo_clients_install=no)
630 AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"])
633 AS_HELP_STRING([--disable-lcms],
634 [Disable lcms support]),,
637 if test "x$enable_lcms" != "xno"; then
638 PKG_CHECK_MODULES(LCMS,
642 if test "x$have_lcms" = "xno" -a "x$enable_lcms" = "xyes"; then
643 AC_MSG_ERROR([lcms support explicitly requested, but lcms couldn't be found])
645 if test "x$have_lcms" = "xyes"; then
647 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
650 AM_CONDITIONAL(HAVE_LCMS, [test "x$enable_lcms" = xyes])
652 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
653 if test x$wayland_scanner = x; then
654 PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
655 wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
658 AC_ARG_ENABLE(systemd_notify,
659 AS_HELP_STRING([--enable-systemd-notify],
660 [Enables systemd notifications to
661 notify systemd about weston state
663 Also sockets provided by systemd
664 in case of socket-base activation
665 are added to wayland display]),,
666 enable_systemd_notify=no)
667 AM_CONDITIONAL(SYSTEMD_NOTIFY_SUPPORT, test x$enable_systemd_notify = xyes)
668 if test "x$enable_systemd_notify" = "xyes"; then
669 AC_DEFINE([SYSTEMD_NOTIFY_SUPPORT], [1], [Build the systemd sd_notify support])
670 PKG_CHECK_MODULES(SYSTEMD_DAEMON, [libsystemd])
673 AC_CONFIG_FILES([Makefile libweston/version.h compositor/weston.pc])
675 # AC_CONFIG_FILES needs the full name when running autoconf, so we need to use
676 # libweston_abi_version here, and outside [] because of m4 quoting rules
677 AC_CONFIG_FILES([libweston/libweston-]libweston_major_version[.pc:libweston/libweston.pc.in])
678 AC_CONFIG_FILES([libweston/libweston-]libweston_major_version[-uninstalled.pc:libweston/libweston-uninstalled.pc.in])
679 AC_CONFIG_FILES([libweston-desktop/libweston-desktop-]libweston_major_version[.pc:libweston-desktop/libweston-desktop.pc.in])
680 AC_CONFIG_FILES([libweston-desktop/libweston-desktop-]libweston_major_version[-uninstalled.pc:libweston-desktop/libweston-desktop-uninstalled.pc.in])
682 AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
687 Native Backend ${WESTON_NATIVE_BACKEND}
688 setuid Install ${enable_setuid_install}
690 Cairo Renderer ${with_cairo}
692 xcb_xkb ${have_xcb_xkb}
693 XWayland ${enable_xwayland}
696 ivi-shell ${enable_ivi_shell}
698 Build wcap utility ${enable_wcap_tools}
699 Build Fullscreen Shell ${enable_fullscreen_shell}
700 Enable developer documentation ${enable_devdocs}
702 weston-launch utility ${enable_weston_launch}
703 systemd-login support ${have_systemd_login}
704 systemd notify support ${enable_systemd_notify}
706 DRM Compositor ${enable_drm_compositor}
707 X11 Compositor ${enable_x11_compositor}
708 Wayland Compositor ${enable_wayland_compositor}
709 Headless Compositor ${enable_headless_compositor}
710 FBDEV Compositor ${enable_fbdev_compositor}
711 RDP Compositor ${enable_rdp_compositor}
712 Screen Sharing ${enable_screen_sharing}
713 JUnit XML output ${enable_junit_xml}
715 Build Clients ${enable_clients}
716 Build EGL Clients ${have_cairo_egl}
717 Build Simple Clients ${enable_simple_clients}
718 Build Simple EGL Clients ${enable_simple_egl_clients}
720 Install Demo Clients ${enable_demo_clients_install}
722 Colord Support ${have_colord}
723 LCMS2 Support ${have_lcms}
724 libjpeg Support ${have_jpeglib}
725 libwebp Support ${have_webp}
726 VA H.264 encoding Support ${have_libva}