blob: 2bf5f7817d3523a607c21f0c315f27e311b43d05 [file] [log] [blame]
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -05001m4_define([weston_major_version], [1])
Kristian Høgsberg95659c02013-10-09 16:20:50 -07002m4_define([weston_minor_version], [3])
Kristian Høgsberg5d380c32013-10-23 09:30:48 -07003m4_define([weston_micro_version], [90])
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -05004m4_define([weston_version],
5 [weston_major_version.weston_minor_version.weston_micro_version])
6
Javier Jardón5b7e43a2010-11-06 01:55:27 +01007AC_PREREQ([2.64])
Kristian Høgsberga7313e72012-02-08 16:35:12 -05008AC_INIT([weston],
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -05009 [weston_version],
10 [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=weston_version],
Kristian Høgsberga7313e72012-02-08 16:35:12 -050011 [weston],
Javier Jardón5b7e43a2010-11-06 01:55:27 +010012 [http://wayland.freedesktop.org/])
13
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -050014AC_SUBST([WESTON_VERSION_MAJOR], [weston_major_version])
15AC_SUBST([WESTON_VERSION_MINOR], [weston_minor_version])
16AC_SUBST([WESTON_VERSION_MICRO], [weston_micro_version])
17AC_SUBST([WESTON_VERSION], [weston_version])
18
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -040019AC_CONFIG_HEADERS([config.h])
Javier Jardón5b7e43a2010-11-06 01:55:27 +010020
Daniel Stonec228e232013-05-22 18:03:19 +030021AC_USE_SYSTEM_EXTENSIONS
Kristian Høgsberg7e105f92013-08-21 15:44:57 -070022AC_SYS_LARGEFILE
Daniel Stonec228e232013-05-22 18:03:19 +030023
Kristian Høgsberg383b60f2013-02-28 11:19:10 -050024AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests])
Javier Jardón5b7e43a2010-11-06 01:55:27 +010025
Kristian Høgsbergf0152da2010-10-12 17:24:20 -040026AM_SILENT_RULES([yes])
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -050027
Javier Jardón5b7e43a2010-11-06 01:55:27 +010028# Check for programs
29AC_PROG_CC
Pekka Paalanena91291c2012-08-29 15:49:48 +030030AC_PROG_SED
Javier Jardón5b7e43a2010-11-06 01:55:27 +010031
Kristian Høgsberg02ec0a52011-04-23 13:04:11 -040032# Initialize libtool
33LT_PREREQ([2.2])
Kristian Høgsberg1c562182011-05-02 22:09:20 -040034LT_INIT([disable-static])
Kristian Høgsberg02ec0a52011-04-23 13:04:11 -040035
Pekka Paalanena51e6fa2012-11-07 12:25:12 +020036AC_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@:>@])
Emilio Pozuelo Monfort8a81b832013-12-02 12:53:32 +010038AC_ARG_VAR([WESTON_SHELL_CLIENT],
39 [Set the default desktop shell client to load if none is specified in weston.ini. @<:@default=weston-desktop-shell@:>@])
Pekka Paalanena51e6fa2012-11-07 12:25:12 +020040
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -050041PKG_PROG_PKG_CONFIG()
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -050042
Kristian Høgsberg02ec0a52011-04-23 13:04:11 -040043AC_CHECK_FUNC([dlopen], [],
44 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
45AC_SUBST(DLOPEN_LIBS)
46
Rob Bradford5a4cea92013-06-04 13:23:01 +010047AC_CHECK_DECL(SFD_CLOEXEC,[],
48 [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
49 [[#include <sys/signalfd.h>]])
50AC_CHECK_DECL(TFD_CLOEXEC,[],
51 [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")],
52 [[#include <sys/timerfd.h>]])
53AC_CHECK_DECL(CLOCK_MONOTONIC,[],
54 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
55 [[#include <time.h>]])
Pekka Paalanen200019c2012-05-30 15:53:42 +030056AC_CHECK_HEADERS([execinfo.h])
57
Pekka Paalanen5b4ddbc2013-11-29 17:48:51 +020058AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
Pekka Paalanen1da1b8f2012-06-06 16:59:43 +030059
Tomeu Vizoso96dc9e42013-10-28 10:17:45 +010060COMPOSITOR_MODULES="wayland-server >= 1.3.90 pixman-1"
Kristian Høgsberg08c40c32011-01-11 13:48:03 -050061
Kristian Høgsbergf82a8062013-01-09 13:36:39 -050062AC_ARG_ENABLE(egl, [ --disable-egl],,
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +030063 enable_egl=yes)
64AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
65if test x$enable_egl = xyes; then
66 AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
Ander Conselvan de Oliveira97f29522013-10-14 15:57:11 +030067 PKG_CHECK_MODULES(EGL, [egl >= 7.10 glesv2])
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +030068fi
69
Rob Bradford382ff462013-06-24 16:52:45 +010070AC_ARG_ENABLE(xkbcommon,
71 AS_HELP_STRING([--disable-xkbcommon], [Disable libxkbcommon
72 support: This is only useful in environments
73 where you do not have a hardware keyboard. If
74 libxkbcommon support is disabled clients will not
75 be sent a keymap and and must know how to
76 interpret the keycode sent for any key event.]),,
77 enable_xkbcommon=yes)
78if test x$enable_xkbcommon = xyes; then
79 AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon support])
Kristian Høgsberg37424342013-10-25 12:49:00 -070080 COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
Rob Bradford382ff462013-06-24 16:52:45 +010081fi
82
Kristian Høgsberg44d4de62012-01-19 13:32:17 -050083AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
84 enable_setuid_install=yes)
Eric Anholt6f82cf52012-02-09 08:36:03 -080085AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
Kristian Høgsberg44d4de62012-01-19 13:32:17 -050086
87
Tiago Vignatti629ce232012-05-23 23:04:14 +030088AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
89 enable_xwayland=yes)
Quentin Glidicbb410052013-02-18 20:38:22 +010090AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],,
91 enable_xwayland_test=yes)
Tiago Vignatti629ce232012-05-23 23:04:14 +030092AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
Quentin Glidicbb410052013-02-18 20:38:22 +010093AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes)
Tiago Vignatti629ce232012-05-23 23:04:14 +030094if test x$enable_xwayland = xyes; then
Kristian Høgsbergbcfd07b2013-10-11 16:48:19 -070095 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcb-composite xcursor cairo-xcb)
Tiago Vignatti629ce232012-05-23 23:04:14 +030096 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
Tiago Vignatti5884bcd2011-08-03 12:12:31 +030097
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])
Quentin Glidicbb410052013-02-18 20:38:22 +0100102 if test x$enable_xwayland_test = xyes; then
103 PKG_CHECK_MODULES([XWAYLAND_TEST], xcb xcb-dri2 libdrm)
104 fi
Kristian Høgsberg5ec0a932011-07-01 10:46:40 -0400105fi
106
Kristian Høgsbergd2c9d8a2013-11-24 14:37:07 -0800107PKG_CHECK_MODULES(LIBDRM, [libdrm],
108 [AC_DEFINE(HAVE_LIBDRM, 1, [Define if libdrm is available]) have_libdrm=yes], have_libdrm=no)
Kristian Høgsberg5ec0a932011-07-01 10:46:40 -0400109
Kristian Høgsberga9410222011-01-14 17:22:35 -0500110AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
111 enable_x11_compositor=yes)
Eric Anholt6f82cf52012-02-09 08:36:03 -0800112AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
113if test x$enable_x11_compositor = xyes; then
Kristian Høgsberga010abf2011-05-11 13:46:29 -0400114 PKG_CHECK_MODULES([XCB], xcb)
115 xcb_save_LIBS=$LIBS
116 xcb_save_CFLAGS=$CFLAGS
117 CFLAGS=$XCB_CFLAGS
118 LIBS=$XCB_LIBS
119 AC_CHECK_FUNCS([xcb_poll_for_queued_event])
120 LIBS=$xcb_save_LIBS
121 CFLAGS=$xcb_save_CFLAGS
122
Damien Lespiaub5bae342013-03-28 15:20:54 +0000123 X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
Daniel Stone62b33b62012-06-22 13:21:35 +0100124
125 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
126 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
127 if test "x$have_xcb_xkb" = xyes; then
128 # Most versions of XCB have totally broken XKB bindings, where the
129 # events don't work. Make sure we can actually use them.
130 xcb_xkb_save_CFLAGS=$CFLAGS
131 CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
132 AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
133 [], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
134 CFLAGS=$xcb_xkb_save_CFLAGS
135 fi
136 if test "x$have_xcb_xkb" = xyes; then
137 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
138 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
139 fi
140
141 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
Kristian Høgsberga9410222011-01-14 17:22:35 -0500142 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
143fi
144
145
Kristian Høgsberg7d498b42011-01-23 13:50:42 -0500146AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
147 enable_drm_compositor=yes)
Kristian Høgsberg02b36f32013-11-24 14:45:23 -0800148AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes)
149if test x$enable_drm_compositor = xyes; then
Kristian Høgsberga9410222011-01-14 17:22:35 -0500150 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
Rob Bradfordeb95d0d2012-05-08 14:49:15 +0100151 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
Kristian Høgsberga9410222011-01-14 17:22:35 -0500152fi
153
Ander Conselvan de Oliveira70e2e682013-10-14 15:57:10 +0300154PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
Kristian Høgsberga9410222011-01-14 17:22:35 -0500155
Kristian Høgsberg7d498b42011-01-23 13:50:42 -0500156AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
157 enable_wayland_compositor=yes)
Kristian Høgsberga9410222011-01-14 17:22:35 -0500158AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +0300159 test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
160if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
Kristian Høgsberga9410222011-01-14 17:22:35 -0500161 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
162 [Build the Wayland (nested) compositor])
Jason Ekstrand7744f712013-10-27 22:24:55 -0500163 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl wayland-cursor])
Kristian Høgsberga9410222011-01-14 17:22:35 -0500164fi
165
Pekka Paalanen3ae50bb2012-05-30 15:53:45 +0300166
Ander Conselvan de Oliveira11f8d402012-10-29 18:19:24 +0200167AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
168 enable_headless_compositor=yes)
169AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
170 test x$enable_headless_compositor = xyes)
171
172
Pekka Paalanene8de35c2012-11-07 12:25:14 +0200173AC_ARG_ENABLE(rpi-compositor,
174 AS_HELP_STRING([--disable-rpi-compositor],
175 [do not build the Raspberry Pi backend]),,
176 enable_rpi_compositor=yes)
Pekka Paalanene31e0532013-05-22 18:03:07 +0300177AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes")
Pekka Paalanene8de35c2012-11-07 12:25:14 +0200178have_bcm_host="no"
Pekka Paalanene31e0532013-05-22 18:03:07 +0300179if test "x$enable_rpi_compositor" = "xyes"; then
Pekka Paalanene8de35c2012-11-07 12:25:14 +0200180 AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
181 PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
182 PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
183 [have_bcm_host="yes"
184 AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])],
185 [AC_MSG_WARN([Raspberry Pi BCM host libraries not found, will use stubs instead.])])
186fi
187AM_CONDITIONAL(INSTALL_RPI_COMPOSITOR, test "x$have_bcm_host" = "xyes")
188
189
Philip Withnall4f499172013-02-02 12:02:32 +0000190AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],,
191 enable_fbdev_compositor=yes)
192AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
193 [test x$enable_fbdev_compositor = xyes])
194AS_IF([test x$enable_fbdev_compositor = xyes], [
195 AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
Adrian Negreanu7b8e9702013-09-26 19:31:32 +0300196 PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0])
Philip Withnall4f499172013-02-02 12:02:32 +0000197])
198
Hardeninga83409c2013-04-01 23:43:58 +0200199AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],,
200 enable_rdp_compositor=no)
201AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
202 [test x$enable_rdp_compositor = xyes])
203if test x$enable_rdp_compositor = xyes; then
Hardeningc077a842013-07-08 00:51:35 +0200204 AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor])
Hardeninga83409c2013-04-01 23:43:58 +0200205 PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
206fi
Philip Withnall4f499172013-02-02 12:02:32 +0000207
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100208AC_ARG_WITH(cairo,
209 AS_HELP_STRING([--with-cairo=@<:@image|gl|glesv2@:>@]
210 [Which Cairo renderer to use for the clients]),
211 [],[with_cairo="image"])
212
213if test "x$with_cairo" = "ximage"; then
214 cairo_modules="cairo"
215else
216if test "x$with_cairo" = "xgl"; then
217 cairo_modules="cairo-gl"
218else
219if test "x$with_cairo" = "xglesv2"; then
220 cairo_modules="cairo-glesv2"
221else
222 AC_ERROR([Unknown cairo renderer requested])
223fi
224fi
225fi
226
227# Included for legacy compat
Pekka Paalanende7fe622012-10-16 17:27:18 +0300228AC_ARG_WITH(cairo-glesv2,
229 AS_HELP_STRING([--with-cairo-glesv2],
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100230 [Use GLESv2 cairo]))
Pekka Paalanende7fe622012-10-16 17:27:18 +0300231if test "x$with_cairo_glesv2" = "xyes"; then
232 cairo_modules="cairo-glesv2"
Armin K0a8461b2013-08-14 03:13:53 +0200233 with_cairo="glesv2"
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100234fi
235
236if test "x$cairo_modules" = "xcairo-glesv2"; then
237AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
Kristian Høgsberg2d574392012-01-18 14:50:58 -0500238fi
239
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400240PKG_CHECK_MODULES(PIXMAN, [pixman-1])
241PKG_CHECK_MODULES(PNG, [libpng])
242PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
243AS_IF([test "x$have_webp" = "xyes"],
244 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
Kristian Høgsberg5a315bc2012-05-15 22:33:43 -0400245
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700246AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],,
247 enable_vaapi_recorder=auto)
248if test x$enable_vaapi_recorder != xno; then
249 PKG_CHECK_MODULES(LIBVA, [libva >= 0.34.0 libva-drm >= 0.34.0],
250 [have_libva=yes], [have_libva=no])
251 if test "x$have_libva" = "xno" -a "x$enable_vaapi_recorder" = "xyes"; then
252 AC_MSG_ERROR([vaapi-recorder explicitly enabled, but libva couldn't be found])
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700253 fi
Kristian Høgsberg1f7ce6e2013-09-03 22:46:02 -0700254 AS_IF([test "x$have_libva" = "xyes"],
255 [AC_DEFINE([BUILD_VAAPI_RECORDER], [1], [Build the vaapi recorder])])
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700256fi
Kristian Høgsberg1f7ce6e2013-09-03 22:46:02 -0700257AM_CONDITIONAL(ENABLE_VAAPI_RECORDER, test "x$have_libva" = xyes)
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700258
Ander Conselvan de Oliveira6aae4d32013-08-23 17:15:48 +0300259
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400260AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
261if test x$have_jpeglib = xyes; then
Kristian Høgsberg6006ecb2012-11-29 12:23:36 -0500262 JPEG_LIBS="-ljpeg"
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400263else
264 AC_ERROR([libjpeg not found])
265fi
Kristian Høgsberg6006ecb2012-11-29 12:23:36 -0500266AC_SUBST(JPEG_LIBS)
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400267
Tiago Vignatti4f238a52012-07-31 15:47:48 +0300268PKG_CHECK_MODULES(CAIRO, [cairo])
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400269
Kristian Høgsberg8e293a52013-11-23 12:40:34 -0800270PKG_CHECK_MODULES(TEST_CLIENT, [wayland-client])
271
Pekka Paalanen5f8a67c2012-10-16 17:27:20 +0300272AC_ARG_ENABLE(simple-clients,
273 AS_HELP_STRING([--disable-simple-clients],
274 [do not build the simple wl_shm clients]),,
275 enable_simple_clients=yes)
276AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
Eric Anholt6f82cf52012-02-09 08:36:03 -0800277if test x$enable_simple_clients = xyes; then
Pekka Paalanen5f8a67c2012-10-16 17:27:20 +0300278 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
279fi
280
281AC_ARG_ENABLE(simple-egl-clients,
282 AS_HELP_STRING([--disable-simple-egl-clients],
283 [do not build the simple EGL clients]),,
Kristian Høgsbergedb6a3b2013-09-03 22:59:17 -0700284 enable_simple_egl_clients="$enable_egl")
285AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes")
286if test x$enable_simple_egl_clients = xyes; then
Pekka Paalanen5f8a67c2012-10-16 17:27:20 +0300287 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
Kristian Høgsberg191e0ee2012-10-29 17:41:46 -0400288 [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
Tiago Vignatti93165e32011-07-21 16:35:40 +0300289fi
Kristian Høgsberga9410222011-01-14 17:22:35 -0500290
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400291AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
Eric Anholt6f82cf52012-02-09 08:36:03 -0800292AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
293if test x$enable_clients = xyes; then
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400294 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
295
Pekka Paalanenfb39d8d2012-10-16 17:27:19 +0300296 PKG_CHECK_MODULES(CLIENT, [wayland-client cairo >= 1.10.0 xkbcommon wayland-cursor])
Armin Ka94e2852013-06-04 13:05:22 +0200297 PKG_CHECK_MODULES(SERVER, [wayland-server])
Philipp Brüschweiler585acb02012-08-15 17:12:00 +0200298 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client])
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400299
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400300 PKG_CHECK_MODULES(POPPLER, [poppler-glib glib-2.0 gobject-2.0 gio-2.0 ],
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400301 [have_poppler=yes], [have_poppler=no])
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100302
303 # Only check for cairo-egl if a GL or GLES renderer requested
304 AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
305 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules],
306 [have_cairo_egl=yes], [have_cairo_egl=no])
307 AS_IF([test "x$have_cairo_egl" = "xyes"],
308 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
Armin K0a8461b2013-08-14 03:13:53 +0200309 [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
310 [have_cairo_egl=no])
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100311
Jan Arne Petersen0a1cf392013-01-16 21:26:42 +0100312 PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400313fi
314
Louis-Francis Ratté-Boulianne6cd1de32013-05-22 18:03:11 +0300315AC_ARG_ENABLE(resize-optimization,
316 AS_HELP_STRING([--disable-resize-optimization],
317 [disable resize optimization allocating a big buffer in toytoolkit]),,
318 enable_resize_optimization=yes)
319AS_IF([test "x$enable_resize_optimization" = "xyes"],
320 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
321
David Herrmanncc5b2ed2013-10-22 00:28:09 +0200322PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login],
323 [have_systemd_login=yes], [have_systemd_login=no])
324AS_IF([test "x$have_systemd_login" = "xyes"],
325 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
326AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
327
328PKG_CHECK_MODULES(SYSTEMD_LOGIN_209, [libsystemd-login >= 209],
329 [have_systemd_login_209=yes], [have_systemd_login_209=no])
330AS_IF([test "x$have_systemd_login_209" = "xyes"],
331 [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
332
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100333AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
334AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
335if test x$enable_weston_launch == xyes; then
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100336 AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
337 if test x$have_pam == xno; then
338 AC_ERROR([weston-launch requires pam])
339 fi
Kristian Høgsbergd2c9d8a2013-11-24 14:37:07 -0800340 PAM_LIBS=-lpam
341 AC_SUBST(PAM_LIBS)
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100342fi
343
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +0300344if test x$enable_egl = xyes; then
345 PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
346fi
Konno, Joe314d9882013-01-30 07:38:57 -0800347AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
Kristian Høgsbergb98905e2012-10-29 13:06:02 -0400348
349
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400350AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -0500351
Jan Arne Petersen0a1cf392013-01-16 21:26:42 +0100352AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
353
Armin Ka94e2852013-06-04 13:05:22 +0200354AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
355 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
356
Pekka Paalanen51d21952012-01-31 16:35:18 +0200357AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +0300358 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
Pekka Paalanen51d21952012-01-31 16:35:18 +0200359
Pekka Paalanen7ff7a802013-04-25 13:57:50 +0300360AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
361 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
362
Kristian Høgsberg1c562182011-05-02 22:09:20 -0400363AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
364
Pekka Paalanen379d3d12012-10-16 17:27:22 +0300365AC_ARG_ENABLE(tablet-shell,
366 AS_HELP_STRING([--disable-tablet-shell],
367 [do not build tablet-shell server plugin and client]),,
Kristian Høgsberg64f1c3f2011-11-14 15:50:03 -0500368 enable_tablet_shell=yes)
369AM_CONDITIONAL(ENABLE_TABLET_SHELL,
Pekka Paalanen379d3d12012-10-16 17:27:22 +0300370 test "x$enable_tablet_shell" = "xyes")
Kristian Høgsberg1c562182011-05-02 22:09:20 -0400371
Richard Hughesbe7c4dd2013-05-11 09:48:22 +0100372# CMS modules
373AC_ARG_ENABLE(colord,
374 AS_HELP_STRING([--disable-colord],
375 [do not build colord CMS support]),,
Armin K49c36c62013-05-30 15:16:40 +0200376 enable_colord=auto)
Armin K49c36c62013-05-30 15:16:40 +0200377if test "x$enable_colord" != "xno"; then
378 PKG_CHECK_MODULES(COLORD,
379 colord >= 0.1.27,
380 have_colord=yes,
381 have_colord=no)
382 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
383 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
384 fi
385 if test "x$have_colord" = "xyes"; then
386 enable_colord=yes
387 fi
Richard Hughesbe7c4dd2013-05-11 09:48:22 +0100388fi
Yanko Kaneti9b78adf2013-07-10 12:01:36 -0400389AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400390
David Herrmann59ab9002013-10-22 00:28:06 +0200391# dbus support
392AC_ARG_ENABLE(dbus,
393 AS_HELP_STRING([--disable-dbus],
394 [do not build with dbus support]),,
395 enable_dbus=auto)
396if test "x$enable_dbus" != "xno"; then
397 PKG_CHECK_MODULES(DBUS,
398 dbus-1 >= 1.6,
399 have_dbus=yes,
400 have_dbus=no)
401 if test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"; then
402 AC_MSG_ERROR([dbus support explicitly requested, but libdbus couldn't be found])
403 fi
404 if test "x$have_dbus" = "xyes"; then
405 enable_dbus=yes
406 AC_DEFINE([HAVE_DBUS], [1], [Build with dbus support])
407 else
408 enable_dbus=no
409 fi
410fi
411AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
412
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400413AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
414AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
415if test x$enable_wcap_tools = xyes; then
416 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
Kristian Høgsberg8d25a5a2012-07-20 18:05:10 -0400417 PKG_CHECK_MODULES(WCAP, [cairo])
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400418 WCAP_LIBS="$WCAP_LIBS -lm"
419fi
420
421AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
422AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
423
Pekka Paalanen4b141592012-08-03 14:39:16 +0300424PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
425AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400426
nobled48f975d2011-01-28 13:47:21 +0000427if test "x$GCC" = "xyes"; then
Pekka Paalanena95efd32013-01-18 12:11:10 +0200428 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
429 -Wno-missing-field-initializers -g -fvisibility=hidden \
Pekka Paalanen15643f62012-06-01 12:20:25 +0300430 -Wstrict-prototypes -Wmissing-prototypes"
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -0500431fi
432AC_SUBST(GCC_CFLAGS)
433
Armin K49c36c62013-05-30 15:16:40 +0200434AC_ARG_ENABLE(libunwind,
435 AS_HELP_STRING([--disable-libunwind],
436 [Disable libunwind usage for backtraces]),,
437 enable_libunwind=auto)
Quentin Glidic5daccc32013-04-03 20:19:45 +0200438AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
Armin K49c36c62013-05-30 15:16:40 +0200439if test "x$enable_libunwind" != "xno"; then
440 PKG_CHECK_MODULES(LIBUNWIND,
441 libunwind,
442 have_libunwind=yes,
443 have_libunwind=no)
444 if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
445 AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
446 fi
447 if test "x$have_libunwind" = "xyes"; then
448 enable_libunwind=yes
449 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
450 fi
451fi
452
Marcin Slusarz554a0da2013-02-18 13:27:22 -0500453
Pekka Paalanena51e6fa2012-11-07 12:25:12 +0200454if test "x$WESTON_NATIVE_BACKEND" = "x"; then
455 WESTON_NATIVE_BACKEND="drm-backend.so"
456fi
457AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
458AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
459 [The default backend to load, if not wayland nor x11.])
460
Emilio Pozuelo Monfort8a81b832013-12-02 12:53:32 +0100461if test "x$WESTON_SHELL_CLIENT" = "x"; then
462 WESTON_SHELL_CLIENT="weston-desktop-shell"
463fi
464AC_MSG_NOTICE([Weston's default desktop shell client: $WESTON_SHELL_CLIENT])
465AC_DEFINE_UNQUOTED([WESTON_SHELL_CLIENT], ["$WESTON_SHELL_CLIENT"],
466 [The default desktop shell client to load.])
467
Armin Kaac60212013-07-14 17:26:23 +0200468AC_ARG_ENABLE(demo-clients,
469 AS_HELP_STRING([--enable-demo-clients],
470 [install demo clients built with weston]),,
471 enable_demo_clients=no)
472AM_CONDITIONAL(ENABLE_DEMO_CLIENTS, [test "x$enable_demo_clients" = "xyes"])
473
Richard Hughesb24e48e2013-05-09 20:31:09 +0100474PKG_CHECK_MODULES(LCMS, lcms2,
475 [have_lcms=yes], [have_lcms=no])
476if test "x$have_lcms" = xyes; then
477 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
478fi
479AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
480
Quentin Glidic9f43cb42013-08-24 20:36:10 +0200481AC_PATH_PROG([wayland_scanner], [wayland-scanner])
482if test x$wayland_scanner = x; then
483 AC_MSG_ERROR([wayland-scanner is needed to compile weston])
484fi
Kristian Høgsbergb2d71852011-02-14 22:13:33 -0500485
Peter Hutterer64db37e2013-10-23 14:57:02 +1000486PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner)
487AC_PATH_PROG(XMLLINT, xmllint)
488AC_ARG_WITH([dtddir],
489 AS_HELP_STRING([--with-dtddir],
490 [Directory containing the Wayland
491 protocol DTD @<:@default=from pkgconfig@:>@]),
492 [dtddir="$withval"],
493 [dtddir=$($PKG_CONFIG --variable=pkgdatadir wayland-scanner)])
494AC_SUBST([dtddir])
495AM_CONDITIONAL([HAVE_XMLLINT], [test "x$XMLLINT" != "x" -a "x$dtddir" != "x"])
496
Kristian Høgsbergb2d71852011-02-14 22:13:33 -0500497AC_CONFIG_FILES([Makefile
Pekka Paalanenc1765c62011-12-05 15:58:11 +0200498 shared/Makefile
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500499 src/Makefile
Kristian Høgsberga9219012012-05-21 15:03:32 -0400500 src/xwayland/Makefile
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -0500501 src/version.h
502 src/weston.pc
Kristian Høgsbergf0152da2010-10-12 17:24:20 -0400503 clients/Makefile
Kristian Høgsberg2bcb2fc2012-05-25 18:03:52 -0400504 wcap/Makefile
Kristian Høgsbergf6a5f7d2012-01-03 11:02:46 -0500505 data/Makefile
Pekka Paalanen4520d5c2012-01-16 15:04:28 +0200506 protocol/Makefile
Pekka Paalanena91291c2012-08-29 15:49:48 +0300507 man/Makefile
Pekka Paalanen4520d5c2012-01-16 15:04:28 +0200508 tests/Makefile])
Kristian Høgsberg4a8767b2008-12-10 13:44:23 -0500509AC_OUTPUT
Armin K0a8461b2013-08-14 03:13:53 +0200510
511AC_MSG_RESULT([
512 Native Backend ${WESTON_NATIVE_BACKEND}
513 setuid Install ${enable_setuid_install}
514
515 Cairo Renderer ${with_cairo}
516 EGL ${enable_egl}
517 libxkbcommon ${enable_xkbcommon}
Jonas Ådahlb8e62d92013-10-25 23:18:02 +0200518 xcb_xkb ${have_xcb_xkb}
Armin K0a8461b2013-08-14 03:13:53 +0200519 XWayland ${enable_xwayland}
David Herrmann59ab9002013-10-22 00:28:06 +0200520 dbus ${enable_dbus}
Armin K0a8461b2013-08-14 03:13:53 +0200521
522 Build wcap utility ${enable_wcap_tools}
523 Build Tablet Shell ${enable_tablet_shell}
524
525 weston-launch utility ${enable_weston_launch}
David Herrmanncc5b2ed2013-10-22 00:28:09 +0200526 systemd-login support ${have_systemd_login}
Armin K0a8461b2013-08-14 03:13:53 +0200527
528 DRM Compositor ${enable_drm_compositor}
529 X11 Compositor ${enable_x11_compositor}
530 Wayland Compositor ${enable_wayland_compositor}
531 Headless Compositor ${enable_headless_compositor}
532 RPI Compositor ${enable_rpi_compositor}
533 FBDEV Compositor ${enable_fbdev_compositor}
534 RDP Compositor ${enable_rdp_compositor}
535
536 Raspberry Pi BCM headers ${have_bcm_host}
537
538 Build Clients ${enable_clients}
539 Build EGL Clients ${have_cairo_egl}
540 Build Simple Clients ${enable_simple_clients}
541 Build Simple EGL Clients ${enable_simple_egl_clients}
542
543 Install Demo Clients ${enable_demo_clients}
544
545 Colord Support ${have_colord}
546 GLU Support ${have_glu}
547 LCMS2 Support ${have_lcms}
548 libwebp Support ${have_webp}
549 libunwind Support ${have_libunwind}
Ander Conselvan de Oliveira6aae4d32013-08-23 17:15:48 +0300550 VA H.264 encoding Support ${have_libva}
Armin K0a8461b2013-08-14 03:13:53 +0200551])