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-bzip2 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 eloop])
133 AC_ARG_ENABLE([eloop],
134 [AS_HELP_STRING([--enable-eloop],
135 [build eloop library])])
136 if test "x$enable_eloop" = "x" ; then
137 enable_eloop="no (default)"
139 AC_MSG_RESULT([$enable_eloop])
142 AC_MSG_CHECKING([whether user wants TSM])
144 [AS_HELP_STRING([--enable-tsm],
145 [build tsm library])])
146 if test "x$enable_tsm" = "x" ; then
147 enable_tsm="no (default)"
149 AC_MSG_RESULT([$enable_tsm])
152 AC_MSG_CHECKING([whether user wants UVT])
154 [AS_HELP_STRING([--enable-uvt],
155 [build uvt library])])
156 if test "x$enable_uvt" = "x" ; then
157 enable_uvt="no (default)"
159 AC_MSG_RESULT([$enable_uvt])
162 AC_MSG_CHECKING([whether user wants uterm])
163 AC_ARG_ENABLE([uterm],
164 [AS_HELP_STRING([--enable-uterm],
165 [build uterm library])])
166 if test "x$enable_uterm" = "x" ; then
167 enable_uterm="no (default)"
169 AC_MSG_RESULT([$enable_uterm])
172 AC_MSG_CHECKING([whether user wants kmscon])
173 AC_ARG_ENABLE([kmscon],
174 [AS_HELP_STRING([--disable-kmscon],
175 [do not build kmscon])])
176 if test "x$enable_kmscon" = "x" ; then
177 enable_kmscon="yes (default)"
179 AC_MSG_RESULT([$enable_kmscon])
182 AC_MSG_CHECKING([whether user wants wlterm])
183 AC_ARG_ENABLE([wlterm],
184 [AS_HELP_STRING([--enable-wlterm],
186 if test "x$enable_wlterm" = "x" ; then
187 enable_wlterm="no (default)"
189 AC_MSG_RESULT([$enable_wlterm])
192 AC_MSG_CHECKING([whether to build with debugging on])
193 AC_ARG_ENABLE([debug],
194 [AS_HELP_STRING([--enable-debug],
195 [whether to build with debugging on])])
196 if test "x$enable_debug" = "x" ; then
197 enable_debug="yes (default)"
199 AC_MSG_RESULT([$enable_debug])
202 AC_MSG_CHECKING([whether to disable code optimizations])
203 AC_ARG_ENABLE([optimizations],
204 [AS_HELP_STRING([--disable-optimizations],
205 [whether to disable code optimizations])])
206 if test "x$enable_optimizations" = "x" ; then
207 enable_optimizations="yes (default)"
209 AC_MSG_RESULT([$enable_optimizations])
212 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
213 AC_ARG_ENABLE([multi-seat],
214 [AS_HELP_STRING([--enable-multi-seat],
215 [enable multi-seat support with systemd])])
216 if test "x$enable_multi_seat" = "x" ; then
217 enable_multi_seat="yes (default)"
219 AC_MSG_RESULT([$enable_multi_seat])
222 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
223 AC_ARG_ENABLE([hotplug],
224 [AS_HELP_STRING([--enable-hotplug],
225 [enable device hotplug support with udev])])
226 if test "x$enable_hotplug" = "x" ; then
227 enable_hotplug="yes (default)"
229 AC_MSG_RESULT([$enable_hotplug])
232 AC_MSG_CHECKING([whether user wants eloop dbus support])
233 AC_ARG_ENABLE([eloop-dbus],
234 [AS_HELP_STRING([--enable-eloop-dbus],
235 [enable eloop dbus support])])
236 if test "x$enable_eloop_dbus" = "x" ; then
237 enable_eloop_dbus="no (default)"
239 AC_MSG_RESULT([$enable_eloop_dbus])
242 AC_MSG_CHECKING([which video backends the user wants])
244 [AS_HELP_STRING([--with-video],
245 [specify list of optional video backends])])
246 enable_video_fbdev="no"
247 enable_video_drm2d="no"
248 enable_video_drm3d="no"
249 if test "x$with_video" = "x" ; then
250 enable_video_fbdev="yes (default)"
251 enable_video_drm2d="yes (default)"
252 enable_video_drm3d="yes (default)"
253 with_video="fbdev,drm2d,drm3d (default)"
257 for i in $with_video ; do
258 if test "x$i" = "xfbdev" ; then
259 enable_video_fbdev="yes"
260 elif test "x$i" = "xdrm2d" ; then
261 enable_video_drm2d="yes"
262 elif test "x$i" = "xdrm3d" ; then
263 enable_video_drm3d="yes"
266 AC_ERROR([Invalid video backend $i])
271 AC_MSG_RESULT([$with_video])
274 AC_MSG_CHECKING([which render backends the user wants])
275 AC_ARG_WITH([renderers],
276 [AS_HELP_STRING([--with-renderers],
277 [specify list of optional render backends])])
278 enable_renderer_bbulk="no"
279 enable_renderer_gltex="no"
280 enable_renderer_cairo="no"
281 enable_renderer_pixman="no"
282 if test "x$with_renderers" = "x" ; then
283 enable_renderer_bbulk="yes (default)"
284 enable_renderer_gltex="yes (default)"
285 enable_renderer_cairo="no (default)"
286 enable_renderer_pixman="no (default)"
287 with_renderers="bbulk,gltex (default)"
291 for i in $with_renderers ; do
292 if test "x$i" = "xbbulk" ; then
293 enable_renderer_bbulk="yes"
294 elif test "x$i" = "xgltex" ; then
295 enable_renderer_gltex="yes"
296 elif test "x$i" = "xcairo" ; then
297 enable_renderer_cairo="yes"
298 elif test "x$i" = "xpixman" ; then
299 enable_renderer_pixman="yes"
302 AC_ERROR([Unknown renderer $i])
307 AC_MSG_RESULT([$with_renderers])
310 AC_MSG_CHECKING([which font backends the user wants])
312 [AS_HELP_STRING([--with-fonts],
313 [specify list of optional font backends])])
314 enable_font_unifont="no"
315 enable_font_freetype2="no"
316 enable_font_pango="no"
317 if test "x$with_fonts" = "x" ; then
318 enable_font_unifont="yes (default)"
319 enable_font_freetype2="no (default)"
320 enable_font_pango="yes (default)"
321 with_fonts="unifont,pango (default)"
325 for i in $with_fonts ; do
326 if test "x$i" = "xunifont" ; then
327 enable_font_unifont="yes"
328 elif test "x$i" = "xfreetype2" ; then
329 enable_font_freetype2="yes"
330 elif test "x$i" = "xpango" ; then
331 enable_font_pango="yes"
334 AC_ERROR([Unknown font backend $i])
339 AC_MSG_RESULT([$with_fonts])
342 AC_MSG_CHECKING([which sessions the user wants])
343 AC_ARG_WITH([sessions],
344 [AS_HELP_STRING([--with-sessions],
345 [specify list of optional sessions])])
346 enable_session_dummy="no"
347 enable_session_terminal="no"
348 enable_session_cdev="no"
349 if test "x$with_sessions" = "x" ; then
350 enable_session_dummy="yes (default)"
351 enable_session_terminal="yes (default)"
352 enable_session_cdev="yes (default)"
353 with_sessions="dummy,terminal,cdev (default)"
357 for i in $with_sessions ; do
358 if test "x$i" = "xdummy" ; then
359 enable_session_dummy="yes"
360 elif test "x$i" = "xterminal" ; then
361 enable_session_terminal="yes"
362 elif test "x$i" = "xcdev" ; then
363 enable_session_cdev="yes"
366 AC_ERROR([Unknown session type $i])
371 AC_MSG_RESULT([$with_sessions])
374 # Check what can be built
375 # This checks each configuration option and tests whether all dependencies are
376 # met. This is done from bottom up to ensure the right order.
382 if test ! "x$enable_debug" = "xno" ; then
385 debug_missing="enable-debug"
389 optimizations_avail=no
390 optimizations_missing=""
391 if test ! "x$enable_optimizations" = "xno" ; then
392 optimizations_avail=yes
394 optimizations_missing="enable-optimizations"
399 eloop_dbus_missing=""
400 if test ! "x$enable_eloop_dbus" = "xno" ; then
402 if test "x$have_dbus" = "xno" ; then
404 eloop_dbus_missing="libdbus"
407 if test "x$eloop_dbus_avail" = "xno" ; then
408 if test "x$enable_eloop_dbus" = "xyes" ; then
409 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
413 eloop_dbus_missing="enable-eloop-dbus"
419 if test ! "x$enable_eloop" = "xno" ; then
422 eloop_missing="enable-eloop"
428 if test ! "x$enable_tsm" = "xno" ; then
430 if test "x$have_xkbcommon" = "xno" ; then
432 tsm_missing="libxkbcommon"
435 if test "x$tsm_avail" = "xno" ; then
436 if test "x$enable_tsm" = "xyes" ; then
437 AC_ERROR([missing for TSM: $tsm_missing])
441 tsm_missing="enable-tsm"
447 if test ! "x$enable_uvt" = "xno" ; then
449 if test "x$have_fuse" = "xno" ; then
454 if test "x$uvt_avail" = "xno" ; then
455 if test "x$enable_uvt" = "xyes" ; then
456 AC_ERROR([missing for UVT: $uvt_missing])
460 uvt_missing="enable-uvt"
465 video_fbdev_missing=""
466 if test ! "x$enable_video_fbdev" = "xno" ; then
467 # TODO: check for kernel headers
468 video_fbdev_avail=yes
470 video_fbdev_missing="enable-video-fbdev"
475 video_drm2d_missing=""
476 if test ! "x$enable_video_drm2d" = "xno" ; then
477 video_drm2d_avail=yes
478 if test "x$have_drm3d" = "xno" ; then
480 video_drm2d_missing="libdrm3d"
483 if test "x$video_drm2d_avail" = "xno" ; then
484 if test "x$enable_video_drm2d" = "xyes" ; then
485 AC_ERROR([missing for drm2d video backend: $video_drm2d_missing])
489 video_drm2d_missing="enable-video-drm2d"
494 video_drm3d_missing=""
495 if test ! "x$enable_video_drm3d" = "xno" ; then
496 video_drm3d_avail=yes
497 if test "x$have_drm3d" = "xno" ; then
499 video_drm3d_missing="libdrm3d,$video_drm3d_missing"
501 if test "x$have_gbm" = "xno" ; then
503 video_drm3d_missing="libgbm,$video_drm3d_missing"
505 if test "x$have_egl" = "xno" ; then
507 video_drm3d_missing="libegl,$video_drm3d_missing"
509 if test "x$have_gles2" = "xno" ; then
511 video_drm3d_missing="libgles2,$video_drm3d_missing"
514 if test "x$video_drm3d_avail" = "xno" ; then
515 if test "x$enable_video_drm3d" = "xyes" ; then
516 AC_ERROR([missing for drm3d video backend: $video_drm3d_missing])
520 video_drm3d_missing="enable-video-drm3d"
526 if test ! "x$enable_uterm" = "xno" ; then
529 uterm_missing="enable-uterm"
534 multi_seat_missing=""
535 if test ! "x$enable_multi_seat" = "xno" ; then
537 if test "x$have_systemd" = "xno" ; then
539 multi_seat_missing="libsystemd"
542 if test "x$multi_seat_avail" = "xno" ; then
543 if test "x$enable_multi_seat" = "xyes" ; then
544 AC_ERROR([missing for multi-seat support: $multi_seat_missing])
548 multi_seat_missing="enable-multi-seat"
554 if test ! "x$enable_hotplug" = "xno" ; then
556 if test "x$have_udev" = "xno" ; then
558 hotplug_missing="libudev"
561 if test "x$hotplug_avail" = "xno" ; then
562 if test "x$enable_hotplug" = "xyes" ; then
563 AC_ERROR([missing for hotplug-support: $hotplug_missing])
567 hotplug_missing="enable-hotplug"
571 renderer_bbulk_avail=no
572 renderer_bbulk_missing=""
573 if test ! "x$enable_renderer_bbulk" = "xno" ; then
574 renderer_bbulk_avail=yes
576 renderer_bbulk_missing="enable-renderer-bbulk"
580 renderer_gltex_avail=no
581 renderer_gltex_missing=""
582 if test ! "x$enable_renderer_gltex" = "xno" ; then
583 renderer_gltex_avail=yes
584 if test "x$have_gles2" = "xno" ; then
585 renderer_gltex_avail=no
586 renderer_gltex_missing="libgles2"
589 if test "x$renderer_gltex_avail" = "xno" ; then
590 if test "x$enable_renderer_gltex" = "xyes" ; then
591 AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
595 renderer_gltex_missing="enable-renderer-gltex"
599 renderer_cairo_avail=no
600 renderer_cairo_missing=""
601 if test ! "x$enable_renderer_cairo" = "xno" ; then
602 renderer_cairo_avail=yes
603 if test "x$have_cairo" = "xno" ; then
604 renderer_cairo_avail=no
605 renderer_cairo_missing="cairo"
608 if test "x$renderer_cairo_avail" = "xno" ; then
609 if test "x$enable_renderer_cairo" = "xyes" ; then
610 AC_ERROR([missing for renderer-cairo: $renderer_cairo_missing])
614 renderer_cairo_missing="enable-renderer-cairo"
618 renderer_pixman_avail=no
619 renderer_pixman_missing=""
620 if test ! "x$enable_renderer_pixman" = "xno" ; then
621 renderer_pixman_avail=yes
622 if test "x$have_pixman" = "xno" ; then
623 renderer_pixman_avail=no
624 renderer_pixman_missing="pixman"
627 if test "x$renderer_pixman_avail" = "xno" ; then
628 if test "x$enable_renderer_pixman" = "xyes" ; then
629 AC_ERROR([missing for renderer-pixman: $renderer_pixman_missing])
633 renderer_pixman_missing="enable-renderer-pixman"
637 font_unifont_avail=no
638 font_unifont_missing=""
639 if test ! "x$enable_font_unifont" = "xno" ; then
640 font_unifont_avail=yes
642 font_unifont_missing="enable-font-unifont"
646 font_freetype2_avail=no
647 font_freetype2_missing=""
648 if test ! "x$enable_font_freetype2" = "xno" ; then
649 font_freetype2_avail=yes
650 if test "x$have_freetype2" = "xno" ; then
651 font_freetype2_avail=no
652 font_freetype2_missing="libfontconfig,libfreetype2"
655 if test "x$font_freetype2_avail" = "xno" ; then
656 if test "x$enable_font_freetype2" = "xyes" ; then
657 AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
661 font_freetype2_missing="enable-font-freetype2"
666 font_pango_missing=""
667 if test ! "x$enable_font_pango" = "xno" ; then
669 if test "x$have_pango" = "xno" ; then
671 font_pango_missing="libpango"
674 if test "x$font_pango_avail" = "xno" ; then
675 if test "x$enable_font_pango" = "xyes" ; then
676 AC_ERROR([missing for font-pango: $font_pango_missing])
680 font_pango_missing="enable-font-pango"
684 session_dummy_avail=no
685 session_dummy_missing=""
686 if test ! "x$enable_session_dummy" = "xno" ; then
687 session_dummy_avail=yes
689 session_dummy_missing="enable-session-dummy"
693 session_terminal_avail=no
694 session_terminal_missing=""
695 if test ! "x$enable_session_terminal" = "xno" ; then
696 session_terminal_avail=yes
697 if test "x$tsm_avail" = "xno" ; then
698 session_terminal_avail=no
699 session_terminal_missing="$tsm_missing"
702 if test "x$session_terminal_avail" = "xno" ; then
703 if test "x$enable_session_terminal" = "xyes" ; then
704 AC_ERROR([missing for session-terminal: $session_terminal_missing])
708 session_terminal_missing="enable-session-terminal"
712 session_cdev_avail=no
713 session_cdev_missing=""
714 if test ! "x$enable_session_cdev" = "xno" ; then
715 session_cdev_avail=yes
716 if test "x$have_fuse" = "xno" ; then
717 session_cdev_avail=no
718 session_cdev_missing="libfuse,$session_cdev_missing"
721 if test "x$tsm_avail" = "xno" ; then
722 session_cdev_avail=no
723 session_cdev_missing="$tsm_missing,$session_cdev_missing"
726 if test "x$session_cdev_avail" = "xno" ; then
727 if test "x$enable_session_cdev" = "xyes" ; then
728 AC_ERROR([missing for session-cdev: $session_cdev_missing])
732 session_cdev_missing="enable-session-cdev"
738 if test ! "x$enable_kmscon" = "xno" ; then
740 if test "x$eloop_avail" = "xno" ; then
742 kmscon_missing="$eloop_missing,$kmscon_missing"
745 if test "x$tsm_avail" = "xno" ; then
747 kmscon_missing="$tsm_missing,$kmscon_missing"
750 if test "x$uterm_avail" = "xno" ; then
752 kmscon_missing="$uterm_missing,$kmscon_missing"
755 if test "x$kmscon_avail" = "xno" ; then
756 if test "x$enable_kmscon" = "xyes" ; then
757 AC_ERROR([missing for kmscon: $kmscon_missing])
761 kmscon_missing="enable-kmscon"
767 if test ! "x$enable_wlterm" = "xno" ; then
769 if test "x$tsm_avail" = "xno" ; then
771 wlterm_missing="$tsm_missing,$wlterm_missing"
774 if test "x$eloop_avail" = "xno" ; then
776 wlterm_missing="$eloop_missing,$wlterm_missing"
779 if test "x$font_pango_avail" = "xno" ; then
781 wlterm_missing="$font_pango_missing,$wlterm_missing"
784 if test "x$have_wayland" = "xno" ; then
786 wlterm_missing="libwayland,$wlterm_missing"
789 if test "x$wlterm_avail" = "xno" ; then
790 if test "x$enable_wlterm" = "xyes" ; then
791 AC_ERROR([missing for wlterm: $wlterm_missing])
795 wlterm_missing="enable-wlterm"
799 # Enable all required modules
800 # We now know which modules can be built by checking the *_avail variables set
801 # above. We now only have to disable all modules that are disabled by default
802 # and the user didn't force-enable them and no other module that is enabled
803 # needs them. This is done top-down of course.
808 if test "x$wlterm_avail" = "xyes" ; then
809 if test "x${enable_wlterm% *}" = "xyes" ; then
813 enable_font_pango=yes
819 if test "x$kmscon_avail" = "xyes" ; then
820 if test "x${enable_kmscon% *}" = "xyes" ; then
828 session_cdev_enabled=no
829 if test "x$session_cdev_avail" = "xyes" ; then
830 if test "x${enable_session_cdev% *}" = "xyes" ; then
831 session_cdev_enabled=yes
836 session_terminal_enabled=no
837 if test "x$session_terminal_avail" = "xyes" ; then
838 if test "x${enable_session_terminal% *}" = "xyes" ; then
839 session_terminal_enabled=yes
845 session_dummy_enabled=no
846 if test "x$session_dummy_avail" = "xyes" ; then
847 if test "x${enable_session_dummy% *}" = "xyes" ; then
848 session_dummy_enabled=yes
853 font_pango_enabled=no
854 if test "x$font_pango_avail" = "xyes" ; then
855 if test "x${enable_font_pango% *}" = "xyes" ; then
856 font_pango_enabled=yes
861 font_freetype2_enabled=no
862 if test "x$font_freetype2_avail" = "xyes" ; then
863 if test "x${enable_font_freetype2% *}" = "xyes" ; then
864 font_freetype2_enabled=yes
869 font_unifont_enabled=no
870 if test "x$font_unifont_avail" = "xyes" ; then
871 if test "x${enable_font_unifont% *}" = "xyes" ; then
872 font_unifont_enabled=yes
877 renderer_gltex_enabled=no
878 if test "x$renderer_gltex_avail" = "xyes" ; then
879 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
880 renderer_gltex_enabled=yes
885 renderer_cairo_enabled=no
886 if test "x$renderer_cairo_avail" = "xyes" ; then
887 if test "x${enable_renderer_cairo% *}" = "xyes" ; then
888 renderer_cairo_enabled=yes
893 renderer_pixman_enabled=no
894 if test "x$renderer_pixman_avail" = "xyes" ; then
895 if test "x${enable_renderer_pixman% *}" = "xyes" ; then
896 renderer_pixman_enabled=yes
901 renderer_bbulk_enabled=no
902 if test "x$renderer_bbulk_avail" = "xyes" ; then
903 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
904 renderer_bbulk_enabled=yes
910 if test "x$hotplug_avail" = "xyes" ; then
911 if test "x${enable_hotplug% *}" = "xyes" ; then
917 multi_seat_enabled=no
918 if test "x$multi_seat_avail" = "xyes" ; then
919 if test "x${enable_multi_seat% *}" = "xyes" ; then
920 multi_seat_enabled=yes
926 if test "x$uterm_avail" = "xyes" ; then
927 if test "x${enable_uterm% *}" = "xyes" ; then
933 video_drm3d_enabled=no
934 if test "x$video_drm3d_avail" = "xyes" ; then
935 if test "x${enable_video_drm3d% *}" = "xyes" ; then
936 video_drm3d_enabled=yes
941 video_drm2d_enabled=no
942 if test "x$video_drm2d_avail" = "xyes" ; then
943 if test "x${enable_video_drm2d% *}" = "xyes" ; then
944 video_drm2d_enabled=yes
949 video_fbdev_enabled=no
950 if test "x$video_fbdev_avail" = "xyes" ; then
951 if test "x${enable_video_fbdev% *}" = "xyes" ; then
952 video_fbdev_enabled=yes
958 if test "x$uvt_avail" = "xyes" ; then
959 if test "x${enable_uvt% *}" = "xyes" ; then
966 if test "x$tsm_avail" = "xyes" ; then
967 if test "x${enable_tsm% *}" = "xyes" ; then
974 if test "x$eloop_avail" = "xyes" ; then
975 if test "x${enable_eloop% *}" = "xyes" ; then
981 eloop_dbus_enabled=no
982 if test "x$eloop_dbus_avail" = "xyes" ; then
983 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
984 eloop_dbus_enabled=yes
989 optimizations_enabled=no
990 if test "x$optimizations_avail" = "xyes" ; then
991 if test "x${enable_optimizations% *}" = "xyes" ; then
992 optimizations_enabled=yes
998 if test "x$debug_avail" = "xyes" ; then
999 if test "x${enable_debug% *}" = "xyes" ; then
1005 # Module Configuration
1006 # We have now done all dependency checking and default-value validation and we
1007 # now know which modules are enabled via the *_enabled variables.
1008 # Everything below is related to the configuration of each module and setting
1009 # the correct flags for the build process.
1013 if test "x$debug_enabled" = "xyes" ; then
1014 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
1016 AC_DEFINE([NDEBUG], [1], [No Debug])
1019 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
1020 [test "x$debug_enabled" = "xyes"])
1023 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
1024 [test "x$optimizations_enabled" = "xyes"])
1027 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
1028 [test "x$eloop_dbus_enabled" = "xyes"])
1031 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
1032 [test "x$eloop_enabled" = "xyes"])
1035 AM_CONDITIONAL([BUILD_ENABLE_TSM],
1036 [test "x$tsm_enabled" = "xyes"])
1039 AM_CONDITIONAL([BUILD_ENABLE_UVT],
1040 [test "x$uvt_enabled" = "xyes"])
1043 if test "x$video_fbdev_enabled" = "xyes" ; then
1044 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
1045 [Build uterm fbdev video backend])
1048 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
1049 [test "x$video_fbdev_enabled" = "xyes"])
1052 if test "x$video_drm2d_enabled" = "xyes" ; then
1053 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
1054 [Build uterm drm2d drm3d video backend])
1057 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
1058 [test "x$video_drm2d_enabled" = "xyes"])
1061 if test "x$video_drm3d_enabled" = "xyes" ; then
1062 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
1063 [Build uterm drm3d video backend])
1066 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
1067 [test "x$video_drm3d_enabled" = "xyes"])
1070 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1071 [test "x$uterm_enabled" = "xyes"])
1074 if test "x$multi_seat_enabled" = "xyes" ; then
1075 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1076 [Use systemd for multi-seat support])
1079 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1080 [test "x$multi_seat_enabled" = "xyes"])
1083 if test "x$hotplug_enabled" = "xyes" ; then
1084 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1085 [Use udev for hotplug support])
1088 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1089 [test "x$hotplug_enabled" = "xyes"])
1092 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1093 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1094 [Build bbulk rendering backend])
1097 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1098 [test "x$renderer_bbulk_enabled" = "xyes"])
1101 if test "x$renderer_gltex_enabled" = "xyes" ; then
1102 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1103 [Build gltex rendering backend])
1106 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1107 [test "x$renderer_gltex_enabled" = "xyes"])
1110 if test "x$renderer_cairo_enabled" = "xyes" ; then
1111 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1112 [Build cairo rendering backend])
1115 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1116 [test "x$renderer_cairo_enabled" = "xyes"])
1119 if test "x$renderer_pixman_enabled" = "xyes" ; then
1120 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1121 [Build pixman rendering backend])
1124 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1125 [test "x$renderer_pixman_enabled" = "xyes"])
1128 if test "x$font_unifont_enabled" = "xyes" ; then
1129 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1130 [Build static unifont backend])
1133 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1134 [test "x$font_unifont_enabled" = "xyes"])
1137 if test "x$font_freetype2_enabled" = "xyes" ; then
1138 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1139 [Build freetype2 font backend])
1142 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1143 [test "x$font_freetype2_enabled" = "xyes"])
1146 if test "x$font_pango_enabled" = "xyes" ; then
1147 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1148 [Build pango font backend])
1151 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1152 [test "x$font_pango_enabled" = "xyes"])
1155 if test "x$session_dummy_enabled" = "xyes" ; then
1156 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1157 [Build dummy session])
1160 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1161 [test "x$session_dummy_enabled" = "xyes"])
1164 if test "x$session_terminal_enabled" = "xyes" ; then
1165 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1166 [Build terminal session])
1169 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1170 [test "x$session_terminal_enabled" = "xyes"])
1173 if test "x$session_cdev_enabled" = "xyes" ; then
1174 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1175 [Build cdev session])
1178 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1179 [test "x$session_cdev_enabled" = "xyes"])
1182 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1183 [test "x$kmscon_enabled" = "xyes"])
1186 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1187 [test "x$wlterm_enabled" = "xyes"])
1190 # Miscellaneous Checks
1191 # All checks below are independent of module checking or depend on the results
1192 # of it. They do not have any dependencies themselves so they are not part of the
1193 # module infrastructure.
1196 # check for _Static_assert
1197 AC_MSG_CHECKING([whether _Static_assert() is supported])
1199 have_static_assert=yes
1200 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1201 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1203 [Define to 1 if _Static_assert() is supported])],
1204 [have_static_assert=no])
1205 AC_MSG_RESULT([$have_static_assert])
1207 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1208 if test x$have_gbm = xyes ; then
1209 save_CFLAGS="$CFLAGS"
1211 save_LDFLAGS="$LDFLAGS"
1212 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1213 LIBS="$DRM_LIBS $GBM_LIBS"
1217 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1219 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1220 CFLAGS="$save_CFLAGS"
1222 LDFLAGS="$save_LDFLAGS"
1225 # check for xsltproc
1226 AC_PATH_PROG(XSLTPROC, xsltproc)
1227 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1229 # check for offline man-pages stylesheet
1230 AC_MSG_CHECKING([for docbook manpages stylesheet])
1231 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1232 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1233 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1234 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1235 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1236 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1237 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1238 AC_MSG_RESULT([yes])
1240 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1246 # After everything is configured, we correctly substitute the values for the
1250 AC_CONFIG_FILES([Makefile
1254 docs/pc/libuterm.pc])
1258 # Configuration output
1259 # Show configuration to the user so they can check whether everything was
1260 # configured as expected.
1263 AC_MSG_NOTICE([Build configuration:
1266 exec-prefix: $exec_prefix
1268 includedir: $includedir
1270 Applications and Libraries:
1271 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1272 wlterm: $wlterm_enabled ($wlterm_avail: $wlterm_missing)
1273 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1274 tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1275 uvt: $uvt_enabled ($uvt_avail: $uvt_missing)
1276 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1278 Miscellaneous Options:
1279 debug: $debug_enabled ($debug_avail: $debug_missing)
1280 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1281 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1282 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1283 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1286 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1287 drm2d: $video_drm2d_enabled ($video_drm2d_avail: $video_drm2d_missing)
1288 drm3d: $video_drm3d_enabled ($video_drm3d_avail: $video_drm3d_missing)
1291 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1292 freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1293 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1296 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1297 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1298 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1299 pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1302 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1303 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1304 cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
1306 Run "${MAKE-make}" to start compilation process])