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)
14 AC_USE_SYSTEM_EXTENSIONS
16 AC_PREFIX_DEFAULT([/usr])
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])
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.
33 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
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
54 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
55 [have_xkbcommon=yes], [have_xkbcommon=no])
56 AC_SUBST(XKBCOMMON_CFLAGS)
57 AC_SUBST(XKBCOMMON_LIBS)
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)
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)
69 PKG_CHECK_MODULES([UDEV], [libudev >= 172],
70 [have_udev=yes], [have_udev=no])
74 PKG_CHECK_MODULES([DBUS], [dbus-1],
75 [have_dbus=yes], [have_dbus=no])
79 PKG_CHECK_MODULES([DRM], [libdrm],
80 [have_drm=yes], [have_drm=no])
84 PKG_CHECK_MODULES([GBM], [gbm],
85 [have_gbm=yes], [have_gbm=no])
89 PKG_CHECK_MODULES([EGL], [egl],
90 [have_egl=yes], [have_egl=no])
94 PKG_CHECK_MODULES([GLES2], [glesv2],
95 [have_gles2=yes], [have_gles2=no])
96 AC_SUBST(GLES2_CFLAGS)
99 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
100 [have_freetype2=yes], [have_freetype2=no])
101 AC_SUBST(FREETYPE2_CFLAGS)
102 AC_SUBST(FREETYPE2_LIBS)
104 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
105 [have_pango=yes], [have_pango=no])
106 AC_SUBST(PANGO_CFLAGS)
109 PKG_CHECK_MODULES([FUSE], [fuse >= 2.9.0],
110 [have_fuse=yes], [have_fuse=no])
111 AC_SUBST(FUSE_CFLAGS)
114 PKG_CHECK_MODULES([CAIRO], [cairo],
115 [have_cairo=yes], [have_cairo=no])
116 AC_SUBST(CAIRO_CFLAGS)
119 PKG_CHECK_MODULES([PIXMAN], [pixman-1],
120 [have_pixman=yes], [have_pixman=no])
121 AC_SUBST(PIXMAN_CFLAGS)
122 AC_SUBST(PIXMAN_LIBS)
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.
132 AC_MSG_CHECKING([whether user wants all])
134 [AS_HELP_STRING([--enable-all],
135 [enable all options (used for debugging)])])
136 if test "x$enable_all" = "x" ; then
139 AC_MSG_RESULT([$enable_all])
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
148 elif test "x$enable_eloop" = "x" ; then
149 enable_eloop="no (default)"
151 AC_MSG_RESULT([$enable_eloop])
154 AC_MSG_CHECKING([whether user wants TSM])
156 [AS_HELP_STRING([--enable-tsm],
157 [build tsm library])])
158 if test "x$enable_all" = "xyes" ; then
160 elif test "x$enable_tsm" = "x" ; then
161 enable_tsm="no (default)"
163 AC_MSG_RESULT([$enable_tsm])
166 AC_MSG_CHECKING([whether user wants UVT])
168 [AS_HELP_STRING([--enable-uvt],
169 [build uvt library])])
170 if test "x$enable_all" = "xyes" ; then
172 elif test "x$enable_uvt" = "x" ; then
173 enable_uvt="no (default)"
175 AC_MSG_RESULT([$enable_uvt])
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
184 elif test "x$enable_uterm" = "x" ; then
185 enable_uterm="no (default)"
187 AC_MSG_RESULT([$enable_uterm])
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
196 elif test "x$enable_kmscon" = "x" ; then
197 enable_kmscon="yes (default)"
199 AC_MSG_RESULT([$enable_kmscon])
202 AC_MSG_CHECKING([whether user wants wlterm])
203 AC_ARG_ENABLE([wlterm],
204 [AS_HELP_STRING([--enable-wlterm],
206 if test "x$enable_all" = "xyes" ; then
208 elif test "x$enable_wlterm" = "x" ; then
209 enable_wlterm="no (default)"
211 AC_MSG_RESULT([$enable_wlterm])
214 AC_MSG_CHECKING([whether user wants uvtd])
215 AC_ARG_ENABLE([uvtd],
216 [AS_HELP_STRING([--enable-uvtd],
218 if test "x$enable_all" = "xyes" ; then
220 elif test "x$enable_uvtd" = "x" ; then
221 enable_uvtd="no (default)"
223 AC_MSG_RESULT([$enable_uvtd])
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
232 elif test "x$enable_debug" = "x" ; then
233 enable_debug="yes (default)"
235 AC_MSG_RESULT([$enable_debug])
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)"
247 AC_MSG_RESULT([$enable_optimizations])
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)"
259 AC_MSG_RESULT([$enable_multi_seat])
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
268 elif test "x$enable_hotplug" = "x" ; then
269 enable_hotplug="yes (default)"
271 AC_MSG_RESULT([$enable_hotplug])
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)"
283 AC_MSG_RESULT([$enable_eloop_dbus])
286 AC_MSG_CHECKING([which video backends the user wants])
288 [AS_HELP_STRING([--with-video],
289 [specify list of optional video backends])],
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
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"
317 AC_ERROR([Invalid video backend $i])
322 AC_MSG_RESULT([$with_video])
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])],
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
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"
361 AC_ERROR([Unknown renderer $i])
366 AC_MSG_RESULT([$with_renderers])
369 AC_MSG_CHECKING([which font backends the user wants])
371 [AS_HELP_STRING([--with-fonts],
372 [specify list of optional font backends])],
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
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"
400 AC_ERROR([Unknown font backend $i])
405 AC_MSG_RESULT([$with_fonts])
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])],
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
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"
439 AC_ERROR([Unknown session type $i])
444 AC_MSG_RESULT([$with_sessions])
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.
455 if test ! "x$enable_debug" = "xno" ; then
458 debug_missing="enable-debug"
462 optimizations_avail=no
463 optimizations_missing=""
464 if test ! "x$enable_optimizations" = "xno" ; then
465 optimizations_avail=yes
467 optimizations_missing="enable-optimizations"
472 eloop_dbus_missing=""
473 if test ! "x$enable_eloop_dbus" = "xno" ; then
475 if test "x$have_dbus" = "xno" ; then
477 eloop_dbus_missing="libdbus"
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])
486 eloop_dbus_missing="enable-eloop-dbus"
492 if test ! "x$enable_eloop" = "xno" ; then
495 eloop_missing="enable-eloop"
501 if test ! "x$enable_tsm" = "xno" ; then
503 if test "x$have_xkbcommon" = "xno" ; then
505 tsm_missing="libxkbcommon"
508 if test "x$tsm_avail" = "xno" ; then
509 if test "x$enable_tsm" = "xyes" ; then
510 AC_ERROR([missing for TSM: $tsm_missing])
514 tsm_missing="enable-tsm"
520 if test ! "x$enable_uvt" = "xno" ; then
522 if test "x$have_fuse" = "xno" ; then
527 if test "x$uvt_avail" = "xno" ; then
528 if test "x$enable_uvt" = "xyes" ; then
529 AC_ERROR([missing for UVT: $uvt_missing])
533 uvt_missing="enable-uvt"
538 video_fbdev_missing=""
539 if test ! "x$enable_video_fbdev" = "xno" ; then
540 # TODO: check for kernel headers
541 video_fbdev_avail=yes
543 video_fbdev_missing="enable-video-fbdev"
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
553 video_drm2d_missing="libdrm3d"
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])
562 video_drm2d_missing="enable-video-drm2d"
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
572 video_drm3d_missing="libdrm3d,$video_drm3d_missing"
574 if test "x$have_gbm" = "xno" ; then
576 video_drm3d_missing="libgbm,$video_drm3d_missing"
578 if test "x$have_egl" = "xno" ; then
580 video_drm3d_missing="libegl,$video_drm3d_missing"
582 if test "x$have_gles2" = "xno" ; then
584 video_drm3d_missing="libgles2,$video_drm3d_missing"
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])
593 video_drm3d_missing="enable-video-drm3d"
599 if test ! "x$enable_uterm" = "xno" ; then
602 uterm_missing="enable-uterm"
607 multi_seat_missing=""
608 if test ! "x$enable_multi_seat" = "xno" ; then
610 if test "x$have_systemd" = "xno" ; then
612 multi_seat_missing="libsystemd"
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])
621 multi_seat_missing="enable-multi-seat"
627 if test ! "x$enable_hotplug" = "xno" ; then
629 if test "x$have_udev" = "xno" ; then
631 hotplug_missing="libudev"
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])
640 hotplug_missing="enable-hotplug"
644 renderer_bbulk_avail=no
645 renderer_bbulk_missing=""
646 if test ! "x$enable_renderer_bbulk" = "xno" ; then
647 renderer_bbulk_avail=yes
649 renderer_bbulk_missing="enable-renderer-bbulk"
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"
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])
668 renderer_gltex_missing="enable-renderer-gltex"
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"
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])
687 renderer_cairo_missing="enable-renderer-cairo"
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"
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])
706 renderer_pixman_missing="enable-renderer-pixman"
710 font_unifont_avail=no
711 font_unifont_missing=""
712 if test ! "x$enable_font_unifont" = "xno" ; then
713 font_unifont_avail=yes
715 font_unifont_missing="enable-font-unifont"
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"
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])
734 font_freetype2_missing="enable-font-freetype2"
739 font_pango_missing=""
740 if test ! "x$enable_font_pango" = "xno" ; then
742 if test "x$have_pango" = "xno" ; then
744 font_pango_missing="libpango"
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])
753 font_pango_missing="enable-font-pango"
757 session_dummy_avail=no
758 session_dummy_missing=""
759 if test ! "x$enable_session_dummy" = "xno" ; then
760 session_dummy_avail=yes
762 session_dummy_missing="enable-session-dummy"
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"
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])
781 session_terminal_missing="enable-session-terminal"
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"
794 if test "x$tsm_avail" = "xno" ; then
795 session_cdev_avail=no
796 session_cdev_missing="$tsm_missing,$session_cdev_missing"
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])
805 session_cdev_missing="enable-session-cdev"
811 if test ! "x$enable_kmscon" = "xno" ; then
813 if test "x$eloop_avail" = "xno" ; then
815 kmscon_missing="$eloop_missing,$kmscon_missing"
818 if test "x$tsm_avail" = "xno" ; then
820 kmscon_missing="$tsm_missing,$kmscon_missing"
823 if test "x$uterm_avail" = "xno" ; then
825 kmscon_missing="$uterm_missing,$kmscon_missing"
828 if test "x$kmscon_avail" = "xno" ; then
829 if test "x$enable_kmscon" = "xyes" ; then
830 AC_ERROR([missing for kmscon: $kmscon_missing])
834 kmscon_missing="enable-kmscon"
840 if test ! "x$enable_wlterm" = "xno" ; then
842 if test "x$tsm_avail" = "xno" ; then
844 wlterm_missing="$tsm_missing,$wlterm_missing"
847 if test "x$eloop_avail" = "xno" ; then
849 wlterm_missing="$eloop_missing,$wlterm_missing"
852 if test "x$font_pango_avail" = "xno" ; then
854 wlterm_missing="$font_pango_missing,$wlterm_missing"
857 if test "x$have_wayland" = "xno" ; then
859 wlterm_missing="libwayland,$wlterm_missing"
862 if test "x$wlterm_avail" = "xno" ; then
863 if test "x$enable_wlterm" = "xyes" ; then
864 AC_ERROR([missing for wlterm: $wlterm_missing])
868 wlterm_missing="enable-wlterm"
874 if test ! "x$enable_uvtd" = "xno" ; then
876 if test "x$uvt_avail" = "xno" ; then
878 uvtd_missing="$uvt_missing,$uvtd_missing"
881 if test "x$eloop_avail" = "xno" ; then
883 uvtd_missing="$eloop_missing,$uvtd_missing"
886 if test "x$uvtd_avail" = "xno" ; then
887 if test "x$enable_uvtd" = "xyes" ; then
888 AC_ERROR([missing for uvtd: $uvtd_missing])
892 uvtd_missing="enable-uvtd"
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.
905 if test "x$uvtd_avail" = "xyes" ; then
906 if test "x${enable_uvtd% *}" = "xyes" ; then
915 if test "x$wlterm_avail" = "xyes" ; then
916 if test "x${enable_wlterm% *}" = "xyes" ; then
920 enable_font_pango=yes
926 if test "x$kmscon_avail" = "xyes" ; then
927 if test "x${enable_kmscon% *}" = "xyes" ; then
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
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
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
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
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
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
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
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
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
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
1017 if test "x$hotplug_avail" = "xyes" ; then
1018 if test "x${enable_hotplug% *}" = "xyes" ; then
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
1033 if test "x$uterm_avail" = "xyes" ; then
1034 if test "x${enable_uterm% *}" = "xyes" ; then
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
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
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
1065 if test "x$uvt_avail" = "xyes" ; then
1066 if test "x${enable_uvt% *}" = "xyes" ; then
1073 if test "x$tsm_avail" = "xyes" ; then
1074 if test "x${enable_tsm% *}" = "xyes" ; then
1081 if test "x$eloop_avail" = "xyes" ; then
1082 if test "x${enable_eloop% *}" = "xyes" ; then
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
1096 optimizations_enabled=no
1097 if test "x$optimizations_avail" = "xyes" ; then
1098 if test "x${enable_optimizations% *}" = "xyes" ; then
1099 optimizations_enabled=yes
1105 if test "x$debug_avail" = "xyes" ; then
1106 if test "x${enable_debug% *}" = "xyes" ; then
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.
1120 if test "x$debug_enabled" = "xyes" ; then
1121 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
1123 AC_DEFINE([NDEBUG], [1], [No Debug])
1126 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
1127 [test "x$debug_enabled" = "xyes"])
1130 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
1131 [test "x$optimizations_enabled" = "xyes"])
1134 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
1135 [test "x$eloop_dbus_enabled" = "xyes"])
1138 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
1139 [test "x$eloop_enabled" = "xyes"])
1142 AM_CONDITIONAL([BUILD_ENABLE_TSM],
1143 [test "x$tsm_enabled" = "xyes"])
1146 AM_CONDITIONAL([BUILD_ENABLE_UVT],
1147 [test "x$uvt_enabled" = "xyes"])
1150 if test "x$video_fbdev_enabled" = "xyes" ; then
1151 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
1152 [Build uterm fbdev video backend])
1155 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
1156 [test "x$video_fbdev_enabled" = "xyes"])
1159 if test "x$video_drm2d_enabled" = "xyes" ; then
1160 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
1161 [Build uterm drm2d drm3d video backend])
1164 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
1165 [test "x$video_drm2d_enabled" = "xyes"])
1168 if test "x$video_drm3d_enabled" = "xyes" ; then
1169 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
1170 [Build uterm drm3d video backend])
1173 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
1174 [test "x$video_drm3d_enabled" = "xyes"])
1177 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1178 [test "x$uterm_enabled" = "xyes"])
1181 if test "x$multi_seat_enabled" = "xyes" ; then
1182 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1183 [Use systemd for multi-seat support])
1186 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1187 [test "x$multi_seat_enabled" = "xyes"])
1190 if test "x$hotplug_enabled" = "xyes" ; then
1191 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1192 [Use udev for hotplug support])
1195 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1196 [test "x$hotplug_enabled" = "xyes"])
1199 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1200 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1201 [Build bbulk rendering backend])
1204 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1205 [test "x$renderer_bbulk_enabled" = "xyes"])
1208 if test "x$renderer_gltex_enabled" = "xyes" ; then
1209 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1210 [Build gltex rendering backend])
1213 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1214 [test "x$renderer_gltex_enabled" = "xyes"])
1217 if test "x$renderer_cairo_enabled" = "xyes" ; then
1218 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1219 [Build cairo rendering backend])
1222 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1223 [test "x$renderer_cairo_enabled" = "xyes"])
1226 if test "x$renderer_pixman_enabled" = "xyes" ; then
1227 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1228 [Build pixman rendering backend])
1231 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1232 [test "x$renderer_pixman_enabled" = "xyes"])
1235 if test "x$font_unifont_enabled" = "xyes" ; then
1236 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1237 [Build static unifont backend])
1240 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1241 [test "x$font_unifont_enabled" = "xyes"])
1244 if test "x$font_freetype2_enabled" = "xyes" ; then
1245 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1246 [Build freetype2 font backend])
1249 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1250 [test "x$font_freetype2_enabled" = "xyes"])
1253 if test "x$font_pango_enabled" = "xyes" ; then
1254 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1255 [Build pango font backend])
1258 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1259 [test "x$font_pango_enabled" = "xyes"])
1262 if test "x$session_dummy_enabled" = "xyes" ; then
1263 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1264 [Build dummy session])
1267 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1268 [test "x$session_dummy_enabled" = "xyes"])
1271 if test "x$session_terminal_enabled" = "xyes" ; then
1272 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1273 [Build terminal session])
1276 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1277 [test "x$session_terminal_enabled" = "xyes"])
1280 if test "x$session_cdev_enabled" = "xyes" ; then
1281 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1282 [Build cdev session])
1285 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1286 [test "x$session_cdev_enabled" = "xyes"])
1289 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1290 [test "x$kmscon_enabled" = "xyes"])
1293 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1294 [test "x$wlterm_enabled" = "xyes"])
1297 AM_CONDITIONAL([BUILD_ENABLE_UVTD],
1298 [test "x$uvtd_enabled" = "xyes"])
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.
1307 # check for _Static_assert
1308 AC_MSG_CHECKING([whether _Static_assert() is supported])
1310 have_static_assert=yes
1311 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1312 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1314 [Define to 1 if _Static_assert() is supported])],
1315 [have_static_assert=no])
1316 AC_MSG_RESULT([$have_static_assert])
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"
1322 save_LDFLAGS="$LDFLAGS"
1323 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1324 LIBS="$DRM_LIBS $GBM_LIBS"
1328 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1330 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1331 CFLAGS="$save_CFLAGS"
1333 LDFLAGS="$save_LDFLAGS"
1336 # check for xsltproc
1337 AC_PATH_PROG(XSLTPROC, xsltproc)
1338 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
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])
1351 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1357 # After everything is configured, we correctly substitute the values for the
1361 AC_CONFIG_FILES([Makefile
1365 docs/pc/libuterm.pc])
1369 # Configuration output
1370 # Show configuration to the user so they can check whether everything was
1371 # configured as expected.
1374 AC_MSG_NOTICE([Build configuration:
1377 exec-prefix: $exec_prefix
1379 includedir: $includedir
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)
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)
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)
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)
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)
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)
1418 Run "${MAKE-make}" to start compilation process])