2 # Kmscon - build configuration script
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
10 [http://bugs.freedesktop.org/enter_bug.cgi?product=kmscon],
12 [http://www.freedesktop.org/wiki/Software/kmscon])
13 AC_CONFIG_SRCDIR([src/kmscon_main.c])
14 AC_CONFIG_AUX_DIR([build-aux])
15 AC_CONFIG_MACRO_DIR([m4])
16 AC_CONFIG_HEADER(config.h)
17 AC_USE_SYSTEM_EXTENSIONS
19 AC_PREFIX_DEFAULT([/usr])
22 AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects dist-xz no-dist-gzip tar-pax -Wall -Werror -Wno-portability])
23 AM_SILENT_RULES([yes])
26 # Don't add a default "-g -O2" if CFLAGS wasn't specified. For debugging it is
27 # often more convenient to have "-g -O0". You can still override it by
28 # explicitly setting it on the command line.
36 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
47 # pkg-config dependencies
48 # This unconditionally checks for all dependencies even if they are disabled. We
49 # later look whether all required depedencies are met and finish the
50 # configuration. We group similar packages into one logical group here to avoid
51 # having variables for each single library.
52 # This, however, makes ./configure output very unintuitive error messages if a
53 # package is not found so we must make sure we print more verbose messages
57 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
58 [have_xkbcommon=yes], [have_xkbcommon=no])
59 AC_SUBST(XKBCOMMON_CFLAGS)
60 AC_SUBST(XKBCOMMON_LIBS)
62 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server wayland-cursor],
63 [have_wayland=yes], [have_wayland=no])
64 AC_SUBST(WAYLAND_CFLAGS)
65 AC_SUBST(WAYLAND_LIBS)
67 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
68 [have_systemd=yes], [have_systemd=no])
69 AC_SUBST(SYSTEMD_CFLAGS)
70 AC_SUBST(SYSTEMD_LIBS)
72 PKG_CHECK_MODULES([UDEV], [libudev >= 172],
73 [have_udev=yes], [have_udev=no])
77 PKG_CHECK_MODULES([DBUS], [dbus-1],
78 [have_dbus=yes], [have_dbus=no])
82 PKG_CHECK_MODULES([DRM], [libdrm],
83 [have_drm=yes], [have_drm=no])
87 PKG_CHECK_MODULES([GBM], [gbm],
88 [have_gbm=yes], [have_gbm=no])
92 PKG_CHECK_MODULES([EGL], [egl],
93 [have_egl=yes], [have_egl=no])
97 PKG_CHECK_MODULES([GLES2], [glesv2],
98 [have_gles2=yes], [have_gles2=no])
99 AC_SUBST(GLES2_CFLAGS)
102 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
103 [have_freetype2=yes], [have_freetype2=no])
104 AC_SUBST(FREETYPE2_CFLAGS)
105 AC_SUBST(FREETYPE2_LIBS)
107 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
108 [have_pango=yes], [have_pango=no])
109 AC_SUBST(PANGO_CFLAGS)
112 PKG_CHECK_MODULES([FUSE], [fuse >= 2.9.0],
113 [have_fuse=yes], [have_fuse=no])
114 AC_SUBST(FUSE_CFLAGS)
117 PKG_CHECK_MODULES([CAIRO], [cairo],
118 [have_cairo=yes], [have_cairo=no])
119 AC_SUBST(CAIRO_CFLAGS)
122 PKG_CHECK_MODULES([PIXMAN], [pixman-1],
123 [have_pixman=yes], [have_pixman=no])
124 AC_SUBST(PIXMAN_CFLAGS)
125 AC_SUBST(PIXMAN_LIBS)
129 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
130 # saves the results in local variables. This does not check dependencies or
131 # similar but does only parse the arguments.
135 AC_MSG_CHECKING([whether user wants all])
137 [AS_HELP_STRING([--enable-all],
138 [enable all options (used for debugging)])])
139 if test "x$enable_all" = "x" ; then
142 AC_MSG_RESULT([$enable_all])
145 AC_MSG_CHECKING([whether user wants eloop])
146 AC_ARG_ENABLE([eloop],
147 [AS_HELP_STRING([--enable-eloop],
148 [build eloop library])])
149 if test "x$enable_all" = "xyes" ; then
151 elif test "x$enable_eloop" = "x" ; then
152 enable_eloop="no (default)"
154 AC_MSG_RESULT([$enable_eloop])
157 AC_MSG_CHECKING([whether user wants TSM])
159 [AS_HELP_STRING([--enable-tsm],
160 [build tsm library])])
161 if test "x$enable_all" = "xyes" ; then
163 elif test "x$enable_tsm" = "x" ; then
164 enable_tsm="no (default)"
166 AC_MSG_RESULT([$enable_tsm])
169 AC_MSG_CHECKING([whether user wants UVT])
171 [AS_HELP_STRING([--enable-uvt],
172 [build uvt library])])
173 if test "x$enable_all" = "xyes" ; then
175 elif test "x$enable_uvt" = "x" ; then
176 enable_uvt="no (default)"
178 AC_MSG_RESULT([$enable_uvt])
181 AC_MSG_CHECKING([whether user wants uterm])
182 AC_ARG_ENABLE([uterm],
183 [AS_HELP_STRING([--enable-uterm],
184 [build uterm library])])
185 if test "x$enable_all" = "xyes" ; then
187 elif test "x$enable_uterm" = "x" ; then
188 enable_uterm="no (default)"
190 AC_MSG_RESULT([$enable_uterm])
193 AC_MSG_CHECKING([whether user wants kmscon])
194 AC_ARG_ENABLE([kmscon],
195 [AS_HELP_STRING([--disable-kmscon],
196 [do not build kmscon])])
197 if test "x$enable_all" = "xyes" ; then
199 elif test "x$enable_kmscon" = "x" ; then
200 enable_kmscon="yes (default)"
202 AC_MSG_RESULT([$enable_kmscon])
205 AC_MSG_CHECKING([whether user wants wlterm])
206 AC_ARG_ENABLE([wlterm],
207 [AS_HELP_STRING([--enable-wlterm],
209 if test "x$enable_all" = "xyes" ; then
211 elif test "x$enable_wlterm" = "x" ; then
212 enable_wlterm="no (default)"
214 AC_MSG_RESULT([$enable_wlterm])
217 AC_MSG_CHECKING([whether user wants uvtd])
218 AC_ARG_ENABLE([uvtd],
219 [AS_HELP_STRING([--enable-uvtd],
221 if test "x$enable_all" = "xyes" ; then
223 elif test "x$enable_uvtd" = "x" ; then
224 enable_uvtd="no (default)"
226 AC_MSG_RESULT([$enable_uvtd])
229 AC_MSG_CHECKING([whether to build with debugging on])
230 AC_ARG_ENABLE([debug],
231 [AS_HELP_STRING([--enable-debug],
232 [whether to build with debugging on])])
233 if test "x$enable_all" = "xyes" ; then
235 elif test "x$enable_debug" = "x" ; then
236 enable_debug="yes (default)"
238 AC_MSG_RESULT([$enable_debug])
241 AC_MSG_CHECKING([whether to disable code optimizations])
242 AC_ARG_ENABLE([optimizations],
243 [AS_HELP_STRING([--disable-optimizations],
244 [whether to disable code optimizations])])
245 if test "x$enable_all" = "xyes" ; then
246 enable_optimizations="yes"
247 elif test "x$enable_optimizations" = "x" ; then
248 enable_optimizations="yes (default)"
250 AC_MSG_RESULT([$enable_optimizations])
253 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
254 AC_ARG_ENABLE([multi-seat],
255 [AS_HELP_STRING([--enable-multi-seat],
256 [enable multi-seat support with systemd])])
257 if test "x$enable_all" = "xyes" ; then
258 enable_multi_seat="yes"
259 elif test "x$enable_multi_seat" = "x" ; then
260 enable_multi_seat="yes (default)"
262 AC_MSG_RESULT([$enable_multi_seat])
265 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
266 AC_ARG_ENABLE([hotplug],
267 [AS_HELP_STRING([--enable-hotplug],
268 [enable device hotplug support with udev])])
269 if test "x$enable_all" = "xyes" ; then
271 elif test "x$enable_hotplug" = "x" ; then
272 enable_hotplug="yes (default)"
274 AC_MSG_RESULT([$enable_hotplug])
277 AC_MSG_CHECKING([whether user wants eloop dbus support])
278 AC_ARG_ENABLE([eloop-dbus],
279 [AS_HELP_STRING([--enable-eloop-dbus],
280 [enable eloop dbus support])])
281 if test "x$enable_all" = "xyes" ; then
282 enable_eloop_dbus="yes"
283 elif test "x$enable_eloop_dbus" = "x" ; then
284 enable_eloop_dbus="no (default)"
286 AC_MSG_RESULT([$enable_eloop_dbus])
289 AC_MSG_CHECKING([which video backends the user wants])
291 [AS_HELP_STRING([--with-video],
292 [specify list of optional video backends])],
294 [with_video="default"])
295 enable_video_fbdev="no"
296 enable_video_drm2d="no"
297 enable_video_drm3d="no"
298 if test "x$enable_all" = "xyes" ; then
299 enable_video_fbdev="yes"
300 enable_video_drm2d="yes"
301 enable_video_drm3d="yes"
302 with_video="fbdev,drm2d,drm3d (all)"
303 elif test "x$with_video" = "xdefault" ; then
304 enable_video_fbdev="yes (default)"
305 enable_video_drm2d="yes (default)"
306 enable_video_drm3d="yes (default)"
307 with_video="fbdev,drm2d,drm3d (default)"
308 elif test ! "x$with_video" = "x" ; then
311 for i in $with_video ; do
312 if test "x$i" = "xfbdev" ; then
313 enable_video_fbdev="yes"
314 elif test "x$i" = "xdrm2d" ; then
315 enable_video_drm2d="yes"
316 elif test "x$i" = "xdrm3d" ; then
317 enable_video_drm3d="yes"
320 AC_ERROR([Invalid video backend $i])
325 AC_MSG_RESULT([$with_video])
328 AC_MSG_CHECKING([which render backends the user wants])
329 AC_ARG_WITH([renderers],
330 [AS_HELP_STRING([--with-renderers],
331 [specify list of optional render backends])],
333 [with_renderers="default"])
334 enable_renderer_bbulk="no"
335 enable_renderer_gltex="no"
336 enable_renderer_cairo="no"
337 enable_renderer_pixman="no"
338 if test "x$enable_all" = "xyes" ; then
339 enable_renderer_bbulk="yes"
340 enable_renderer_gltex="yes"
341 enable_renderer_cairo="yes"
342 enable_renderer_pixman="yes"
343 with_renderers="bbulk,gltex,cairo,pixman (all)"
344 elif test "x$with_renderers" = "xdefault" ; then
345 enable_renderer_bbulk="yes (default)"
346 enable_renderer_gltex="yes (default)"
347 enable_renderer_cairo="no (default)"
348 enable_renderer_pixman="no (default)"
349 with_renderers="bbulk,gltex (default)"
350 elif test ! "x$with_renderers" = "x" ; then
353 for i in $with_renderers ; do
354 if test "x$i" = "xbbulk" ; then
355 enable_renderer_bbulk="yes"
356 elif test "x$i" = "xgltex" ; then
357 enable_renderer_gltex="yes"
358 elif test "x$i" = "xcairo" ; then
359 enable_renderer_cairo="yes"
360 elif test "x$i" = "xpixman" ; then
361 enable_renderer_pixman="yes"
364 AC_ERROR([Unknown renderer $i])
369 AC_MSG_RESULT([$with_renderers])
372 AC_MSG_CHECKING([which font backends the user wants])
374 [AS_HELP_STRING([--with-fonts],
375 [specify list of optional font backends])],
377 [with_fonts="default"])
378 enable_font_unifont="no"
379 enable_font_freetype2="no"
380 enable_font_pango="no"
381 if test "x$enable_all" = "xyes" ; then
382 enable_font_unifont="yes"
383 enable_font_freetype2="yes"
384 enable_font_pango="yes"
385 with_fonts="unifont,freetype2,pango (all)"
386 elif test "x$with_fonts" = "xdefault" ; then
387 enable_font_unifont="yes (default)"
388 enable_font_freetype2="no (default)"
389 enable_font_pango="yes (default)"
390 with_fonts="unifont,pango (default)"
391 elif test ! "x$with_fonts" = "x" ; then
394 for i in $with_fonts ; do
395 if test "x$i" = "xunifont" ; then
396 enable_font_unifont="yes"
397 elif test "x$i" = "xfreetype2" ; then
398 enable_font_freetype2="yes"
399 elif test "x$i" = "xpango" ; then
400 enable_font_pango="yes"
403 AC_ERROR([Unknown font backend $i])
408 AC_MSG_RESULT([$with_fonts])
411 AC_MSG_CHECKING([which sessions the user wants])
412 AC_ARG_WITH([sessions],
413 [AS_HELP_STRING([--with-sessions],
414 [specify list of optional sessions])],
416 [with_sessions="default"])
417 enable_session_dummy="no"
418 enable_session_terminal="no"
419 enable_session_cdev="no"
420 if test "x$enable_all" = "xyes" ; then
421 enable_session_dummy="yes"
422 enable_session_terminal="yes"
423 enable_session_cdev="yes"
424 with_sessions="dummy,terminal,cdev (all)"
425 elif test "x$with_sessions" = "xdefault" ; then
426 enable_session_dummy="yes (default)"
427 enable_session_terminal="yes (default)"
428 enable_session_cdev="yes (default)"
429 with_sessions="dummy,terminal,cdev (default)"
430 elif test ! "x$with_sessions" = "x" ; then
433 for i in $with_sessions ; do
434 if test "x$i" = "xdummy" ; then
435 enable_session_dummy="yes"
436 elif test "x$i" = "xterminal" ; then
437 enable_session_terminal="yes"
438 elif test "x$i" = "xcdev" ; then
439 enable_session_cdev="yes"
442 AC_ERROR([Unknown session type $i])
447 AC_MSG_RESULT([$with_sessions])
450 # Check what can be built
451 # This checks each configuration option and tests whether all dependencies are
452 # met. This is done from bottom up to ensure the right order.
458 if test ! "x$enable_debug" = "xno" ; then
461 debug_missing="enable-debug"
465 optimizations_avail=no
466 optimizations_missing=""
467 if test ! "x$enable_optimizations" = "xno" ; then
468 optimizations_avail=yes
470 optimizations_missing="enable-optimizations"
475 eloop_dbus_missing=""
476 if test ! "x$enable_eloop_dbus" = "xno" ; then
478 if test "x$have_dbus" = "xno" ; then
480 eloop_dbus_missing="libdbus"
483 if test "x$eloop_dbus_avail" = "xno" ; then
484 if test "x$enable_eloop_dbus" = "xyes" ; then
485 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
489 eloop_dbus_missing="enable-eloop-dbus"
495 if test ! "x$enable_eloop" = "xno" ; then
498 eloop_missing="enable-eloop"
504 if test ! "x$enable_tsm" = "xno" ; then
506 if test "x$have_xkbcommon" = "xno" ; then
508 tsm_missing="libxkbcommon"
511 if test "x$tsm_avail" = "xno" ; then
512 if test "x$enable_tsm" = "xyes" ; then
513 AC_ERROR([missing for TSM: $tsm_missing])
517 tsm_missing="enable-tsm"
523 if test ! "x$enable_uvt" = "xno" ; then
525 if test "x$have_fuse" = "xno" ; then
530 if test "x$uvt_avail" = "xno" ; then
531 if test "x$enable_uvt" = "xyes" ; then
532 AC_ERROR([missing for UVT: $uvt_missing])
536 uvt_missing="enable-uvt"
541 video_fbdev_missing=""
542 if test ! "x$enable_video_fbdev" = "xno" ; then
543 # TODO: check for kernel headers
544 video_fbdev_avail=yes
546 video_fbdev_missing="enable-video-fbdev"
551 video_drm2d_missing=""
552 if test ! "x$enable_video_drm2d" = "xno" ; then
553 video_drm2d_avail=yes
554 if test "x$have_drm3d" = "xno" ; then
556 video_drm2d_missing="libdrm3d"
559 if test "x$video_drm2d_avail" = "xno" ; then
560 if test "x$enable_video_drm2d" = "xyes" ; then
561 AC_ERROR([missing for drm2d video backend: $video_drm2d_missing])
565 video_drm2d_missing="enable-video-drm2d"
570 video_drm3d_missing=""
571 if test ! "x$enable_video_drm3d" = "xno" ; then
572 video_drm3d_avail=yes
573 if test "x$have_drm3d" = "xno" ; then
575 video_drm3d_missing="libdrm3d,$video_drm3d_missing"
577 if test "x$have_gbm" = "xno" ; then
579 video_drm3d_missing="libgbm,$video_drm3d_missing"
581 if test "x$have_egl" = "xno" ; then
583 video_drm3d_missing="libegl,$video_drm3d_missing"
585 if test "x$have_gles2" = "xno" ; then
587 video_drm3d_missing="libgles2,$video_drm3d_missing"
590 if test "x$video_drm3d_avail" = "xno" ; then
591 if test "x$enable_video_drm3d" = "xyes" ; then
592 AC_ERROR([missing for drm3d video backend: $video_drm3d_missing])
596 video_drm3d_missing="enable-video-drm3d"
602 if test ! "x$enable_uterm" = "xno" ; then
605 uterm_missing="enable-uterm"
610 multi_seat_missing=""
611 if test ! "x$enable_multi_seat" = "xno" ; then
613 if test "x$have_systemd" = "xno" ; then
615 multi_seat_missing="libsystemd"
618 if test "x$multi_seat_avail" = "xno" ; then
619 if test "x$enable_multi_seat" = "xyes" ; then
620 AC_ERROR([missing for multi-seat support: $multi_seat_missing])
624 multi_seat_missing="enable-multi-seat"
630 if test ! "x$enable_hotplug" = "xno" ; then
632 if test "x$have_udev" = "xno" ; then
634 hotplug_missing="libudev"
637 if test "x$hotplug_avail" = "xno" ; then
638 if test "x$enable_hotplug" = "xyes" ; then
639 AC_ERROR([missing for hotplug-support: $hotplug_missing])
643 hotplug_missing="enable-hotplug"
647 renderer_bbulk_avail=no
648 renderer_bbulk_missing=""
649 if test ! "x$enable_renderer_bbulk" = "xno" ; then
650 renderer_bbulk_avail=yes
652 renderer_bbulk_missing="enable-renderer-bbulk"
656 renderer_gltex_avail=no
657 renderer_gltex_missing=""
658 if test ! "x$enable_renderer_gltex" = "xno" ; then
659 renderer_gltex_avail=yes
660 if test "x$have_gles2" = "xno" ; then
661 renderer_gltex_avail=no
662 renderer_gltex_missing="libgles2"
665 if test "x$renderer_gltex_avail" = "xno" ; then
666 if test "x$enable_renderer_gltex" = "xyes" ; then
667 AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
671 renderer_gltex_missing="enable-renderer-gltex"
675 renderer_cairo_avail=no
676 renderer_cairo_missing=""
677 if test ! "x$enable_renderer_cairo" = "xno" ; then
678 renderer_cairo_avail=yes
679 if test "x$have_cairo" = "xno" ; then
680 renderer_cairo_avail=no
681 renderer_cairo_missing="cairo"
684 if test "x$renderer_cairo_avail" = "xno" ; then
685 if test "x$enable_renderer_cairo" = "xyes" ; then
686 AC_ERROR([missing for renderer-cairo: $renderer_cairo_missing])
690 renderer_cairo_missing="enable-renderer-cairo"
694 renderer_pixman_avail=no
695 renderer_pixman_missing=""
696 if test ! "x$enable_renderer_pixman" = "xno" ; then
697 renderer_pixman_avail=yes
698 if test "x$have_pixman" = "xno" ; then
699 renderer_pixman_avail=no
700 renderer_pixman_missing="pixman"
703 if test "x$renderer_pixman_avail" = "xno" ; then
704 if test "x$enable_renderer_pixman" = "xyes" ; then
705 AC_ERROR([missing for renderer-pixman: $renderer_pixman_missing])
709 renderer_pixman_missing="enable-renderer-pixman"
713 font_unifont_avail=no
714 font_unifont_missing=""
715 if test ! "x$enable_font_unifont" = "xno" ; then
716 font_unifont_avail=yes
718 font_unifont_missing="enable-font-unifont"
722 font_freetype2_avail=no
723 font_freetype2_missing=""
724 if test ! "x$enable_font_freetype2" = "xno" ; then
725 font_freetype2_avail=yes
726 if test "x$have_freetype2" = "xno" ; then
727 font_freetype2_avail=no
728 font_freetype2_missing="libfontconfig,libfreetype2"
731 if test "x$font_freetype2_avail" = "xno" ; then
732 if test "x$enable_font_freetype2" = "xyes" ; then
733 AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
737 font_freetype2_missing="enable-font-freetype2"
742 font_pango_missing=""
743 if test ! "x$enable_font_pango" = "xno" ; then
745 if test "x$have_pango" = "xno" ; then
747 font_pango_missing="libpango"
750 if test "x$font_pango_avail" = "xno" ; then
751 if test "x$enable_font_pango" = "xyes" ; then
752 AC_ERROR([missing for font-pango: $font_pango_missing])
756 font_pango_missing="enable-font-pango"
760 session_dummy_avail=no
761 session_dummy_missing=""
762 if test ! "x$enable_session_dummy" = "xno" ; then
763 session_dummy_avail=yes
765 session_dummy_missing="enable-session-dummy"
769 session_terminal_avail=no
770 session_terminal_missing=""
771 if test ! "x$enable_session_terminal" = "xno" ; then
772 session_terminal_avail=yes
773 if test "x$tsm_avail" = "xno" ; then
774 session_terminal_avail=no
775 session_terminal_missing="$tsm_missing"
778 if test "x$session_terminal_avail" = "xno" ; then
779 if test "x$enable_session_terminal" = "xyes" ; then
780 AC_ERROR([missing for session-terminal: $session_terminal_missing])
784 session_terminal_missing="enable-session-terminal"
788 session_cdev_avail=no
789 session_cdev_missing=""
790 if test ! "x$enable_session_cdev" = "xno" ; then
791 session_cdev_avail=yes
792 if test "x$have_fuse" = "xno" ; then
793 session_cdev_avail=no
794 session_cdev_missing="libfuse,$session_cdev_missing"
797 if test "x$tsm_avail" = "xno" ; then
798 session_cdev_avail=no
799 session_cdev_missing="$tsm_missing,$session_cdev_missing"
802 if test "x$session_cdev_avail" = "xno" ; then
803 if test "x$enable_session_cdev" = "xyes" ; then
804 AC_ERROR([missing for session-cdev: $session_cdev_missing])
808 session_cdev_missing="enable-session-cdev"
814 if test ! "x$enable_kmscon" = "xno" ; then
816 if test "x$eloop_avail" = "xno" ; then
818 kmscon_missing="$eloop_missing,$kmscon_missing"
821 if test "x$tsm_avail" = "xno" ; then
823 kmscon_missing="$tsm_missing,$kmscon_missing"
826 if test "x$uterm_avail" = "xno" ; then
828 kmscon_missing="$uterm_missing,$kmscon_missing"
831 if test "x$kmscon_avail" = "xno" ; then
832 if test "x$enable_kmscon" = "xyes" ; then
833 AC_ERROR([missing for kmscon: $kmscon_missing])
837 kmscon_missing="enable-kmscon"
843 if test ! "x$enable_wlterm" = "xno" ; then
845 if test "x$tsm_avail" = "xno" ; then
847 wlterm_missing="$tsm_missing,$wlterm_missing"
850 if test "x$eloop_avail" = "xno" ; then
852 wlterm_missing="$eloop_missing,$wlterm_missing"
855 if test "x$font_pango_avail" = "xno" ; then
857 wlterm_missing="$font_pango_missing,$wlterm_missing"
860 if test "x$have_wayland" = "xno" ; then
862 wlterm_missing="libwayland,$wlterm_missing"
865 if test "x$wlterm_avail" = "xno" ; then
866 if test "x$enable_wlterm" = "xyes" ; then
867 AC_ERROR([missing for wlterm: $wlterm_missing])
871 wlterm_missing="enable-wlterm"
877 if test ! "x$enable_uvtd" = "xno" ; then
879 if test "x$uvt_avail" = "xno" ; then
881 uvtd_missing="$uvt_missing,$uvtd_missing"
884 if test "x$eloop_avail" = "xno" ; then
886 uvtd_missing="$eloop_missing,$uvtd_missing"
889 if test "x$uvtd_avail" = "xno" ; then
890 if test "x$enable_uvtd" = "xyes" ; then
891 AC_ERROR([missing for uvtd: $uvtd_missing])
895 uvtd_missing="enable-uvtd"
899 # Enable all required modules
900 # We now know which modules can be built by checking the *_avail variables set
901 # above. We now only have to disable all modules that are disabled by default
902 # and the user didn't force-enable them and no other module that is enabled
903 # needs them. This is done top-down of course.
908 if test "x$uvtd_avail" = "xyes" ; then
909 if test "x${enable_uvtd% *}" = "xyes" ; then
918 if test "x$wlterm_avail" = "xyes" ; then
919 if test "x${enable_wlterm% *}" = "xyes" ; then
923 enable_font_pango=yes
929 if test "x$kmscon_avail" = "xyes" ; then
930 if test "x${enable_kmscon% *}" = "xyes" ; then
938 session_cdev_enabled=no
939 if test "x$session_cdev_avail" = "xyes" ; then
940 if test "x${enable_session_cdev% *}" = "xyes" ; then
941 session_cdev_enabled=yes
946 session_terminal_enabled=no
947 if test "x$session_terminal_avail" = "xyes" ; then
948 if test "x${enable_session_terminal% *}" = "xyes" ; then
949 session_terminal_enabled=yes
955 session_dummy_enabled=no
956 if test "x$session_dummy_avail" = "xyes" ; then
957 if test "x${enable_session_dummy% *}" = "xyes" ; then
958 session_dummy_enabled=yes
963 font_pango_enabled=no
964 if test "x$font_pango_avail" = "xyes" ; then
965 if test "x${enable_font_pango% *}" = "xyes" ; then
966 font_pango_enabled=yes
971 font_freetype2_enabled=no
972 if test "x$font_freetype2_avail" = "xyes" ; then
973 if test "x${enable_font_freetype2% *}" = "xyes" ; then
974 font_freetype2_enabled=yes
979 font_unifont_enabled=no
980 if test "x$font_unifont_avail" = "xyes" ; then
981 if test "x${enable_font_unifont% *}" = "xyes" ; then
982 font_unifont_enabled=yes
987 renderer_gltex_enabled=no
988 if test "x$renderer_gltex_avail" = "xyes" ; then
989 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
990 renderer_gltex_enabled=yes
995 renderer_cairo_enabled=no
996 if test "x$renderer_cairo_avail" = "xyes" ; then
997 if test "x${enable_renderer_cairo% *}" = "xyes" ; then
998 renderer_cairo_enabled=yes
1003 renderer_pixman_enabled=no
1004 if test "x$renderer_pixman_avail" = "xyes" ; then
1005 if test "x${enable_renderer_pixman% *}" = "xyes" ; then
1006 renderer_pixman_enabled=yes
1011 renderer_bbulk_enabled=no
1012 if test "x$renderer_bbulk_avail" = "xyes" ; then
1013 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
1014 renderer_bbulk_enabled=yes
1020 if test "x$hotplug_avail" = "xyes" ; then
1021 if test "x${enable_hotplug% *}" = "xyes" ; then
1027 multi_seat_enabled=no
1028 if test "x$multi_seat_avail" = "xyes" ; then
1029 if test "x${enable_multi_seat% *}" = "xyes" ; then
1030 multi_seat_enabled=yes
1036 if test "x$uterm_avail" = "xyes" ; then
1037 if test "x${enable_uterm% *}" = "xyes" ; then
1043 video_drm3d_enabled=no
1044 if test "x$video_drm3d_avail" = "xyes" ; then
1045 if test "x${enable_video_drm3d% *}" = "xyes" ; then
1046 video_drm3d_enabled=yes
1051 video_drm2d_enabled=no
1052 if test "x$video_drm2d_avail" = "xyes" ; then
1053 if test "x${enable_video_drm2d% *}" = "xyes" ; then
1054 video_drm2d_enabled=yes
1059 video_fbdev_enabled=no
1060 if test "x$video_fbdev_avail" = "xyes" ; then
1061 if test "x${enable_video_fbdev% *}" = "xyes" ; then
1062 video_fbdev_enabled=yes
1068 if test "x$uvt_avail" = "xyes" ; then
1069 if test "x${enable_uvt% *}" = "xyes" ; then
1076 if test "x$tsm_avail" = "xyes" ; then
1077 if test "x${enable_tsm% *}" = "xyes" ; then
1084 if test "x$eloop_avail" = "xyes" ; then
1085 if test "x${enable_eloop% *}" = "xyes" ; then
1091 eloop_dbus_enabled=no
1092 if test "x$eloop_dbus_avail" = "xyes" ; then
1093 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
1094 eloop_dbus_enabled=yes
1099 optimizations_enabled=no
1100 if test "x$optimizations_avail" = "xyes" ; then
1101 if test "x${enable_optimizations% *}" = "xyes" ; then
1102 optimizations_enabled=yes
1108 if test "x$debug_avail" = "xyes" ; then
1109 if test "x${enable_debug% *}" = "xyes" ; then
1115 # Module Configuration
1116 # We have now done all dependency checking and default-value validation and we
1117 # now know which modules are enabled via the *_enabled variables.
1118 # Everything below is related to the configuration of each module and setting
1119 # the correct flags for the build process.
1123 if test "x$debug_enabled" = "xyes" ; then
1124 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
1126 AC_DEFINE([NDEBUG], [1], [No Debug])
1129 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
1130 [test "x$debug_enabled" = "xyes"])
1133 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
1134 [test "x$optimizations_enabled" = "xyes"])
1137 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
1138 [test "x$eloop_dbus_enabled" = "xyes"])
1141 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
1142 [test "x$eloop_enabled" = "xyes"])
1145 AM_CONDITIONAL([BUILD_ENABLE_TSM],
1146 [test "x$tsm_enabled" = "xyes"])
1149 AM_CONDITIONAL([BUILD_ENABLE_UVT],
1150 [test "x$uvt_enabled" = "xyes"])
1153 if test "x$video_fbdev_enabled" = "xyes" ; then
1154 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
1155 [Build uterm fbdev video backend])
1158 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
1159 [test "x$video_fbdev_enabled" = "xyes"])
1162 if test "x$video_drm2d_enabled" = "xyes" ; then
1163 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
1164 [Build uterm drm2d drm3d video backend])
1167 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
1168 [test "x$video_drm2d_enabled" = "xyes"])
1171 if test "x$video_drm3d_enabled" = "xyes" ; then
1172 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
1173 [Build uterm drm3d video backend])
1176 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
1177 [test "x$video_drm3d_enabled" = "xyes"])
1180 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1181 [test "x$uterm_enabled" = "xyes"])
1184 if test "x$multi_seat_enabled" = "xyes" ; then
1185 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1186 [Use systemd for multi-seat support])
1189 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1190 [test "x$multi_seat_enabled" = "xyes"])
1193 if test "x$hotplug_enabled" = "xyes" ; then
1194 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1195 [Use udev for hotplug support])
1198 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1199 [test "x$hotplug_enabled" = "xyes"])
1202 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1203 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1204 [Build bbulk rendering backend])
1207 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1208 [test "x$renderer_bbulk_enabled" = "xyes"])
1211 if test "x$renderer_gltex_enabled" = "xyes" ; then
1212 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1213 [Build gltex rendering backend])
1216 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1217 [test "x$renderer_gltex_enabled" = "xyes"])
1220 if test "x$renderer_cairo_enabled" = "xyes" ; then
1221 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1222 [Build cairo rendering backend])
1225 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1226 [test "x$renderer_cairo_enabled" = "xyes"])
1229 if test "x$renderer_pixman_enabled" = "xyes" ; then
1230 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1231 [Build pixman rendering backend])
1234 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1235 [test "x$renderer_pixman_enabled" = "xyes"])
1238 if test "x$font_unifont_enabled" = "xyes" ; then
1239 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1240 [Build static unifont backend])
1243 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1244 [test "x$font_unifont_enabled" = "xyes"])
1247 if test "x$font_freetype2_enabled" = "xyes" ; then
1248 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1249 [Build freetype2 font backend])
1252 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1253 [test "x$font_freetype2_enabled" = "xyes"])
1256 if test "x$font_pango_enabled" = "xyes" ; then
1257 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1258 [Build pango font backend])
1261 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1262 [test "x$font_pango_enabled" = "xyes"])
1265 if test "x$session_dummy_enabled" = "xyes" ; then
1266 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1267 [Build dummy session])
1270 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1271 [test "x$session_dummy_enabled" = "xyes"])
1274 if test "x$session_terminal_enabled" = "xyes" ; then
1275 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1276 [Build terminal session])
1279 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1280 [test "x$session_terminal_enabled" = "xyes"])
1283 if test "x$session_cdev_enabled" = "xyes" ; then
1284 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1285 [Build cdev session])
1288 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1289 [test "x$session_cdev_enabled" = "xyes"])
1292 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1293 [test "x$kmscon_enabled" = "xyes"])
1296 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1297 [test "x$wlterm_enabled" = "xyes"])
1300 AM_CONDITIONAL([BUILD_ENABLE_UVTD],
1301 [test "x$uvtd_enabled" = "xyes"])
1304 # Miscellaneous Checks
1305 # All checks below are independent of module checking or depend on the results
1306 # of it. They do not have any dependencies themselves so they are not part of the
1307 # module infrastructure.
1310 # check for _Static_assert
1311 AC_MSG_CHECKING([whether _Static_assert() is supported])
1313 have_static_assert=yes
1314 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1315 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1317 [Define to 1 if _Static_assert() is supported])],
1318 [have_static_assert=no])
1319 AC_MSG_RESULT([$have_static_assert])
1321 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1322 if test x$have_gbm = xyes ; then
1323 save_CFLAGS="$CFLAGS"
1325 save_LDFLAGS="$LDFLAGS"
1326 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1327 LIBS="$DRM_LIBS $GBM_LIBS"
1331 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1333 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1334 CFLAGS="$save_CFLAGS"
1336 LDFLAGS="$save_LDFLAGS"
1339 # check for xsltproc
1340 AC_PATH_PROG(XSLTPROC, xsltproc)
1341 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1343 # check for offline man-pages stylesheet
1344 AC_MSG_CHECKING([for docbook manpages stylesheet])
1345 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1346 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1347 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1348 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1349 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1350 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1351 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1352 AC_MSG_RESULT([yes])
1354 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1360 # After everything is configured, we correctly substitute the values for the
1364 AC_CONFIG_FILES([Makefile
1368 docs/pc/libuterm.pc])
1372 # Configuration output
1373 # Show configuration to the user so they can check whether everything was
1374 # configured as expected.
1377 AC_MSG_NOTICE([Build configuration:
1380 exec-prefix: $exec_prefix
1382 includedir: $includedir
1384 Applications and Libraries:
1385 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1386 wlterm: $wlterm_enabled ($wlterm_avail: $wlterm_missing)
1387 uvtd: $uvtd_enabled ($uvtd_avail: $uvtd_missing)
1388 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1389 tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1390 uvt: $uvt_enabled ($uvt_avail: $uvt_missing)
1391 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1393 Miscellaneous Options:
1394 debug: $debug_enabled ($debug_avail: $debug_missing)
1395 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1396 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1397 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1398 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1401 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1402 drm2d: $video_drm2d_enabled ($video_drm2d_avail: $video_drm2d_missing)
1403 drm3d: $video_drm3d_enabled ($video_drm3d_avail: $video_drm3d_missing)
1406 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1407 freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1408 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1411 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1412 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1413 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1414 pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1417 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1418 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1419 cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
1421 Run "${MAKE-make}" to start compilation process])