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.1.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_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
244 if test x$have_jpeglib = xyes; then
247 AC_ERROR([libjpeg not found])
251 PKG_CHECK_MODULES(CAIRO, [cairo])
253 AC_ARG_ENABLE(simple-clients,
254 AS_HELP_STRING([--disable-simple-clients],
255 [do not build the simple wl_shm clients]),,
256 enable_simple_clients=yes)
257 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
258 if test x$enable_simple_clients = xyes; then
259 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
262 AC_ARG_ENABLE(simple-egl-clients,
263 AS_HELP_STRING([--disable-simple-egl-clients],
264 [do not build the simple EGL clients]),,
265 enable_simple_egl_clients=yes)
266 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes" -a "x$enable_egl" = "xyes")
267 if test x$enable_simple_egl_clients = xyes -a x$enable_egl = xyes; then
268 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
269 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
272 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
273 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
274 if test x$enable_clients = xyes; then
275 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
277 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
278 PKG_CHECK_MODULES(SERVER, [wayland-server])
279 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
281 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
282 [have_poppler=yes], [have_poppler=no])
284 # Only check for cairo-egl if a GL or GLES renderer requested
285 AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
286 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
287 [have_cairo_egl=yes], [have_cairo_egl=no])
288 AS_IF([test "x$have_cairo_egl" = "xyes"],
289 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
290 [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
293 PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
296 AC_ARG_ENABLE(resize-optimization,
297 AS_HELP_STRING([--disable-resize-optimization],
298 [disable resize optimization allocating a big buffer in toytoolkit]),,
299 enable_resize_optimization=yes)
300 AS_IF([test "x$enable_resize_optimization" = "xyes"],
301 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
303 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
304 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
305 if test x$enable_weston_launch == xyes; then
306 PKG_CHECK_MODULES(WESTON_LAUNCH, [libdrm])
307 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
308 [have_systemd_login=yes], [have_systemd_login=no])
309 AS_IF([test "x$have_systemd_login" = "xyes"],
310 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
312 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
313 if test x$have_pam == xno; then
314 AC_ERROR([weston-launch requires pam])
316 WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
319 if test x$enable_egl = xyes; then
320 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
322 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
325 AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
327 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
329 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
330 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
332 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
333 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
335 AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
336 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
338 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
340 AC_ARG_ENABLE(tablet-shell,
341 AS_HELP_STRING([--disable-tablet-shell],
342 [do not build tablet-shell server plugin and client]),,
343 enable_tablet_shell=yes)
344 AM_CONDITIONAL(ENABLE_TABLET_SHELL,
345 test "x$enable_tablet_shell" = "xyes")
348 AC_ARG_ENABLE(colord,
349 AS_HELP_STRING([--disable-colord],
350 [do not build colord CMS support]),,
352 if test "x$enable_colord" != "xno"; then
353 PKG_CHECK_MODULES(COLORD,
357 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
358 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
360 if test "x$have_colord" = "xyes"; then
364 AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
366 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
367 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
368 if test x$enable_wcap_tools = xyes; then
369 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
370 PKG_CHECK_MODULES(WCAP, [cairo])
371 WCAP_LIBS="$WCAP_LIBS -lm"
374 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
375 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
377 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
378 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
380 if test "x$GCC" = "xyes"; then
381 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
382 -Wno-missing-field-initializers -g -fvisibility=hidden \
383 -Wstrict-prototypes -Wmissing-prototypes"
387 AC_ARG_ENABLE(libunwind,
388 AS_HELP_STRING([--disable-libunwind],
389 [Disable libunwind usage for backtraces]),,
390 enable_libunwind=auto)
391 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
392 if test "x$enable_libunwind" != "xno"; then
393 PKG_CHECK_MODULES(LIBUNWIND,
397 if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
398 AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
400 if test "x$have_libunwind" = "xyes"; then
402 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
407 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
408 WESTON_NATIVE_BACKEND="drm-backend.so"
410 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
411 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
412 [The default backend to load, if not wayland nor x11.])
414 AC_ARG_ENABLE(demo-clients,
415 AS_HELP_STRING([--enable-demo-clients],
416 [install demo clients built with weston]),,
417 enable_demo_clients=no)
418 AM_CONDITIONAL(ENABLE_DEMO_CLIENTS, [test "x$enable_demo_clients" = "xyes"])
420 PKG_CHECK_MODULES(LCMS, lcms2,
421 [have_lcms=yes], [have_lcms=no])
422 if test "x$have_lcms" = xyes; then
423 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
425 AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
427 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
428 if test x$wayland_scanner = x; then
429 AC_MSG_ERROR([wayland-scanner is needed to compile weston])
432 AC_CONFIG_FILES([Makefile
435 src/xwayland/Makefile
447 Native Backend ${WESTON_NATIVE_BACKEND}
448 setuid Install ${enable_setuid_install}
450 Cairo Renderer ${with_cairo}
452 libxkbcommon ${enable_xkbcommon}
453 XWayland ${enable_xwayland}
455 Build wcap utility ${enable_wcap_tools}
456 Build Tablet Shell ${enable_tablet_shell}
458 weston-launch utility ${enable_weston_launch}
459 weston-launch systemd support ${have_systemd_login}
461 DRM Compositor ${enable_drm_compositor}
462 X11 Compositor ${enable_x11_compositor}
463 Wayland Compositor ${enable_wayland_compositor}
464 Headless Compositor ${enable_headless_compositor}
465 RPI Compositor ${enable_rpi_compositor}
466 FBDEV Compositor ${enable_fbdev_compositor}
467 RDP Compositor ${enable_rdp_compositor}
469 Raspberry Pi BCM headers ${have_bcm_host}
471 Build Clients ${enable_clients}
472 Build EGL Clients ${have_cairo_egl}
473 Build Simple Clients ${enable_simple_clients}
474 Build Simple EGL Clients ${enable_simple_egl_clients}
476 Install Demo Clients ${enable_demo_clients}
478 Colord Support ${have_colord}
479 GLU Support ${have_glu}
480 LCMS2 Support ${have_lcms}
481 libwebp Support ${have_webp}
482 libunwind Support ${have_libunwind}