1 m4_define([weston_major_version], [1])
2 m4_define([weston_minor_version], [2])
3 m4_define([weston_micro_version], [90])
4 m4_define([weston_version],
5 [weston_major_version.weston_minor_version.weston_micro_version])
10 [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=weston_version],
12 [http://wayland.freedesktop.org/])
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])
19 AC_CONFIG_HEADERS([config.h])
21 AC_USE_SYSTEM_EXTENSIONS
24 AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests])
26 AM_SILENT_RULES([yes])
34 LT_INIT([disable-static])
36 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
37 [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
41 AC_CHECK_FUNC([dlopen], [],
42 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
45 AC_CHECK_DECL(SFD_CLOEXEC,[],
46 [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
47 [[#include <sys/signalfd.h>]])
48 AC_CHECK_DECL(TFD_CLOEXEC,[],
49 [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")],
50 [[#include <sys/timerfd.h>]])
51 AC_CHECK_DECL(CLOCK_MONOTONIC,[],
52 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
53 [[#include <time.h>]])
54 AC_CHECK_HEADERS([execinfo.h])
56 AC_CHECK_FUNCS([mkostemp strchrnul initgroups])
58 COMPOSITOR_MODULES="wayland-server >= 1.2.90 pixman-1"
60 AC_ARG_ENABLE(egl, [ --disable-egl],,
62 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
63 if test x$enable_egl = xyes; then
64 AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
65 COMPOSITOR_MODULES="$COMPOSITOR_MODULES egl >= 7.10 glesv2"
68 AC_ARG_ENABLE(xkbcommon,
69 AS_HELP_STRING([--disable-xkbcommon], [Disable libxkbcommon
70 support: This is only useful in environments
71 where you do not have a hardware keyboard. If
72 libxkbcommon support is disabled clients will not
73 be sent a keymap and and must know how to
74 interpret the keycode sent for any key event.]),,
76 if test x$enable_xkbcommon = xyes; then
77 AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon support])
78 COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon"
81 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
83 AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
84 enable_setuid_install=yes)
85 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
88 AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
90 AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],,
91 enable_xwayland_test=yes)
92 AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
93 AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes)
94 if test x$enable_xwayland = xyes; then
95 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcursor cairo-xcb)
96 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
98 AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
99 [Path to X server]), [XSERVER_PATH="$withval"],
100 [XSERVER_PATH="$bindir/Xorg"])
101 AC_SUBST([XSERVER_PATH])
102 if test x$enable_xwayland_test = xyes; then
103 PKG_CHECK_MODULES([XWAYLAND_TEST], xcb xcb-dri2 libdrm)
108 AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
109 enable_x11_compositor=yes)
110 AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
111 if test x$enable_x11_compositor = xyes; then
112 PKG_CHECK_MODULES([XCB], xcb)
114 xcb_save_CFLAGS=$CFLAGS
117 AC_CHECK_FUNCS([xcb_poll_for_queued_event])
119 CFLAGS=$xcb_save_CFLAGS
121 X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
123 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
124 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
125 if test "x$have_xcb_xkb" = xyes; then
126 # Most versions of XCB have totally broken XKB bindings, where the
127 # events don't work. Make sure we can actually use them.
128 xcb_xkb_save_CFLAGS=$CFLAGS
129 CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
130 AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
131 [], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
132 CFLAGS=$xcb_xkb_save_CFLAGS
134 if test "x$have_xcb_xkb" = xyes; then
135 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
136 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
139 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
140 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
144 AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
145 enable_drm_compositor=yes)
146 AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes -a x$enable_egl = xyes)
147 if test x$enable_drm_compositor = xyes -a x$enable_egl = xyes; then
148 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
149 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
153 AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
154 enable_wayland_compositor=yes)
155 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
156 test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
157 if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
158 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
159 [Build the Wayland (nested) compositor])
160 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
164 AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
165 enable_headless_compositor=yes)
166 AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
167 test x$enable_headless_compositor = xyes)
170 AC_ARG_ENABLE(rpi-compositor,
171 AS_HELP_STRING([--disable-rpi-compositor],
172 [do not build the Raspberry Pi backend]),,
173 enable_rpi_compositor=yes)
174 AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes")
176 if test "x$enable_rpi_compositor" = "xyes"; then
177 AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
178 PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
179 PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
181 AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])],
182 [AC_MSG_WARN([Raspberry Pi BCM host libraries not found, will use stubs instead.])])
184 AM_CONDITIONAL(INSTALL_RPI_COMPOSITOR, test "x$have_bcm_host" = "xyes")
187 AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],,
188 enable_fbdev_compositor=yes)
189 AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
190 [test x$enable_fbdev_compositor = xyes])
191 AS_IF([test x$enable_fbdev_compositor = xyes], [
192 AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
193 PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0 libdrm >= 2.4.30])
196 AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],,
197 enable_rdp_compositor=no)
198 AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
199 [test x$enable_rdp_compositor = xyes])
200 if test x$enable_rdp_compositor = xyes; then
201 AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor])
202 PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
206 AS_HELP_STRING([--with-cairo=@<:@image|gl|glesv2@:>@]
207 [Which Cairo renderer to use for the clients]),
208 [],[with_cairo="image"])
210 if test "x$with_cairo" = "ximage"; then
211 cairo_modules="cairo"
213 if test "x$with_cairo" = "xgl"; then
214 cairo_modules="cairo-gl"
216 if test "x$with_cairo" = "xglesv2"; then
217 cairo_modules="cairo-glesv2"
219 AC_ERROR([Unknown cairo renderer requested])
224 # Included for legacy compat
225 AC_ARG_WITH(cairo-glesv2,
226 AS_HELP_STRING([--with-cairo-glesv2],
228 if test "x$with_cairo_glesv2" = "xyes"; then
229 cairo_modules="cairo-glesv2"
233 if test "x$cairo_modules" = "xcairo-glesv2"; then
234 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
237 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
238 PKG_CHECK_MODULES(PNG, [libpng])
239 PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
240 AS_IF([test "x$have_webp" = "xyes"],
241 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
243 AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],,
244 enable_vaapi_recorder=auto)
245 if test x$enable_vaapi_recorder != xno; then
246 PKG_CHECK_MODULES(LIBVA, [libva >= 0.34.0 libva-drm >= 0.34.0],
247 [have_libva=yes], [have_libva=no])
248 if test "x$have_libva" = "xno" -a "x$enable_vaapi_recorder" = "xyes"; then
249 AC_MSG_ERROR([vaapi-recorder explicitly enabled, but libva couldn't be found])
251 AS_IF([test "x$have_libva" = "xyes"],
252 [AC_DEFINE([BUILD_VAAPI_RECORDER], [1], [Build the vaapi recorder])])
254 AM_CONDITIONAL(ENABLE_VAAPI_RECORDER, test "x$have_libva" = xyes)
257 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
258 if test x$have_jpeglib = xyes; then
261 AC_ERROR([libjpeg not found])
265 PKG_CHECK_MODULES(CAIRO, [cairo])
267 AC_ARG_ENABLE(simple-clients,
268 AS_HELP_STRING([--disable-simple-clients],
269 [do not build the simple wl_shm clients]),,
270 enable_simple_clients=yes)
271 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
272 if test x$enable_simple_clients = xyes; then
273 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
276 AC_ARG_ENABLE(simple-egl-clients,
277 AS_HELP_STRING([--disable-simple-egl-clients],
278 [do not build the simple EGL clients]),,
279 enable_simple_egl_clients="$enable_egl")
280 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes")
281 if test x$enable_simple_egl_clients = xyes; then
282 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
283 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
286 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
287 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
288 if test x$enable_clients = xyes; then
289 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
291 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
292 PKG_CHECK_MODULES(SERVER, [wayland-server])
293 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
295 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
296 [have_poppler=yes], [have_poppler=no])
298 # Only check for cairo-egl if a GL or GLES renderer requested
299 AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
300 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
301 [have_cairo_egl=yes], [have_cairo_egl=no])
302 AS_IF([test "x$have_cairo_egl" = "xyes"],
303 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
304 [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
307 PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
310 AC_ARG_ENABLE(resize-optimization,
311 AS_HELP_STRING([--disable-resize-optimization],
312 [disable resize optimization allocating a big buffer in toytoolkit]),,
313 enable_resize_optimization=yes)
314 AS_IF([test "x$enable_resize_optimization" = "xyes"],
315 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
317 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
318 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
319 if test x$enable_weston_launch == xyes; then
320 PKG_CHECK_MODULES(WESTON_LAUNCH, [libdrm])
321 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
322 [have_systemd_login=yes], [have_systemd_login=no])
323 AS_IF([test "x$have_systemd_login" = "xyes"],
324 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
326 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
327 if test x$have_pam == xno; then
328 AC_ERROR([weston-launch requires pam])
330 WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
333 if test x$enable_egl = xyes; then
334 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
336 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
339 AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
341 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
343 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
344 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
346 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
347 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
349 AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
350 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
352 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
354 AC_ARG_ENABLE(tablet-shell,
355 AS_HELP_STRING([--disable-tablet-shell],
356 [do not build tablet-shell server plugin and client]),,
357 enable_tablet_shell=yes)
358 AM_CONDITIONAL(ENABLE_TABLET_SHELL,
359 test "x$enable_tablet_shell" = "xyes")
362 AC_ARG_ENABLE(colord,
363 AS_HELP_STRING([--disable-colord],
364 [do not build colord CMS support]),,
366 if test "x$enable_colord" != "xno"; then
367 PKG_CHECK_MODULES(COLORD,
371 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
372 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
374 if test "x$have_colord" = "xyes"; then
378 AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
380 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
381 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
382 if test x$enable_wcap_tools = xyes; then
383 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
384 PKG_CHECK_MODULES(WCAP, [cairo])
385 WCAP_LIBS="$WCAP_LIBS -lm"
388 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
389 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
391 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
392 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
394 if test "x$GCC" = "xyes"; then
395 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
396 -Wno-missing-field-initializers -g -fvisibility=hidden \
397 -Wstrict-prototypes -Wmissing-prototypes"
401 AC_ARG_ENABLE(libunwind,
402 AS_HELP_STRING([--disable-libunwind],
403 [Disable libunwind usage for backtraces]),,
404 enable_libunwind=auto)
405 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
406 if test "x$enable_libunwind" != "xno"; then
407 PKG_CHECK_MODULES(LIBUNWIND,
411 if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
412 AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
414 if test "x$have_libunwind" = "xyes"; then
416 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
421 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
422 WESTON_NATIVE_BACKEND="drm-backend.so"
424 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
425 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
426 [The default backend to load, if not wayland nor x11.])
428 AC_ARG_ENABLE(demo-clients,
429 AS_HELP_STRING([--enable-demo-clients],
430 [install demo clients built with weston]),,
431 enable_demo_clients=no)
432 AM_CONDITIONAL(ENABLE_DEMO_CLIENTS, [test "x$enable_demo_clients" = "xyes"])
434 PKG_CHECK_MODULES(LCMS, lcms2,
435 [have_lcms=yes], [have_lcms=no])
436 if test "x$have_lcms" = xyes; then
437 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
439 AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
441 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
442 if test x$wayland_scanner = x; then
443 AC_MSG_ERROR([wayland-scanner is needed to compile weston])
446 AC_CONFIG_FILES([Makefile
449 src/xwayland/Makefile
461 Native Backend ${WESTON_NATIVE_BACKEND}
462 setuid Install ${enable_setuid_install}
464 Cairo Renderer ${with_cairo}
466 libxkbcommon ${enable_xkbcommon}
467 XWayland ${enable_xwayland}
469 Build wcap utility ${enable_wcap_tools}
470 Build Tablet Shell ${enable_tablet_shell}
472 weston-launch utility ${enable_weston_launch}
473 weston-launch systemd support ${have_systemd_login}
475 DRM Compositor ${enable_drm_compositor}
476 X11 Compositor ${enable_x11_compositor}
477 Wayland Compositor ${enable_wayland_compositor}
478 Headless Compositor ${enable_headless_compositor}
479 RPI Compositor ${enable_rpi_compositor}
480 FBDEV Compositor ${enable_fbdev_compositor}
481 RDP Compositor ${enable_rdp_compositor}
483 Raspberry Pi BCM headers ${have_bcm_host}
485 Build Clients ${enable_clients}
486 Build EGL Clients ${have_cairo_egl}
487 Build Simple Clients ${enable_simple_clients}
488 Build Simple EGL Clients ${enable_simple_egl_clients}
490 Install Demo Clients ${enable_demo_clients}
492 Colord Support ${have_colord}
493 GLU Support ${have_glu}
494 LCMS2 Support ${have_lcms}
495 libwebp Support ${have_webp}
496 libunwind Support ${have_libunwind}
497 VA H.264 encoding Support ${have_libva}