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.
37 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
48 # pkg-config dependencies
49 # This unconditionally checks for all dependencies even if they are disabled. We
50 # later look whether all required depedencies are met and finish the
51 # configuration. We group similar packages into one logical group here to avoid
52 # having variables for each single library.
53 # This, however, makes ./configure output very unintuitive error messages if a
54 # package is not found so we must make sure we print more verbose messages
58 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
59 [have_xkbcommon=yes], [have_xkbcommon=no])
60 AC_SUBST(XKBCOMMON_CFLAGS)
61 AC_SUBST(XKBCOMMON_LIBS)
63 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
64 [have_systemd=yes], [have_systemd=no])
65 AC_SUBST(SYSTEMD_CFLAGS)
66 AC_SUBST(SYSTEMD_LIBS)
68 PKG_CHECK_MODULES([UDEV], [libudev >= 172],
69 [have_udev=yes], [have_udev=no])
73 PKG_CHECK_MODULES([DBUS], [dbus-1],
74 [have_dbus=yes], [have_dbus=no])
78 PKG_CHECK_MODULES([DRM], [libdrm],
79 [have_drm=yes], [have_drm=no])
83 PKG_CHECK_MODULES([GBM], [gbm],
84 [have_gbm=yes], [have_gbm=no])
88 PKG_CHECK_MODULES([EGL], [egl],
89 [have_egl=yes], [have_egl=no])
93 PKG_CHECK_MODULES([GLES2], [glesv2],
94 [have_gles2=yes], [have_gles2=no])
95 AC_SUBST(GLES2_CFLAGS)
98 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
99 [have_freetype2=yes], [have_freetype2=no])
100 AC_SUBST(FREETYPE2_CFLAGS)
101 AC_SUBST(FREETYPE2_LIBS)
103 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
104 [have_pango=yes], [have_pango=no])
105 AC_SUBST(PANGO_CFLAGS)
108 PKG_CHECK_MODULES([FUSE], [fuse >= 2.9.0],
109 [have_fuse=yes], [have_fuse=no])
110 AC_SUBST(FUSE_CFLAGS)
113 PKG_CHECK_MODULES([CAIRO], [cairo],
114 [have_cairo=yes], [have_cairo=no])
115 AC_SUBST(CAIRO_CFLAGS)
118 PKG_CHECK_MODULES([PIXMAN], [pixman-1],
119 [have_pixman=yes], [have_pixman=no])
120 AC_SUBST(PIXMAN_CFLAGS)
121 AC_SUBST(PIXMAN_LIBS)
125 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
126 # saves the results in local variables. This does not check dependencies or
127 # similar but does only parse the arguments.
131 AC_MSG_CHECKING([whether user wants all])
133 [AS_HELP_STRING([--enable-all],
134 [enable all options (used for debugging)])])
135 if test "x$enable_all" = "x" ; then
138 AC_MSG_RESULT([$enable_all])
141 AC_MSG_CHECKING([whether user wants eloop])
142 AC_ARG_ENABLE([eloop],
143 [AS_HELP_STRING([--enable-eloop],
144 [build eloop library])])
145 if test "x$enable_all" = "xyes" ; then
147 elif test "x$enable_eloop" = "x" ; then
148 enable_eloop="no (default)"
150 AC_MSG_RESULT([$enable_eloop])
153 AC_MSG_CHECKING([whether user wants TSM])
155 [AS_HELP_STRING([--enable-tsm],
156 [build tsm library])])
157 if test "x$enable_all" = "xyes" ; then
159 elif test "x$enable_tsm" = "x" ; then
160 enable_tsm="no (default)"
162 AC_MSG_RESULT([$enable_tsm])
165 AC_MSG_CHECKING([whether user wants UVT])
167 [AS_HELP_STRING([--enable-uvt],
168 [build uvt library])])
169 if test "x$enable_all" = "xyes" ; then
171 elif test "x$enable_uvt" = "x" ; then
172 enable_uvt="no (default)"
174 AC_MSG_RESULT([$enable_uvt])
177 AC_MSG_CHECKING([whether user wants uterm])
178 AC_ARG_ENABLE([uterm],
179 [AS_HELP_STRING([--enable-uterm],
180 [build uterm library])])
181 if test "x$enable_all" = "xyes" ; then
183 elif test "x$enable_uterm" = "x" ; then
184 enable_uterm="no (default)"
186 AC_MSG_RESULT([$enable_uterm])
189 AC_MSG_CHECKING([whether user wants kmscon])
190 AC_ARG_ENABLE([kmscon],
191 [AS_HELP_STRING([--disable-kmscon],
192 [do not build kmscon])])
193 if test "x$enable_all" = "xyes" ; then
195 elif test "x$enable_kmscon" = "x" ; then
196 enable_kmscon="yes (default)"
198 AC_MSG_RESULT([$enable_kmscon])
201 AC_MSG_CHECKING([whether to build with debugging on])
202 AC_ARG_ENABLE([debug],
203 [AS_HELP_STRING([--enable-debug],
204 [whether to build with debugging on])])
205 if test "x$enable_all" = "xyes" ; then
207 elif test "x$enable_debug" = "x" ; then
208 enable_debug="yes (default)"
210 AC_MSG_RESULT([$enable_debug])
213 AC_MSG_CHECKING([whether to disable code optimizations])
214 AC_ARG_ENABLE([optimizations],
215 [AS_HELP_STRING([--disable-optimizations],
216 [whether to disable code optimizations])])
217 if test "x$enable_all" = "xyes" ; then
218 enable_optimizations="yes"
219 elif test "x$enable_optimizations" = "x" ; then
220 enable_optimizations="yes (default)"
222 AC_MSG_RESULT([$enable_optimizations])
225 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
226 AC_ARG_ENABLE([multi-seat],
227 [AS_HELP_STRING([--enable-multi-seat],
228 [enable multi-seat support with systemd])])
229 if test "x$enable_all" = "xyes" ; then
230 enable_multi_seat="yes"
231 elif test "x$enable_multi_seat" = "x" ; then
232 enable_multi_seat="yes (default)"
234 AC_MSG_RESULT([$enable_multi_seat])
237 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
238 AC_ARG_ENABLE([hotplug],
239 [AS_HELP_STRING([--enable-hotplug],
240 [enable device hotplug support with udev])])
241 if test "x$enable_all" = "xyes" ; then
243 elif test "x$enable_hotplug" = "x" ; then
244 enable_hotplug="yes (default)"
246 AC_MSG_RESULT([$enable_hotplug])
249 AC_MSG_CHECKING([whether user wants eloop dbus support])
250 AC_ARG_ENABLE([eloop-dbus],
251 [AS_HELP_STRING([--enable-eloop-dbus],
252 [enable eloop dbus support])])
253 if test "x$enable_all" = "xyes" ; then
254 enable_eloop_dbus="yes"
255 elif test "x$enable_eloop_dbus" = "x" ; then
256 enable_eloop_dbus="no (default)"
258 AC_MSG_RESULT([$enable_eloop_dbus])
261 AC_MSG_CHECKING([which video backends the user wants])
263 [AS_HELP_STRING([--with-video],
264 [specify list of optional video backends])],
266 [with_video="default"])
267 enable_video_fbdev="no"
268 enable_video_drm2d="no"
269 enable_video_drm3d="no"
270 if test "x$enable_all" = "xyes" ; then
271 enable_video_fbdev="yes"
272 enable_video_drm2d="yes"
273 enable_video_drm3d="yes"
274 with_video="fbdev,drm2d,drm3d (all)"
275 elif test "x$with_video" = "xdefault" ; then
276 enable_video_fbdev="yes (default)"
277 enable_video_drm2d="yes (default)"
278 enable_video_drm3d="yes (default)"
279 with_video="fbdev,drm2d,drm3d (default)"
280 elif test ! "x$with_video" = "x" ; then
283 for i in $with_video ; do
284 if test "x$i" = "xfbdev" ; then
285 enable_video_fbdev="yes"
286 elif test "x$i" = "xdrm2d" ; then
287 enable_video_drm2d="yes"
288 elif test "x$i" = "xdrm3d" ; then
289 enable_video_drm3d="yes"
292 AC_ERROR([Invalid video backend $i])
297 AC_MSG_RESULT([$with_video])
300 AC_MSG_CHECKING([which render backends the user wants])
301 AC_ARG_WITH([renderers],
302 [AS_HELP_STRING([--with-renderers],
303 [specify list of optional render backends])],
305 [with_renderers="default"])
306 enable_renderer_bbulk="no"
307 enable_renderer_gltex="no"
308 enable_renderer_cairo="no"
309 enable_renderer_pixman="no"
310 if test "x$enable_all" = "xyes" ; then
311 enable_renderer_bbulk="yes"
312 enable_renderer_gltex="yes"
313 enable_renderer_cairo="yes"
314 enable_renderer_pixman="yes"
315 with_renderers="bbulk,gltex,cairo,pixman (all)"
316 elif test "x$with_renderers" = "xdefault" ; then
317 enable_renderer_bbulk="yes (default)"
318 enable_renderer_gltex="yes (default)"
319 enable_renderer_cairo="no (default)"
320 enable_renderer_pixman="no (default)"
321 with_renderers="bbulk,gltex (default)"
322 elif test ! "x$with_renderers" = "x" ; then
325 for i in $with_renderers ; do
326 if test "x$i" = "xbbulk" ; then
327 enable_renderer_bbulk="yes"
328 elif test "x$i" = "xgltex" ; then
329 enable_renderer_gltex="yes"
330 elif test "x$i" = "xcairo" ; then
331 enable_renderer_cairo="yes"
332 elif test "x$i" = "xpixman" ; then
333 enable_renderer_pixman="yes"
336 AC_ERROR([Unknown renderer $i])
341 AC_MSG_RESULT([$with_renderers])
344 AC_MSG_CHECKING([which font backends the user wants])
346 [AS_HELP_STRING([--with-fonts],
347 [specify list of optional font backends])],
349 [with_fonts="default"])
350 enable_font_unifont="no"
351 enable_font_freetype2="no"
352 enable_font_pango="no"
353 if test "x$enable_all" = "xyes" ; then
354 enable_font_unifont="yes"
355 enable_font_freetype2="yes"
356 enable_font_pango="yes"
357 with_fonts="unifont,freetype2,pango (all)"
358 elif test "x$with_fonts" = "xdefault" ; then
359 enable_font_unifont="yes (default)"
360 enable_font_freetype2="no (default)"
361 enable_font_pango="yes (default)"
362 with_fonts="unifont,pango (default)"
363 elif test ! "x$with_fonts" = "x" ; then
366 for i in $with_fonts ; do
367 if test "x$i" = "xunifont" ; then
368 enable_font_unifont="yes"
369 elif test "x$i" = "xfreetype2" ; then
370 enable_font_freetype2="yes"
371 elif test "x$i" = "xpango" ; then
372 enable_font_pango="yes"
375 AC_ERROR([Unknown font backend $i])
380 AC_MSG_RESULT([$with_fonts])
383 AC_MSG_CHECKING([which sessions the user wants])
384 AC_ARG_WITH([sessions],
385 [AS_HELP_STRING([--with-sessions],
386 [specify list of optional sessions])],
388 [with_sessions="default"])
389 enable_session_dummy="no"
390 enable_session_terminal="no"
391 enable_session_cdev="no"
392 if test "x$enable_all" = "xyes" ; then
393 enable_session_dummy="yes"
394 enable_session_terminal="yes"
395 enable_session_cdev="yes"
396 with_sessions="dummy,terminal,cdev (all)"
397 elif test "x$with_sessions" = "xdefault" ; then
398 enable_session_dummy="yes (default)"
399 enable_session_terminal="yes (default)"
400 enable_session_cdev="yes (default)"
401 with_sessions="dummy,terminal,cdev (default)"
402 elif test ! "x$with_sessions" = "x" ; then
405 for i in $with_sessions ; do
406 if test "x$i" = "xdummy" ; then
407 enable_session_dummy="yes"
408 elif test "x$i" = "xterminal" ; then
409 enable_session_terminal="yes"
410 elif test "x$i" = "xcdev" ; then
411 enable_session_cdev="yes"
414 AC_ERROR([Unknown session type $i])
419 AC_MSG_RESULT([$with_sessions])
422 # Check what can be built
423 # This checks each configuration option and tests whether all dependencies are
424 # met. This is done from bottom up to ensure the right order.
430 if test ! "x$enable_debug" = "xno" ; then
433 debug_missing="enable-debug"
437 optimizations_avail=no
438 optimizations_missing=""
439 if test ! "x$enable_optimizations" = "xno" ; then
440 optimizations_avail=yes
442 optimizations_missing="enable-optimizations"
447 eloop_dbus_missing=""
448 if test ! "x$enable_eloop_dbus" = "xno" ; then
450 if test "x$have_dbus" = "xno" ; then
452 eloop_dbus_missing="libdbus"
455 if test "x$eloop_dbus_avail" = "xno" ; then
456 if test "x$enable_eloop_dbus" = "xyes" ; then
457 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
461 eloop_dbus_missing="enable-eloop-dbus"
467 if test ! "x$enable_eloop" = "xno" ; then
470 eloop_missing="enable-eloop"
476 if test ! "x$enable_tsm" = "xno" ; then
478 if test "x$have_xkbcommon" = "xno" ; then
480 tsm_missing="libxkbcommon"
483 if test "x$tsm_avail" = "xno" ; then
484 if test "x$enable_tsm" = "xyes" ; then
485 AC_ERROR([missing for TSM: $tsm_missing])
489 tsm_missing="enable-tsm"
495 if test ! "x$enable_uvt" = "xno" ; then
497 if test "x$have_fuse" = "xno" ; then
502 if test "x$uvt_avail" = "xno" ; then
503 if test "x$enable_uvt" = "xyes" ; then
504 AC_ERROR([missing for UVT: $uvt_missing])
508 uvt_missing="enable-uvt"
513 video_fbdev_missing=""
514 if test ! "x$enable_video_fbdev" = "xno" ; then
515 # TODO: check for kernel headers
516 video_fbdev_avail=yes
518 video_fbdev_missing="enable-video-fbdev"
523 video_drm2d_missing=""
524 if test ! "x$enable_video_drm2d" = "xno" ; then
525 video_drm2d_avail=yes
526 if test "x$have_drm3d" = "xno" ; then
528 video_drm2d_missing="libdrm3d"
531 if test "x$video_drm2d_avail" = "xno" ; then
532 if test "x$enable_video_drm2d" = "xyes" ; then
533 AC_ERROR([missing for drm2d video backend: $video_drm2d_missing])
537 video_drm2d_missing="enable-video-drm2d"
542 video_drm3d_missing=""
543 if test ! "x$enable_video_drm3d" = "xno" ; then
544 video_drm3d_avail=yes
545 if test "x$have_drm3d" = "xno" ; then
547 video_drm3d_missing="libdrm3d,$video_drm3d_missing"
549 if test "x$have_gbm" = "xno" ; then
551 video_drm3d_missing="libgbm,$video_drm3d_missing"
553 if test "x$have_egl" = "xno" ; then
555 video_drm3d_missing="libegl,$video_drm3d_missing"
557 if test "x$have_gles2" = "xno" ; then
559 video_drm3d_missing="libgles2,$video_drm3d_missing"
562 if test "x$video_drm3d_avail" = "xno" ; then
563 if test "x$enable_video_drm3d" = "xyes" ; then
564 AC_ERROR([missing for drm3d video backend: $video_drm3d_missing])
568 video_drm3d_missing="enable-video-drm3d"
574 if test ! "x$enable_uterm" = "xno" ; then
577 uterm_missing="enable-uterm"
582 multi_seat_missing=""
583 if test ! "x$enable_multi_seat" = "xno" ; then
585 if test "x$have_systemd" = "xno" ; then
587 multi_seat_missing="libsystemd"
590 if test "x$multi_seat_avail" = "xno" ; then
591 if test "x$enable_multi_seat" = "xyes" ; then
592 AC_ERROR([missing for multi-seat support: $multi_seat_missing])
596 multi_seat_missing="enable-multi-seat"
602 if test ! "x$enable_hotplug" = "xno" ; then
604 if test "x$have_udev" = "xno" ; then
606 hotplug_missing="libudev"
609 if test "x$hotplug_avail" = "xno" ; then
610 if test "x$enable_hotplug" = "xyes" ; then
611 AC_ERROR([missing for hotplug-support: $hotplug_missing])
615 hotplug_missing="enable-hotplug"
619 renderer_bbulk_avail=no
620 renderer_bbulk_missing=""
621 if test ! "x$enable_renderer_bbulk" = "xno" ; then
622 renderer_bbulk_avail=yes
624 renderer_bbulk_missing="enable-renderer-bbulk"
628 renderer_gltex_avail=no
629 renderer_gltex_missing=""
630 if test ! "x$enable_renderer_gltex" = "xno" ; then
631 renderer_gltex_avail=yes
632 if test "x$have_gles2" = "xno" ; then
633 renderer_gltex_avail=no
634 renderer_gltex_missing="libgles2"
637 if test "x$renderer_gltex_avail" = "xno" ; then
638 if test "x$enable_renderer_gltex" = "xyes" ; then
639 AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
643 renderer_gltex_missing="enable-renderer-gltex"
647 renderer_cairo_avail=no
648 renderer_cairo_missing=""
649 if test ! "x$enable_renderer_cairo" = "xno" ; then
650 renderer_cairo_avail=yes
651 if test "x$have_cairo" = "xno" ; then
652 renderer_cairo_avail=no
653 renderer_cairo_missing="cairo"
656 if test "x$renderer_cairo_avail" = "xno" ; then
657 if test "x$enable_renderer_cairo" = "xyes" ; then
658 AC_ERROR([missing for renderer-cairo: $renderer_cairo_missing])
662 renderer_cairo_missing="enable-renderer-cairo"
666 renderer_pixman_avail=no
667 renderer_pixman_missing=""
668 if test ! "x$enable_renderer_pixman" = "xno" ; then
669 renderer_pixman_avail=yes
670 if test "x$have_pixman" = "xno" ; then
671 renderer_pixman_avail=no
672 renderer_pixman_missing="pixman"
675 if test "x$renderer_pixman_avail" = "xno" ; then
676 if test "x$enable_renderer_pixman" = "xyes" ; then
677 AC_ERROR([missing for renderer-pixman: $renderer_pixman_missing])
681 renderer_pixman_missing="enable-renderer-pixman"
685 font_unifont_avail=no
686 font_unifont_missing=""
687 if test ! "x$enable_font_unifont" = "xno" ; then
688 font_unifont_avail=yes
690 font_unifont_missing="enable-font-unifont"
694 font_freetype2_avail=no
695 font_freetype2_missing=""
696 if test ! "x$enable_font_freetype2" = "xno" ; then
697 font_freetype2_avail=yes
698 if test "x$have_freetype2" = "xno" ; then
699 font_freetype2_avail=no
700 font_freetype2_missing="libfontconfig,libfreetype2"
703 if test "x$font_freetype2_avail" = "xno" ; then
704 if test "x$enable_font_freetype2" = "xyes" ; then
705 AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
709 font_freetype2_missing="enable-font-freetype2"
714 font_pango_missing=""
715 if test ! "x$enable_font_pango" = "xno" ; then
717 if test "x$have_pango" = "xno" ; then
719 font_pango_missing="libpango"
722 if test "x$font_pango_avail" = "xno" ; then
723 if test "x$enable_font_pango" = "xyes" ; then
724 AC_ERROR([missing for font-pango: $font_pango_missing])
728 font_pango_missing="enable-font-pango"
732 session_dummy_avail=no
733 session_dummy_missing=""
734 if test ! "x$enable_session_dummy" = "xno" ; then
735 session_dummy_avail=yes
737 session_dummy_missing="enable-session-dummy"
741 session_terminal_avail=no
742 session_terminal_missing=""
743 if test ! "x$enable_session_terminal" = "xno" ; then
744 session_terminal_avail=yes
745 if test "x$tsm_avail" = "xno" ; then
746 session_terminal_avail=no
747 session_terminal_missing="$tsm_missing"
750 if test "x$session_terminal_avail" = "xno" ; then
751 if test "x$enable_session_terminal" = "xyes" ; then
752 AC_ERROR([missing for session-terminal: $session_terminal_missing])
756 session_terminal_missing="enable-session-terminal"
760 session_cdev_avail=no
761 session_cdev_missing=""
762 if test ! "x$enable_session_cdev" = "xno" ; then
763 session_cdev_avail=yes
764 if test "x$have_fuse" = "xno" ; then
765 session_cdev_avail=no
766 session_cdev_missing="libfuse,$session_cdev_missing"
769 if test "x$tsm_avail" = "xno" ; then
770 session_cdev_avail=no
771 session_cdev_missing="$tsm_missing,$session_cdev_missing"
774 if test "x$session_cdev_avail" = "xno" ; then
775 if test "x$enable_session_cdev" = "xyes" ; then
776 AC_ERROR([missing for session-cdev: $session_cdev_missing])
780 session_cdev_missing="enable-session-cdev"
786 if test ! "x$enable_kmscon" = "xno" ; then
788 if test "x$eloop_avail" = "xno" ; then
790 kmscon_missing="$eloop_missing,$kmscon_missing"
793 if test "x$tsm_avail" = "xno" ; then
795 kmscon_missing="$tsm_missing,$kmscon_missing"
798 if test "x$uterm_avail" = "xno" ; then
800 kmscon_missing="$uterm_missing,$kmscon_missing"
803 if test "x$kmscon_avail" = "xno" ; then
804 if test "x$enable_kmscon" = "xyes" ; then
805 AC_ERROR([missing for kmscon: $kmscon_missing])
809 kmscon_missing="enable-kmscon"
813 # Enable all required modules
814 # We now know which modules can be built by checking the *_avail variables set
815 # above. We now only have to disable all modules that are disabled by default
816 # and the user didn't force-enable them and no other module that is enabled
817 # needs them. This is done top-down of course.
822 if test "x$kmscon_avail" = "xyes" ; then
823 if test "x${enable_kmscon% *}" = "xyes" ; then
831 session_cdev_enabled=no
832 if test "x$session_cdev_avail" = "xyes" ; then
833 if test "x${enable_session_cdev% *}" = "xyes" ; then
834 session_cdev_enabled=yes
839 session_terminal_enabled=no
840 if test "x$session_terminal_avail" = "xyes" ; then
841 if test "x${enable_session_terminal% *}" = "xyes" ; then
842 session_terminal_enabled=yes
848 session_dummy_enabled=no
849 if test "x$session_dummy_avail" = "xyes" ; then
850 if test "x${enable_session_dummy% *}" = "xyes" ; then
851 session_dummy_enabled=yes
856 font_pango_enabled=no
857 if test "x$font_pango_avail" = "xyes" ; then
858 if test "x${enable_font_pango% *}" = "xyes" ; then
859 font_pango_enabled=yes
864 font_freetype2_enabled=no
865 if test "x$font_freetype2_avail" = "xyes" ; then
866 if test "x${enable_font_freetype2% *}" = "xyes" ; then
867 font_freetype2_enabled=yes
872 font_unifont_enabled=no
873 if test "x$font_unifont_avail" = "xyes" ; then
874 if test "x${enable_font_unifont% *}" = "xyes" ; then
875 font_unifont_enabled=yes
880 renderer_gltex_enabled=no
881 if test "x$renderer_gltex_avail" = "xyes" ; then
882 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
883 renderer_gltex_enabled=yes
888 renderer_cairo_enabled=no
889 if test "x$renderer_cairo_avail" = "xyes" ; then
890 if test "x${enable_renderer_cairo% *}" = "xyes" ; then
891 renderer_cairo_enabled=yes
896 renderer_pixman_enabled=no
897 if test "x$renderer_pixman_avail" = "xyes" ; then
898 if test "x${enable_renderer_pixman% *}" = "xyes" ; then
899 renderer_pixman_enabled=yes
904 renderer_bbulk_enabled=no
905 if test "x$renderer_bbulk_avail" = "xyes" ; then
906 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
907 renderer_bbulk_enabled=yes
913 if test "x$hotplug_avail" = "xyes" ; then
914 if test "x${enable_hotplug% *}" = "xyes" ; then
920 multi_seat_enabled=no
921 if test "x$multi_seat_avail" = "xyes" ; then
922 if test "x${enable_multi_seat% *}" = "xyes" ; then
923 multi_seat_enabled=yes
929 if test "x$uterm_avail" = "xyes" ; then
930 if test "x${enable_uterm% *}" = "xyes" ; then
936 video_drm3d_enabled=no
937 if test "x$video_drm3d_avail" = "xyes" ; then
938 if test "x${enable_video_drm3d% *}" = "xyes" ; then
939 video_drm3d_enabled=yes
944 video_drm2d_enabled=no
945 if test "x$video_drm2d_avail" = "xyes" ; then
946 if test "x${enable_video_drm2d% *}" = "xyes" ; then
947 video_drm2d_enabled=yes
952 video_fbdev_enabled=no
953 if test "x$video_fbdev_avail" = "xyes" ; then
954 if test "x${enable_video_fbdev% *}" = "xyes" ; then
955 video_fbdev_enabled=yes
961 if test "x$uvt_avail" = "xyes" ; then
962 if test "x${enable_uvt% *}" = "xyes" ; then
969 if test "x$tsm_avail" = "xyes" ; then
970 if test "x${enable_tsm% *}" = "xyes" ; then
977 if test "x$eloop_avail" = "xyes" ; then
978 if test "x${enable_eloop% *}" = "xyes" ; then
984 eloop_dbus_enabled=no
985 if test "x$eloop_dbus_avail" = "xyes" ; then
986 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
987 eloop_dbus_enabled=yes
992 optimizations_enabled=no
993 if test "x$optimizations_avail" = "xyes" ; then
994 if test "x${enable_optimizations% *}" = "xyes" ; then
995 optimizations_enabled=yes
1001 if test "x$debug_avail" = "xyes" ; then
1002 if test "x${enable_debug% *}" = "xyes" ; then
1008 # Module Configuration
1009 # We have now done all dependency checking and default-value validation and we
1010 # now know which modules are enabled via the *_enabled variables.
1011 # Everything below is related to the configuration of each module and setting
1012 # the correct flags for the build process.
1016 if test "x$debug_enabled" = "xyes" ; then
1017 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
1019 AC_DEFINE([NDEBUG], [1], [No Debug])
1022 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
1023 [test "x$debug_enabled" = "xyes"])
1026 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
1027 [test "x$optimizations_enabled" = "xyes"])
1030 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
1031 [test "x$eloop_dbus_enabled" = "xyes"])
1034 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
1035 [test "x$eloop_enabled" = "xyes"])
1038 AM_CONDITIONAL([BUILD_ENABLE_TSM],
1039 [test "x$tsm_enabled" = "xyes"])
1042 AM_CONDITIONAL([BUILD_ENABLE_UVT],
1043 [test "x$uvt_enabled" = "xyes"])
1046 if test "x$video_fbdev_enabled" = "xyes" ; then
1047 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
1048 [Build uterm fbdev video backend])
1051 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
1052 [test "x$video_fbdev_enabled" = "xyes"])
1055 if test "x$video_drm2d_enabled" = "xyes" ; then
1056 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
1057 [Build uterm drm2d drm3d video backend])
1060 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
1061 [test "x$video_drm2d_enabled" = "xyes"])
1064 if test "x$video_drm3d_enabled" = "xyes" ; then
1065 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
1066 [Build uterm drm3d video backend])
1069 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
1070 [test "x$video_drm3d_enabled" = "xyes"])
1073 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1074 [test "x$uterm_enabled" = "xyes"])
1077 if test "x$multi_seat_enabled" = "xyes" ; then
1078 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1079 [Use systemd for multi-seat support])
1082 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1083 [test "x$multi_seat_enabled" = "xyes"])
1086 if test "x$hotplug_enabled" = "xyes" ; then
1087 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1088 [Use udev for hotplug support])
1091 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1092 [test "x$hotplug_enabled" = "xyes"])
1095 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1096 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1097 [Build bbulk rendering backend])
1100 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1101 [test "x$renderer_bbulk_enabled" = "xyes"])
1104 if test "x$renderer_gltex_enabled" = "xyes" ; then
1105 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1106 [Build gltex rendering backend])
1109 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1110 [test "x$renderer_gltex_enabled" = "xyes"])
1113 if test "x$renderer_cairo_enabled" = "xyes" ; then
1114 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1115 [Build cairo rendering backend])
1118 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1119 [test "x$renderer_cairo_enabled" = "xyes"])
1122 if test "x$renderer_pixman_enabled" = "xyes" ; then
1123 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1124 [Build pixman rendering backend])
1127 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1128 [test "x$renderer_pixman_enabled" = "xyes"])
1131 if test "x$font_unifont_enabled" = "xyes" ; then
1132 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1133 [Build static unifont backend])
1136 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1137 [test "x$font_unifont_enabled" = "xyes"])
1140 if test "x$font_freetype2_enabled" = "xyes" ; then
1141 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1142 [Build freetype2 font backend])
1145 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1146 [test "x$font_freetype2_enabled" = "xyes"])
1149 if test "x$font_pango_enabled" = "xyes" ; then
1150 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1151 [Build pango font backend])
1154 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1155 [test "x$font_pango_enabled" = "xyes"])
1158 if test "x$session_dummy_enabled" = "xyes" ; then
1159 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1160 [Build dummy session])
1163 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1164 [test "x$session_dummy_enabled" = "xyes"])
1167 if test "x$session_terminal_enabled" = "xyes" ; then
1168 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1169 [Build terminal session])
1172 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1173 [test "x$session_terminal_enabled" = "xyes"])
1176 if test "x$session_cdev_enabled" = "xyes" ; then
1177 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1178 [Build cdev session])
1181 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1182 [test "x$session_cdev_enabled" = "xyes"])
1185 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1186 [test "x$kmscon_enabled" = "xyes"])
1189 # Miscellaneous Checks
1190 # All checks below are independent of module checking or depend on the results
1191 # of it. They do not have any dependencies themselves so they are not part of the
1192 # module infrastructure.
1195 # check for _Static_assert
1196 AC_MSG_CHECKING([whether _Static_assert() is supported])
1198 have_static_assert=yes
1199 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1200 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1202 [Define to 1 if _Static_assert() is supported])],
1203 [have_static_assert=no])
1204 AC_MSG_RESULT([$have_static_assert])
1206 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1207 if test x$have_gbm = xyes ; then
1208 save_CFLAGS="$CFLAGS"
1210 save_LDFLAGS="$LDFLAGS"
1211 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1212 LIBS="$DRM_LIBS $GBM_LIBS"
1216 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1218 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1219 CFLAGS="$save_CFLAGS"
1221 LDFLAGS="$save_LDFLAGS"
1224 # check for xsltproc
1225 AC_PATH_PROG(XSLTPROC, xsltproc)
1226 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1228 # check for offline man-pages stylesheet
1229 AC_MSG_CHECKING([for docbook manpages stylesheet])
1230 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1231 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1232 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1233 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1234 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1235 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1236 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1237 AC_MSG_RESULT([yes])
1239 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1245 # After everything is configured, we correctly substitute the values for the
1249 AC_CONFIG_FILES([Makefile
1253 docs/pc/libuterm.pc])
1257 # Configuration output
1258 # Show configuration to the user so they can check whether everything was
1259 # configured as expected.
1262 AC_MSG_NOTICE([Build configuration:
1265 exec-prefix: $exec_prefix
1267 includedir: $includedir
1269 Applications and Libraries:
1270 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1271 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1272 tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1273 uvt: $uvt_enabled ($uvt_avail: $uvt_missing)
1274 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1276 Miscellaneous Options:
1277 debug: $debug_enabled ($debug_avail: $debug_missing)
1278 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1279 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1280 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1281 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1284 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1285 drm2d: $video_drm2d_enabled ($video_drm2d_avail: $video_drm2d_missing)
1286 drm3d: $video_drm3d_enabled ($video_drm3d_avail: $video_drm3d_missing)
1289 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1290 freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1291 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1294 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1295 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1296 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1297 pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1300 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1301 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1302 cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
1304 Run "${MAKE-make}" to start compilation process])