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 if test "x$enable_all" = "xyes" ; then
392 enable_session_dummy="yes"
393 enable_session_terminal="yes"
394 with_sessions="dummy,terminal (all)"
395 elif test "x$with_sessions" = "xdefault" ; then
396 enable_session_dummy="yes (default)"
397 enable_session_terminal="yes (default)"
398 with_sessions="dummy,terminal (default)"
399 elif test ! "x$with_sessions" = "x" ; then
402 for i in $with_sessions ; do
403 if test "x$i" = "xdummy" ; then
404 enable_session_dummy="yes"
405 elif test "x$i" = "xterminal" ; then
406 enable_session_terminal="yes"
409 AC_ERROR([Unknown session type $i])
414 AC_MSG_RESULT([$with_sessions])
417 # Check what can be built
418 # This checks each configuration option and tests whether all dependencies are
419 # met. This is done from bottom up to ensure the right order.
425 if test ! "x$enable_debug" = "xno" ; then
428 debug_missing="enable-debug"
432 optimizations_avail=no
433 optimizations_missing=""
434 if test ! "x$enable_optimizations" = "xno" ; then
435 optimizations_avail=yes
437 optimizations_missing="enable-optimizations"
442 eloop_dbus_missing=""
443 if test ! "x$enable_eloop_dbus" = "xno" ; then
445 if test "x$have_dbus" = "xno" ; then
447 eloop_dbus_missing="libdbus"
450 if test "x$eloop_dbus_avail" = "xno" ; then
451 if test "x$enable_eloop_dbus" = "xyes" ; then
452 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
456 eloop_dbus_missing="enable-eloop-dbus"
462 if test ! "x$enable_eloop" = "xno" ; then
465 eloop_missing="enable-eloop"
471 if test ! "x$enable_tsm" = "xno" ; then
473 if test "x$have_xkbcommon" = "xno" ; then
475 tsm_missing="libxkbcommon"
478 if test "x$tsm_avail" = "xno" ; then
479 if test "x$enable_tsm" = "xyes" ; then
480 AC_ERROR([missing for TSM: $tsm_missing])
484 tsm_missing="enable-tsm"
490 if test ! "x$enable_uvt" = "xno" ; then
492 if test "x$have_fuse" = "xno" ; then
497 if test "x$uvt_avail" = "xno" ; then
498 if test "x$enable_uvt" = "xyes" ; then
499 AC_ERROR([missing for UVT: $uvt_missing])
503 uvt_missing="enable-uvt"
508 video_fbdev_missing=""
509 if test ! "x$enable_video_fbdev" = "xno" ; then
510 # TODO: check for kernel headers
511 video_fbdev_avail=yes
513 video_fbdev_missing="enable-video-fbdev"
518 video_drm2d_missing=""
519 if test ! "x$enable_video_drm2d" = "xno" ; then
520 video_drm2d_avail=yes
521 if test "x$have_drm3d" = "xno" ; then
523 video_drm2d_missing="libdrm3d"
526 if test "x$video_drm2d_avail" = "xno" ; then
527 if test "x$enable_video_drm2d" = "xyes" ; then
528 AC_ERROR([missing for drm2d video backend: $video_drm2d_missing])
532 video_drm2d_missing="enable-video-drm2d"
537 video_drm3d_missing=""
538 if test ! "x$enable_video_drm3d" = "xno" ; then
539 video_drm3d_avail=yes
540 if test "x$have_drm3d" = "xno" ; then
542 video_drm3d_missing="libdrm3d,$video_drm3d_missing"
544 if test "x$have_gbm" = "xno" ; then
546 video_drm3d_missing="libgbm,$video_drm3d_missing"
548 if test "x$have_egl" = "xno" ; then
550 video_drm3d_missing="libegl,$video_drm3d_missing"
552 if test "x$have_gles2" = "xno" ; then
554 video_drm3d_missing="libgles2,$video_drm3d_missing"
557 if test "x$video_drm3d_avail" = "xno" ; then
558 if test "x$enable_video_drm3d" = "xyes" ; then
559 AC_ERROR([missing for drm3d video backend: $video_drm3d_missing])
563 video_drm3d_missing="enable-video-drm3d"
569 if test ! "x$enable_uterm" = "xno" ; then
572 uterm_missing="enable-uterm"
577 multi_seat_missing=""
578 if test ! "x$enable_multi_seat" = "xno" ; then
580 if test "x$have_systemd" = "xno" ; then
582 multi_seat_missing="libsystemd"
585 if test "x$multi_seat_avail" = "xno" ; then
586 if test "x$enable_multi_seat" = "xyes" ; then
587 AC_ERROR([missing for multi-seat support: $multi_seat_missing])
591 multi_seat_missing="enable-multi-seat"
597 if test ! "x$enable_hotplug" = "xno" ; then
599 if test "x$have_udev" = "xno" ; then
601 hotplug_missing="libudev"
604 if test "x$hotplug_avail" = "xno" ; then
605 if test "x$enable_hotplug" = "xyes" ; then
606 AC_ERROR([missing for hotplug-support: $hotplug_missing])
610 hotplug_missing="enable-hotplug"
614 renderer_bbulk_avail=no
615 renderer_bbulk_missing=""
616 if test ! "x$enable_renderer_bbulk" = "xno" ; then
617 renderer_bbulk_avail=yes
619 renderer_bbulk_missing="enable-renderer-bbulk"
623 renderer_gltex_avail=no
624 renderer_gltex_missing=""
625 if test ! "x$enable_renderer_gltex" = "xno" ; then
626 renderer_gltex_avail=yes
627 if test "x$have_gles2" = "xno" ; then
628 renderer_gltex_avail=no
629 renderer_gltex_missing="libgles2"
632 if test "x$renderer_gltex_avail" = "xno" ; then
633 if test "x$enable_renderer_gltex" = "xyes" ; then
634 AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
638 renderer_gltex_missing="enable-renderer-gltex"
642 renderer_cairo_avail=no
643 renderer_cairo_missing=""
644 if test ! "x$enable_renderer_cairo" = "xno" ; then
645 renderer_cairo_avail=yes
646 if test "x$have_cairo" = "xno" ; then
647 renderer_cairo_avail=no
648 renderer_cairo_missing="cairo"
651 if test "x$renderer_cairo_avail" = "xno" ; then
652 if test "x$enable_renderer_cairo" = "xyes" ; then
653 AC_ERROR([missing for renderer-cairo: $renderer_cairo_missing])
657 renderer_cairo_missing="enable-renderer-cairo"
661 renderer_pixman_avail=no
662 renderer_pixman_missing=""
663 if test ! "x$enable_renderer_pixman" = "xno" ; then
664 renderer_pixman_avail=yes
665 if test "x$have_pixman" = "xno" ; then
666 renderer_pixman_avail=no
667 renderer_pixman_missing="pixman"
670 if test "x$renderer_pixman_avail" = "xno" ; then
671 if test "x$enable_renderer_pixman" = "xyes" ; then
672 AC_ERROR([missing for renderer-pixman: $renderer_pixman_missing])
676 renderer_pixman_missing="enable-renderer-pixman"
680 font_unifont_avail=no
681 font_unifont_missing=""
682 if test ! "x$enable_font_unifont" = "xno" ; then
683 font_unifont_avail=yes
685 font_unifont_missing="enable-font-unifont"
689 font_freetype2_avail=no
690 font_freetype2_missing=""
691 if test ! "x$enable_font_freetype2" = "xno" ; then
692 font_freetype2_avail=yes
693 if test "x$have_freetype2" = "xno" ; then
694 font_freetype2_avail=no
695 font_freetype2_missing="libfontconfig,libfreetype2"
698 if test "x$font_freetype2_avail" = "xno" ; then
699 if test "x$enable_font_freetype2" = "xyes" ; then
700 AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
704 font_freetype2_missing="enable-font-freetype2"
709 font_pango_missing=""
710 if test ! "x$enable_font_pango" = "xno" ; then
712 if test "x$have_pango" = "xno" ; then
714 font_pango_missing="libpango"
717 if test "x$font_pango_avail" = "xno" ; then
718 if test "x$enable_font_pango" = "xyes" ; then
719 AC_ERROR([missing for font-pango: $font_pango_missing])
723 font_pango_missing="enable-font-pango"
727 session_dummy_avail=no
728 session_dummy_missing=""
729 if test ! "x$enable_session_dummy" = "xno" ; then
730 session_dummy_avail=yes
732 session_dummy_missing="enable-session-dummy"
736 session_terminal_avail=no
737 session_terminal_missing=""
738 if test ! "x$enable_session_terminal" = "xno" ; then
739 session_terminal_avail=yes
740 if test "x$tsm_avail" = "xno" ; then
741 session_terminal_avail=no
742 session_terminal_missing="$tsm_missing"
745 if test "x$session_terminal_avail" = "xno" ; then
746 if test "x$enable_session_terminal" = "xyes" ; then
747 AC_ERROR([missing for session-terminal: $session_terminal_missing])
751 session_terminal_missing="enable-session-terminal"
757 if test ! "x$enable_kmscon" = "xno" ; then
759 if test "x$eloop_avail" = "xno" ; then
761 kmscon_missing="$eloop_missing,$kmscon_missing"
764 if test "x$tsm_avail" = "xno" ; then
766 kmscon_missing="$tsm_missing,$kmscon_missing"
769 if test "x$uterm_avail" = "xno" ; then
771 kmscon_missing="$uterm_missing,$kmscon_missing"
774 if test "x$kmscon_avail" = "xno" ; then
775 if test "x$enable_kmscon" = "xyes" ; then
776 AC_ERROR([missing for kmscon: $kmscon_missing])
780 kmscon_missing="enable-kmscon"
784 # Enable all required modules
785 # We now know which modules can be built by checking the *_avail variables set
786 # above. We now only have to disable all modules that are disabled by default
787 # and the user didn't force-enable them and no other module that is enabled
788 # needs them. This is done top-down of course.
793 if test "x$kmscon_avail" = "xyes" ; then
794 if test "x${enable_kmscon% *}" = "xyes" ; then
802 session_terminal_enabled=no
803 if test "x$session_terminal_avail" = "xyes" ; then
804 if test "x${enable_session_terminal% *}" = "xyes" ; then
805 session_terminal_enabled=yes
811 session_dummy_enabled=no
812 if test "x$session_dummy_avail" = "xyes" ; then
813 if test "x${enable_session_dummy% *}" = "xyes" ; then
814 session_dummy_enabled=yes
819 font_pango_enabled=no
820 if test "x$font_pango_avail" = "xyes" ; then
821 if test "x${enable_font_pango% *}" = "xyes" ; then
822 font_pango_enabled=yes
827 font_freetype2_enabled=no
828 if test "x$font_freetype2_avail" = "xyes" ; then
829 if test "x${enable_font_freetype2% *}" = "xyes" ; then
830 font_freetype2_enabled=yes
835 font_unifont_enabled=no
836 if test "x$font_unifont_avail" = "xyes" ; then
837 if test "x${enable_font_unifont% *}" = "xyes" ; then
838 font_unifont_enabled=yes
843 renderer_gltex_enabled=no
844 if test "x$renderer_gltex_avail" = "xyes" ; then
845 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
846 renderer_gltex_enabled=yes
851 renderer_cairo_enabled=no
852 if test "x$renderer_cairo_avail" = "xyes" ; then
853 if test "x${enable_renderer_cairo% *}" = "xyes" ; then
854 renderer_cairo_enabled=yes
859 renderer_pixman_enabled=no
860 if test "x$renderer_pixman_avail" = "xyes" ; then
861 if test "x${enable_renderer_pixman% *}" = "xyes" ; then
862 renderer_pixman_enabled=yes
867 renderer_bbulk_enabled=no
868 if test "x$renderer_bbulk_avail" = "xyes" ; then
869 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
870 renderer_bbulk_enabled=yes
876 if test "x$hotplug_avail" = "xyes" ; then
877 if test "x${enable_hotplug% *}" = "xyes" ; then
883 multi_seat_enabled=no
884 if test "x$multi_seat_avail" = "xyes" ; then
885 if test "x${enable_multi_seat% *}" = "xyes" ; then
886 multi_seat_enabled=yes
892 if test "x$uterm_avail" = "xyes" ; then
893 if test "x${enable_uterm% *}" = "xyes" ; then
899 video_drm3d_enabled=no
900 if test "x$video_drm3d_avail" = "xyes" ; then
901 if test "x${enable_video_drm3d% *}" = "xyes" ; then
902 video_drm3d_enabled=yes
907 video_drm2d_enabled=no
908 if test "x$video_drm2d_avail" = "xyes" ; then
909 if test "x${enable_video_drm2d% *}" = "xyes" ; then
910 video_drm2d_enabled=yes
915 video_fbdev_enabled=no
916 if test "x$video_fbdev_avail" = "xyes" ; then
917 if test "x${enable_video_fbdev% *}" = "xyes" ; then
918 video_fbdev_enabled=yes
924 if test "x$uvt_avail" = "xyes" ; then
925 if test "x${enable_uvt% *}" = "xyes" ; then
932 if test "x$tsm_avail" = "xyes" ; then
933 if test "x${enable_tsm% *}" = "xyes" ; then
940 if test "x$eloop_avail" = "xyes" ; then
941 if test "x${enable_eloop% *}" = "xyes" ; then
947 eloop_dbus_enabled=no
948 if test "x$eloop_dbus_avail" = "xyes" ; then
949 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
950 eloop_dbus_enabled=yes
955 optimizations_enabled=no
956 if test "x$optimizations_avail" = "xyes" ; then
957 if test "x${enable_optimizations% *}" = "xyes" ; then
958 optimizations_enabled=yes
964 if test "x$debug_avail" = "xyes" ; then
965 if test "x${enable_debug% *}" = "xyes" ; then
971 # Module Configuration
972 # We have now done all dependency checking and default-value validation and we
973 # now know which modules are enabled via the *_enabled variables.
974 # Everything below is related to the configuration of each module and setting
975 # the correct flags for the build process.
979 if test "x$debug_enabled" = "xyes" ; then
980 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
982 AC_DEFINE([NDEBUG], [1], [No Debug])
985 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
986 [test "x$debug_enabled" = "xyes"])
989 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
990 [test "x$optimizations_enabled" = "xyes"])
993 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
994 [test "x$eloop_dbus_enabled" = "xyes"])
997 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
998 [test "x$eloop_enabled" = "xyes"])
1001 AM_CONDITIONAL([BUILD_ENABLE_TSM],
1002 [test "x$tsm_enabled" = "xyes"])
1005 AM_CONDITIONAL([BUILD_ENABLE_UVT],
1006 [test "x$uvt_enabled" = "xyes"])
1009 if test "x$video_fbdev_enabled" = "xyes" ; then
1010 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
1011 [Build uterm fbdev video backend])
1014 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
1015 [test "x$video_fbdev_enabled" = "xyes"])
1018 if test "x$video_drm2d_enabled" = "xyes" ; then
1019 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
1020 [Build uterm drm2d drm3d video backend])
1023 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
1024 [test "x$video_drm2d_enabled" = "xyes"])
1027 if test "x$video_drm3d_enabled" = "xyes" ; then
1028 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
1029 [Build uterm drm3d video backend])
1032 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
1033 [test "x$video_drm3d_enabled" = "xyes"])
1036 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1037 [test "x$uterm_enabled" = "xyes"])
1040 if test "x$multi_seat_enabled" = "xyes" ; then
1041 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1042 [Use systemd for multi-seat support])
1045 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1046 [test "x$multi_seat_enabled" = "xyes"])
1049 if test "x$hotplug_enabled" = "xyes" ; then
1050 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1051 [Use udev for hotplug support])
1054 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1055 [test "x$hotplug_enabled" = "xyes"])
1058 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1059 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1060 [Build bbulk rendering backend])
1063 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1064 [test "x$renderer_bbulk_enabled" = "xyes"])
1067 if test "x$renderer_gltex_enabled" = "xyes" ; then
1068 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1069 [Build gltex rendering backend])
1072 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1073 [test "x$renderer_gltex_enabled" = "xyes"])
1076 if test "x$renderer_cairo_enabled" = "xyes" ; then
1077 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1078 [Build cairo rendering backend])
1081 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1082 [test "x$renderer_cairo_enabled" = "xyes"])
1085 if test "x$renderer_pixman_enabled" = "xyes" ; then
1086 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1087 [Build pixman rendering backend])
1090 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1091 [test "x$renderer_pixman_enabled" = "xyes"])
1094 if test "x$font_unifont_enabled" = "xyes" ; then
1095 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1096 [Build static unifont backend])
1099 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1100 [test "x$font_unifont_enabled" = "xyes"])
1103 if test "x$font_freetype2_enabled" = "xyes" ; then
1104 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1105 [Build freetype2 font backend])
1108 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1109 [test "x$font_freetype2_enabled" = "xyes"])
1112 if test "x$font_pango_enabled" = "xyes" ; then
1113 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1114 [Build pango font backend])
1117 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1118 [test "x$font_pango_enabled" = "xyes"])
1121 if test "x$session_dummy_enabled" = "xyes" ; then
1122 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1123 [Build dummy session])
1126 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1127 [test "x$session_dummy_enabled" = "xyes"])
1130 if test "x$session_terminal_enabled" = "xyes" ; then
1131 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1132 [Build terminal session])
1135 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1136 [test "x$session_terminal_enabled" = "xyes"])
1139 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1140 [test "x$kmscon_enabled" = "xyes"])
1143 # Miscellaneous Checks
1144 # All checks below are independent of module checking or depend on the results
1145 # of it. They do not have any dependencies themselves so they are not part of the
1146 # module infrastructure.
1149 # check for _Static_assert
1150 AC_MSG_CHECKING([whether _Static_assert() is supported])
1152 have_static_assert=yes
1153 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1154 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1156 [Define to 1 if _Static_assert() is supported])],
1157 [have_static_assert=no])
1158 AC_MSG_RESULT([$have_static_assert])
1160 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1161 if test x$have_gbm = xyes ; then
1162 save_CFLAGS="$CFLAGS"
1164 save_LDFLAGS="$LDFLAGS"
1165 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1166 LIBS="$DRM_LIBS $GBM_LIBS"
1170 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1172 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1173 CFLAGS="$save_CFLAGS"
1175 LDFLAGS="$save_LDFLAGS"
1178 # check for xsltproc
1179 AC_PATH_PROG(XSLTPROC, xsltproc)
1180 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1182 # check for offline man-pages stylesheet
1183 AC_MSG_CHECKING([for docbook manpages stylesheet])
1184 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1185 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1186 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1187 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1188 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1189 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1190 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1191 AC_MSG_RESULT([yes])
1193 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1199 # After everything is configured, we correctly substitute the values for the
1203 AC_CONFIG_FILES([Makefile
1207 docs/pc/libuterm.pc])
1211 # Configuration output
1212 # Show configuration to the user so they can check whether everything was
1213 # configured as expected.
1216 AC_MSG_NOTICE([Build configuration:
1219 exec-prefix: $exec_prefix
1221 includedir: $includedir
1223 Applications and Libraries:
1224 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1225 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1226 tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1227 uvt: $uvt_enabled ($uvt_avail: $uvt_missing)
1228 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1230 Miscellaneous Options:
1231 debug: $debug_enabled ($debug_avail: $debug_missing)
1232 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1233 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1234 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1235 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1238 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1239 drm2d: $video_drm2d_enabled ($video_drm2d_avail: $video_drm2d_missing)
1240 drm3d: $video_drm3d_enabled ($video_drm3d_avail: $video_drm3d_missing)
1243 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1244 freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1245 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1248 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1249 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1250 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1251 pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1254 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1255 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1257 Run "${MAKE-make}" to start compilation process])