4 [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.0.90],
6 [http://wayland.freedesktop.org/])
8 AC_CONFIG_HEADERS([config.h])
10 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
12 AM_SILENT_RULES([yes])
20 LT_INIT([disable-static])
22 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
23 [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
27 AC_CHECK_FUNC([dlopen], [],
28 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
31 AC_CHECK_HEADERS([execinfo.h])
33 AC_CHECK_FUNCS([mkostemp strchrnul])
35 COMPOSITOR_MODULES="wayland-server xkbcommon pixman-1"
37 AC_ARG_ENABLE(egl, [ --disable-egl],,
39 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
40 if test x$enable_egl = xyes; then
41 AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
42 COMPOSITOR_MODULES="$COMPOSITOR_MODULES egl >= 7.10 glesv2"
45 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
47 AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
48 enable_setuid_install=yes)
49 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
52 AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
54 AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
55 if test x$enable_xwayland = xyes; then
56 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcursor cairo-xcb)
57 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
59 AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
60 [Path to X server]), [XSERVER_PATH="$withval"],
61 [XSERVER_PATH="$bindir/Xorg"])
62 AC_SUBST([XSERVER_PATH])
65 AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],,
66 enable_xwayland_test=yes)
67 AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland_test = xyes)
68 if test x$enable_xwayland_test = xyes; then
69 PKG_CHECK_MODULES([XWAYLAND_TEST], xcb xcb-dri2 libdrm)
72 AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
73 enable_x11_compositor=yes)
74 AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
75 if test x$enable_x11_compositor = xyes; then
76 PKG_CHECK_MODULES([XCB], xcb)
78 xcb_save_CFLAGS=$CFLAGS
81 AC_CHECK_FUNCS([xcb_poll_for_queued_event])
83 CFLAGS=$xcb_save_CFLAGS
85 X11_COMPOSITOR_MODULES="x11 x11-xcb"
87 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
88 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
89 if test "x$have_xcb_xkb" = xyes; then
90 # Most versions of XCB have totally broken XKB bindings, where the
91 # events don't work. Make sure we can actually use them.
92 xcb_xkb_save_CFLAGS=$CFLAGS
93 CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
94 AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
95 [], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
96 CFLAGS=$xcb_xkb_save_CFLAGS
98 if test "x$have_xcb_xkb" = xyes; then
99 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
100 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
103 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
104 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
108 AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
109 enable_drm_compositor=yes)
110 AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes -a x$enable_egl = xyes)
111 if test x$enable_drm_compositor = xyes -a x$enable_egl = xyes; then
112 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
113 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
117 AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
118 enable_wayland_compositor=yes)
119 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
120 test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
121 if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
122 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
123 [Build the Wayland (nested) compositor])
124 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
128 AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
129 enable_headless_compositor=yes)
130 AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
131 test x$enable_headless_compositor = xyes)
134 AC_ARG_ENABLE(rpi-compositor,
135 AS_HELP_STRING([--disable-rpi-compositor],
136 [do not build the Raspberry Pi backend]),,
137 enable_rpi_compositor=yes)
138 AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes" -a "x$enable_egl" = "xyes")
140 if test x$enable_rpi_compositor = xyes -a x$enable_egl = xyes; then
141 AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
142 PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
143 PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
145 AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])],
146 [AC_MSG_WARN([Raspberry Pi BCM host libraries not found, will use stubs instead.])])
148 AM_CONDITIONAL(INSTALL_RPI_COMPOSITOR, test "x$have_bcm_host" = "xyes")
151 AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],,
152 enable_fbdev_compositor=yes)
153 AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
154 [test x$enable_fbdev_compositor = xyes])
155 AS_IF([test x$enable_fbdev_compositor = xyes], [
156 AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
157 PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0])
161 AC_ARG_WITH(cairo-glesv2,
162 AS_HELP_STRING([--with-cairo-glesv2],
163 [Use GLESv2 cairo instead of full GL]))
164 if test "x$with_cairo_glesv2" = "xyes"; then
165 cairo_modules="cairo-glesv2"
166 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
168 cairo_modules="cairo-gl"
171 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
172 PKG_CHECK_MODULES(PNG, [libpng])
173 PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
174 AS_IF([test "x$have_webp" = "xyes"],
175 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
177 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
178 if test x$have_jpeglib = xyes; then
181 AC_ERROR([libjpeg not found])
185 PKG_CHECK_MODULES(CAIRO, [cairo])
187 AC_ARG_ENABLE(simple-clients,
188 AS_HELP_STRING([--disable-simple-clients],
189 [do not build the simple wl_shm clients]),,
190 enable_simple_clients=yes)
191 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
192 if test x$enable_simple_clients = xyes; then
193 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
196 AC_ARG_ENABLE(simple-egl-clients,
197 AS_HELP_STRING([--disable-simple-egl-clients],
198 [do not build the simple EGL clients]),,
199 enable_simple_egl_clients=yes)
200 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes" -a "x$enable_egl" = "xyes")
201 if test x$enable_simple_egl_clients = xyes -a x$enable_egl = xyes; then
202 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
203 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
206 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
207 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
208 if test x$enable_clients = xyes; then
209 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
211 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
212 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
214 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
215 [have_poppler=yes], [have_poppler=no])
216 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
217 [have_cairo_egl=yes], [have_cairo_egl=no])
218 AS_IF([test "x$have_cairo_egl" = "xyes"],
219 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
220 [AC_MSG_WARN([clients will use cairo image, cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])
223 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
224 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
225 if test x$enable_weston_launch == xyes; then
226 PKG_CHECK_MODULES(WESTON_LAUNCH, [libdrm])
227 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
228 [have_systemd_login=yes], [have_systemd_login=no])
229 AS_IF([test "x$have_systemd_login" = "xyes"],
230 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
232 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
233 if test x$have_pam == xno; then
234 AC_ERROR([weston-launch requires pam])
236 WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
239 if test x$enable_egl = xyes; then
240 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
242 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
245 AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
247 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
248 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
250 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
252 AC_ARG_ENABLE(tablet-shell,
253 AS_HELP_STRING([--disable-tablet-shell],
254 [do not build tablet-shell server plugin and client]),,
255 enable_tablet_shell=yes)
256 AM_CONDITIONAL(ENABLE_TABLET_SHELL,
257 test "x$enable_tablet_shell" = "xyes")
260 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
261 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
262 if test x$enable_wcap_tools = xyes; then
263 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
264 PKG_CHECK_MODULES(WCAP, [cairo])
265 WCAP_LIBS="$WCAP_LIBS -lm"
268 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
269 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
271 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
272 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
274 if test "x$GCC" = "xyes"; then
275 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
276 -Wno-missing-field-initializers -g -fvisibility=hidden \
277 -Wstrict-prototypes -Wmissing-prototypes"
281 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
282 WESTON_NATIVE_BACKEND="drm-backend.so"
284 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
285 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
286 [The default backend to load, if not wayland nor x11.])
288 WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
290 AC_CONFIG_FILES([Makefile
293 src/xwayland/Makefile