blob: 0ea7b703bf20a347a2e043af9fd06c31097e30f3 [file] [log] [blame]
Bryce Harrington2a528182017-08-08 11:46:14 -07001m4_define([weston_major_version], [3])
2m4_define([weston_minor_version], [0])
Bryce Harrington1b3c05f2017-08-08 12:01:55 -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])
Pekka Paalanen080f1302017-03-14 12:14:51 +02006m4_define([libweston_major_version], [3])
Armin Krezovića01ab6d2016-09-30 14:11:02 +02007m4_define([libweston_minor_version], [0])
Pekka Paalanen94e664d2017-08-11 10:44:57 +03008m4_define([libweston_patch_version], [90])
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -05009
Javier Jardón5b7e43a2010-11-06 01:55:27 +010010AC_PREREQ([2.64])
Kristian Høgsberga7313e72012-02-08 16:35:12 -050011AC_INIT([weston],
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -050012 [weston_version],
13 [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=weston_version],
Kristian Høgsberga7313e72012-02-08 16:35:12 -050014 [weston],
Daniel Stone32d9ea12014-10-08 12:15:48 +010015 [http://wayland.freedesktop.org])
Javier Jardón5b7e43a2010-11-06 01:55:27 +010016
Bryce Harringtona08dff52016-09-20 12:22:46 -070017WAYLAND_PREREQ_VERSION="1.12.0"
Bryce Harrington46f1f052016-05-11 13:18:59 -070018
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -050019AC_SUBST([WESTON_VERSION_MAJOR], [weston_major_version])
20AC_SUBST([WESTON_VERSION_MINOR], [weston_minor_version])
21AC_SUBST([WESTON_VERSION_MICRO], [weston_micro_version])
22AC_SUBST([WESTON_VERSION], [weston_version])
Emil Velikov7fe47f32016-07-22 14:51:51 +010023AC_SUBST([LIBWESTON_MAJOR], [libweston_major_version])
24# We use minor as current and age since on ABI/API break/removal we bump major
25# so minor will be reset to 0.
26m4_define([lt_current], [libweston_minor_version])
27m4_define([lt_revision], [libweston_patch_version])
28m4_define([lt_age], [libweston_minor_version])
29AC_SUBST([LT_VERSION_INFO], [lt_current:lt_revision:lt_age])
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -050030
Guillem Joverdff63a22014-02-01 18:48:43 +010031AC_CONFIG_AUX_DIR([build-aux])
Kristian Høgsbergd0c3b9d2010-10-25 11:40:03 -040032AC_CONFIG_HEADERS([config.h])
Thierry Reding0e6d9a72014-05-27 09:07:54 +020033AC_CONFIG_MACRO_DIR([m4])
Javier Jardón5b7e43a2010-11-06 01:55:27 +010034
Daniel Stonec228e232013-05-22 18:03:19 +030035AC_USE_SYSTEM_EXTENSIONS
Kristian Høgsberg7e105f92013-08-21 15:44:57 -070036AC_SYS_LARGEFILE
Daniel Stonec228e232013-05-22 18:03:19 +030037
Kristian Høgsberg396a9bb2014-01-31 23:49:33 -080038AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects])
Javier Jardón5b7e43a2010-11-06 01:55:27 +010039
Kristian Høgsbergf0152da2010-10-12 17:24:20 -040040AM_SILENT_RULES([yes])
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -050041
Pekka Paalanenb40b8272016-08-15 14:06:15 +030042# Check Weston and libweston version consistency
43m4_if(m4_cmp(weston_micro_version, [90]), [-1],
44 [
45 dnl micro < 90
46 dnl A final or stable release, not a pre-release:
47 dnl Weston and libweston versions must match.
48 m4_if(weston_version, libweston_major_version[.]libweston_minor_version[.]libweston_patch_version,
49 [],
50 [AC_MSG_ERROR([Weston and libweston version mismatch for a final release])])
51 ],
52 [
53 dnl A pre-release:
54 dnl libweston must be equal or greater than weston.
55 m4_case(m4_list_cmp([weston_major_version, weston_minor_version, weston_micro_version],
56 [libweston_major_version, libweston_minor_version, libweston_patch_version]),
57 [-1], [
58 dnl weston < libweston
59 dnl libweston must be weston_major+1.0.0
60 m4_if(m4_eval(weston_major_version+1)[.0.0],
61 libweston_major_version[.]libweston_minor_version[.]libweston_patch_version,
62 [],
63 [AC_MSG_ERROR([libweston version is greater but not (weston_major+1).0.0])])
64 ],
65 [0], [
66 dnl weston == libweston, all ok
67 ],
68 [1], [
69 dnl weston > libweston, wrong
70 AC_MSG_ERROR([Weston version is greater than libweston.])
71 ])
72 ])
73
Javier Jardón5b7e43a2010-11-06 01:55:27 +010074# Check for programs
75AC_PROG_CC
Pekka Paalanena91291c2012-08-29 15:49:48 +030076AC_PROG_SED
Javier Jardón5b7e43a2010-11-06 01:55:27 +010077
Kristian Høgsberg02ec0a52011-04-23 13:04:11 -040078# Initialize libtool
79LT_PREREQ([2.2])
Kristian Høgsberg1c562182011-05-02 22:09:20 -040080LT_INIT([disable-static])
Kristian Høgsberg02ec0a52011-04-23 13:04:11 -040081
Pekka Paalanena51e6fa2012-11-07 12:25:12 +020082AC_ARG_VAR([WESTON_NATIVE_BACKEND],
83 [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 +010084AC_ARG_VAR([WESTON_SHELL_CLIENT],
85 [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 +020086
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -050087PKG_PROG_PKG_CONFIG()
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -050088
Arnaud Vracd6d97da2017-08-05 13:58:59 +020089# Check for dlsym instead of dlopen because ASAN hijacks the latter
90WESTON_SEARCH_LIBS([DL], [dl], [dlsym])
Kristian Høgsberg02ec0a52011-04-23 13:04:11 -040091
Yann E. MORINb51e6ed2016-12-19 18:20:09 +010092# In old glibc versions (< 2.17) clock_gettime() and clock_getres() are in librt
Quentin Glidic9992bdc2016-04-23 12:02:58 +020093WESTON_SEARCH_LIBS([CLOCK_GETTIME], [rt], [clock_gettime])
Yann E. MORINb51e6ed2016-12-19 18:20:09 +010094WESTON_SEARCH_LIBS([CLOCK_GETRES], [rt], [clock_getres])
Gustavo Zacarias34d59852016-04-21 11:18:48 -030095
Rob Bradford5a4cea92013-06-04 13:23:01 +010096AC_CHECK_DECL(SFD_CLOEXEC,[],
97 [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
98 [[#include <sys/signalfd.h>]])
99AC_CHECK_DECL(TFD_CLOEXEC,[],
100 [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")],
101 [[#include <sys/timerfd.h>]])
102AC_CHECK_DECL(CLOCK_MONOTONIC,[],
103 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
104 [[#include <time.h>]])
Pekka Paalanen200019c2012-05-30 15:53:42 +0300105AC_CHECK_HEADERS([execinfo.h])
106
Pekka Paalanen5b4ddbc2013-11-29 17:48:51 +0200107AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
Pekka Paalanen1da1b8f2012-06-06 16:59:43 +0300108
Pekka Paalanenb0308972017-04-06 14:06:20 +0300109# check for libdrm as a build-time dependency only
110# libdrm 2.4.30 introduced drm_fourcc.h.
111PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.30], [], [AC_MSG_ERROR([
112 libdrm is a hard build-time dependency for libweston core,
113 but a sufficient version was not found. However, libdrm
114 is not a runtime dependency unless you have features
115 enabled that require it.])])
116
Bryce Harrington46f1f052016-05-11 13:18:59 -0700117COMPOSITOR_MODULES="wayland-server >= $WAYLAND_PREREQ_VERSION pixman-1 >= 0.25.2"
Kristian Høgsberg08c40c32011-01-11 13:48:03 -0500118
Jon A. Cruz179c1862015-07-15 19:22:43 -0700119AC_CONFIG_FILES([doc/doxygen/tools.doxygen doc/doxygen/tooldev.doxygen])
120
121AC_ARG_ENABLE(devdocs,
122 AS_HELP_STRING([--disable-devdocs],
123 [do not enable building of developer documentation]),,
124 enable_devdocs=auto)
125if test "x$enable_devdocs" != "xno"; then
126 AC_CHECK_PROGS([DOXYGEN], [doxygen])
127 if test "x$DOXYGEN" = "x" -a "x$enable_devdocs" = "xyes"; then
128 AC_MSG_ERROR([Developer documentation explicitly requested, but Doxygen couldn't be found])
129 fi
130 if test "x$DOXYGEN" != "x"; then
131 enable_devdocs=yes
132 else
133 enable_devdocs=no
134 fi
135fi
136AM_CONDITIONAL(ENABLE_DEVDOCS, test "x$enable_devdocs" = "xyes")
137
Kristian Høgsbergf82a8062013-01-09 13:36:39 -0500138AC_ARG_ENABLE(egl, [ --disable-egl],,
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +0300139 enable_egl=yes)
140AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
141if test x$enable_egl = xyes; then
142 AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
Ucan, Emre (ADITG/SW1)7d967da2015-11-18 10:23:50 +0000143 PKG_CHECK_MODULES(EGL, [egl glesv2])
144 PKG_CHECK_MODULES([EGL_TESTS], [egl glesv2 wayland-client wayland-egl])
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +0300145fi
146
Derek Foreman185d1582017-06-28 11:17:23 -0500147COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
148
149PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0],
150 [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1,
151 [Define if xkbcommon is 0.5.0 or newer])],true)
Rob Bradford382ff462013-06-24 16:52:45 +0100152
Kristian Høgsberg44d4de62012-01-19 13:32:17 -0500153AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
154 enable_setuid_install=yes)
Eric Anholt6f82cf52012-02-09 08:36:03 -0800155AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
Kristian Høgsberg44d4de62012-01-19 13:32:17 -0500156
157
Tiago Vignatti629ce232012-05-23 23:04:14 +0300158AC_ARG_ENABLE(xwayland, [ --enable-xwayland],,
159 enable_xwayland=yes)
Quentin Glidicbb410052013-02-18 20:38:22 +0100160AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],,
161 enable_xwayland_test=yes)
Tiago Vignatti629ce232012-05-23 23:04:14 +0300162AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes)
Quentin Glidicbb410052013-02-18 20:38:22 +0100163AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes)
Tiago Vignatti629ce232012-05-23 23:04:14 +0300164if test x$enable_xwayland = xyes; then
Kristian Høgsbergbcfd07b2013-10-11 16:48:19 -0700165 PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcb-composite xcursor cairo-xcb)
Tiago Vignatti629ce232012-05-23 23:04:14 +0300166 AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher])
Tiago Vignatti5884bcd2011-08-03 12:12:31 +0300167
168 AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH],
169 [Path to X server]), [XSERVER_PATH="$withval"],
Derek Foreman1f9d4f92015-02-09 09:57:28 -0600170 [XSERVER_PATH="/usr/bin/Xwayland"])
Tiago Vignatti5884bcd2011-08-03 12:12:31 +0300171 AC_SUBST([XSERVER_PATH])
Quentin Glidicbb410052013-02-18 20:38:22 +0100172 if test x$enable_xwayland_test = xyes; then
Derek Foreman8771a142015-01-29 16:44:55 -0600173 PKG_CHECK_MODULES([XWAYLAND_TEST], x11)
Quentin Glidicbb410052013-02-18 20:38:22 +0100174 fi
Kristian Høgsberg5ec0a932011-07-01 10:46:40 -0400175fi
176
Kristian Høgsberga9410222011-01-14 17:22:35 -0500177AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
178 enable_x11_compositor=yes)
Eric Anholt6f82cf52012-02-09 08:36:03 -0800179AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
Emmanuel Gil Peyrot226408d2016-12-04 21:34:56 +0000180have_xcb_xkb=no
Eric Anholt6f82cf52012-02-09 08:36:03 -0800181if test x$enable_x11_compositor = xyes; then
Daniel Stonef86e67d2016-11-29 12:03:35 +0000182 PKG_CHECK_MODULES([XCB], xcb >= 1.8)
Damien Lespiaub5bae342013-03-28 15:20:54 +0000183 X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
Daniel Stone62b33b62012-06-22 13:21:35 +0100184
Daniel Stonef86e67d2016-11-29 12:03:35 +0000185 PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb >= 1.9],
Daniel Stone62b33b62012-06-22 13:21:35 +0100186 [have_xcb_xkb="yes"], [have_xcb_xkb="no"])
187 if test "x$have_xcb_xkb" = xyes; then
Daniel Stone62b33b62012-06-22 13:21:35 +0100188 X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
189 AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
190 fi
191
192 PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES])
Kristian Høgsberga9410222011-01-14 17:22:35 -0500193 AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor])
194fi
195
196
Kristian Høgsberg7d498b42011-01-23 13:50:42 -0500197AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
198 enable_drm_compositor=yes)
Kristian Høgsberg02b36f32013-11-24 14:45:23 -0800199AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes)
200if test x$enable_drm_compositor = xyes; then
Kristian Høgsberga9410222011-01-14 17:22:35 -0500201 AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
Arnaud Vrac167bbb62017-08-05 13:59:00 +0200202 PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm])
Bryce Harringtona3582072015-08-14 12:23:13 -0700203 PKG_CHECK_MODULES(DRM_COMPOSITOR_GBM, [gbm >= 10.2],
204 [AC_DEFINE([HAVE_GBM_FD_IMPORT], 1, [gbm supports dmabuf import])],
205 [AC_MSG_WARN([gbm does not support dmabuf import, will omit that capability])])
Kristian Høgsberga9410222011-01-14 17:22:35 -0500206fi
207
Jonas Ådahle0de3c22014-03-12 22:08:42 +0100208
Jonas Ådahlfaec1eb2015-01-15 14:45:56 +0800209PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
Ander Conselvan de Oliveira70e2e682013-10-14 15:57:10 +0300210PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
Kristian Høgsberga9410222011-01-14 17:22:35 -0500211
Varad Gautam65c94b82017-04-26 19:15:59 +0530212PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.8],
Jonas Ådahl496adb32015-11-17 16:00:27 +0800213 [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
214AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
215
Kristian Høgsberg7d498b42011-01-23 13:50:42 -0500216AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
217 enable_wayland_compositor=yes)
Kristian Høgsberga9410222011-01-14 17:22:35 -0500218AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
Armin Krezovićb08e1a52016-12-09 22:58:27 +0100219 test x$enable_wayland_compositor = xyes)
220if test x$enable_wayland_compositor = xyes; then
Kristian Høgsberga9410222011-01-14 17:22:35 -0500221 AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
222 [Build the Wayland (nested) compositor])
Armin Krezovićb08e1a52016-12-09 22:58:27 +0100223 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client >= $WAYLAND_PREREQ_VERSION wayland-cursor])
224 if test x$enable_egl = xyes; then
225 PKG_CHECK_MODULES(WAYLAND_COMPOSITOR_EGL, [wayland-egl])
226 fi
Kristian Høgsberga9410222011-01-14 17:22:35 -0500227fi
228
Pekka Paalanen3ae50bb2012-05-30 15:53:45 +0300229
Ander Conselvan de Oliveira11f8d402012-10-29 18:19:24 +0200230AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],,
231 enable_headless_compositor=yes)
232AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR,
233 test x$enable_headless_compositor = xyes)
Bryce Harrington19c8db92014-11-19 15:06:16 -0800234if test x$enable_headless_compositor = xyes; then
235 AC_DEFINE([BUILD_HEADLESS_COMPOSITOR], [1], [Build the headless compositor])
236fi
Ander Conselvan de Oliveira11f8d402012-10-29 18:19:24 +0200237
238
Philip Withnall4f499172013-02-02 12:02:32 +0000239AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],,
240 enable_fbdev_compositor=yes)
241AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR],
242 [test x$enable_fbdev_compositor = xyes])
243AS_IF([test x$enable_fbdev_compositor = xyes], [
244 AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor])
Arnaud Vrac167bbb62017-08-05 13:59:00 +0200245 PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136])
Philip Withnall4f499172013-02-02 12:02:32 +0000246])
247
Hardeninga83409c2013-04-01 23:43:58 +0200248AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],,
249 enable_rdp_compositor=no)
250AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
251 [test x$enable_rdp_compositor = xyes])
252if test x$enable_rdp_compositor = xyes; then
Hardeningc077a842013-07-08 00:51:35 +0200253 AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor])
FORT David58b63ab2016-05-01 23:32:07 +0200254 PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp2 >= 2.0.0],
255 [],
256 [PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0],[])]
257 )
Hardening04633b62014-01-10 11:33:06 +0100258
259 SAVED_CPPFLAGS="$CPPFLAGS"
260 CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS"
261 AC_CHECK_HEADERS([freerdp/version.h])
262 CPPFLAGS="$SAVED_CPPFLAGS"
Hardeninga83409c2013-04-01 23:43:58 +0200263fi
Philip Withnall4f499172013-02-02 12:02:32 +0000264
Kristian Høgsbergd33cc732014-05-09 15:32:02 -0700265AC_ARG_ENABLE([screen-sharing], [ --enable-screen-sharing],,
Jason Ekstrand47928d82014-04-02 19:54:01 -0500266 enable_screen_sharing=no)
267AM_CONDITIONAL([ENABLE_SCREEN_SHARING],
268 [test x$enable_screen_sharing = xyes])
269if test x$enable_screen_sharing = xyes; then
270 PKG_CHECK_MODULES(SCREEN_SHARE, [wayland-client])
271
272 if test x$enable_rdp_compositor != xyes; then
273 AC_MSG_WARN([The screen-share.so module requires the RDP backend.])
274 fi
275fi
276
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100277AC_ARG_WITH(cairo,
278 AS_HELP_STRING([--with-cairo=@<:@image|gl|glesv2@:>@]
279 [Which Cairo renderer to use for the clients]),
280 [],[with_cairo="image"])
281
282if test "x$with_cairo" = "ximage"; then
283 cairo_modules="cairo"
284else
285if test "x$with_cairo" = "xgl"; then
286 cairo_modules="cairo-gl"
Bryce Harrington42db3132015-05-19 13:24:37 -0700287 AC_MSG_WARN([The --with-cairo=gl option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs.])
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100288else
289if test "x$with_cairo" = "xglesv2"; then
290 cairo_modules="cairo-glesv2"
Bryce Harrington42db3132015-05-19 13:24:37 -0700291 AC_MSG_WARN([The --with-cairo=gles2 option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs.])
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100292else
293 AC_ERROR([Unknown cairo renderer requested])
294fi
295fi
296fi
297
298# Included for legacy compat
Pekka Paalanende7fe622012-10-16 17:27:18 +0300299AC_ARG_WITH(cairo-glesv2,
300 AS_HELP_STRING([--with-cairo-glesv2],
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100301 [Use GLESv2 cairo]))
Pekka Paalanende7fe622012-10-16 17:27:18 +0300302if test "x$with_cairo_glesv2" = "xyes"; then
303 cairo_modules="cairo-glesv2"
Armin K0a8461b2013-08-14 03:13:53 +0200304 with_cairo="glesv2"
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100305fi
306
307if test "x$cairo_modules" = "xcairo-glesv2"; then
308AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend])
Kristian Høgsberg2d574392012-01-18 14:50:58 -0500309fi
310
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400311PKG_CHECK_MODULES(PIXMAN, [pixman-1])
312PKG_CHECK_MODULES(PNG, [libpng])
Emmanuel Gil Peyrot58b7a152016-02-16 01:57:51 +0000313
Emmanuel Gil Peyrot66e16142016-02-16 01:57:52 +0000314AC_ARG_WITH([jpeg],
315 AS_HELP_STRING([--without-jpeg],
316 [Use jpeglib for JPEG decoding support [default=auto]]))
317AS_IF([test "x$with_jpeg" != "xno"],
Quentin Glidic9992bdc2016-04-23 12:02:58 +0200318 [WESTON_SEARCH_LIBS([JPEG], [jpeg], [jpeg_CreateDecompress], [have_jpeglib=yes], [have_jpeglib=no])],
Emmanuel Gil Peyrot66e16142016-02-16 01:57:52 +0000319 [have_jpeglib=no])
320AS_IF([test "x$have_jpeglib" = "xyes"],
Quentin Glidic9992bdc2016-04-23 12:02:58 +0200321 [AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])],
Emmanuel Gil Peyrot66e16142016-02-16 01:57:52 +0000322 [AS_IF([test "x$with_jpeg" = "xyes"],
323 [AC_MSG_ERROR([JPEG support explicitly requested, but jpeglib couldn't be found])])])
324
Emmanuel Gil Peyrot58b7a152016-02-16 01:57:51 +0000325AC_ARG_WITH([webp],
326 AS_HELP_STRING([--without-webp],
327 [Use libwebp for WebP decoding support [default=auto]]))
328AS_IF([test "x$with_webp" != "xno"],
329 [PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])],
330 [have_webp=no])
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400331AS_IF([test "x$have_webp" = "xyes"],
Emmanuel Gil Peyrot58b7a152016-02-16 01:57:51 +0000332 [AC_DEFINE([HAVE_WEBP], [1], [Have webp])],
333 [AS_IF([test "x$with_webp" = "xyes"],
334 [AC_MSG_ERROR([WebP support explicitly requested, but libwebp couldn't be found])])])
Kristian Høgsberg5a315bc2012-05-15 22:33:43 -0400335
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700336AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],,
337 enable_vaapi_recorder=auto)
Emmanuel Gil Peyrot226408d2016-12-04 21:34:56 +0000338have_libva=no
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700339if test x$enable_vaapi_recorder != xno; then
340 PKG_CHECK_MODULES(LIBVA, [libva >= 0.34.0 libva-drm >= 0.34.0],
341 [have_libva=yes], [have_libva=no])
342 if test "x$have_libva" = "xno" -a "x$enable_vaapi_recorder" = "xyes"; then
343 AC_MSG_ERROR([vaapi-recorder explicitly enabled, but libva couldn't be found])
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700344 fi
Kristian Høgsberg1f7ce6e2013-09-03 22:46:02 -0700345 AS_IF([test "x$have_libva" = "xyes"],
346 [AC_DEFINE([BUILD_VAAPI_RECORDER], [1], [Build the vaapi recorder])])
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700347fi
Kristian Høgsberg1f7ce6e2013-09-03 22:46:02 -0700348AM_CONDITIONAL(ENABLE_VAAPI_RECORDER, test "x$have_libva" = xyes)
Kristian Høgsberg0eac34a2013-08-30 14:28:22 -0700349
Tiago Vignatti4f238a52012-07-31 15:47:48 +0300350PKG_CHECK_MODULES(CAIRO, [cairo])
Kristian Høgsbergf02a6492012-03-12 01:05:25 -0400351
Pekka Paalanen924cd942016-05-20 17:25:38 +0300352PKG_CHECK_MODULES(TEST_CLIENT, [wayland-client >= $WAYLAND_PREREQ_VERSION pixman-1])
Kristian Høgsberg8e293a52013-11-23 12:40:34 -0800353
Pekka Paalanen5f8a67c2012-10-16 17:27:20 +0300354AC_ARG_ENABLE(simple-clients,
355 AS_HELP_STRING([--disable-simple-clients],
356 [do not build the simple wl_shm clients]),,
357 enable_simple_clients=yes)
358AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes")
Eric Anholt6f82cf52012-02-09 08:36:03 -0800359if test x$enable_simple_clients = xyes; then
Pekka Paalanen5f8a67c2012-10-16 17:27:20 +0300360 PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client])
361fi
362
363AC_ARG_ENABLE(simple-egl-clients,
364 AS_HELP_STRING([--disable-simple-egl-clients],
365 [do not build the simple EGL clients]),,
Kristian Høgsbergedb6a3b2013-09-03 22:59:17 -0700366 enable_simple_egl_clients="$enable_egl")
367AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes")
368if test x$enable_simple_egl_clients = xyes; then
Pekka Paalanen5f8a67c2012-10-16 17:27:20 +0300369 PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
Ucan, Emre (ADITG/SW1)7d967da2015-11-18 10:23:50 +0000370 [egl glesv2 wayland-client wayland-egl wayland-cursor])
Tiago Vignatti93165e32011-07-21 16:35:40 +0300371fi
Kristian Høgsberga9410222011-01-14 17:22:35 -0500372
Varad Gautamf9dec672016-11-17 17:25:59 +0530373AC_ARG_ENABLE(simple-dmabuf-drm-client,
374 AS_HELP_STRING([--disable-simple-dmabuf-drm-client],
375 [do not build the simple dmabuf drm client]),,
376 enable_simple_dmabuf_drm_client="auto")
377if ! test "x$enable_simple_dmabuf_drm_client" = "xno"; then
Varad Gautamee589112016-11-23 14:03:21 +0530378 PKG_CHECK_MODULES(SIMPLE_DMABUF_DRM_CLIENT, [wayland-client libdrm egl],
Varad Gautamf7b3a392017-04-26 19:17:18 +0530379 [PKG_CHECK_MODULES(LIBDRM_PLATFORM, [libdrm_freedreno],
380 AC_DEFINE([HAVE_LIBDRM_FREEDRENO], [1], [Build freedreno dmabuf client]) have_simple_dmabuf_drm_client=freedreno,
381 [PKG_CHECK_MODULES(LIBDRM_PLATFORM, [libdrm_intel],
382 AC_DEFINE([HAVE_LIBDRM_INTEL], [1], [Build intel dmabuf client]) have_simple_dmabuf_drm_client=intel,
383 have_simple_dmabuf_drm_client=unsupported)])],
384 have_simple_dmabuf_drm_client=unsupported)
385
386 if test "x$have_simple_dmabuf_drm_client" = "xunsupported" -a "x$enable_simple_dmabuf_drm_client" = "xyes"; then
387 AC_MSG_ERROR([DRM dmabuf client explicitly enabled, but libdrm_intel or libdrm_freedreno not found])
Bryce Harringtoncb512c02015-08-14 12:44:50 -0700388 fi
Varad Gautamf7b3a392017-04-26 19:17:18 +0530389
390 if test "x$have_simple_dmabuf_drm_client" = "xfreedreno" -o "x$have_simple_dmabuf_drm_client" = "xintel"; then
391 enable_simple_dmabuf_drm_client="yes"
392 fi
George Kiagiadakis53868982014-06-12 16:26:49 +0200393fi
Varad Gautamf9dec672016-11-17 17:25:59 +0530394AM_CONDITIONAL(BUILD_SIMPLE_DMABUF_DRM_CLIENT, test "x$enable_simple_dmabuf_drm_client" = "xyes")
George Kiagiadakis53868982014-06-12 16:26:49 +0200395
Emmanuel Gil Peyrot5d43af32016-01-11 19:04:38 +0000396AC_ARG_ENABLE(simple-dmabuf-v4l-client,
397 AS_HELP_STRING([--disable-simple-dmabuf-v4l-client],
398 [do not build the simple dmabuf v4l client]),,
399 enable_simple_dmabuf_v4l_client="auto")
400if ! test "x$enable_simple_dmabuf_v4l_client" = "xno"; then
401 PKG_CHECK_MODULES(SIMPLE_DMABUF_V4L_CLIENT, [wayland-client libdrm],
402 have_simple_dmabuf_v4l_client=yes, have_simple_dmabuf_v4l_client=no)
403 if test "x$have_simple_dmabuf_v4l_client" = "xno" -a "x$enable_simple_dmabuf_v4l_client" = "xyes"; then
404 AC_MSG_ERROR([V4L dmabuf client explicitly enabled, but libdrm couldn't be found])
405 fi
406 enable_simple_dmabuf_v4l_client="$have_simple_dmabuf_v4l_client"
407fi
408AM_CONDITIONAL(BUILD_SIMPLE_DMABUF_V4L_CLIENT, test "x$enable_simple_dmabuf_v4l_client" = "xyes")
409
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400410AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes)
Eric Anholt6f82cf52012-02-09 08:36:03 -0800411AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes)
Emmanuel Gil Peyrot226408d2016-12-04 21:34:56 +0000412have_cairo_egl=no
Eric Anholt6f82cf52012-02-09 08:36:03 -0800413if test x$enable_clients = xyes; then
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400414 AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients])
415
Bryce Harrington46f1f052016-05-11 13:18:59 -0700416 PKG_CHECK_MODULES(CLIENT, [wayland-client >= $WAYLAND_PREREQ_VERSION cairo >= 1.10.0 xkbcommon wayland-cursor])
Armin Ka94e2852013-06-04 13:05:22 +0200417 PKG_CHECK_MODULES(SERVER, [wayland-server])
Bryce Harrington46f1f052016-05-11 13:18:59 -0700418 PKG_CHECK_MODULES(WESTON_INFO, [wayland-client >= $WAYLAND_PREREQ_VERSION])
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400419
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100420 # Only check for cairo-egl if a GL or GLES renderer requested
421 AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [
Ucan, Emre (ADITG/SW1)7d967da2015-11-18 10:23:50 +0000422 PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl cairo-egl >= 1.11.3 $cairo_modules],
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100423 [have_cairo_egl=yes], [have_cairo_egl=no])
424 AS_IF([test "x$have_cairo_egl" = "xyes"],
425 [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])],
Armin K0a8461b2013-08-14 03:13:53 +0200426 [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
427 [have_cairo_egl=no])
Rob Bradford4c1a9bc2013-08-09 16:52:46 +0100428
Quentin Glidicdb776db2016-06-23 21:00:31 +0200429 PKG_CHECK_MODULES(PANGO, [pangocairo pango glib-2.0 >= 2.36], [have_pango=yes], [have_pango=no])
Kristian Høgsberg60c15082011-04-26 11:47:00 -0400430fi
431
Louis-Francis Ratté-Boulianne6cd1de32013-05-22 18:03:11 +0300432AC_ARG_ENABLE(resize-optimization,
433 AS_HELP_STRING([--disable-resize-optimization],
434 [disable resize optimization allocating a big buffer in toytoolkit]),,
435 enable_resize_optimization=yes)
436AS_IF([test "x$enable_resize_optimization" = "xyes"],
437 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
438
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100439AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
Murray Calavera3123c812016-09-29 21:24:30 +0100440AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
441if test x$enable_weston_launch = xyes; then
Quentin Glidic9992bdc2016-04-23 12:02:58 +0200442 WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
Murray Calavera3123c812016-09-29 21:24:30 +0100443 if test x$have_pam = xno; then
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100444 AC_ERROR([weston-launch requires pam])
445 fi
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100446fi
447
Jan Arne Petersen0a1cf392013-01-16 21:26:42 +0100448AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
449
Armin Ka94e2852013-06-04 13:05:22 +0200450AM_CONDITIONAL(HAVE_CAIRO_GLESV2,
451 [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"])
452
Pekka Paalanen51d21952012-01-31 16:35:18 +0200453AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
Vasily Khoruzhick1bfe2e62013-01-08 19:09:02 +0300454 test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
Pekka Paalanen51d21952012-01-31 16:35:18 +0200455
Pekka Paalanen7ff7a802013-04-25 13:57:50 +0300456AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT,
457 [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"])
458
Kristian Høgsberg1c562182011-05-02 22:09:20 -0400459AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
460
Jason Ekstrand946a9482014-04-02 19:53:47 -0500461AC_ARG_ENABLE(fullscreen-shell,
462 AS_HELP_STRING([--disable-fullscreen-shell],
463 [do not build fullscreen-shell server plugin]),,
464 enable_fullscreen_shell=yes)
465AM_CONDITIONAL(ENABLE_FULLSCREEN_SHELL,
466 test "x$enable_fullscreen_shell" = "xyes")
467
Richard Hughesbe7c4dd2013-05-11 09:48:22 +0100468# CMS modules
469AC_ARG_ENABLE(colord,
470 AS_HELP_STRING([--disable-colord],
471 [do not build colord CMS support]),,
Armin K49c36c62013-05-30 15:16:40 +0200472 enable_colord=auto)
Emmanuel Gil Peyrot226408d2016-12-04 21:34:56 +0000473have_colord=no
Armin K49c36c62013-05-30 15:16:40 +0200474if test "x$enable_colord" != "xno"; then
475 PKG_CHECK_MODULES(COLORD,
476 colord >= 0.1.27,
477 have_colord=yes,
478 have_colord=no)
479 if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then
480 AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found])
481 fi
482 if test "x$have_colord" = "xyes"; then
483 enable_colord=yes
484 fi
Richard Hughesbe7c4dd2013-05-11 09:48:22 +0100485fi
Yanko Kaneti9b78adf2013-07-10 12:01:36 -0400486AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400487
David Herrmann59ab9002013-10-22 00:28:06 +0200488# dbus support
489AC_ARG_ENABLE(dbus,
490 AS_HELP_STRING([--disable-dbus],
491 [do not build with dbus support]),,
492 enable_dbus=auto)
493if test "x$enable_dbus" != "xno"; then
494 PKG_CHECK_MODULES(DBUS,
495 dbus-1 >= 1.6,
496 have_dbus=yes,
497 have_dbus=no)
498 if test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"; then
499 AC_MSG_ERROR([dbus support explicitly requested, but libdbus couldn't be found])
500 fi
501 if test "x$have_dbus" = "xyes"; then
502 enable_dbus=yes
503 AC_DEFINE([HAVE_DBUS], [1], [Build with dbus support])
504 else
505 enable_dbus=no
506 fi
507fi
508AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
509
Manuel Bachmannf989c382015-11-04 12:13:08 +0100510# systemd-login support
511AC_ARG_ENABLE(systemd-login,
512 AS_HELP_STRING([--enable-systemd-login],
513 [Enable logind support]),,
514 enable_systemd_login=auto)
515if test x$enable_systemd_login != xno -a x$have_dbus != xno; then
516 PKG_CHECK_MODULES(SYSTEMD_LOGIN,
517 [libsystemd >= 209],
518 [have_systemd_login_209=yes;have_systemd_login=yes],
519 [have_systemd_login_209=no;have_systemd_login=no])
520
521 # Older versions of systemd package systemd-login separately. Fall back on that
522 AS_IF([test x$have_systemd_login != xyes],[
523 PKG_CHECK_MODULES(SYSTEMD_LOGIN,
524 [libsystemd-login >= 198],
525 [have_systemd_login=yes],
526 [have_systemd_login=no])
527 ])
528else
529 have_systemd_login=no
530fi
531
532if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
533 AC_MSG_ERROR([systemd-login support explicitly enabled, but can't find libsystemd>=209, libsystemd-login or dbus])
534fi
535
536AS_IF([test "x$have_systemd_login" = "xyes"],
537 [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
538AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
539
540AS_IF([test "x$have_systemd_login_209" = "xyes"],
541 [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
542
543
Jon A. Cruz646aef52015-07-15 19:22:41 -0700544# Note that other features might want libxml2, or this feature might use
545# alternative xml libraries at some point. Therefore the feature and
546# pre-requisite concepts are split.
547AC_ARG_ENABLE(junit_xml,
548 AS_HELP_STRING([--disable-junit-xml],
549 [do not build with JUnit XML output]),,
550 enable_junit_xml=auto)
551if test "x$enable_junit_xml" != "xno"; then
552 PKG_CHECK_MODULES(LIBXML2,
553 [libxml-2.0 >= 2.6],
554 have_libxml2=yes,
555 have_libxml2=no)
556 if test "x$have_libxml2" = "xno" -a "x$enable_junit_xml" = "xyes"; then
557 AC_MSG_ERROR([JUnit XML support explicitly requested, but libxml2 couldn't be found])
558 fi
559 if test "x$have_libxml2" = "xyes"; then
560 enable_junit_xml=yes
561 AC_DEFINE(ENABLE_JUNIT_XML, [1], [Build Weston with JUnit output support])
562 else
563 enable_junit_xml=no
564 fi
565fi
566AM_CONDITIONAL(ENABLE_JUNIT_XML, test "x$enable_junit_xml" = "xyes")
567
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900568# ivi-shell support
569AC_ARG_ENABLE(ivi-shell,
570 AS_HELP_STRING([--disable-ivi-shell],
571 [do not build ivi-shell server plugin and client]),,
572 enable_ivi_shell=yes)
573AM_CONDITIONAL(ENABLE_IVI_SHELL, test "x$enable_ivi_shell" = "xyes")
574
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400575AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
576AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
577if test x$enable_wcap_tools = xyes; then
578 AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools])
Kristian Høgsberg8d25a5a2012-07-20 18:05:10 -0400579 PKG_CHECK_MODULES(WCAP, [cairo])
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400580 WCAP_LIBS="$WCAP_LIBS -lm"
581fi
582
Pekka Paalanen4b141592012-08-03 14:39:16 +0300583PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
584AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
Kristian Høgsberg61cfa662012-05-26 13:19:22 -0400585
nobled48f975d2011-01-28 13:47:21 +0000586if test "x$GCC" = "xyes"; then
Pekka Paalanena95efd32013-01-18 12:11:10 +0200587 GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \
Daniel Stonead0241d2016-06-18 16:04:30 +1000588 -Wno-shift-negative-value -Wno-missing-field-initializers \
589 -g -fvisibility=hidden \
Kristian Høgsberg6fd73cd2014-02-01 11:02:41 -0800590 -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare"
Kristian Høgsbergd4de54e2008-12-04 22:48:50 -0500591fi
592AC_SUBST(GCC_CFLAGS)
593
Armin K49c36c62013-05-30 15:16:40 +0200594AC_ARG_ENABLE(libunwind,
595 AS_HELP_STRING([--disable-libunwind],
596 [Disable libunwind usage for backtraces]),,
597 enable_libunwind=auto)
Quentin Glidic5daccc32013-04-03 20:19:45 +0200598AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
Emmanuel Gil Peyrot226408d2016-12-04 21:34:56 +0000599have_libunwind=no
Armin K49c36c62013-05-30 15:16:40 +0200600if test "x$enable_libunwind" != "xno"; then
601 PKG_CHECK_MODULES(LIBUNWIND,
602 libunwind,
603 have_libunwind=yes,
604 have_libunwind=no)
605 if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then
606 AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found])
607 fi
608 if test "x$have_libunwind" = "xyes"; then
609 enable_libunwind=yes
610 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
611 fi
612fi
613
Marcin Slusarz554a0da2013-02-18 13:27:22 -0500614
Pekka Paalanena51e6fa2012-11-07 12:25:12 +0200615if test "x$WESTON_NATIVE_BACKEND" = "x"; then
616 WESTON_NATIVE_BACKEND="drm-backend.so"
617fi
618AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND])
619AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"],
620 [The default backend to load, if not wayland nor x11.])
621
Emilio Pozuelo Monfort8a81b832013-12-02 12:53:32 +0100622if test "x$WESTON_SHELL_CLIENT" = "x"; then
623 WESTON_SHELL_CLIENT="weston-desktop-shell"
624fi
625AC_MSG_NOTICE([Weston's default desktop shell client: $WESTON_SHELL_CLIENT])
626AC_DEFINE_UNQUOTED([WESTON_SHELL_CLIENT], ["$WESTON_SHELL_CLIENT"],
627 [The default desktop shell client to load.])
628
Kristian Høgsbergea520d52014-01-01 12:47:40 -0800629AC_ARG_ENABLE(demo-clients-install,
630 AS_HELP_STRING([--enable-demo-clients-install],
631 [Install demo clients built with weston]),,
Ricardo Vieira14613ba2014-01-02 15:31:14 -0800632 enable_demo_clients_install=no)
633AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"])
Armin Kaac60212013-07-14 17:26:23 +0200634
Jussi Kukkonen3375cca2015-11-27 16:37:35 +0200635AC_ARG_ENABLE(lcms,
636 AS_HELP_STRING([--disable-lcms],
637 [Disable lcms support]),,
638 enable_lcms=auto)
Emmanuel Gil Peyrot226408d2016-12-04 21:34:56 +0000639have_lcms=no
Jussi Kukkonen3375cca2015-11-27 16:37:35 +0200640if test "x$enable_lcms" != "xno"; then
641 PKG_CHECK_MODULES(LCMS,
642 lcms2,
643 have_lcms=yes,
644 have_lcms=no)
645 if test "x$have_lcms" = "xno" -a "x$enable_lcms" = "xyes"; then
646 AC_MSG_ERROR([lcms support explicitly requested, but lcms couldn't be found])
647 fi
648 if test "x$have_lcms" = "xyes"; then
649 enable_lcms=yes
650 AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
651 fi
Richard Hughesb24e48e2013-05-09 20:31:09 +0100652fi
Jussi Kukkonen3375cca2015-11-27 16:37:35 +0200653AM_CONDITIONAL(HAVE_LCMS, [test "x$enable_lcms" = xyes])
Richard Hughesb24e48e2013-05-09 20:31:09 +0100654
Quentin Glidic9f43cb42013-08-24 20:36:10 +0200655AC_PATH_PROG([wayland_scanner], [wayland-scanner])
656if test x$wayland_scanner = x; then
Emil Velikov32318a52015-02-17 15:13:32 +0000657 PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
658 wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
Quentin Glidic9f43cb42013-08-24 20:36:10 +0200659fi
Kristian Høgsbergb2d71852011-02-14 22:13:33 -0500660
Egor Starkov7ce2e972015-09-25 18:00:27 +0300661AC_ARG_ENABLE(systemd_notify,
662 AS_HELP_STRING([--enable-systemd-notify],
663 [Enables systemd notifications to
664 notify systemd about weston state
Friedrich, Eugen (ADITG/SW1)265aeb32016-04-05 20:43:29 +0000665 and update watchdog.
666 Also sockets provided by systemd
667 in case of socket-base activation
668 are added to wayland display]),,
Egor Starkov7ce2e972015-09-25 18:00:27 +0300669 enable_systemd_notify=no)
670AM_CONDITIONAL(SYSTEMD_NOTIFY_SUPPORT, test x$enable_systemd_notify = xyes)
671if test "x$enable_systemd_notify" = "xyes"; then
672 AC_DEFINE([SYSTEMD_NOTIFY_SUPPORT], [1], [Build the systemd sd_notify support])
673 PKG_CHECK_MODULES(SYSTEMD_DAEMON, [libsystemd])
674fi
675
Pekka Paalanenb5e3ea22016-06-03 17:12:10 +0300676AC_CONFIG_FILES([Makefile libweston/version.h compositor/weston.pc])
Kristian Høgsberg0aa19e92014-01-31 16:33:48 -0800677
Giulio Camuffo9e445982016-06-02 21:48:15 +0300678# AC_CONFIG_FILES needs the full name when running autoconf, so we need to use
679# libweston_abi_version here, and outside [] because of m4 quoting rules
Emil Velikov7fe47f32016-07-22 14:51:51 +0100680AC_CONFIG_FILES([libweston/libweston-]libweston_major_version[.pc:libweston/libweston.pc.in])
Quentin Glidic248dd102016-08-12 10:41:34 +0200681AC_CONFIG_FILES([libweston-desktop/libweston-desktop-]libweston_major_version[.pc:libweston-desktop/libweston-desktop.pc.in])
Giulio Camuffo9e445982016-06-02 21:48:15 +0300682
Kristian Høgsberg0aa19e92014-01-31 16:33:48 -0800683AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
684
Kristian Høgsberg4a8767b2008-12-10 13:44:23 -0500685AC_OUTPUT
Armin K0a8461b2013-08-14 03:13:53 +0200686
687AC_MSG_RESULT([
688 Native Backend ${WESTON_NATIVE_BACKEND}
689 setuid Install ${enable_setuid_install}
690
691 Cairo Renderer ${with_cairo}
692 EGL ${enable_egl}
Jonas Ådahlb8e62d92013-10-25 23:18:02 +0200693 xcb_xkb ${have_xcb_xkb}
Armin K0a8461b2013-08-14 03:13:53 +0200694 XWayland ${enable_xwayland}
David Herrmann59ab9002013-10-22 00:28:06 +0200695 dbus ${enable_dbus}
Armin K0a8461b2013-08-14 03:13:53 +0200696
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900697 ivi-shell ${enable_ivi_shell}
698
Armin K0a8461b2013-08-14 03:13:53 +0200699 Build wcap utility ${enable_wcap_tools}
Jason Ekstrand946a9482014-04-02 19:53:47 -0500700 Build Fullscreen Shell ${enable_fullscreen_shell}
Jon A. Cruz179c1862015-07-15 19:22:43 -0700701 Enable developer documentation ${enable_devdocs}
Armin K0a8461b2013-08-14 03:13:53 +0200702
703 weston-launch utility ${enable_weston_launch}
David Herrmanncc5b2ed2013-10-22 00:28:09 +0200704 systemd-login support ${have_systemd_login}
Egor Starkov7ce2e972015-09-25 18:00:27 +0300705 systemd notify support ${enable_systemd_notify}
Armin K0a8461b2013-08-14 03:13:53 +0200706
707 DRM Compositor ${enable_drm_compositor}
708 X11 Compositor ${enable_x11_compositor}
709 Wayland Compositor ${enable_wayland_compositor}
710 Headless Compositor ${enable_headless_compositor}
Armin K0a8461b2013-08-14 03:13:53 +0200711 FBDEV Compositor ${enable_fbdev_compositor}
712 RDP Compositor ${enable_rdp_compositor}
Jason Ekstrand47928d82014-04-02 19:54:01 -0500713 Screen Sharing ${enable_screen_sharing}
Jon A. Cruz646aef52015-07-15 19:22:41 -0700714 JUnit XML output ${enable_junit_xml}
Armin K0a8461b2013-08-14 03:13:53 +0200715
Armin K0a8461b2013-08-14 03:13:53 +0200716 Build Clients ${enable_clients}
717 Build EGL Clients ${have_cairo_egl}
718 Build Simple Clients ${enable_simple_clients}
719 Build Simple EGL Clients ${enable_simple_egl_clients}
720
Ricardo Vieira14613ba2014-01-02 15:31:14 -0800721 Install Demo Clients ${enable_demo_clients_install}
Armin K0a8461b2013-08-14 03:13:53 +0200722
723 Colord Support ${have_colord}
Armin K0a8461b2013-08-14 03:13:53 +0200724 LCMS2 Support ${have_lcms}
Emmanuel Gil Peyrot66e16142016-02-16 01:57:52 +0000725 libjpeg Support ${have_jpeglib}
Armin K0a8461b2013-08-14 03:13:53 +0200726 libwebp Support ${have_webp}
727 libunwind Support ${have_libunwind}
Ander Conselvan de Oliveira6aae4d32013-08-23 17:15:48 +0300728 VA H.264 encoding Support ${have_libva}
Armin K0a8461b2013-08-14 03:13:53 +0200729])