docs: man: document configuration files in kmscon(1)
[platform/upstream/kmscon.git] / configure.ac
1 #
2 # Kmscon - build configuration script
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
4 #
5
6 AC_PREREQ(2.68)
7
8 AC_INIT([kmscon],
9         [7],
10         [http://bugs.freedesktop.org/enter_bug.cgi?product=kmscon],
11         [kmscon],
12         [http://www.freedesktop.org/wiki/Software/kmscon])
13 AC_CONFIG_SRCDIR([src/kmscon_main.c])
14 AC_CONFIG_AUX_DIR([build-aux])
15 AC_CONFIG_MACRO_DIR([m4])
16 AC_CONFIG_HEADER(config.h)
17 AC_USE_SYSTEM_EXTENSIONS
18 AC_SYS_LARGEFILE
19 AC_PREFIX_DEFAULT([/usr])
20 AC_CANONICAL_HOST
21
22 AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects dist-xz no-dist-gzip tar-pax -Wall -Werror -Wno-portability])
23 AM_SILENT_RULES([yes])
24
25 #
26 # Don't add a default "-g -O2" if CFLAGS wasn't specified. For debugging it is
27 # often more convenient to have "-g -O0". You can still override it by
28 # explicitly setting it on the command line.
29 #
30
31 : ${CFLAGS=""}
32
33 AC_PROG_CC
34 AC_PROG_CC_C99
35 AM_PROG_CC_C_O
36 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
37 AC_PROG_SED
38 AC_PROG_MKDIR_P
39 AC_PROG_LN_S
40 AC_PROG_GREP
41 AC_PROG_AWK
42
43 LT_PREREQ(2.2)
44 LT_INIT
45
46 #
47 # pkg-config dependencies
48 # This unconditionally checks for all dependencies even if they are disabled. We
49 # later look whether all required depedencies are met and finish the
50 # configuration. We group similar packages into one logical group here to avoid
51 # having variables for each single library.
52 # This, however, makes ./configure output very unintuitive error messages if a
53 # package is not found so we must make sure we print more verbose messages
54 # ourself.
55 #
56
57 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
58                   [have_xkbcommon=yes], [have_xkbcommon=no])
59 AC_SUBST(XKBCOMMON_CFLAGS)
60 AC_SUBST(XKBCOMMON_LIBS)
61
62 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server wayland-cursor],
63                   [have_wayland=yes], [have_wayland=no])
64 AC_SUBST(WAYLAND_CFLAGS)
65 AC_SUBST(WAYLAND_LIBS)
66
67 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
68                   [have_systemd=yes], [have_systemd=no])
69 AC_SUBST(SYSTEMD_CFLAGS)
70 AC_SUBST(SYSTEMD_LIBS)
71
72 PKG_CHECK_MODULES([UDEV], [libudev >= 172],
73                   [have_udev=yes], [have_udev=no])
74 AC_SUBST(UDEV_CFLAGS)
75 AC_SUBST(UDEV_LIBS)
76
77 PKG_CHECK_MODULES([DBUS], [dbus-1],
78                   [have_dbus=yes], [have_dbus=no])
79 AC_SUBST(DBUS_CFLAGS)
80 AC_SUBST(DBUS_LIBS)
81
82 PKG_CHECK_MODULES([DRM], [libdrm],
83                   [have_drm=yes], [have_drm=no])
84 AC_SUBST(DRM_CFLAGS)
85 AC_SUBST(DRM_LIBS)
86
87 PKG_CHECK_MODULES([GBM], [gbm],
88                   [have_gbm=yes], [have_gbm=no])
89 AC_SUBST(GBM_CFLAGS)
90 AC_SUBST(GBM_LIBS)
91
92 PKG_CHECK_MODULES([EGL], [egl],
93                   [have_egl=yes], [have_egl=no])
94 AC_SUBST(EGL_CFLAGS)
95 AC_SUBST(EGL_LIBS)
96
97 PKG_CHECK_MODULES([GLES2], [glesv2],
98                   [have_gles2=yes], [have_gles2=no])
99 AC_SUBST(GLES2_CFLAGS)
100 AC_SUBST(GLES2_LIBS)
101
102 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
103                   [have_freetype2=yes], [have_freetype2=no])
104 AC_SUBST(FREETYPE2_CFLAGS)
105 AC_SUBST(FREETYPE2_LIBS)
106
107 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
108                   [have_pango=yes], [have_pango=no])
109 AC_SUBST(PANGO_CFLAGS)
110 AC_SUBST(PANGO_LIBS)
111
112 PKG_CHECK_MODULES([FUSE], [fuse >= 2.9.0],
113                   [have_fuse=yes], [have_fuse=no])
114 AC_SUBST(FUSE_CFLAGS)
115 AC_SUBST(FUSE_LIBS)
116
117 PKG_CHECK_MODULES([CAIRO], [cairo],
118                   [have_cairo=yes], [have_cairo=no])
119 AC_SUBST(CAIRO_CFLAGS)
120 AC_SUBST(CAIRO_LIBS)
121
122 PKG_CHECK_MODULES([PIXMAN], [pixman-1],
123                   [have_pixman=yes], [have_pixman=no])
124 AC_SUBST(PIXMAN_CFLAGS)
125 AC_SUBST(PIXMAN_LIBS)
126
127 #
128 # Parse arguments
129 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
130 # saves the results in local variables. This does not check dependencies or
131 # similar but does only parse the arguments.
132 #
133
134 # all
135 AC_MSG_CHECKING([whether user wants all])
136 AC_ARG_ENABLE([all],
137               [AS_HELP_STRING([--enable-all],
138                               [enable all options (used for debugging)])])
139 if test "x$enable_all" = "x" ; then
140         enable_all="no"
141 fi
142 AC_MSG_RESULT([$enable_all])
143
144 # eloop
145 AC_MSG_CHECKING([whether user wants eloop])
146 AC_ARG_ENABLE([eloop],
147               [AS_HELP_STRING([--enable-eloop],
148                               [build eloop library])])
149 if test "x$enable_all" = "xyes" ; then
150         enable_eloop="yes"
151 elif test "x$enable_eloop" = "x" ; then
152         enable_eloop="no (default)"
153 fi
154 AC_MSG_RESULT([$enable_eloop])
155
156 # TSM
157 AC_MSG_CHECKING([whether user wants TSM])
158 AC_ARG_ENABLE([tsm],
159               [AS_HELP_STRING([--enable-tsm],
160                               [build tsm library])])
161 if test "x$enable_all" = "xyes" ; then
162         enable_tsm="yes"
163 elif test "x$enable_tsm" = "x" ; then
164         enable_tsm="no (default)"
165 fi
166 AC_MSG_RESULT([$enable_tsm])
167
168 # UVT
169 AC_MSG_CHECKING([whether user wants UVT])
170 AC_ARG_ENABLE([uvt],
171               [AS_HELP_STRING([--enable-uvt],
172                               [build uvt library])])
173 if test "x$enable_all" = "xyes" ; then
174         enable_uvt="yes"
175 elif test "x$enable_uvt" = "x" ; then
176         enable_uvt="no (default)"
177 fi
178 AC_MSG_RESULT([$enable_uvt])
179
180 # uterm
181 AC_MSG_CHECKING([whether user wants uterm])
182 AC_ARG_ENABLE([uterm],
183               [AS_HELP_STRING([--enable-uterm],
184                               [build uterm library])])
185 if test "x$enable_all" = "xyes" ; then
186         enable_uterm="yes"
187 elif test "x$enable_uterm" = "x" ; then
188         enable_uterm="no (default)"
189 fi
190 AC_MSG_RESULT([$enable_uterm])
191
192 # kmscon
193 AC_MSG_CHECKING([whether user wants kmscon])
194 AC_ARG_ENABLE([kmscon],
195               [AS_HELP_STRING([--disable-kmscon],
196                               [do not build kmscon])])
197 if test "x$enable_all" = "xyes" ; then
198         enable_kmscon="yes"
199 elif test "x$enable_kmscon" = "x" ; then
200         enable_kmscon="yes (default)"
201 fi
202 AC_MSG_RESULT([$enable_kmscon])
203
204 # wlterm
205 AC_MSG_CHECKING([whether user wants wlterm])
206 AC_ARG_ENABLE([wlterm],
207               [AS_HELP_STRING([--enable-wlterm],
208                               [build wlterm])])
209 if test "x$enable_all" = "xyes" ; then
210         enable_wlterm="yes"
211 elif test "x$enable_wlterm" = "x" ; then
212         enable_wlterm="no (default)"
213 fi
214 AC_MSG_RESULT([$enable_wlterm])
215
216 # uvtd
217 AC_MSG_CHECKING([whether user wants uvtd])
218 AC_ARG_ENABLE([uvtd],
219               [AS_HELP_STRING([--enable-uvtd],
220                               [build uvtd])])
221 if test "x$enable_all" = "xyes" ; then
222         enable_uvtd="yes"
223 elif test "x$enable_uvtd" = "x" ; then
224         enable_uvtd="no (default)"
225 fi
226 AC_MSG_RESULT([$enable_uvtd])
227
228 # debug
229 AC_MSG_CHECKING([whether to build with debugging on])
230 AC_ARG_ENABLE([debug],
231               [AS_HELP_STRING([--enable-debug],
232                               [whether to build with debugging on])])
233 if test "x$enable_all" = "xyes" ; then
234         enable_debug="yes"
235 elif test "x$enable_debug" = "x" ; then
236         enable_debug="yes (default)"
237 fi
238 AC_MSG_RESULT([$enable_debug])
239
240 # optimizations
241 AC_MSG_CHECKING([whether to disable code optimizations])
242 AC_ARG_ENABLE([optimizations],
243               [AS_HELP_STRING([--disable-optimizations],
244                               [whether to disable code optimizations])])
245 if test "x$enable_all" = "xyes" ; then
246         enable_optimizations="yes"
247 elif test "x$enable_optimizations" = "x" ; then
248         enable_optimizations="yes (default)"
249 fi
250 AC_MSG_RESULT([$enable_optimizations])
251
252 # multi-seat
253 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
254 AC_ARG_ENABLE([multi-seat],
255               [AS_HELP_STRING([--enable-multi-seat],
256                               [enable multi-seat support with systemd])])
257 if test "x$enable_all" = "xyes" ; then
258         enable_multi_seat="yes"
259 elif test "x$enable_multi_seat" = "x" ; then
260         enable_multi_seat="yes (default)"
261 fi
262 AC_MSG_RESULT([$enable_multi_seat])
263
264 # hotplug
265 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
266 AC_ARG_ENABLE([hotplug],
267               [AS_HELP_STRING([--enable-hotplug],
268                               [enable device hotplug support with udev])])
269 if test "x$enable_all" = "xyes" ; then
270         enable_hotplug="yes"
271 elif test "x$enable_hotplug" = "x" ; then
272         enable_hotplug="yes (default)"
273 fi
274 AC_MSG_RESULT([$enable_hotplug])
275
276 # eloop-dbus
277 AC_MSG_CHECKING([whether user wants eloop dbus support])
278 AC_ARG_ENABLE([eloop-dbus],
279               [AS_HELP_STRING([--enable-eloop-dbus],
280                               [enable eloop dbus support])])
281 if test "x$enable_all" = "xyes" ; then
282         enable_eloop_dbus="yes"
283 elif test "x$enable_eloop_dbus" = "x" ; then
284         enable_eloop_dbus="no (default)"
285 fi
286 AC_MSG_RESULT([$enable_eloop_dbus])
287
288 # video backends
289 AC_MSG_CHECKING([which video backends the user wants])
290 AC_ARG_WITH([video],
291             [AS_HELP_STRING([--with-video],
292               [specify list of optional video backends])],
293             [],
294             [with_video="default"])
295 enable_video_fbdev="no"
296 enable_video_drm2d="no"
297 enable_video_drm3d="no"
298 if test "x$enable_all" = "xyes" ; then
299         enable_video_fbdev="yes"
300         enable_video_drm2d="yes"
301         enable_video_drm3d="yes"
302         with_video="fbdev,drm2d,drm3d (all)"
303 elif test "x$with_video" = "xdefault" ; then
304         enable_video_fbdev="yes (default)"
305         enable_video_drm2d="yes (default)"
306         enable_video_drm3d="yes (default)"
307         with_video="fbdev,drm2d,drm3d (default)"
308 elif test ! "x$with_video" = "x" ; then
309         SAVEIFS="$IFS"
310         IFS=","
311         for i in $with_video ; do
312                 if test "x$i" = "xfbdev" ; then
313                         enable_video_fbdev="yes"
314                 elif test "x$i" = "xdrm2d" ; then
315                         enable_video_drm2d="yes"
316                 elif test "x$i" = "xdrm3d" ; then
317                         enable_video_drm3d="yes"
318                 else
319                         IFS="$SAVEIFS"
320                         AC_ERROR([Invalid video backend $i])
321                 fi
322         done
323         IFS="$SAVEIFS"
324 fi
325 AC_MSG_RESULT([$with_video])
326
327 # renderers
328 AC_MSG_CHECKING([which render backends the user wants])
329 AC_ARG_WITH([renderers],
330             [AS_HELP_STRING([--with-renderers],
331               [specify list of optional render backends])],
332             [],
333             [with_renderers="default"])
334 enable_renderer_bbulk="no"
335 enable_renderer_gltex="no"
336 enable_renderer_cairo="no"
337 enable_renderer_pixman="no"
338 if test "x$enable_all" = "xyes" ; then
339         enable_renderer_bbulk="yes"
340         enable_renderer_gltex="yes"
341         enable_renderer_cairo="yes"
342         enable_renderer_pixman="yes"
343         with_renderers="bbulk,gltex,cairo,pixman (all)"
344 elif test "x$with_renderers" = "xdefault" ; then
345         enable_renderer_bbulk="yes (default)"
346         enable_renderer_gltex="yes (default)"
347         enable_renderer_cairo="no (default)"
348         enable_renderer_pixman="no (default)"
349         with_renderers="bbulk,gltex (default)"
350 elif test ! "x$with_renderers" = "x" ; then
351         SAVEIFS="$IFS"
352         IFS=","
353         for i in $with_renderers ; do
354                 if test "x$i" = "xbbulk" ; then
355                         enable_renderer_bbulk="yes"
356                 elif test "x$i" = "xgltex" ; then
357                         enable_renderer_gltex="yes"
358                 elif test "x$i" = "xcairo" ; then
359                         enable_renderer_cairo="yes"
360                 elif test "x$i" = "xpixman" ; then
361                         enable_renderer_pixman="yes"
362                 else
363                         IFS="$SAVEIFS"
364                         AC_ERROR([Unknown renderer $i])
365                 fi
366         done
367         IFS="$SAVEIFS"
368 fi
369 AC_MSG_RESULT([$with_renderers])
370
371 # font backends
372 AC_MSG_CHECKING([which font backends the user wants])
373 AC_ARG_WITH([fonts],
374             [AS_HELP_STRING([--with-fonts],
375               [specify list of optional font backends])],
376             [],
377             [with_fonts="default"])
378 enable_font_unifont="no"
379 enable_font_freetype2="no"
380 enable_font_pango="no"
381 if test "x$enable_all" = "xyes" ; then
382         enable_font_unifont="yes"
383         enable_font_freetype2="yes"
384         enable_font_pango="yes"
385         with_fonts="unifont,freetype2,pango (all)"
386 elif test "x$with_fonts" = "xdefault" ; then
387         enable_font_unifont="yes (default)"
388         enable_font_freetype2="no (default)"
389         enable_font_pango="yes (default)"
390         with_fonts="unifont,pango (default)"
391 elif test ! "x$with_fonts" = "x" ; then
392         SAVEIFS="$IFS"
393         IFS=","
394         for i in $with_fonts ; do
395                 if test "x$i" = "xunifont" ; then
396                         enable_font_unifont="yes"
397                 elif test "x$i" = "xfreetype2" ; then
398                         enable_font_freetype2="yes"
399                 elif test "x$i" = "xpango" ; then
400                         enable_font_pango="yes"
401                 else
402                         IFS="$SAVEIFS"
403                         AC_ERROR([Unknown font backend $i])
404                 fi
405         done
406         IFS="$SAVEIFS"
407 fi
408 AC_MSG_RESULT([$with_fonts])
409
410 # kmscon sessions
411 AC_MSG_CHECKING([which sessions the user wants])
412 AC_ARG_WITH([sessions],
413             [AS_HELP_STRING([--with-sessions],
414               [specify list of optional sessions])],
415             [],
416             [with_sessions="default"])
417 enable_session_dummy="no"
418 enable_session_terminal="no"
419 enable_session_cdev="no"
420 if test "x$enable_all" = "xyes" ; then
421         enable_session_dummy="yes"
422         enable_session_terminal="yes"
423         enable_session_cdev="yes"
424         with_sessions="dummy,terminal,cdev (all)"
425 elif test "x$with_sessions" = "xdefault" ; then
426         enable_session_dummy="yes (default)"
427         enable_session_terminal="yes (default)"
428         enable_session_cdev="yes (default)"
429         with_sessions="dummy,terminal,cdev (default)"
430 elif test ! "x$with_sessions" = "x" ; then
431         SAVEIFS="$IFS"
432         IFS=","
433         for i in $with_sessions ; do
434                 if test "x$i" = "xdummy" ; then
435                         enable_session_dummy="yes"
436                 elif test "x$i" = "xterminal" ; then
437                         enable_session_terminal="yes"
438                 elif test "x$i" = "xcdev" ; then
439                         enable_session_cdev="yes"
440                 else
441                         IFS="$SAVEIFS"
442                         AC_ERROR([Unknown session type $i])
443                 fi
444         done
445         IFS="$SAVEIFS"
446 fi
447 AC_MSG_RESULT([$with_sessions])
448
449 #
450 # Check what can be built
451 # This checks each configuration option and tests whether all dependencies are
452 # met. This is done from bottom up to ensure the right order.
453 #
454
455 # debug
456 debug_avail=no
457 debug_missing=""
458 if test ! "x$enable_debug" = "xno" ; then
459         debug_avail=yes
460 else
461         debug_missing="enable-debug"
462 fi
463
464 # optimizations
465 optimizations_avail=no
466 optimizations_missing=""
467 if test ! "x$enable_optimizations" = "xno" ; then
468         optimizations_avail=yes
469 else
470         optimizations_missing="enable-optimizations"
471 fi
472
473 # eloop-dbus
474 eloop_dbus_avail=no
475 eloop_dbus_missing=""
476 if test ! "x$enable_eloop_dbus" = "xno" ; then
477         eloop_dbus_avail=yes
478         if test "x$have_dbus" = "xno" ; then
479                 eloop_dbus_avail=no
480                 eloop_dbus_missing="libdbus"
481         fi
482
483         if test "x$eloop_dbus_avail" = "xno" ; then
484                 if test "x$enable_eloop_dbus" = "xyes" ; then
485                         AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
486                 fi
487         fi
488 else
489         eloop_dbus_missing="enable-eloop-dbus"
490 fi
491
492 # eloop
493 eloop_avail=no
494 eloop_missing=""
495 if test ! "x$enable_eloop" = "xno" ; then
496         eloop_avail=yes
497 else
498         eloop_missing="enable-eloop"
499 fi
500
501 # TSM
502 tsm_avail=no
503 tsm_missing=""
504 if test ! "x$enable_tsm" = "xno" ; then
505         tsm_avail=yes
506         if test "x$have_xkbcommon" = "xno" ; then
507                 tsm_avail=no
508                 tsm_missing="libxkbcommon"
509         fi
510
511         if test "x$tsm_avail" = "xno" ; then
512                 if test "x$enable_tsm" = "xyes" ; then
513                         AC_ERROR([missing for TSM: $tsm_missing])
514                 fi
515         fi
516 else
517         tsm_missing="enable-tsm"
518 fi
519
520 # UVT
521 uvt_avail=no
522 uvt_missing=""
523 if test ! "x$enable_uvt" = "xno" ; then
524         uvt_avail=yes
525         if test "x$have_fuse" = "xno" ; then
526                 uvt_avail=no
527                 uvt_missing="fuse"
528         fi
529
530         if test "x$uvt_avail" = "xno" ; then
531                 if test "x$enable_uvt" = "xyes" ; then
532                         AC_ERROR([missing for UVT: $uvt_missing])
533                 fi
534         fi
535 else
536         uvt_missing="enable-uvt"
537 fi
538
539 # video fbdev
540 video_fbdev_avail=no
541 video_fbdev_missing=""
542 if test ! "x$enable_video_fbdev" = "xno" ; then
543         # TODO: check for kernel headers
544         video_fbdev_avail=yes
545 else
546         video_fbdev_missing="enable-video-fbdev"
547 fi
548
549 # video drm2d
550 video_drm2d_avail=no
551 video_drm2d_missing=""
552 if test ! "x$enable_video_drm2d" = "xno" ; then
553         video_drm2d_avail=yes
554         if test "x$have_drm3d" = "xno" ; then
555                 video_drm2d_avail=no
556                 video_drm2d_missing="libdrm3d"
557         fi
558
559         if test "x$video_drm2d_avail" = "xno" ; then
560                 if test "x$enable_video_drm2d" = "xyes" ; then
561                         AC_ERROR([missing for drm2d video backend: $video_drm2d_missing])
562                 fi
563         fi
564 else
565         video_drm2d_missing="enable-video-drm2d"
566 fi
567
568 # video drm3d
569 video_drm3d_avail=no
570 video_drm3d_missing=""
571 if test ! "x$enable_video_drm3d" = "xno" ; then
572         video_drm3d_avail=yes
573         if test "x$have_drm3d" = "xno" ; then
574                 video_drm3d_avail=no
575                 video_drm3d_missing="libdrm3d,$video_drm3d_missing"
576         fi
577         if test "x$have_gbm" = "xno" ; then
578                 video_drm3d_avail=no
579                 video_drm3d_missing="libgbm,$video_drm3d_missing"
580         fi
581         if test "x$have_egl" = "xno" ; then
582                 video_drm3d_avail=no
583                 video_drm3d_missing="libegl,$video_drm3d_missing"
584         fi
585         if test "x$have_gles2" = "xno" ; then
586                 video_drm3d_avail=no
587                 video_drm3d_missing="libgles2,$video_drm3d_missing"
588         fi
589
590         if test "x$video_drm3d_avail" = "xno" ; then
591                 if test "x$enable_video_drm3d" = "xyes" ; then
592                         AC_ERROR([missing for drm3d video backend: $video_drm3d_missing])
593                 fi
594         fi
595 else
596         video_drm3d_missing="enable-video-drm3d"
597 fi
598
599 # uterm
600 uterm_avail=no
601 uterm_missing=""
602 if test ! "x$enable_uterm" = "xno" ; then
603         uterm_avail=yes
604 else
605         uterm_missing="enable-uterm"
606 fi
607
608 # multi-seat
609 multi_seat_avail=no
610 multi_seat_missing=""
611 if test ! "x$enable_multi_seat" = "xno" ; then
612         multi_seat_avail=yes
613         if test "x$have_systemd" = "xno" ; then
614                 multi_seat_avail=no
615                 multi_seat_missing="libsystemd"
616         fi
617
618         if test "x$multi_seat_avail" = "xno" ; then
619                 if test "x$enable_multi_seat" = "xyes" ; then
620                         AC_ERROR([missing for multi-seat support: $multi_seat_missing])
621                 fi
622         fi
623 else
624         multi_seat_missing="enable-multi-seat"
625 fi
626
627 # hotplug
628 hotplug_avail=no
629 hotplug_missing=""
630 if test ! "x$enable_hotplug" = "xno" ; then
631         hotplug_avail=yes
632         if test "x$have_udev" = "xno" ; then
633                 hotplug_avail=no
634                 hotplug_missing="libudev"
635         fi
636
637         if test "x$hotplug_avail" = "xno" ; then
638                 if test "x$enable_hotplug" = "xyes" ; then
639                         AC_ERROR([missing for hotplug-support: $hotplug_missing])
640                 fi
641         fi
642 else
643         hotplug_missing="enable-hotplug"
644 fi
645
646 # renderer bbulk
647 renderer_bbulk_avail=no
648 renderer_bbulk_missing=""
649 if test ! "x$enable_renderer_bbulk" = "xno" ; then
650         renderer_bbulk_avail=yes
651 else
652         renderer_bbulk_missing="enable-renderer-bbulk"
653 fi
654
655 # renderer gltex
656 renderer_gltex_avail=no
657 renderer_gltex_missing=""
658 if test ! "x$enable_renderer_gltex" = "xno" ; then
659         renderer_gltex_avail=yes
660         if test "x$have_gles2" = "xno" ; then
661                 renderer_gltex_avail=no
662                 renderer_gltex_missing="libgles2"
663         fi
664
665         if test "x$renderer_gltex_avail" = "xno" ; then
666                 if test "x$enable_renderer_gltex" = "xyes" ; then
667                         AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
668                 fi
669         fi
670 else
671         renderer_gltex_missing="enable-renderer-gltex"
672 fi
673
674 # renderer cairo
675 renderer_cairo_avail=no
676 renderer_cairo_missing=""
677 if test ! "x$enable_renderer_cairo" = "xno" ; then
678         renderer_cairo_avail=yes
679         if test "x$have_cairo" = "xno" ; then
680                 renderer_cairo_avail=no
681                 renderer_cairo_missing="cairo"
682         fi
683
684         if test "x$renderer_cairo_avail" = "xno" ; then
685                 if test "x$enable_renderer_cairo" = "xyes" ; then
686                         AC_ERROR([missing for renderer-cairo: $renderer_cairo_missing])
687                 fi
688         fi
689 else
690         renderer_cairo_missing="enable-renderer-cairo"
691 fi
692
693 # renderer pixman
694 renderer_pixman_avail=no
695 renderer_pixman_missing=""
696 if test ! "x$enable_renderer_pixman" = "xno" ; then
697         renderer_pixman_avail=yes
698         if test "x$have_pixman" = "xno" ; then
699                 renderer_pixman_avail=no
700                 renderer_pixman_missing="pixman"
701         fi
702
703         if test "x$renderer_pixman_avail" = "xno" ; then
704                 if test "x$enable_renderer_pixman" = "xyes" ; then
705                         AC_ERROR([missing for renderer-pixman: $renderer_pixman_missing])
706                 fi
707         fi
708 else
709         renderer_pixman_missing="enable-renderer-pixman"
710 fi
711
712 # font unifont
713 font_unifont_avail=no
714 font_unifont_missing=""
715 if test ! "x$enable_font_unifont" = "xno" ; then
716         font_unifont_avail=yes
717 else
718         font_unifont_missing="enable-font-unifont"
719 fi
720
721 # font freetype2
722 font_freetype2_avail=no
723 font_freetype2_missing=""
724 if test ! "x$enable_font_freetype2" = "xno" ; then
725         font_freetype2_avail=yes
726         if test "x$have_freetype2" = "xno" ; then
727                 font_freetype2_avail=no
728                 font_freetype2_missing="libfontconfig,libfreetype2"
729         fi
730
731         if test "x$font_freetype2_avail" = "xno" ; then
732                 if test "x$enable_font_freetype2" = "xyes" ; then
733                         AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
734                 fi
735         fi
736 else
737         font_freetype2_missing="enable-font-freetype2"
738 fi
739
740 # font pango
741 font_pango_avail=no
742 font_pango_missing=""
743 if test ! "x$enable_font_pango" = "xno" ; then
744         font_pango_avail=yes
745         if test "x$have_pango" = "xno" ; then
746                 font_pango_avail=no
747                 font_pango_missing="libpango"
748         fi
749
750         if test "x$font_pango_avail" = "xno" ; then
751                 if test "x$enable_font_pango" = "xyes" ; then
752                         AC_ERROR([missing for font-pango: $font_pango_missing])
753                 fi
754         fi
755 else
756         font_pango_missing="enable-font-pango"
757 fi
758
759 # session dummy
760 session_dummy_avail=no
761 session_dummy_missing=""
762 if test ! "x$enable_session_dummy" = "xno" ; then
763         session_dummy_avail=yes
764 else
765         session_dummy_missing="enable-session-dummy"
766 fi
767
768 # session terminal
769 session_terminal_avail=no
770 session_terminal_missing=""
771 if test ! "x$enable_session_terminal" = "xno" ; then
772         session_terminal_avail=yes
773         if test "x$tsm_avail" = "xno" ; then
774                 session_terminal_avail=no
775                 session_terminal_missing="$tsm_missing"
776         fi
777
778         if test "x$session_terminal_avail" = "xno" ; then
779                 if test "x$enable_session_terminal" = "xyes" ; then
780                         AC_ERROR([missing for session-terminal: $session_terminal_missing])
781                 fi
782         fi
783 else
784         session_terminal_missing="enable-session-terminal"
785 fi
786
787 # session cdev
788 session_cdev_avail=no
789 session_cdev_missing=""
790 if test ! "x$enable_session_cdev" = "xno" ; then
791         session_cdev_avail=yes
792         if test "x$have_fuse" = "xno" ; then
793                 session_cdev_avail=no
794                 session_cdev_missing="libfuse,$session_cdev_missing"
795         fi
796
797         if test "x$tsm_avail" = "xno" ; then
798                 session_cdev_avail=no
799                 session_cdev_missing="$tsm_missing,$session_cdev_missing"
800         fi
801
802         if test "x$session_cdev_avail" = "xno" ; then
803                 if test "x$enable_session_cdev" = "xyes" ; then
804                         AC_ERROR([missing for session-cdev: $session_cdev_missing])
805                 fi
806         fi
807 else
808         session_cdev_missing="enable-session-cdev"
809 fi
810
811 # kmscon
812 kmscon_avail=no
813 kmscon_missing=""
814 if test ! "x$enable_kmscon" = "xno" ; then
815         kmscon_avail=yes
816         if test "x$eloop_avail" = "xno" ; then
817                 kmscon_avail=no
818                 kmscon_missing="$eloop_missing,$kmscon_missing"
819         fi
820
821         if test "x$tsm_avail" = "xno" ; then
822                 kmscon_avail=no
823                 kmscon_missing="$tsm_missing,$kmscon_missing"
824         fi
825
826         if test "x$uterm_avail" = "xno" ; then
827                 kmscon_avail=no
828                 kmscon_missing="$uterm_missing,$kmscon_missing"
829         fi
830
831         if test "x$kmscon_avail" = "xno" ; then
832                 if test "x$enable_kmscon" = "xyes" ; then
833                         AC_ERROR([missing for kmscon: $kmscon_missing])
834                 fi
835         fi
836 else
837         kmscon_missing="enable-kmscon"
838 fi
839
840 # wlterm
841 wlterm_avail=no
842 wlterm_missing=""
843 if test ! "x$enable_wlterm" = "xno" ; then
844         wlterm_avail=yes
845         if test "x$tsm_avail" = "xno" ; then
846                 wlterm_avail=no
847                 wlterm_missing="$tsm_missing,$wlterm_missing"
848         fi
849
850         if test "x$eloop_avail" = "xno" ; then
851                 wlterm_avail=no
852                 wlterm_missing="$eloop_missing,$wlterm_missing"
853         fi
854
855         if test "x$font_pango_avail" = "xno" ; then
856                 wlterm_avail=no
857                 wlterm_missing="$font_pango_missing,$wlterm_missing"
858         fi
859
860         if test "x$have_wayland" = "xno" ; then
861                 wlterm_avail=no
862                 wlterm_missing="libwayland,$wlterm_missing"
863         fi
864
865         if test "x$wlterm_avail" = "xno" ; then
866                 if test "x$enable_wlterm" = "xyes" ; then
867                         AC_ERROR([missing for wlterm: $wlterm_missing])
868                 fi
869         fi
870 else
871         wlterm_missing="enable-wlterm"
872 fi
873
874 # uvtd
875 uvtd_avail=no
876 uvtd_missing=""
877 if test ! "x$enable_uvtd" = "xno" ; then
878         uvtd_avail=yes
879         if test "x$uvt_avail" = "xno" ; then
880                 uvtd_avail=no
881                 uvtd_missing="$uvt_missing,$uvtd_missing"
882         fi
883
884         if test "x$eloop_avail" = "xno" ; then
885                 uvtd_avail=no
886                 uvtd_missing="$eloop_missing,$uvtd_missing"
887         fi
888
889         if test "x$uvtd_avail" = "xno" ; then
890                 if test "x$enable_uvtd" = "xyes" ; then
891                         AC_ERROR([missing for uvtd: $uvtd_missing])
892                 fi
893         fi
894 else
895         uvtd_missing="enable-uvtd"
896 fi
897
898 #
899 # Enable all required modules
900 # We now know which modules can be built by checking the *_avail variables set
901 # above. We now only have to disable all modules that are disabled by default
902 # and the user didn't force-enable them and no other module that is enabled
903 # needs them. This is done top-down of course.
904 #
905
906 # uvtd
907 uvtd_enabled=no
908 if test "x$uvtd_avail" = "xyes" ; then
909         if test "x${enable_uvtd% *}" = "xyes" ; then
910                 uvtd_enabled=yes
911                 enable_eloop=yes
912                 enable_uvt=yes
913         fi
914 fi
915
916 # wlterm
917 wlterm_enabled=no
918 if test "x$wlterm_avail" = "xyes" ; then
919         if test "x${enable_wlterm% *}" = "xyes" ; then
920                 wlterm_enabled=yes
921                 enable_eloop=yes
922                 enable_tsm=yes
923                 enable_font_pango=yes
924         fi
925 fi
926
927 # kmscon
928 kmscon_enabled=no
929 if test "x$kmscon_avail" = "xyes" ; then
930         if test "x${enable_kmscon% *}" = "xyes" ; then
931                 kmscon_enabled=yes
932                 enable_eloop=yes
933                 enable_uterm=yes
934         fi
935 fi
936
937 # session cdev
938 session_cdev_enabled=no
939 if test "x$session_cdev_avail" = "xyes" ; then
940         if test "x${enable_session_cdev% *}" = "xyes" ; then
941                 session_cdev_enabled=yes
942         fi
943 fi
944
945 # session terminal
946 session_terminal_enabled=no
947 if test "x$session_terminal_avail" = "xyes" ; then
948         if test "x${enable_session_terminal% *}" = "xyes" ; then
949                 session_terminal_enabled=yes
950                 enable_tsm=yes
951         fi
952 fi
953
954 # session dummy
955 session_dummy_enabled=no
956 if test "x$session_dummy_avail" = "xyes" ; then
957         if test "x${enable_session_dummy% *}" = "xyes" ; then
958                 session_dummy_enabled=yes
959         fi
960 fi
961
962 # font pango
963 font_pango_enabled=no
964 if test "x$font_pango_avail" = "xyes" ; then
965         if test "x${enable_font_pango% *}" = "xyes" ; then
966                 font_pango_enabled=yes
967         fi
968 fi
969
970 # font freetype2
971 font_freetype2_enabled=no
972 if test "x$font_freetype2_avail" = "xyes" ; then
973         if test "x${enable_font_freetype2% *}" = "xyes" ; then
974                 font_freetype2_enabled=yes
975         fi
976 fi
977
978 # font unifont
979 font_unifont_enabled=no
980 if test "x$font_unifont_avail" = "xyes" ; then
981         if test "x${enable_font_unifont% *}" = "xyes" ; then
982                 font_unifont_enabled=yes
983         fi
984 fi
985
986 # renderer gltex
987 renderer_gltex_enabled=no
988 if test "x$renderer_gltex_avail" = "xyes" ; then
989         if test "x${enable_renderer_gltex% *}" = "xyes" ; then
990                 renderer_gltex_enabled=yes
991         fi
992 fi
993
994 # renderer cairo
995 renderer_cairo_enabled=no
996 if test "x$renderer_cairo_avail" = "xyes" ; then
997         if test "x${enable_renderer_cairo% *}" = "xyes" ; then
998                 renderer_cairo_enabled=yes
999         fi
1000 fi
1001
1002 # renderer pixman
1003 renderer_pixman_enabled=no
1004 if test "x$renderer_pixman_avail" = "xyes" ; then
1005         if test "x${enable_renderer_pixman% *}" = "xyes" ; then
1006                 renderer_pixman_enabled=yes
1007         fi
1008 fi
1009
1010 # renderer bbulk
1011 renderer_bbulk_enabled=no
1012 if test "x$renderer_bbulk_avail" = "xyes" ; then
1013         if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
1014                 renderer_bbulk_enabled=yes
1015         fi
1016 fi
1017
1018 # hotplug
1019 hotplug_enabled=no
1020 if test "x$hotplug_avail" = "xyes" ; then
1021         if test "x${enable_hotplug% *}" = "xyes" ; then
1022                 hotplug_enabled=yes
1023         fi
1024 fi
1025
1026 # multi-seat
1027 multi_seat_enabled=no
1028 if test "x$multi_seat_avail" = "xyes" ; then
1029         if test "x${enable_multi_seat% *}" = "xyes" ; then
1030                 multi_seat_enabled=yes
1031         fi
1032 fi
1033
1034 # uterm
1035 uterm_enabled=no
1036 if test "x$uterm_avail" = "xyes" ; then
1037         if test "x${enable_uterm% *}" = "xyes" ; then
1038                 uterm_enabled=yes
1039         fi
1040 fi
1041
1042 # video drm3d
1043 video_drm3d_enabled=no
1044 if test "x$video_drm3d_avail" = "xyes" ; then
1045         if test "x${enable_video_drm3d% *}" = "xyes" ; then
1046                 video_drm3d_enabled=yes
1047         fi
1048 fi
1049
1050 # video drm2d
1051 video_drm2d_enabled=no
1052 if test "x$video_drm2d_avail" = "xyes" ; then
1053         if test "x${enable_video_drm2d% *}" = "xyes" ; then
1054                 video_drm2d_enabled=yes
1055         fi
1056 fi
1057
1058 # video fbdev
1059 video_fbdev_enabled=no
1060 if test "x$video_fbdev_avail" = "xyes" ; then
1061         if test "x${enable_video_fbdev% *}" = "xyes" ; then
1062                 video_fbdev_enabled=yes
1063         fi
1064 fi
1065
1066 # UVT
1067 uvt_enabled=no
1068 if test "x$uvt_avail" = "xyes" ; then
1069         if test "x${enable_uvt% *}" = "xyes" ; then
1070                 uvt_enabled=yes
1071         fi
1072 fi
1073
1074 # tsm
1075 tsm_enabled=no
1076 if test "x$tsm_avail" = "xyes" ; then
1077         if test "x${enable_tsm% *}" = "xyes" ; then
1078                 tsm_enabled=yes
1079         fi
1080 fi
1081
1082 # eloop
1083 eloop_enabled=no
1084 if test "x$eloop_avail" = "xyes" ; then
1085         if test "x${enable_eloop% *}" = "xyes" ; then
1086                 eloop_enabled=yes
1087         fi
1088 fi
1089
1090 # eloop-dbus
1091 eloop_dbus_enabled=no
1092 if test "x$eloop_dbus_avail" = "xyes" ; then
1093         if test "x${enable_eloop_dbus% *}" = "xyes" ; then
1094                 eloop_dbus_enabled=yes
1095         fi
1096 fi
1097
1098 # optimizations
1099 optimizations_enabled=no
1100 if test "x$optimizations_avail" = "xyes" ; then
1101         if test "x${enable_optimizations% *}" = "xyes" ; then
1102                 optimizations_enabled=yes
1103         fi
1104 fi
1105
1106 # debug
1107 debug_enabled=no
1108 if test "x$debug_avail" = "xyes" ; then
1109         if test "x${enable_debug% *}" = "xyes" ; then
1110                 debug_enabled=yes
1111         fi
1112 fi
1113
1114 #
1115 # Module Configuration
1116 # We have now done all dependency checking and default-value validation and we
1117 # now know which modules are enabled via the *_enabled variables.
1118 # Everything below is related to the configuration of each module and setting
1119 # the correct flags for the build process.
1120 #
1121
1122 # debug
1123 if test "x$debug_enabled" = "xyes" ; then
1124         AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
1125 else
1126         AC_DEFINE([NDEBUG], [1], [No Debug])
1127 fi
1128
1129 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
1130                [test "x$debug_enabled" = "xyes"])
1131
1132 # optimizations
1133 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
1134                [test "x$optimizations_enabled" = "xyes"])
1135
1136 # eloop-dbus
1137 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
1138                [test "x$eloop_dbus_enabled" = "xyes"])
1139
1140 # eloop
1141 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
1142                [test "x$eloop_enabled" = "xyes"])
1143
1144 # TSM
1145 AM_CONDITIONAL([BUILD_ENABLE_TSM],
1146                [test "x$tsm_enabled" = "xyes"])
1147
1148 # UVT
1149 AM_CONDITIONAL([BUILD_ENABLE_UVT],
1150                [test "x$uvt_enabled" = "xyes"])
1151
1152 # video fbdev
1153 if test "x$video_fbdev_enabled" = "xyes" ; then
1154         AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
1155                   [Build uterm fbdev video backend])
1156 fi
1157
1158 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
1159                [test "x$video_fbdev_enabled" = "xyes"])
1160
1161 # video drm2d
1162 if test "x$video_drm2d_enabled" = "xyes" ; then
1163         AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
1164                   [Build uterm drm2d drm3d video backend])
1165 fi
1166
1167 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
1168                [test "x$video_drm2d_enabled" = "xyes"])
1169
1170 # video drm3d
1171 if test "x$video_drm3d_enabled" = "xyes" ; then
1172         AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
1173                   [Build uterm drm3d video backend])
1174 fi
1175
1176 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
1177                [test "x$video_drm3d_enabled" = "xyes"])
1178
1179 # uterm
1180 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1181                [test "x$uterm_enabled" = "xyes"])
1182
1183 # multi-seat
1184 if test "x$multi_seat_enabled" = "xyes" ; then
1185         AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1186                   [Use systemd for multi-seat support])
1187 fi
1188
1189 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1190                [test "x$multi_seat_enabled" = "xyes"])
1191
1192 # hotplug
1193 if test "x$hotplug_enabled" = "xyes" ; then
1194         AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1195                   [Use udev for hotplug support])
1196 fi
1197
1198 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1199                [test "x$hotplug_enabled" = "xyes"])
1200
1201 # renderer bbulk
1202 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1203         AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1204                   [Build bbulk rendering backend])
1205 fi
1206
1207 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1208                [test "x$renderer_bbulk_enabled" = "xyes"])
1209
1210 # renderer gltex
1211 if test "x$renderer_gltex_enabled" = "xyes" ; then
1212         AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1213                   [Build gltex rendering backend])
1214 fi
1215
1216 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1217                [test "x$renderer_gltex_enabled" = "xyes"])
1218
1219 # renderer cairo
1220 if test "x$renderer_cairo_enabled" = "xyes" ; then
1221         AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1222                   [Build cairo rendering backend])
1223 fi
1224
1225 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1226                [test "x$renderer_cairo_enabled" = "xyes"])
1227
1228 # renderer pixman
1229 if test "x$renderer_pixman_enabled" = "xyes" ; then
1230         AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1231                   [Build pixman rendering backend])
1232 fi
1233
1234 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1235                [test "x$renderer_pixman_enabled" = "xyes"])
1236
1237 # font unifont
1238 if test "x$font_unifont_enabled" = "xyes" ; then
1239         AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1240                   [Build static unifont backend])
1241 fi
1242
1243 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1244                [test "x$font_unifont_enabled" = "xyes"])
1245
1246 # font freetype2
1247 if test "x$font_freetype2_enabled" = "xyes" ; then
1248         AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1249                   [Build freetype2 font backend])
1250 fi
1251
1252 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1253                [test "x$font_freetype2_enabled" = "xyes"])
1254
1255 # font pango
1256 if test "x$font_pango_enabled" = "xyes" ; then
1257         AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1258                   [Build pango font backend])
1259 fi
1260
1261 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1262                [test "x$font_pango_enabled" = "xyes"])
1263
1264 # session dummy
1265 if test "x$session_dummy_enabled" = "xyes" ; then
1266         AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1267                   [Build dummy session])
1268 fi
1269
1270 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1271                [test "x$session_dummy_enabled" = "xyes"])
1272
1273 # session terminal
1274 if test "x$session_terminal_enabled" = "xyes" ; then
1275         AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1276                   [Build terminal session])
1277 fi
1278
1279 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1280                [test "x$session_terminal_enabled" = "xyes"])
1281
1282 # session cdev
1283 if test "x$session_cdev_enabled" = "xyes" ; then
1284         AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1285                   [Build cdev session])
1286 fi
1287
1288 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1289                [test "x$session_cdev_enabled" = "xyes"])
1290
1291 # kmscon
1292 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1293                [test "x$kmscon_enabled" = "xyes"])
1294
1295 # wlterm
1296 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1297                [test "x$wlterm_enabled" = "xyes"])
1298
1299 # uvtd
1300 AM_CONDITIONAL([BUILD_ENABLE_UVTD],
1301                [test "x$uvtd_enabled" = "xyes"])
1302
1303 #
1304 # Miscellaneous Checks
1305 # All checks below are independent of module checking or depend on the results
1306 # of it. They do not have any dependencies themselves so they are not part of the
1307 # module infrastructure.
1308 #
1309
1310 # check for _Static_assert
1311 AC_MSG_CHECKING([whether _Static_assert() is supported])
1312 AC_LANG([C])
1313 have_static_assert=yes
1314 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1315                   [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1316                              [1],
1317                              [Define to 1 if _Static_assert() is supported])],
1318                   [have_static_assert=no])
1319 AC_MSG_RESULT([$have_static_assert])
1320
1321 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1322 if test x$have_gbm = xyes ; then
1323         save_CFLAGS="$CFLAGS"
1324         save_LIBS="$LIBS"
1325         save_LDFLAGS="$LDFLAGS"
1326         CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1327         LIBS="$DRM_LIBS $GBM_LIBS"
1328         LDFLAGS=""
1329         AC_CHECK_LIB([gbm],
1330                      [gbm_bo_get_pitch],
1331                      [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1332                                 [1],
1333                                 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1334         CFLAGS="$save_CFLAGS"
1335         LIBS="$save_LIBS"
1336         LDFLAGS="$save_LDFLAGS"
1337 fi
1338
1339 # check for xsltproc
1340 AC_PATH_PROG(XSLTPROC, xsltproc)
1341 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1342
1343 # check for offline man-pages stylesheet
1344 AC_MSG_CHECKING([for docbook manpages stylesheet])
1345 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1346 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1347                             AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1348                                   [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1349 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1350         AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1351         AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1352         AC_MSG_RESULT([yes])
1353 else
1354         AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1355         AC_MSG_RESULT([no])
1356 fi
1357
1358 #
1359 # Makefile vars
1360 # After everything is configured, we correctly substitute the values for the
1361 # makefiles.
1362 #
1363
1364 AC_CONFIG_FILES([Makefile
1365                  docs/pc/libeloop.pc
1366                  docs/pc/libtsm.pc
1367                  docs/pc/libuvt.pc
1368                  docs/pc/libuterm.pc])
1369 AC_OUTPUT
1370
1371 #
1372 # Configuration output
1373 # Show configuration to the user so they can check whether everything was
1374 # configured as expected.
1375 #
1376
1377 AC_MSG_NOTICE([Build configuration:
1378
1379                prefix: $prefix
1380           exec-prefix: $exec_prefix
1381                libdir: $libdir
1382            includedir: $includedir
1383
1384   Applications and Libraries:
1385                kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1386                wlterm: $wlterm_enabled ($wlterm_avail: $wlterm_missing)
1387                  uvtd: $uvtd_enabled ($uvtd_avail: $uvtd_missing)
1388                 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1389                   tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1390                   uvt: $uvt_enabled ($uvt_avail: $uvt_missing)
1391                 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1392
1393   Miscellaneous Options:
1394                 debug: $debug_enabled ($debug_avail: $debug_missing)
1395         optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1396            multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1397               hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1398            eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1399
1400   Video Backends:
1401                 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1402                 drm2d: $video_drm2d_enabled ($video_drm2d_avail: $video_drm2d_missing)
1403                 drm3d: $video_drm3d_enabled ($video_drm3d_avail: $video_drm3d_missing)
1404
1405   Font Backends:
1406               unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1407             freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1408                 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1409
1410   Renderers:
1411                 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1412                 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1413                 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1414                pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1415
1416   Session Types:
1417                 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1418              terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1419                  cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
1420
1421         Run "${MAKE-make}" to start compilation process])