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 PKG_CHECK_MODULES(LIBVA, [libva >= 0.34.0 libva-drm >= 0.34.0], [have_libva=yes], [have_libva=no])
244 AS_IF([test "x$have_libva" = "xyes"],
245 [AC_DEFINE([HAVE_LIBVA], [1], [Have libva])])
246 AM_CONDITIONAL(ENABLE_LIBVA, test "x$have_libva" = "xyes")
248 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
249 if test x$have_jpeglib = xyes; then
252 AC_ERROR([libjpeg not found])
256 PKG_CHECK_MODULES(CAIRO, [cairo])
258 AC_ARG_ENABLE(simple-clients,
259 AS_HELP_STRING([--disable-simple-clients],
260 [do not build the simple wl_shm clients]),,
261 enable_simple_clients=yes)
262 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
263 if test x$enable_simple_clients = xyes; then
264 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
267 AC_ARG_ENABLE(simple-egl-clients,
268 AS_HELP_STRING([--disable-simple-egl-clients],
269 [do not build the simple EGL clients]),,
270 enable_simple_egl_clients=yes)
271 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes" -a "x$enable_egl" = "xyes")
272 if test x$enable_simple_egl_clients = xyes -a x$enable_egl = xyes; then
273 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
274 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
277 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
278 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
279 if test x$enable_clients = xyes; then
280 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
282 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
283 PKG_CHECK_MODULES(SERVER, [wayland-server])
284 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
286 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
287 [have_poppler=yes], [have_poppler=no])
289 # Only check for cairo-egl if a GL or GLES renderer requested
290 AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
291 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
292 [have_cairo_egl=yes], [have_cairo_egl=no])
293 AS_IF([test "x$have_cairo_egl" = "xyes"],
294 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
295 [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
298 PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
301 AC_ARG_ENABLE(resize-optimization,
302 AS_HELP_STRING([--disable-resize-optimization],
303 [disable resize optimization allocating a big buffer in toytoolkit]),,
304 enable_resize_optimization=yes)
305 AS_IF([test "x$enable_resize_optimization" = "xyes"],
306 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
308 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
309 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
310 if test x$enable_weston_launch == xyes; then
311 PKG_CHECK_MODULES(WESTON_LAUNCH, [libdrm])
312 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
313 [have_systemd_login=yes], [have_systemd_login=no])
314 AS_IF([test "x$have_systemd_login" = "xyes"],
315 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
317 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
318 if test x$have_pam == xno; then
319 AC_ERROR([weston-launch requires pam])
321 WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
324 if test x$enable_egl = xyes; then
325 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
327 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
330 AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
332 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
334 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
335 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
337 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
338 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
340 AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
341 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
343 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
345 AC_ARG_ENABLE(tablet-shell,
346 AS_HELP_STRING([--disable-tablet-shell],
347 [do not build tablet-shell server plugin and client]),,
348 enable_tablet_shell=yes)
349 AM_CONDITIONAL(ENABLE_TABLET_SHELL,
350 test "x$enable_tablet_shell" = "xyes")
353 AC_ARG_ENABLE(colord,
354 AS_HELP_STRING([--disable-colord],
355 [do not build colord CMS support]),,
357 if test "x$enable_colord" != "xno"; then
358 PKG_CHECK_MODULES(COLORD,
362 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
363 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
365 if test "x$have_colord" = "xyes"; then
369 AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
371 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
372 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
373 if test x$enable_wcap_tools = xyes; then
374 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
375 PKG_CHECK_MODULES(WCAP, [cairo])
376 WCAP_LIBS="$WCAP_LIBS -lm"
379 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
380 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
382 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
383 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
385 if test "x$GCC" = "xyes"; then
386 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
387 -Wno-missing-field-initializers -g -fvisibility=hidden \
388 -Wstrict-prototypes -Wmissing-prototypes"
392 AC_ARG_ENABLE(libunwind,
393 AS_HELP_STRING([--disable-libunwind],
394 [Disable libunwind usage for backtraces]),,
395 enable_libunwind=auto)
396 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
397 if test "x$enable_libunwind" != "xno"; then
398 PKG_CHECK_MODULES(LIBUNWIND,
402 if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
403 AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
405 if test "x$have_libunwind" = "xyes"; then
407 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
412 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
413 WESTON_NATIVE_BACKEND="drm-backend.so"
415 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
416 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
417 [The default backend to load, if not wayland nor x11.])
419 AC_ARG_ENABLE(demo-clients,
420 AS_HELP_STRING([--enable-demo-clients],
421 [install demo clients built with weston]),,
422 enable_demo_clients=no)
423 AM_CONDITIONAL(ENABLE_DEMO_CLIENTS, [test "x$enable_demo_clients" = "xyes"])
425 PKG_CHECK_MODULES(LCMS, lcms2,
426 [have_lcms=yes], [have_lcms=no])
427 if test "x$have_lcms" = xyes; then
428 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
430 AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
432 AC_PATH_PROG([wayland_scanner], [wayland-scanner])
433 if test x$wayland_scanner = x; then
434 AC_MSG_ERROR([wayland-scanner is needed to compile weston])
437 AC_CONFIG_FILES([Makefile
440 src/xwayland/Makefile
452 Native Backend ${WESTON_NATIVE_BACKEND}
453 setuid Install ${enable_setuid_install}
455 Cairo Renderer ${with_cairo}
457 libxkbcommon ${enable_xkbcommon}
458 XWayland ${enable_xwayland}
460 Build wcap utility ${enable_wcap_tools}
461 Build Tablet Shell ${enable_tablet_shell}
463 weston-launch utility ${enable_weston_launch}
464 weston-launch systemd support ${have_systemd_login}
466 DRM Compositor ${enable_drm_compositor}
467 X11 Compositor ${enable_x11_compositor}
468 Wayland Compositor ${enable_wayland_compositor}
469 Headless Compositor ${enable_headless_compositor}
470 RPI Compositor ${enable_rpi_compositor}
471 FBDEV Compositor ${enable_fbdev_compositor}
472 RDP Compositor ${enable_rdp_compositor}
474 Raspberry Pi BCM headers ${have_bcm_host}
476 Build Clients ${enable_clients}
477 Build EGL Clients ${have_cairo_egl}
478 Build Simple Clients ${enable_simple_clients}
479 Build Simple EGL Clients ${enable_simple_egl_clients}
481 Install Demo Clients ${enable_demo_clients}
483 Colord Support ${have_colord}
484 GLU Support ${have_glu}
485 LCMS2 Support ${have_lcms}
486 libwebp Support ${have_webp}
487 libunwind Support ${have_libunwind}
488 VA H.264 encoding Support ${have_libva}