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