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 AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests])
23 AM_SILENT_RULES([yes])
31 LT_INIT([disable-static])
33 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
34 [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
38 AC_CHECK_FUNC([dlopen], [],
39 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
42 AC_CHECK_DECL(SFD_CLOEXEC,[],
43 [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
44 [[#include <sys/signalfd.h>]])
45 AC_CHECK_DECL(TFD_CLOEXEC,[],
46 [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")],
47 [[#include <sys/timerfd.h>]])
48 AC_CHECK_DECL(CLOCK_MONOTONIC,[],
49 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
50 [[#include <time.h>]])
51 AC_CHECK_HEADERS([execinfo.h])
53 AC_CHECK_FUNCS([mkostemp strchrnul])
55 COMPOSITOR_MODULES="wayland-server >= 1.1.90 xkbcommon pixman-1"
57 AC_ARG_ENABLE(egl, [ --disable-egl],,
59 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
60 if test x$enable_egl = xyes; then
61 AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
62 COMPOSITOR_MODULES="$COMPOSITOR_MODULES egl >= 7.10 glesv2"
65 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
67 AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
68 enable_setuid_install=yes)
69 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
72 AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
74 AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],,
75 enable_xwayland_test=yes)
76 AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
77 AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes)
78 if test x$enable_xwayland = xyes; then
79 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcursor cairo-xcb)
80 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
82 AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
83 [Path to X server]), [XSERVER_PATH="$withval"],
84 [XSERVER_PATH="$bindir/Xorg"])
85 AC_SUBST([XSERVER_PATH])
86 if test x$enable_xwayland_test = xyes; then
87 PKG_CHECK_MODULES([XWAYLAND_TEST], xcb xcb-dri2 libdrm)
92 AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
93 enable_x11_compositor=yes)
94 AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
95 if test x$enable_x11_compositor = xyes; then
96 PKG_CHECK_MODULES([XCB], xcb)
98 xcb_save_CFLAGS=$CFLAGS
101 AC_CHECK_FUNCS([xcb_poll_for_queued_event])
103 CFLAGS=$xcb_save_CFLAGS
105 X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
107 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
108 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
109 if test "x$have_xcb_xkb" = xyes; then
110 # Most versions of XCB have totally broken XKB bindings, where the
111 # events don't work. Make sure we can actually use them.
112 xcb_xkb_save_CFLAGS=$CFLAGS
113 CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
114 AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
115 [], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
116 CFLAGS=$xcb_xkb_save_CFLAGS
118 if test "x$have_xcb_xkb" = xyes; then
119 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
120 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
123 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
124 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
128 AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
129 enable_drm_compositor=yes)
130 AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes -a x$enable_egl = xyes)
131 if test x$enable_drm_compositor = xyes -a x$enable_egl = xyes; then
132 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
133 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
137 AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
138 enable_wayland_compositor=yes)
139 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
140 test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
141 if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
142 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
143 [Build the Wayland (nested) compositor])
144 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
148 AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
149 enable_headless_compositor=yes)
150 AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
151 test x$enable_headless_compositor = xyes)
154 AC_ARG_ENABLE(rpi-compositor,
155 AS_HELP_STRING([--disable-rpi-compositor],
156 [do not build the Raspberry Pi backend]),,
157 enable_rpi_compositor=yes)
158 AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes")
160 if test "x$enable_rpi_compositor" = "xyes"; then
161 AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
162 PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
163 PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
165 AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])],
166 [AC_MSG_WARN([Raspberry Pi BCM host libraries not found, will use stubs instead.])])
168 AM_CONDITIONAL(INSTALL_RPI_COMPOSITOR, test "x$have_bcm_host" = "xyes")
171 AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],,
172 enable_fbdev_compositor=yes)
173 AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
174 [test x$enable_fbdev_compositor = xyes])
175 AS_IF([test x$enable_fbdev_compositor = xyes], [
176 AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
177 PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0])
180 AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],,
181 enable_rdp_compositor=no)
182 AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
183 [test x$enable_rdp_compositor = xyes])
184 if test x$enable_rdp_compositor = xyes; then
185 PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
188 AC_ARG_WITH(cairo-glesv2,
189 AS_HELP_STRING([--with-cairo-glesv2],
190 [Use GLESv2 cairo instead of full GL]))
191 if test "x$with_cairo_glesv2" = "xyes"; then
192 cairo_modules="cairo-glesv2"
193 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
195 cairo_modules="cairo-gl"
198 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
199 PKG_CHECK_MODULES(PNG, [libpng])
200 PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
201 AS_IF([test "x$have_webp" = "xyes"],
202 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
204 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
205 if test x$have_jpeglib = xyes; then
208 AC_ERROR([libjpeg not found])
212 PKG_CHECK_MODULES(CAIRO, [cairo])
214 AC_ARG_ENABLE(simple-clients,
215 AS_HELP_STRING([--disable-simple-clients],
216 [do not build the simple wl_shm clients]),,
217 enable_simple_clients=yes)
218 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
219 if test x$enable_simple_clients = xyes; then
220 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
223 AC_ARG_ENABLE(simple-egl-clients,
224 AS_HELP_STRING([--disable-simple-egl-clients],
225 [do not build the simple EGL clients]),,
226 enable_simple_egl_clients=yes)
227 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes" -a "x$enable_egl" = "xyes")
228 if test x$enable_simple_egl_clients = xyes -a x$enable_egl = xyes; then
229 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
230 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
233 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
234 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
235 if test x$enable_clients = xyes; then
236 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
238 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
239 PKG_CHECK_MODULES(SERVER, [wayland-server])
240 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
242 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
243 [have_poppler=yes], [have_poppler=no])
244 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
245 [have_cairo_egl=yes], [have_cairo_egl=no])
246 AS_IF([test "x$have_cairo_egl" = "xyes"],
247 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
248 [AC_MSG_WARN([clients will use cairo image, cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])
249 PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
252 AC_ARG_ENABLE(resize-optimization,
253 AS_HELP_STRING([--disable-resize-optimization],
254 [disable resize optimization allocating a big buffer in toytoolkit]),,
255 enable_resize_optimization=yes)
256 AS_IF([test "x$enable_resize_optimization" = "xyes"],
257 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
259 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
260 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
261 if test x$enable_weston_launch == xyes; then
262 PKG_CHECK_MODULES(WESTON_LAUNCH, [libdrm])
263 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
264 [have_systemd_login=yes], [have_systemd_login=no])
265 AS_IF([test "x$have_systemd_login" = "xyes"],
266 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
268 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
269 if test x$have_pam == xno; then
270 AC_ERROR([weston-launch requires pam])
272 WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
275 if test x$enable_egl = xyes; then
276 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
278 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
281 AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
283 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
285 AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
286 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
288 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
289 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
291 AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
292 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
294 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
296 AC_ARG_ENABLE(tablet-shell,
297 AS_HELP_STRING([--disable-tablet-shell],
298 [do not build tablet-shell server plugin and client]),,
299 enable_tablet_shell=yes)
300 AM_CONDITIONAL(ENABLE_TABLET_SHELL,
301 test "x$enable_tablet_shell" = "xyes")
304 AC_ARG_ENABLE(colord,
305 AS_HELP_STRING([--disable-colord],
306 [do not build colord CMS support]),,
308 AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
309 if test "x$enable_colord" != "xno"; then
310 PKG_CHECK_MODULES(COLORD,
314 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
315 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
317 if test "x$have_colord" = "xyes"; then
322 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
323 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
324 if test x$enable_wcap_tools = xyes; then
325 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
326 PKG_CHECK_MODULES(WCAP, [cairo])
327 WCAP_LIBS="$WCAP_LIBS -lm"
330 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
331 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
333 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
334 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
336 if test "x$GCC" = "xyes"; then
337 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
338 -Wno-missing-field-initializers -g -fvisibility=hidden \
339 -Wstrict-prototypes -Wmissing-prototypes"
343 AC_ARG_ENABLE(libunwind,
344 AS_HELP_STRING([--disable-libunwind],
345 [Disable libunwind usage for backtraces]),,
346 enable_libunwind=auto)
347 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
348 if test "x$enable_libunwind" != "xno"; then
349 PKG_CHECK_MODULES(LIBUNWIND,
353 if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
354 AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
356 if test "x$have_libunwind" = "xyes"; then
358 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
363 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
364 WESTON_NATIVE_BACKEND="drm-backend.so"
366 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
367 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
368 [The default backend to load, if not wayland nor x11.])
370 PKG_CHECK_MODULES(LCMS, lcms2,
371 [have_lcms=yes], [have_lcms=no])
372 if test "x$have_lcms" = xyes; then
373 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
375 AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
377 WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
379 AC_CONFIG_FILES([Makefile
382 src/xwayland/Makefile