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 -Wno-portability])
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
31 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
37 # pkg-config dependencies
38 # This unconditionally checks for all dependencies even if they are disabled. We
39 # later look whether all required depedencies are met and finish the
40 # configuration. We group similar packages into one logical group here to avoid
41 # having variables for each single library.
42 # This, however, makes ./configure output very unintuitive error messages if a
43 # package is not found so we must make sure we print more verbose messages
47 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
48 [have_xkbcommon=yes], [have_xkbcommon=no])
49 AC_SUBST(XKBCOMMON_CFLAGS)
50 AC_SUBST(XKBCOMMON_LIBS)
52 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server wayland-cursor],
53 [have_wayland=yes], [have_wayland=no])
54 AC_SUBST(WAYLAND_CFLAGS)
55 AC_SUBST(WAYLAND_LIBS)
57 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
58 [have_systemd=yes], [have_systemd=no])
59 AC_SUBST(SYSTEMD_CFLAGS)
60 AC_SUBST(SYSTEMD_LIBS)
62 PKG_CHECK_MODULES([UDEV], [libudev >= 172],
63 [have_udev=yes], [have_udev=no])
67 PKG_CHECK_MODULES([DBUS], [dbus-1],
68 [have_dbus=yes], [have_dbus=no])
72 PKG_CHECK_MODULES([DRM], [libdrm],
73 [have_drm=yes], [have_drm=no])
77 PKG_CHECK_MODULES([GBM], [gbm],
78 [have_gbm=yes], [have_gbm=no])
82 PKG_CHECK_MODULES([EGL], [egl],
83 [have_egl=yes], [have_egl=no])
87 PKG_CHECK_MODULES([GLES2], [glesv2],
88 [have_gles2=yes], [have_gles2=no])
89 AC_SUBST(GLES2_CFLAGS)
92 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
93 [have_freetype2=yes], [have_freetype2=no])
94 AC_SUBST(FREETYPE2_CFLAGS)
95 AC_SUBST(FREETYPE2_LIBS)
97 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
98 [have_pango=yes], [have_pango=no])
99 AC_SUBST(PANGO_CFLAGS)
102 PKG_CHECK_MODULES([FUSE], [fuse],
103 [have_fuse=yes], [have_fuse=no])
104 AC_SUBST(FUSE_CFLAGS)
107 PKG_CHECK_MODULES([CAIRO], [cairo],
108 [have_cairo=yes], [have_cairo=no])
109 AC_SUBST(CAIRO_CFLAGS)
112 PKG_CHECK_MODULES([PIXMAN], [pixman-1],
113 [have_pixman=yes], [have_pixman=no])
114 AC_SUBST(PIXMAN_CFLAGS)
115 AC_SUBST(PIXMAN_LIBS)
119 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
120 # saves the results in local variables. This does not check dependencies or
121 # similar but does only parse the arguments.
125 AC_MSG_CHECKING([whether user wants eloop])
126 AC_ARG_ENABLE([eloop],
127 [AS_HELP_STRING([--enable-eloop],
128 [build eloop library])])
129 if test "x$enable_eloop" = "x" ; then
130 enable_eloop="no (default)"
132 AC_MSG_RESULT([$enable_eloop])
135 AC_MSG_CHECKING([whether user wants TSM])
137 [AS_HELP_STRING([--enable-tsm],
138 [build tsm library])])
139 if test "x$enable_tsm" = "x" ; then
140 enable_tsm="no (default)"
142 AC_MSG_RESULT([$enable_tsm])
145 AC_MSG_CHECKING([whether user wants uterm])
146 AC_ARG_ENABLE([uterm],
147 [AS_HELP_STRING([--enable-uterm],
148 [build uterm library])])
149 if test "x$enable_uterm" = "x" ; then
150 enable_uterm="no (default)"
152 AC_MSG_RESULT([$enable_uterm])
155 AC_MSG_CHECKING([whether user wants kmscon])
156 AC_ARG_ENABLE([kmscon],
157 [AS_HELP_STRING([--disable-kmscon],
158 [do not build kmscon])])
159 if test "x$enable_kmscon" = "x" ; then
160 enable_kmscon="yes (default)"
162 AC_MSG_RESULT([$enable_kmscon])
165 AC_MSG_CHECKING([whether user wants wlterm])
166 AC_ARG_ENABLE([wlterm],
167 [AS_HELP_STRING([--enable-wlterm],
169 if test "x$enable_wlterm" = "x" ; then
170 enable_wlterm="no (default)"
172 AC_MSG_RESULT([$enable_wlterm])
175 AC_MSG_CHECKING([whether to build with debugging on])
176 AC_ARG_ENABLE([debug],
177 [AS_HELP_STRING([--enable-debug],
178 [whether to build with debugging on])])
179 if test "x$enable_debug" = "x" ; then
180 enable_debug="yes (default)"
182 AC_MSG_RESULT([$enable_debug])
185 AC_MSG_CHECKING([whether to disable code optimizations])
186 AC_ARG_ENABLE([optimizations],
187 [AS_HELP_STRING([--disable-optimizations],
188 [whether to disable code optimizations])])
189 if test "x$enable_optimizations" = "x" ; then
190 enable_optimizations="yes (default)"
192 AC_MSG_RESULT([$enable_optimizations])
195 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
196 AC_ARG_ENABLE([multi-seat],
197 [AS_HELP_STRING([--enable-multi-seat],
198 [enable multi-seat support with systemd])])
199 if test "x$enable_multi_seat" = "x" ; then
200 enable_multi_seat="yes (default)"
202 AC_MSG_RESULT([$enable_multi_seat])
205 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
206 AC_ARG_ENABLE([hotplug],
207 [AS_HELP_STRING([--enable-hotplug],
208 [enable device hotplug support with udev])])
209 if test "x$enable_hotplug" = "x" ; then
210 enable_hotplug="yes (default)"
212 AC_MSG_RESULT([$enable_hotplug])
215 AC_MSG_CHECKING([whether user wants eloop dbus support])
216 AC_ARG_ENABLE([eloop-dbus],
217 [AS_HELP_STRING([--enable-eloop-dbus],
218 [enable eloop dbus support])])
219 if test "x$enable_eloop_dbus" = "x" ; then
220 enable_eloop_dbus="no (default)"
222 AC_MSG_RESULT([$enable_eloop_dbus])
225 AC_MSG_CHECKING([which video backends the user wants])
227 [AS_HELP_STRING([--with-video],
228 [specify list of optional video backends])])
229 enable_video_fbdev="no"
230 enable_video_dumb="no"
231 enable_video_drm="no"
232 if test "x$with_video" = "x" ; then
233 enable_video_fbdev="yes (default)"
234 enable_video_dumb="yes (default)"
235 enable_video_drm="yes (default)"
236 with_video="fbdev,dumb,drm (default)"
240 for i in $with_video ; do
241 if test "x$i" = "xfbdev" ; then
242 enable_video_fbdev="yes"
243 elif test "x$i" = "xdumb" ; then
244 enable_video_dumb="yes"
245 elif test "x$i" = "xdrm" ; then
246 enable_video_drm="yes"
249 AC_ERROR([Invalid video backend $i])
254 AC_MSG_RESULT([$with_video])
257 AC_MSG_CHECKING([which render backends the user wants])
258 AC_ARG_WITH([renderers],
259 [AS_HELP_STRING([--with-renderers],
260 [specify list of optional render backends])])
261 enable_renderer_bbulk="no"
262 enable_renderer_gltex="no"
263 enable_renderer_cairo="no"
264 enable_renderer_pixman="no"
265 if test "x$with_renderers" = "x" ; then
266 enable_renderer_bbulk="yes (default)"
267 enable_renderer_gltex="yes (default)"
268 enable_renderer_cairo="no (default)"
269 enable_renderer_pixman="no (default)"
270 with_renderers="bbulk,gltex (default)"
274 for i in $with_renderers ; do
275 if test "x$i" = "xbbulk" ; then
276 enable_renderer_bbulk="yes"
277 elif test "x$i" = "xgltex" ; then
278 enable_renderer_gltex="yes"
279 elif test "x$i" = "xcairo" ; then
280 enable_renderer_cairo="yes"
281 elif test "x$i" = "xpixman" ; then
282 enable_renderer_pixman="yes"
285 AC_ERROR([Unknown renderer $i])
290 AC_MSG_RESULT([$with_renderers])
293 AC_MSG_CHECKING([which font backends the user wants])
295 [AS_HELP_STRING([--with-fonts],
296 [specify list of optional font backends])])
297 enable_font_unifont="no"
298 enable_font_freetype2="no"
299 enable_font_pango="no"
300 if test "x$with_fonts" = "x" ; then
301 enable_font_unifont="no (default)"
302 enable_font_freetype2="no (default)"
303 enable_font_pango="yes (default)"
304 with_fonts="freetype2,pango (default)"
308 for i in $with_fonts ; do
309 if test "x$i" = "xunifont" ; then
310 enable_font_unifont="yes"
311 elif test "x$i" = "xfreetype2" ; then
312 enable_font_freetype2="yes"
313 elif test "x$i" = "xpango" ; then
314 enable_font_pango="yes"
317 AC_ERROR([Unknown font backend $i])
322 AC_MSG_RESULT([$with_fonts])
325 AC_MSG_CHECKING([which sessions the user wants])
326 AC_ARG_WITH([sessions],
327 [AS_HELP_STRING([--with-sessions],
328 [specify list of optional sessions])])
329 enable_session_dummy="no"
330 enable_session_terminal="no"
331 enable_session_cdev="no"
332 if test "x$with_sessions" = "x" ; then
333 enable_session_dummy="yes (default)"
334 enable_session_terminal="yes (default)"
335 enable_session_cdev="yes (default)"
336 with_sessions="dummy,terminal,cdev (default)"
340 for i in $with_sessions ; do
341 if test "x$i" = "xdummy" ; then
342 enable_session_dummy="yes"
343 elif test "x$i" = "xterminal" ; then
344 enable_session_terminal="yes"
345 elif test "x$i" = "xcdev" ; then
346 enable_session_cdev="yes"
349 AC_ERROR([Unknown session type $i])
354 AC_MSG_RESULT([$with_sessions])
357 # Check what can be built
358 # This checks each configuration option and tests whether all dependencies are
359 # met. This is done from bottom up to ensure the right order.
365 if test ! "x$enable_debug" = "xno" ; then
368 debug_missing="enable-debug"
372 optimizations_avail=no
373 optimizations_missing=""
374 if test ! "x$enable_optimizations" = "xno" ; then
375 optimizations_avail=yes
377 optimizations_missing="enable-optimizations"
382 eloop_dbus_missing=""
383 if test ! "x$enable_eloop_dbus" = "xno" ; then
385 if test "x$have_dbus" = "xno" ; then
387 eloop_dbus_missing="libdbus"
390 if test "x$eloop_dbus_avail" = "xno" ; then
391 if test "x$enable_eloop_dbus" = "xyes" ; then
392 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
396 eloop_dbus_missing="enable-eloop-dbus"
402 if test ! "x$enable_eloop" = "xno" ; then
405 eloop_missing="enable-eloop"
411 if test ! "x$enable_tsm" = "xno" ; then
413 if test "x$have_xkbcommon" = "xno" ; then
415 tsm_missing="libxkbcommon"
418 if test "x$tsm_avail" = "xno" ; then
419 if test "x$enable_tsm" = "xyes" ; then
420 AC_ERROR([missing for TSM: $tsm_missing])
424 tsm_missing="enable-tsm"
429 video_fbdev_missing=""
430 if test ! "x$enable_video_fbdev" = "xno" ; then
431 # TODO: check for kernel headers
432 video_fbdev_avail=yes
434 video_fbdev_missing="enable-video-fbdev"
439 video_dumb_missing=""
440 if test ! "x$enable_video_dumb" = "xno" ; then
442 if test "x$have_drm" = "xno" ; then
444 video_dumb_missing="libdrm"
447 if test "x$video_dumb_avail" = "xno" ; then
448 if test "x$enable_video_dumb" = "xyes" ; then
449 AC_ERROR([missing for dumb video backend: $video_dumb_missing])
453 video_dumb_missing="enable-video-dumb"
459 if test ! "x$enable_video_drm" = "xno" ; then
461 if test "x$have_drm" = "xno" ; then
463 video_drm_missing="libdrm,$video_drm_missing"
465 if test "x$have_gbm" = "xno" ; then
467 video_drm_missing="libgbm,$video_drm_missing"
469 if test "x$have_egl" = "xno" ; then
471 video_drm_missing="libegl,$video_drm_missing"
473 if test "x$have_gles2" = "xno" ; then
475 video_drm_missing="libgles2,$video_drm_missing"
478 if test "x$video_drm_avail" = "xno" ; then
479 if test "x$enable_video_drm" = "xyes" ; then
480 AC_ERROR([missing for drm video backend: $video_drm_missing])
484 video_drm_missing="enable-video-drm"
490 if test ! "x$enable_uterm" = "xno" ; then
493 uterm_missing="enable-uterm"
498 multi_seat_missing=""
499 if test ! "x$enable_multi_seat" = "xno" ; then
501 if test "x$have_systemd" = "xno" ; then
503 multi_seat_missing="libsystemd"
506 if test "x$multi_seat_avail" = "xno" ; then
507 if test "x$enable_multi_seat" = "xyes" ; then
508 AC_ERROR([missing for multi-seat support: $multi_seat_missing])
512 multi_seat_missing="enable-multi-seat"
518 if test ! "x$enable_hotplug" = "xno" ; then
520 if test "x$have_udev" = "xno" ; then
522 hotplug_missing="libudev"
525 if test "x$hotplug_avail" = "xno" ; then
526 if test "x$enable_hotplug" = "xyes" ; then
527 AC_ERROR([missing for hotplug-support: $hotplug_missing])
531 hotplug_missing="enable-hotplug"
535 renderer_bbulk_avail=no
536 renderer_bbulk_missing=""
537 if test ! "x$enable_renderer_bbulk" = "xno" ; then
538 renderer_bbulk_avail=yes
540 renderer_bbulk_missing="enable-renderer-bbulk"
544 renderer_gltex_avail=no
545 renderer_gltex_missing=""
546 if test ! "x$enable_renderer_gltex" = "xno" ; then
547 renderer_gltex_avail=yes
548 if test "x$have_gles2" = "xno" ; then
549 renderer_gltex_avail=no
550 renderer_gltex_missing="libgles2"
553 if test "x$renderer_gltex_avail" = "xno" ; then
554 if test "x$enable_renderer_gltex" = "xyes" ; then
555 AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
559 renderer_gltex_missing="enable-renderer-gltex"
563 renderer_cairo_avail=no
564 renderer_cairo_missing=""
565 if test ! "x$enable_renderer_cairo" = "xno" ; then
566 renderer_cairo_avail=yes
567 if test "x$have_cairo" = "xno" ; then
568 renderer_cairo_avail=no
569 renderer_cairo_missing="cairo"
572 if test "x$renderer_cairo_avail" = "xno" ; then
573 if test "x$enable_renderer_cairo" = "xyes" ; then
574 AC_ERROR([missing for renderer-cairo: $renderer_cairo_missing])
578 renderer_cairo_missing="enable-renderer-cairo"
582 renderer_pixman_avail=no
583 renderer_pixman_missing=""
584 if test ! "x$enable_renderer_pixman" = "xno" ; then
585 renderer_pixman_avail=yes
586 if test "x$have_pixman" = "xno" ; then
587 renderer_pixman_avail=no
588 renderer_pixman_missing="pixman"
591 if test "x$renderer_pixman_avail" = "xno" ; then
592 if test "x$enable_renderer_pixman" = "xyes" ; then
593 AC_ERROR([missing for renderer-pixman: $renderer_pixman_missing])
597 renderer_pixman_missing="enable-renderer-pixman"
601 font_unifont_avail=no
602 font_unifont_missing=""
603 if test ! "x$enable_font_unifont" = "xno" ; then
604 font_unifont_avail=yes
606 font_unifont_missing="enable-font-unifont"
610 font_freetype2_avail=no
611 font_freetype2_missing=""
612 if test ! "x$enable_font_freetype2" = "xno" ; then
613 font_freetype2_avail=yes
614 if test "x$have_freetype2" = "xno" ; then
615 font_freetype2_avail=no
616 font_freetype2_missing="libfontconfig,libfreetype2"
619 if test "x$font_freetype2_avail" = "xno" ; then
620 if test "x$enable_font_freetype2" = "xyes" ; then
621 AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
625 font_freetype2_missing="enable-font-freetype2"
630 font_pango_missing=""
631 if test ! "x$enable_font_pango" = "xno" ; then
633 if test "x$have_pango" = "xno" ; then
635 font_pango_missing="libpango"
638 if test "x$font_pango_avail" = "xno" ; then
639 if test "x$enable_font_pango" = "xyes" ; then
640 AC_ERROR([missing for font-pango: $font_pango_missing])
644 font_pango_missing="enable-font-pango"
648 session_dummy_avail=no
649 session_dummy_missing=""
650 if test ! "x$enable_session_dummy" = "xno" ; then
651 session_dummy_avail=yes
653 session_dummy_missing="enable-session-dummy"
657 session_terminal_avail=no
658 session_terminal_missing=""
659 if test ! "x$enable_session_terminal" = "xno" ; then
660 session_terminal_avail=yes
661 if test "x$tsm_avail" = "xno" ; then
662 session_terminal_avail=no
663 session_terminal_missing="$tsm_missing"
666 if test "x$session_terminal_avail" = "xno" ; then
667 if test "x$enable_session_terminal" = "xyes" ; then
668 AC_ERROR([missing for session-terminal: $session_terminal_missing])
672 session_terminal_missing="enable-session-terminal"
676 session_cdev_avail=no
677 session_cdev_missing=""
678 if test ! "x$enable_session_cdev" = "xno" ; then
679 session_cdev_avail=yes
680 if test "x$have_fuse" = "xno" ; then
681 session_cdev_avail=no
682 session_cdev_missing="libfuse,$session_cdev_missing"
685 if test "x$tsm_avail" = "xno" ; then
686 session_cdev_avail=no
687 session_cdev_missing="$tsm_missing,$session_cdev_missing"
690 if test "x$session_cdev_avail" = "xno" ; then
691 if test "x$enable_session_cdev" = "xyes" ; then
692 AC_ERROR([missing for session-cdev: $session_cdev_missing])
696 session_cdev_missing="enable-session-cdev"
702 if test ! "x$enable_kmscon" = "xno" ; then
704 if test "x$eloop_avail" = "xno" ; then
706 kmscon_missing="$eloop_missing,$kmscon_missing"
709 if test "x$tsm_avail" = "xno" ; then
711 kmscon_missing="$tsm_missing,$kmscon_missing"
714 if test "x$uterm_avail" = "xno" ; then
716 kmscon_missing="$uterm_missing,$kmscon_missing"
719 if test "x$kmscon_avail" = "xno" ; then
720 if test "x$enable_kmscon" = "xyes" ; then
721 AC_ERROR([missing for kmscon: $kmscon_missing])
725 kmscon_missing="enable-kmscon"
731 if test ! "x$enable_wlterm" = "xno" ; then
733 if test "x$tsm_avail" = "xno" ; then
735 wlterm_missing="$tsm_missing,$wlterm_missing"
738 if test "x$eloop_avail" = "xno" ; then
740 wlterm_missing="$eloop_missing,$wlterm_missing"
743 if test "x$have_wayland" = "xno" ; then
745 wlterm_missing="libwayland,$wlterm_missing"
748 if test "x$wlterm_avail" = "xno" ; then
749 if test "x$enable_wlterm" = "xyes" ; then
750 AC_ERROR([missing for wlterm: $wlterm_missing])
754 wlterm_missing="enable-wlterm"
758 # Enable all required modules
759 # We now know which modules can be built by checking the *_avail variables set
760 # above. We now only have to disable all modules that are disabled by default
761 # and the user didn't force-enable them and no other module that is enabled
762 # needs them. This is done top-down of course.
767 if test "x$wlterm_avail" = "xyes" ; then
768 if test "x${enable_wlterm% *}" = "xyes" ; then
777 if test "x$kmscon_avail" = "xyes" ; then
778 if test "x${enable_kmscon% *}" = "xyes" ; then
786 session_cdev_enabled=no
787 if test "x$session_cdev_avail" = "xyes" ; then
788 if test "x${enable_session_cdev% *}" = "xyes" ; then
789 session_cdev_enabled=yes
794 session_terminal_enabled=no
795 if test "x$session_terminal_avail" = "xyes" ; then
796 if test "x${enable_session_terminal% *}" = "xyes" ; then
797 session_terminal_enabled=yes
803 session_dummy_enabled=no
804 if test "x$session_dummy_avail" = "xyes" ; then
805 if test "x${enable_session_dummy% *}" = "xyes" ; then
806 session_dummy_enabled=yes
811 font_pango_enabled=no
812 if test "x$font_pango_avail" = "xyes" ; then
813 if test "x${enable_font_pango% *}" = "xyes" ; then
814 font_pango_enabled=yes
819 font_freetype2_enabled=no
820 if test "x$font_freetype2_avail" = "xyes" ; then
821 if test "x${enable_font_freetype2% *}" = "xyes" ; then
822 font_freetype2_enabled=yes
827 font_unifont_enabled=no
828 if test "x$font_unifont_avail" = "xyes" ; then
829 if test "x${enable_font_unifont% *}" = "xyes" ; then
830 font_unifont_enabled=yes
835 renderer_gltex_enabled=no
836 if test "x$renderer_gltex_avail" = "xyes" ; then
837 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
838 renderer_gltex_enabled=yes
843 renderer_cairo_enabled=no
844 if test "x$renderer_cairo_avail" = "xyes" ; then
845 if test "x${enable_renderer_cairo% *}" = "xyes" ; then
846 renderer_cairo_enabled=yes
851 renderer_pixman_enabled=no
852 if test "x$renderer_pixman_avail" = "xyes" ; then
853 if test "x${enable_renderer_pixman% *}" = "xyes" ; then
854 renderer_pixman_enabled=yes
859 renderer_bbulk_enabled=no
860 if test "x$renderer_bbulk_avail" = "xyes" ; then
861 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
862 renderer_bbulk_enabled=yes
868 if test "x$hotplug_avail" = "xyes" ; then
869 if test "x${enable_hotplug% *}" = "xyes" ; then
875 multi_seat_enabled=no
876 if test "x$multi_seat_avail" = "xyes" ; then
877 if test "x${enable_multi_seat% *}" = "xyes" ; then
878 multi_seat_enabled=yes
884 if test "x$uterm_avail" = "xyes" ; then
885 if test "x${enable_uterm% *}" = "xyes" ; then
892 if test "x$video_drm_avail" = "xyes" ; then
893 if test "x${enable_video_drm% *}" = "xyes" ; then
894 video_drm_enabled=yes
899 video_dumb_enabled=no
900 if test "x$video_dumb_avail" = "xyes" ; then
901 if test "x${enable_video_dumb% *}" = "xyes" ; then
902 video_dumb_enabled=yes
907 video_fbdev_enabled=no
908 if test "x$video_fbdev_avail" = "xyes" ; then
909 if test "x${enable_video_fbdev% *}" = "xyes" ; then
910 video_fbdev_enabled=yes
916 if test "x$tsm_avail" = "xyes" ; then
917 if test "x${enable_tsm% *}" = "xyes" ; then
924 if test "x$eloop_avail" = "xyes" ; then
925 if test "x${enable_eloop% *}" = "xyes" ; then
931 eloop_dbus_enabled=no
932 if test "x$eloop_dbus_avail" = "xyes" ; then
933 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
934 eloop_dbus_enabled=yes
939 optimizations_enabled=no
940 if test "x$optimizations_avail" = "xyes" ; then
941 if test "x${enable_optimizations% *}" = "xyes" ; then
942 optimizations_enabled=yes
948 if test "x$debug_avail" = "xyes" ; then
949 if test "x${enable_debug% *}" = "xyes" ; then
955 # Module Configuration
956 # We have now done all dependency checking and default-value validation and we
957 # now know which modules are enabled via the *_enabled variables.
958 # Everything below is related to the configuration of each module and setting
959 # the correct flags for the build process.
963 if test "x$debug_enabled" = "xyes" ; then
964 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
966 AC_DEFINE([NDEBUG], [1], [No Debug])
969 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
970 [test "x$debug_enabled" = "xyes"])
973 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
974 [test "x$optimizations_enabled" = "xyes"])
977 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
978 [test "x$eloop_dbus_enabled" = "xyes"])
981 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
982 [test "x$eloop_enabled" = "xyes"])
985 AM_CONDITIONAL([BUILD_ENABLE_TSM],
986 [test "x$tsm_enabled" = "xyes"])
989 if test "x$video_fbdev_enabled" = "xyes" ; then
990 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
991 [Build uterm fbdev video backend])
994 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
995 [test "x$video_fbdev_enabled" = "xyes"])
998 if test "x$video_dumb_enabled" = "xyes" ; then
999 AC_DEFINE([BUILD_ENABLE_VIDEO_DUMB], [1],
1000 [Build uterm dumb drm video backend])
1003 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DUMB],
1004 [test "x$video_dumb_enabled" = "xyes"])
1007 if test "x$video_drm_enabled" = "xyes" ; then
1008 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM], [1],
1009 [Build uterm drm video backend])
1012 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM],
1013 [test "x$video_drm_enabled" = "xyes"])
1016 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1017 [test "x$uterm_enabled" = "xyes"])
1020 if test "x$multi_seat_enabled" = "xyes" ; then
1021 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1022 [Use systemd for multi-seat support])
1025 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1026 [test "x$multi_seat_enabled" = "xyes"])
1029 if test "x$hotplug_enabled" = "xyes" ; then
1030 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1031 [Use udev for hotplug support])
1034 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1035 [test "x$hotplug_enabled" = "xyes"])
1038 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1039 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1040 [Build bbulk rendering backend])
1043 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1044 [test "x$renderer_bbulk_enabled" = "xyes"])
1047 if test "x$renderer_gltex_enabled" = "xyes" ; then
1048 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1049 [Build gltex rendering backend])
1052 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1053 [test "x$renderer_gltex_enabled" = "xyes"])
1056 if test "x$renderer_cairo_enabled" = "xyes" ; then
1057 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1058 [Build cairo rendering backend])
1061 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1062 [test "x$renderer_cairo_enabled" = "xyes"])
1065 if test "x$renderer_pixman_enabled" = "xyes" ; then
1066 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1067 [Build pixman rendering backend])
1070 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1071 [test "x$renderer_pixman_enabled" = "xyes"])
1074 if test "x$font_unifont_enabled" = "xyes" ; then
1075 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1076 [Build static unifont backend])
1079 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1080 [test "x$font_unifont_enabled" = "xyes"])
1083 if test "x$font_freetype2_enabled" = "xyes" ; then
1084 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1085 [Build freetype2 font backend])
1088 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1089 [test "x$font_freetype2_enabled" = "xyes"])
1092 if test "x$font_pango_enabled" = "xyes" ; then
1093 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1094 [Build pango font backend])
1097 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1098 [test "x$font_pango_enabled" = "xyes"])
1101 if test "x$session_dummy_enabled" = "xyes" ; then
1102 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1103 [Build dummy session])
1106 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1107 [test "x$session_dummy_enabled" = "xyes"])
1110 if test "x$session_terminal_enabled" = "xyes" ; then
1111 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1112 [Build terminal session])
1115 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1116 [test "x$session_terminal_enabled" = "xyes"])
1119 if test "x$session_cdev_enabled" = "xyes" ; then
1120 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1121 [Build cdev session])
1124 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1125 [test "x$session_cdev_enabled" = "xyes"])
1128 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1129 [test "x$kmscon_enabled" = "xyes"])
1132 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1133 [test "x$wlterm_enabled" = "xyes"])
1136 # Miscellaneous Checks
1137 # All checks below are independent of module checking or depend on the results
1138 # of it. They do not have any dependencies themself so they are not part of the
1139 # module infrastructure.
1142 # check for _Static_assert
1143 AC_MSG_CHECKING([whether _Static_assert() is supported])
1145 have_static_assert=yes
1146 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1147 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1149 [Define to 1 if _Static_assert() is supported])],
1150 [have_static_assert=no])
1151 AC_MSG_RESULT([$have_static_assert])
1153 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1154 if test x$have_gbm = xyes ; then
1155 save_CFLAGS="$CFLAGS"
1157 save_LDFLAGS="$LDFLAGS"
1158 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1159 LIBS="$DRM_LIBS $GBM_LIBS"
1163 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1165 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1166 CFLAGS="$save_CFLAGS"
1168 LDFLAGS="$save_LDFLAGS"
1171 # check for xsltproc
1172 AC_PATH_PROG(XSLTPROC, xsltproc)
1173 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1175 # check for offline man-pages stylesheet
1176 AC_MSG_CHECKING([for docbook manpages stylesheet])
1177 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1178 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1179 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1180 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1181 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1182 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1183 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1184 AC_MSG_RESULT([yes])
1186 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1192 # After everything is configured, we correctly substitute the values for the
1196 AC_CONFIG_FILES([Makefile
1199 docs/pc/libuterm.pc])
1203 # Configuration output
1204 # Show configuration to the user so they can check whether everything was
1205 # configured as expected.
1208 AC_MSG_NOTICE([Build configuration:
1211 exec-prefix: $exec_prefix
1213 includedir: $includedir
1215 Applications and Libraries:
1216 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1217 wlterm: $wlterm_enabled ($wlterm_avail: $wlterm_missing)
1218 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1219 tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1220 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1222 Miscellaneous Options:
1223 debug: $debug_enabled ($debug_avail: $debug_missing)
1224 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1225 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1226 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1227 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1230 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1231 dumb drm: $video_dumb_enabled ($video_dumb_avail: $video_dumb_missing)
1232 drm: $video_drm_enabled ($video_drm_avail: $video_drm_missing)
1235 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1236 freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1237 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1240 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1241 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1242 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1243 pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1246 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1247 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1248 cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
1250 Run "${MAKE-make}" to start compilation process])