4 [https://bugs.freedesktop.org/enter_bug.cgi?product=weston],
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])
21 LT_INIT([disable-static])
23 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
24 [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
28 AC_CHECK_FUNC([dlopen], [],
29 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
32 AC_CHECK_HEADERS([execinfo.h])
34 AC_CHECK_FUNCS([mkostemp strchrnul])
36 PKG_CHECK_MODULES(COMPOSITOR,
37 [wayland-server egl >= 7.10 glesv2 xkbcommon pixman-1])
40 AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
41 enable_setuid_install=yes)
42 AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
45 AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
47 AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
48 if test x$enable_xwayland = xyes; then
49 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcursor cairo-xcb)
50 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
52 AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
53 [Path to X server]), [XSERVER_PATH="$withval"],
54 [XSERVER_PATH="$bindir/Xorg"])
55 AC_SUBST([XSERVER_PATH])
59 AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
60 enable_x11_compositor=yes)
61 AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
62 if test x$enable_x11_compositor = xyes; then
63 PKG_CHECK_MODULES([XCB], xcb)
65 xcb_save_CFLAGS=$CFLAGS
68 AC_CHECK_FUNCS([xcb_poll_for_queued_event])
70 CFLAGS=$xcb_save_CFLAGS
72 X11_COMPOSITOR_MODULES="x11 x11-xcb"
74 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
75 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
76 if test "x$have_xcb_xkb" = xyes; then
77 # Most versions of XCB have totally broken XKB bindings, where the
78 # events don't work. Make sure we can actually use them.
79 xcb_xkb_save_CFLAGS=$CFLAGS
80 CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
81 AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
82 [], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
83 CFLAGS=$xcb_xkb_save_CFLAGS
85 if test "x$have_xcb_xkb" = xyes; then
86 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
87 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
90 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
91 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
95 AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
96 enable_drm_compositor=yes)
97 AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes)
98 if test x$enable_drm_compositor = xyes; then
99 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
100 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
104 AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
105 enable_wayland_compositor=yes)
106 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
107 test x$enable_wayland_compositor = xyes)
108 if test x$enable_wayland_compositor = xyes; then
109 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
110 [Build the Wayland (nested) compositor])
111 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
115 AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
116 enable_headless_compositor=yes)
117 AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
118 test x$enable_headless_compositor = xyes)
121 AC_ARG_ENABLE(android-compositor,
122 AS_HELP_STRING([--disable-android-compositor],
123 [do not build-test the Android 4.0 backend]),,
124 enable_android_compositor=yes)
125 AM_CONDITIONAL(ENABLE_ANDROID_COMPOSITOR, test x$enable_android_compositor = xyes)
126 if test x$enable_android_compositor = xyes; then
127 AC_DEFINE([BUILD_ANDROID_COMPOSITOR], [1], [Build the compositor for Android 4.0])
128 PKG_CHECK_MODULES(ANDROID_COMPOSITOR, [mtdev >= 1.1.0])
131 AC_ARG_WITH(cairo-glesv2,
132 AS_HELP_STRING([--with-cairo-glesv2],
133 [Use GLESv2 cairo instead of full GL]))
134 if test "x$with_cairo_glesv2" = "xyes"; then
135 cairo_modules="cairo-glesv2"
136 AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
138 cairo_modules="cairo-gl"
141 PKG_CHECK_MODULES(PIXMAN, [pixman-1])
142 PKG_CHECK_MODULES(PNG, [libpng])
143 PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
144 AS_IF([test "x$have_webp" = "xyes"],
145 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
147 AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
148 if test x$have_jpeglib = xyes; then
149 IMAGE_LIBS="$IMAGE_LIBS -ljpeg"
151 AC_ERROR([libjpeg not found])
154 PKG_CHECK_MODULES(CAIRO, [cairo])
155 SHARED_LIBS="$CAIRO_LIBS $PIXMAN_LIBS $PNG_LIBS $WEBP_LIBS $IMAGE_LIBS"
156 SHARED_CFLAGS="$CAIRO_CFLAGS $PIXMAN_CFLAGS $PNG_CFLAGS $WEBP_CFLAGS"
157 AC_SUBST(SHARED_LIBS)
158 AC_SUBST(SHARED_CFLAGS)
160 COMPOSITOR_LIBS="$COMPOSITOR_LIBS $IMAGE_LIBS"
161 COMPOSITOR_CFLAGS="$COMPOSITOR_CFLAGS $IMAGE_CFLAGS"
163 AC_ARG_ENABLE(simple-clients,
164 AS_HELP_STRING([--disable-simple-clients],
165 [do not build the simple wl_shm clients]),,
166 enable_simple_clients=yes)
167 AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
168 if test x$enable_simple_clients = xyes; then
169 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
172 AC_ARG_ENABLE(simple-egl-clients,
173 AS_HELP_STRING([--disable-simple-egl-clients],
174 [do not build the simple EGL clients]),,
175 enable_simple_egl_clients=yes)
176 AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes")
177 if test x$enable_simple_egl_clients = xyes; then
178 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
179 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
182 AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
183 AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
184 if test x$enable_clients = xyes; then
185 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
187 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
188 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
190 CLIENT_CFLAGS="$CLIENT_CFLAGS $IMAGE_CFLAGS"
191 CLIENT_LIBS="$CLIENT_LIBS $IMAGE_LIBS"
193 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
194 [have_poppler=yes], [have_poppler=no])
195 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
196 [have_cairo_egl=yes], [have_cairo_egl=no])
197 AS_IF([test "x$have_cairo_egl" = "xyes"],
198 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
199 [AC_MSG_WARN([clients will use cairo image, cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])
202 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
203 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
204 if test x$enable_weston_launch == xyes; then
205 PKG_CHECK_MODULES(WESTON_LAUNCH, [libdrm])
206 PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
207 [have_systemd_login=yes], [have_systemd_login=no])
208 AS_IF([test "x$have_systemd_login" = "xyes"],
209 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
211 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
212 if test x$have_pam == xno; then
213 AC_ERROR([weston-launch requires pam])
215 WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
218 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
219 AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
222 AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
224 AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
225 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes")
227 AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
229 AC_ARG_ENABLE(tablet-shell,
230 AS_HELP_STRING([--disable-tablet-shell],
231 [do not build tablet-shell server plugin and client]),,
232 enable_tablet_shell=yes)
233 AM_CONDITIONAL(ENABLE_TABLET_SHELL,
234 test "x$enable_tablet_shell" = "xyes")
237 AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
238 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
239 if test x$enable_wcap_tools = xyes; then
240 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
241 PKG_CHECK_MODULES(WCAP, [cairo])
242 WCAP_LIBS="$WCAP_LIBS -lm"
245 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
246 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
248 PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
249 AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
251 if test "x$GCC" = "xyes"; then
252 my_common_gcc_flags="-Wall -Wextra -Wno-unused-parameter \
253 -Wno-missing-field-initializers -g -fvisibility=hidden"
254 GCC_CFLAGS="$my_common_gcc_flags \
255 -Wstrict-prototypes -Wmissing-prototypes"
256 GCC_CXXFLAGS="$my_common_gcc_flags"
259 AC_SUBST(GCC_CXXFLAGS)
261 if test "x$WESTON_NATIVE_BACKEND" = "x"; then
262 WESTON_NATIVE_BACKEND="drm-backend.so"
264 AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
265 AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
266 [The default backend to load, if not wayland nor x11.])
268 WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
270 AC_CONFIG_FILES([Makefile
273 src/xwayland/Makefile