2 # Kmscon - build configuration script
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
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)
15 AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects dist-bzip2 no-dist-gzip tar-pax -Wall -Werror])
16 AM_SILENT_RULES([yes])
19 # Don't add a default "-g -O2" if CFLAGS wasn't specified. For debugging it is
20 # often more convenient to have "-g -O0". You can still override it by
21 # explicitely setting it on the command line.
26 AC_USE_SYSTEM_EXTENSIONS
30 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
36 # pkg-config dependencies
37 # This unconditionally checks for all dependencies even if they are disabled. We
38 # later look whether all required depedencies are met and finish the
39 # configuration. We group similar packages into one logical group here to avoid
40 # having variables for each single library.
41 # This, however, makes ./configure output very unintuitive error messages if a
42 # package is not found so we must make sure we print more verbose messages
46 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
47 [have_xkbcommon=yes], [have_xkbcommon=no])
48 AC_SUBST(XKBCOMMON_CFLAGS)
49 AC_SUBST(XKBCOMMON_LIBS)
51 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server wayland-cursor],
52 [have_wayland=yes], [have_wayland=no])
53 AC_SUBST(WAYLAND_CFLAGS)
54 AC_SUBST(WAYLAND_LIBS)
56 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-login],
57 [have_systemd=yes], [have_systemd=no])
58 AC_SUBST(SYSTEMD_CFLAGS)
59 AC_SUBST(SYSTEMD_LIBS)
61 PKG_CHECK_MODULES([UDEV], [libudev],
62 [have_udev=yes], [have_udev=no])
66 PKG_CHECK_MODULES([DBUS], [dbus-1],
67 [have_dbus=yes], [have_dbus=no])
71 PKG_CHECK_MODULES([DRM], [libdrm],
72 [have_drm=yes], [have_drm=no])
76 PKG_CHECK_MODULES([GBM], [gbm],
77 [have_gbm=yes], [have_gbm=no])
81 PKG_CHECK_MODULES([EGL], [egl],
82 [have_egl=yes], [have_egl=no])
86 PKG_CHECK_MODULES([GLES2], [glesv2],
87 [have_gles2=yes], [have_gles2=no])
88 AC_SUBST(GLES2_CFLAGS)
91 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
92 [have_freetype2=yes], [have_freetype2=no])
93 AC_SUBST(FREETYPE2_CFLAGS)
94 AC_SUBST(FREETYPE2_LIBS)
96 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
97 [have_pango=yes], [have_pango=no])
98 AC_SUBST(PANGO_CFLAGS)
103 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
104 # saves the results in local variables. This does not check dependencies or
105 # similar but does only parse the arguments.
109 AC_MSG_CHECKING([whether user wants eloop])
110 AC_ARG_ENABLE([eloop],
111 [AS_HELP_STRING([--enable-eloop],
112 [build eloop library])])
113 if test "x$enable_eloop" = "x" ; then
114 enable_eloop="no (default)"
116 AC_MSG_RESULT([$enable_eloop])
119 AC_MSG_CHECKING([whether user wants TSM])
121 [AS_HELP_STRING([--enable-tsm],
122 [build tsm library])])
123 if test "x$enable_tsm" = "x" ; then
124 enable_tsm="no (default)"
126 AC_MSG_RESULT([$enable_tsm])
129 AC_MSG_CHECKING([whether user wants uterm])
130 AC_ARG_ENABLE([uterm],
131 [AS_HELP_STRING([--enable-uterm],
132 [build uterm library])])
133 if test "x$enable_uterm" = "x" ; then
134 enable_uterm="no (default)"
136 AC_MSG_RESULT([$enable_uterm])
139 AC_MSG_CHECKING([whether user wants kmscon])
140 AC_ARG_ENABLE([kmscon],
141 [AS_HELP_STRING([--disable-kmscon],
142 [do not build kmscon])])
143 if test "x$enable_kmscon" = "x" ; then
144 enable_kmscon="yes (default)"
146 AC_MSG_RESULT([$enable_kmscon])
149 AC_MSG_CHECKING([whether user wants wlterm])
150 AC_ARG_ENABLE([wlterm],
151 [AS_HELP_STRING([--enable-wlterm],
153 if test "x$enable_wlterm" = "x" ; then
154 enable_wlterm="yes (default)"
156 AC_MSG_RESULT([$enable_wlterm])
159 AC_MSG_CHECKING([whether to build with debugging on])
160 AC_ARG_ENABLE([debug],
161 [AS_HELP_STRING([--enable-debug],
162 [whether to build with debugging on])])
163 if test "x$enable_debug" = "x" ; then
164 enable_debug="yes (default)"
166 AC_MSG_RESULT([$enable_debug])
169 AC_MSG_CHECKING([whether to disable code optimizations])
170 AC_ARG_ENABLE([optimizations],
171 [AS_HELP_STRING([--disable-optimizations],
172 [whether to disable code optimizations])])
173 if test "x$enable_optimizations" = "x" ; then
174 enable_optimizations="yes (default)"
176 AC_MSG_RESULT([$enable_optimizations])
179 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
180 AC_ARG_ENABLE([multi-seat],
181 [AS_HELP_STRING([--enable-multi-seat],
182 [enable multi-seat support with systemd])])
183 if test "x$enable_multi_seat" = "x" ; then
184 enable_multi_seat="yes (default)"
186 AC_MSG_RESULT([$enable_multi_seat])
189 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
190 AC_ARG_ENABLE([hotplug],
191 [AS_HELP_STRING([--enable-hotplug],
192 [enable device hotplug support with udev])])
193 if test "x$enable_hotplug" = "x" ; then
194 enable_hotplug="yes (default)"
196 AC_MSG_RESULT([$enable_hotplug])
199 AC_MSG_CHECKING([whether user wants eloop dbus support])
200 AC_ARG_ENABLE([eloop-dbus],
201 [AS_HELP_STRING([--enable-eloop-dbus],
202 [enable eloop dbus support])])
203 if test "x$enable_eloop_dbus" = "x" ; then
204 enable_eloop_dbus="no (default)"
206 AC_MSG_RESULT([$enable_eloop_dbus])
209 AC_MSG_CHECKING([which video backends the user wants])
211 [AS_HELP_STRING([--with-video],
212 [specify list of optional video backends])])
213 enable_video_fbdev="no"
214 enable_video_dumb="no"
215 enable_video_drm="no"
216 if test "x$with_video" = "x" ; then
217 enable_video_fbdev="yes (default)"
218 enable_video_dumb="yes (default)"
219 enable_video_drm="yes (default)"
220 with_video="fbdev,dumb,drm (default)"
224 for i in $with_video ; do
225 if test "x$i" = "xfbdev" ; then
226 enable_video_fbdev="yes"
227 elif test "x$i" = "xdumb" ; then
228 enable_video_dumb="yes"
229 elif test "x$i" = "xdrm" ; then
230 enable_video_drm="yes"
233 AC_ERROR([Invalid video backend $i])
238 AC_MSG_RESULT([$with_video])
241 AC_MSG_CHECKING([which render backends the user wants])
242 AC_ARG_WITH([renderers],
243 [AS_HELP_STRING([--with-renderers],
244 [specify list of optional render backends])])
245 enable_renderer_bblit="no"
246 enable_renderer_bbulk="no"
247 enable_renderer_gltex="no"
248 if test "x$with_renderers" = "x" ; then
249 enable_renderer_bblit="yes (default)"
250 enable_renderer_bbulk="yes (default)"
251 enable_renderer_gltex="yes (default)"
252 with_renderers="bblit,bbulk,gltex (default)"
256 for i in $with_renderers ; do
257 if test "x$i" = "xbblit" ; then
258 enable_renderer_bblit="yes"
259 elif test "x$i" = "xbbulk" ; then
260 enable_renderer_bbulk="yes"
261 elif test "x$i" = "xgltex" ; then
262 enable_renderer_gltex="yes"
265 AC_ERROR([Unknown renderer $i])
270 AC_MSG_RESULT([$with_renderers])
273 AC_MSG_CHECKING([which font backends the user wants])
275 [AS_HELP_STRING([--with-fonts],
276 [specify list of optional font backends])])
277 enable_font_8x16="no"
278 enable_font_unifont="no"
279 enable_font_freetype2="no"
280 enable_font_pango="no"
281 if test "x$with_fonts" = "x" ; then
282 enable_font_8x16="yes (default)"
283 enable_font_unifont="no (default)"
284 enable_font_freetype2="yes (default)"
285 enable_font_pango="yes (default)"
286 with_fonts="8x16,freetype2,pango (default)"
290 for i in $with_fonts ; do
291 if test "x$i" = "x8x16" ; then
292 enable_font_8x16="yes"
293 elif test "x$i" = "xunifont" ; then
294 enable_font_unifont="yes"
295 elif test "x$i" = "xfreetype2" ; then
296 enable_font_freetype2="yes"
297 elif test "x$i" = "xpango" ; then
298 enable_font_pango="yes"
301 AC_ERROR([Unknown font backend $i])
306 AC_MSG_RESULT([$with_fonts])
309 AC_MSG_CHECKING([which sessions the user wants])
310 AC_ARG_WITH([sessions],
311 [AS_HELP_STRING([--with-sessions],
312 [specify list of optional sessions])])
313 enable_session_dummy="no"
314 enable_session_terminal="no"
315 enable_session_compositor="no"
316 if test "x$with_sessions" = "x" ; then
317 enable_session_dummy="yes (default)"
318 enable_session_terminal="yes (default)"
319 enable_session_compositor="no (default)"
320 with_sessions="dummy,terminal (default)"
324 for i in $with_sessions ; do
325 if test "x$i" = "xdummy" ; then
326 enable_session_dummy="yes"
327 elif test "x$i" = "xterminal" ; then
328 enable_session_terminal="yes"
329 elif test "x$i" = "xcompositor" ; then
330 enable_session_compositor="yes"
333 AC_ERROR([Unknown session type $i])
338 AC_MSG_RESULT([$with_sessions])
341 # Check what can be built
342 # This checks each configuration option and tests whether all dependencies are
343 # met. This is done from bottom up to ensure the right order.
348 if test ! "x$enable_debug" = "xno" ; then
353 optimizations_avail=no
354 if test ! "x$enable_optimizations" = "xno" ; then
355 optimizations_avail=yes
360 if test ! "x$enable_eloop_dbus" = "xno" ; then
361 if test "x$have_dbus" = "xyes" ; then
363 elif test "x$enable_eloop_dbus" = "xyes" ; then
364 AC_ERROR([DBus libraries not found for eloop-dbus])
370 if test ! "x$enable_eloop" = "xno" ; then
376 if test ! "x$enable_tsm" = "xno" ; then
377 if test "x$have_xkbcommon" = "xyes" ; then
379 elif test "x$enable_tsm" = "xyes" ; then
380 AC_ERROR([xkbcommon libraries not found for TSM])
386 if test ! "x$enable_video_fbdev" = "xno" ; then
387 # TODO: check for kernel headers
388 video_fbdev_avail=yes
393 if test ! "x$enable_video_dumb" = "xno" ; then
394 if test "x$have_drm" = "xyes" ; then
396 elif test "x$enable_video_dumb" = "xyes" ; then
397 AC_ERROR([DRM libraries not found for dumb video backend])
403 if test ! "x$enable_video_drm" = "xno" ; then
404 if test "x$have_drm" = "xno" ; then
406 elif test "x$have_gbm" = "xno" ; then
408 elif test "x$have_egl" = "xno" ; then
410 elif test "x$have_gles2" = "xno" ; then
416 if test "x$video_drm_avail" = "xno" ; then
417 if test "x$enable_video_drm" = "xyes" ; then
418 AC_ERROR([DRM, gbm or EGL libraries not found for DRM video backend])
425 if test ! "x$enable_uterm" = "xno" ; then
431 if test ! "x$enable_multi_seat" = "xno" ; then
432 if test "x$have_systemd" = "xyes" ; then
434 elif test "x$enable_multi_seat" = "xyes" ; then
435 AC_ERROR([systemd libraries not found for multi-seat support])
441 if test ! "x$enable_hotplug" = "xno" ; then
442 if test "x$have_udev" = "xyes" ; then
444 elif test "x$enable_hotplug" = "xyes" ; then
445 AC_ERROR([udev libraries not found for hotplug support])
450 renderer_bblit_avail=no
451 if test ! "x$enable_renderer_bblit" = "xno" ; then
452 renderer_bblit_avail=yes
456 renderer_bbulk_avail=no
457 if test ! "x$enable_renderer_bbulk" = "xno" ; then
458 renderer_bbulk_avail=yes
462 renderer_gltex_avail=no
463 if test ! "x$enable_renderer_gltex" = "xno" ; then
464 if test "x$have_gles2" = "xyes" ; then
465 renderer_gltex_avail=yes
466 elif test "x$enable_renderer_gltex" = "xyes" ; then
467 AC_ERROR([OpenGLESv2 libraries not found for gltex renderer])
473 if test ! "x$enable_font_8x16" = "xno" ; then
478 font_unifont_avail=no
479 if test ! "x$enable_font_unifont" = "xno" ; then
480 font_unifont_avail=yes
484 font_freetype2_avail=no
485 if test ! "x$enable_font_freetype2" = "xno" ; then
486 if test "x$have_freetype2" ; then
487 font_freetype2_avail=yes
488 elif test "x$enable_font_freetype2" = "xyes" ; then
489 AC_ERROR([freetype2 or fontconfig libs not found for freetype2 font backend])
495 if test ! "x$enable_font_pango" = "xno" ; then
496 if test "x$have_pango" ; then
498 elif test "x$enable_font_pango" = "xyes" ; then
499 AC_ERROR([pango libraries not found for pango font backend])
504 session_dummy_avail=no
505 if test ! "x$enable_session_dummy" = "xno" ; then
506 session_dummy_avail=yes
510 session_terminal_avail=no
511 if test ! "x$enable_session_terminal" = "xno" ; then
512 if test "x$tsm_avail" = "xyes" ; then
513 session_terminal_avail=yes
514 elif test "x$enable_session_terminal" = "xyes" ; then
515 AC_ERROR([TSM cannot be built for kmscon terminal session])
520 session_compositor_avail=no
521 if test ! "x$enable_session_compositor" = "xno" ; then
522 if test "x$have_wayland" = "xyes" ; then
523 session_compositor_avail=yes
524 elif test "x$enable_session_compositor" = "xyes" ; then
525 AC_ERROR([wayland libraries not found for kmscon compositor session])
531 if test ! "x$enable_kmscon" = "xno" ; then
532 if test "x$eloop_avail" = "xno" ; then
534 elif test "x$tsm_avail" = "xno" ; then
536 elif test "x$uterm_avail" = "xno" ; then
542 if test "x$enable_kmscon" = "xyes" ; then
543 if test "x$kmscon_avail" = "xno" ; then
544 AC_ERROR([eloop, TSM or uterm cannot be built for kmscon])
551 if test ! "x$enable_wlterm" = "xno" ; then
552 if test "x$tsm_avail" = "xno" ; then
554 elif test "x$eloop_avail" = "xno" ; then
560 if test "x$enable_wlterm" = "xyes" ; then
561 if test "x$wlterm_avail" = "xno" ; then
562 AC_ERROR([eloop or TSM cannot be built for wlterm])
566 if test "x$have_wayland" = "xyes" ; then
568 elif test "x$enable_wlterm" = "xyes" ; then
569 AC_ERROR([wayland libraries not found for wlterm])
574 # Enable all required modules
575 # We now know which modules can be built by checking the *_avail variables set
576 # above. We now only have to disable all modules that are disabled by default
577 # and the user didn't force-enable them and no other module that is enabled
578 # needs them. This is done top-down of course.
583 if test "x$wlterm_avail" = "xyes" ; then
584 if test "x${enable_wlterm% *}" = "xyes" ; then
593 if test "x$kmscon_avail" = "xyes" ; then
594 if test "x${enable_kmscon% *}" = "xyes" ; then
602 session_compositor_enabled=no
603 if test "x$session_compositor_avail" = "xyes" ; then
604 if test "x${enable_session_compositor% *}" = "xyes" ; then
605 session_compositor_enabled=yes
610 session_terminal_enabled=no
611 if test "x$session_terminal_avail" = "xyes" ; then
612 if test "x${enable_session_terminal% *}" = "xyes" ; then
613 session_terminal_enabled=yes
619 session_dummy_enabled=no
620 if test "x$session_dummy_avail" = "xyes" ; then
621 if test "x${enable_session_dummy% *}" = "xyes" ; then
622 session_dummy_enabled=yes
627 font_pango_enabled=no
628 if test "x$font_pango_avail" = "xyes" ; then
629 if test "x${enable_font_pango% *}" = "xyes" ; then
630 font_pango_enabled=yes
635 font_freetype2_enabled=no
636 if test "x$font_freetype2_avail" = "xyes" ; then
637 if test "x${enable_font_freetype2% *}" = "xyes" ; then
638 font_freetype2_enabled=yes
643 font_unifont_enabled=no
644 if test "x$font_unifont_avail" = "xyes" ; then
645 if test "x${enable_font_unifont% *}" = "xyes" ; then
646 font_unifont_enabled=yes
652 if test "x$font_8x16_avail" = "xyes" ; then
653 if test "x${enable_font_8x16% *}" = "xyes" ; then
654 font_8x16_enabled=yes
659 renderer_gltex_enabled=no
660 if test "x$renderer_gltex_avail" = "xyes" ; then
661 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
662 renderer_gltex_enabled=yes
667 renderer_bbulk_enabled=no
668 if test "x$renderer_bbulk_avail" = "xyes" ; then
669 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
670 renderer_bbulk_enabled=yes
675 renderer_bblit_enabled=no
676 if test "x$renderer_bblit_avail" = "xyes" ; then
677 if test "x${enable_renderer_bblit% *}" = "xyes" ; then
678 renderer_bblit_enabled=yes
684 if test "x$hotplug_avail" = "xyes" ; then
685 if test "x${enable_hotplug% *}" = "xyes" ; then
691 multi_seat_enabled=no
692 if test "x$multi_seat_avail" = "xyes" ; then
693 if test "x${enable_multi_seat% *}" = "xyes" ; then
694 multi_seat_enabled=yes
700 if test "x$uterm_avail" = "xyes" ; then
701 if test "x${enable_uterm% *}" = "xyes" ; then
708 if test "x$video_drm_avail" = "xyes" ; then
709 if test "x${enable_video_drm% *}" = "xyes" ; then
710 video_drm_enabled=yes
715 video_dumb_enabled=no
716 if test "x$video_dumb_avail" = "xyes" ; then
717 if test "x${enable_video_dumb% *}" = "xyes" ; then
718 video_dumb_enabled=yes
723 video_fbdev_enabled=no
724 if test "x$video_fbdev_avail" = "xyes" ; then
725 if test "x${enable_video_fbdev% *}" = "xyes" ; then
726 video_fbdev_enabled=yes
732 if test "x$tsm_avail" = "xyes" ; then
733 if test "x${enable_tsm% *}" = "xyes" ; then
740 if test "x$eloop_avail" = "xyes" ; then
741 if test "x${enable_eloop% *}" = "xyes" ; then
747 eloop_dbus_enabled=no
748 if test "x$eloop_dbus_avail" = "xyes" ; then
749 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
750 eloop_dbus_enabled=yes
755 optimizations_enabled=no
756 if test "x$optimizations_avail" = "xyes" ; then
757 if test "x${enable_optimizations% *}" = "xyes" ; then
758 optimizations_enabled=yes
764 if test "x$debug_avail" = "xyes" ; then
765 if test "x${enable_debug% *}" = "xyes" ; then
771 # Module Configuration
772 # We have now done all dependency checking and default-value validation and we
773 # now know which modules are enabled via the *_enabled variables.
774 # Everything below is related to the configuration of each module and setting
775 # the correct flags for the build process.
779 if test "x$debug_enabled" = "xyes" ; then
780 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
782 AC_DEFINE([NDEBUG], [1], [No Debug])
785 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
786 [test "x$debug_enabled" = "xyes"])
789 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
790 [test "x$optimizations_enabled" = "xyes"])
793 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
794 [test "x$eloop_dbus_enabled" = "xyes"])
797 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
798 [test "x$eloop_enabled" = "xyes"])
801 AM_CONDITIONAL([BUILD_ENABLE_TSM],
802 [test "x$tsm_enabled" = "xyes"])
805 if test "x$video_fbdev_enabled" = "xyes" ; then
806 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
807 [Build uterm fbdev video backend])
810 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
811 [test "x$video_fbdev_enabled" = "xyes"])
814 if test "x$video_dumb_enabled" = "xyes" ; then
815 AC_DEFINE([BUILD_ENABLE_VIDEO_DUMB], [1],
816 [Build uterm dumb drm video backend])
819 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DUMB],
820 [test "x$video_dumb_enabled" = "xyes"])
823 if test "x$video_drm_enabled" = "xyes" ; then
824 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM], [1],
825 [Build uterm drm video backend])
828 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM],
829 [test "x$video_drm_enabled" = "xyes"])
832 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
833 [test "x$uterm_enabled" = "xyes"])
836 if test "x$multi_seat_enabled" = "xyes" ; then
837 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
838 [Use systemd for multi-seat support])
841 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
842 [test "x$multi_seat_enabled" = "xyes"])
845 if test "x$hotplug_enabled" = "xyes" ; then
846 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
847 [Use udev for hotplug support])
850 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
851 [test "x$hotplug_enabled" = "xyes"])
854 if test "x$renderer_bblit_enabled" = "xyes" ; then
855 AC_DEFINE([BUILD_ENABLE_RENDERER_BBLIT], [1],
856 [Build bblit rendering backend])
859 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBLIT],
860 [test "x$renderer_bblit_enabled" = "xyes"])
863 if test "x$renderer_bbulk_enabled" = "xyes" ; then
864 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
865 [Build bbulk rendering backend])
868 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
869 [test "x$renderer_bbulk_enabled" = "xyes"])
872 if test "x$renderer_gltex_enabled" = "xyes" ; then
873 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
874 [Build gltex rendering backend])
877 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
878 [test "x$renderer_gltex_enabled" = "xyes"])
881 if test "x$font_8x16_enabled" = "xyes" ; then
882 AC_DEFINE([BUILD_ENABLE_FONT_8X16], [1],
883 [Build static 8x16 font backend])
886 AM_CONDITIONAL([BUILD_ENABLE_FONT_8X16],
887 [test "x$font_8x16_enabled" = "xyes"])
890 if test "x$font_unifont_enabled" = "xyes" ; then
891 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
892 [Build static unifont backend])
895 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
896 [test "x$font_unifont_enabled" = "xyes"])
899 if test "x$font_freetype2_enabled" = "xyes" ; then
900 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
901 [Build freetype2 font backend])
904 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
905 [test "x$font_freetype2_enabled" = "xyes"])
908 if test "x$font_pango_enabled" = "xyes" ; then
909 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
910 [Build pango font backend])
913 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
914 [test "x$font_pango_enabled" = "xyes"])
917 if test "x$session_dummy_enabled" = "xyes" ; then
918 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
919 [Build dummy session])
922 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
923 [test "x$session_dummy_enabled" = "xyes"])
926 if test "x$session_terminal_enabled" = "xyes" ; then
927 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
928 [Build terminal session])
931 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
932 [test "x$session_terminal_enabled" = "xyes"])
935 if test "x$session_compositor_enabled" = "xyes" ; then
936 AC_DEFINE([BUILD_ENABLE_SESSION_COMPOSITOR], [1],
937 [Build compositor session])
940 AM_CONDITIONAL([BUILD_ENABLE_SESSION_COMPOSITOR],
941 [test "x$session_compositor_enabled" = "xyes"])
944 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
945 [test "x$kmscon_enabled" = "xyes"])
948 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
949 [test "x$wlterm_enabled" = "xyes"])
952 # Miscellaneous Checks
953 # All checks below are independent of module checking or depend on the results
954 # of it. They do not have any dependencies themself so they are not part of the
955 # module infrastructure.
958 # check for _Static_assert
959 AC_MSG_CHECKING([whether _Static_assert() is supported])
961 have_static_assert=yes
962 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
963 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
965 [Define to 1 if _Static_assert() is supported])],
966 [have_static_assert=no])
967 AC_MSG_RESULT([$have_static_assert])
969 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
970 if test x$have_gbm = xyes ; then
971 save_CFLAGS="$CFLAGS"
973 save_LDFLAGS="$LDFLAGS"
974 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
975 LIBS="$DRM_LIBS $GBM_LIBS"
979 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
981 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
982 CFLAGS="$save_CFLAGS"
984 LDFLAGS="$save_LDFLAGS"
989 # After everything is configured, we correctly substitute the values for the
993 AC_CONFIG_FILES([Makefile
1000 # Configuration output
1001 # Show configuration to the user so they can check whether everything was
1002 # configured as expected.
1005 AC_MSG_NOTICE([Build configuration:
1007 Applications and Libraries:
1008 kmscon: $kmscon_enabled ($kmscon_avail)
1009 wlterm: $wlterm_enabled ($wlterm_avail)
1010 uterm: $uterm_enabled ($uterm_avail)
1011 tsm: $tsm_enabled ($tsm_avail)
1012 eloop: $eloop_enabled ($eloop_avail)
1014 Miscellaneous Options:
1015 debug: $debug_enabled ($debug_avail)
1016 optimizations: $optimizations_enabled ($optimizations_avail)
1017 multi-seat: $multi_seat_enabled ($multi_seat_avail)
1018 hotplug: $hotplug_enabled ($hotplug_avail)
1019 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail)
1022 fbdev: $video_fbdev_enabled ($video_fbdev_avail)
1023 dumb drm: $video_dumb_enabled ($video_dumb_avail)
1024 drm: $video_drm_enabled ($video_drm_avail)
1027 8x16: $font_8x16_enabled ($font_8x16_avail)
1028 unifont: $font_unifont_enabled ($font_unifont_avail)
1029 freetype2: $font_freetype2_enabled ($font_freetype2_avail)
1030 pango: $font_pango_enabled ($font_pango_avail)
1033 bblit: $renderer_bblit_enabled ($renderer_bblit_avail)
1034 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail)
1035 gltex: $renderer_gltex_enabled ($renderer_gltex_avail)
1038 dummy: $session_dummy_enabled ($session_dummy_avail)
1039 terminal: $session_terminal_enabled ($session_terminal_avail)
1040 compositor: $session_compositor_enabled ($session_compositor_avail)
1042 Run "make" to start compilation process])