1 m4_define([weston_major_version], [1])
2 m4_define([weston_minor_version], [1])
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
23 AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests])
25 AM_SILENT_RULES([yes])
33 LT_INIT([disable-static])
35 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
36 [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
40 AC_CHECK_FUNC([dlopen], [],
41 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
44 AC_CHECK_DECL(SFD_CLOEXEC,[],
45 [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
46 [[#include <sys/signalfd.h>]])
47 AC_CHECK_DECL(TFD_CLOEXEC,[],
48 [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")],
49 [[#include <sys/timerfd.h>]])
50 AC_CHECK_DECL(CLOCK_MONOTONIC,[],
51 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
52 [[#include <time.h>]])
53 AC_CHECK_HEADERS([execinfo.h])
55 AC_CHECK_FUNCS([mkostemp strchrnul])
57 COMPOSITOR_MODULES="wayland-server >= 1.1.90 xkbcommon pixman-1"
59 AC_ARG_ENABLE(egl, [ --disable-egl],,
61 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
62 if test x$enable_egl = xyes; then
63 AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
64 COMPOSITOR_MODULES="$COMPOSITOR_MODULES egl >= 7.10 glesv2"
67 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
69 AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
70 enable_setuid_install=yes)
71 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
74 AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
76 AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],,
77 enable_xwayland_test=yes)
78 AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
79 AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes)
80 if test x$enable_xwayland = xyes; then
81 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcursor cairo-xcb)
82 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
84 AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
85 [Path to X server]), [XSERVER_PATH="$withval"],
86 [XSERVER_PATH="$bindir/Xorg"])
87 AC_SUBST([XSERVER_PATH])
88 if test x$enable_xwayland_test = xyes; then
89 PKG_CHECK_MODULES([XWAYLAND_TEST], xcb xcb-dri2 libdrm)
94 AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
95 enable_x11_compositor=yes)
96 AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
97 if test x$enable_x11_compositor = xyes; then
98 PKG_CHECK_MODULES([XCB], xcb)
100 xcb_save_CFLAGS=$CFLAGS
103 AC_CHECK_FUNCS([xcb_poll_for_queued_event])
105 CFLAGS=$xcb_save_CFLAGS
107 X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
109 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
110 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
111 if test "x$have_xcb_xkb" = xyes; then
112 # Most versions of XCB have totally broken XKB bindings, where the
113 # events don't work. Make sure we can actually use them.
114 xcb_xkb_save_CFLAGS=$CFLAGS
115 CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
116 AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
117 [], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
118 CFLAGS=$xcb_xkb_save_CFLAGS
120 if test "x$have_xcb_xkb" = xyes; then
121 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
122 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
125 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
126 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
130 AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
131 enable_drm_compositor=yes)
132 AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes -a x$enable_egl = xyes)
133 if test x$enable_drm_compositor = xyes -a x$enable_egl = xyes; then
134 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
135 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
139 AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
140 enable_wayland_compositor=yes)
141 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
142 test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
143 if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
144 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
145 [Build the Wayland (nested) compositor])
146 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
150 AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
151 enable_headless_compositor=yes)
152 AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
153 test x$enable_headless_compositor = xyes)
156 AC_ARG_ENABLE(rpi-compositor,
157 AS_HELP_STRING([--disable-rpi-compositor],
158 [do not build the Raspberry Pi backend]),,
159 enable_rpi_compositor=yes)
160 AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes")
162 if test "x$enable_rpi_compositor" = "xyes"; then
163 AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
164 PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
165 PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
167 AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])],
168 [AC_MSG_WARN([Raspberry Pi BCM host libraries not found, will use stubs instead.])])
170 AM_CONDITIONAL(INSTALL_RPI_COMPOSITOR, test "x$have_bcm_host" = "xyes")
173 AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],,
174 enable_fbdev_compositor=yes)
175 AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
176 [test x$enable_fbdev_compositor = xyes])
177 AS_IF([test x$enable_fbdev_compositor = xyes], [
178 AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
179 PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0])
182 AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],,
183 enable_rdp_compositor=no)
184 AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
185 [test x$enable_rdp_compositor = xyes])
186 if test x$enable_rdp_compositor = xyes; then
187 PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
190 AC_ARG_WITH(cairo-glesv2,
191 AS_HELP_STRING([--with-cairo-glesv2],
192 [Use GLESv2 cairo instead of full GL]))
193 if test "x$with_cairo_glesv2" = "xyes"; then
194 cairo_modules="cairo-glesv2"
195 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
197 cairo_modules="cairo-gl"
200 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
201 PKG_CHECK_MODULES(PNG, [libpng])
202 PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
203 AS_IF([test "x$have_webp" = "xyes"],
204 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
206 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
207 if test x$have_jpeglib = xyes; then
210 AC_ERROR([libjpeg not found])
214 PKG_CHECK_MODULES(CAIRO, [cairo])
216 AC_ARG_ENABLE(simple-clients,
217 AS_HELP_STRING([--disable-simple-clients],
218 [do not build the simple wl_shm clients]),,
219 enable_simple_clients=yes)
220 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
221 if test x$enable_simple_clients = xyes; then
222 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
225 AC_ARG_ENABLE(simple-egl-clients,
226 AS_HELP_STRING([--disable-simple-egl-clients],
227 [do not build the simple EGL clients]),,
228 enable_simple_egl_clients=yes)
229 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes" -a "x$enable_egl" = "xyes")
230 if test x$enable_simple_egl_clients = xyes -a x$enable_egl = xyes; then
231 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
232 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
235 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
236 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
237 if test x$enable_clients = xyes; then
238 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
240 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
241 PKG_CHECK_MODULES(SERVER, [wayland-server])
242 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
244 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
245 [have_poppler=yes], [have_poppler=no])
246 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
247 [have_cairo_egl=yes], [have_cairo_egl=no])
248 AS_IF([test "x$have_cairo_egl" = "xyes"],
249 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
250 [AC_MSG_WARN([clients will use cairo image, cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])
251 PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
254 AC_ARG_ENABLE(resize-optimization,
255 AS_HELP_STRING([--disable-resize-optimization],
256 [disable resize optimization allocating a big buffer in toytoolkit]),,
257 enable_resize_optimization=yes)
258 AS_IF([test "x$enable_resize_optimization" = "xyes"],
259 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
261 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
262 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
263 if test x$enable_weston_launch == xyes; then
264 PKG_CHECK_MODULES(WESTON_LAUNCH, [libdrm])
265 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
266 [have_systemd_login=yes], [have_systemd_login=no])
267 AS_IF([test "x$have_systemd_login" = "xyes"],
268 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
270 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
271 if test x$have_pam == xno; then
272 AC_ERROR([weston-launch requires pam])
274 WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
277 if test x$enable_egl = xyes; then
278 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
280 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
283 AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
285 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
287 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
288 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
290 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
291 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
293 AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
294 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
296 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
298 AC_ARG_ENABLE(tablet-shell,
299 AS_HELP_STRING([--disable-tablet-shell],
300 [do not build tablet-shell server plugin and client]),,
301 enable_tablet_shell=yes)
302 AM_CONDITIONAL(ENABLE_TABLET_SHELL,
303 test "x$enable_tablet_shell" = "xyes")
306 AC_ARG_ENABLE(colord,
307 AS_HELP_STRING([--disable-colord],
308 [do not build colord CMS support]),,
310 AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
311 if test "x$enable_colord" != "xno"; then
312 PKG_CHECK_MODULES(COLORD,
316 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
317 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
319 if test "x$have_colord" = "xyes"; then
324 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
325 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
326 if test x$enable_wcap_tools = xyes; then
327 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
328 PKG_CHECK_MODULES(WCAP, [cairo])
329 WCAP_LIBS="$WCAP_LIBS -lm"
332 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
333 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
335 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
336 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
338 if test "x$GCC" = "xyes"; then
339 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
340 -Wno-missing-field-initializers -g -fvisibility=hidden \
341 -Wstrict-prototypes -Wmissing-prototypes"
345 AC_ARG_ENABLE(libunwind,
346 AS_HELP_STRING([--disable-libunwind],
347 [Disable libunwind usage for backtraces]),,
348 enable_libunwind=auto)
349 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
350 if test "x$enable_libunwind" != "xno"; then
351 PKG_CHECK_MODULES(LIBUNWIND,
355 if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
356 AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
358 if test "x$have_libunwind" = "xyes"; then
360 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
365 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
366 WESTON_NATIVE_BACKEND="drm-backend.so"
368 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
369 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
370 [The default backend to load, if not wayland nor x11.])
372 PKG_CHECK_MODULES(LCMS, lcms2,
373 [have_lcms=yes], [have_lcms=no])
374 if test "x$have_lcms" = xyes; then
375 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
377 AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
379 WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
381 AC_CONFIG_FILES([Makefile
384 src/xwayland/Makefile