2 # Kmscon - build configuration script
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
9 AC_SUBST(PACKAGE_URL, [https://github.com/dvdhrm/kmscon])
10 AC_CONFIG_SRCDIR([src/kmscon_main.c])
11 AC_CONFIG_AUX_DIR([build-aux])
12 AC_CONFIG_MACRO_DIR([m4])
13 AC_CONFIG_HEADER(config.h)
14 AC_USE_SYSTEM_EXTENSIONS
16 AC_PREFIX_DEFAULT([/usr])
19 AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects dist-bzip2 no-dist-gzip tar-pax -Wall -Werror -Wno-portability])
20 AM_SILENT_RULES([yes])
23 # Don't add a default "-g -O2" if CFLAGS wasn't specified. For debugging it is
24 # often more convenient to have "-g -O0". You can still override it by
25 # explicitly setting it on the command line.
33 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
41 LT_INIT([disable-static])
44 # pkg-config dependencies
45 # This unconditionally checks for all dependencies even if they are disabled. We
46 # later look whether all required depedencies are met and finish the
47 # configuration. We group similar packages into one logical group here to avoid
48 # having variables for each single library.
49 # This, however, makes ./configure output very unintuitive error messages if a
50 # package is not found so we must make sure we print more verbose messages
54 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
55 [have_xkbcommon=yes], [have_xkbcommon=no])
56 AC_SUBST(XKBCOMMON_CFLAGS)
57 AC_SUBST(XKBCOMMON_LIBS)
59 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server wayland-cursor],
60 [have_wayland=yes], [have_wayland=no])
61 AC_SUBST(WAYLAND_CFLAGS)
62 AC_SUBST(WAYLAND_LIBS)
64 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
65 [have_systemd=yes], [have_systemd=no])
66 AC_SUBST(SYSTEMD_CFLAGS)
67 AC_SUBST(SYSTEMD_LIBS)
69 PKG_CHECK_MODULES([UDEV], [libudev >= 172],
70 [have_udev=yes], [have_udev=no])
74 PKG_CHECK_MODULES([DBUS], [dbus-1],
75 [have_dbus=yes], [have_dbus=no])
79 PKG_CHECK_MODULES([DRM], [libdrm],
80 [have_drm=yes], [have_drm=no])
84 PKG_CHECK_MODULES([GBM], [gbm],
85 [have_gbm=yes], [have_gbm=no])
89 PKG_CHECK_MODULES([EGL], [egl],
90 [have_egl=yes], [have_egl=no])
94 PKG_CHECK_MODULES([GLES2], [glesv2],
95 [have_gles2=yes], [have_gles2=no])
96 AC_SUBST(GLES2_CFLAGS)
99 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
100 [have_freetype2=yes], [have_freetype2=no])
101 AC_SUBST(FREETYPE2_CFLAGS)
102 AC_SUBST(FREETYPE2_LIBS)
104 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
105 [have_pango=yes], [have_pango=no])
106 AC_SUBST(PANGO_CFLAGS)
109 PKG_CHECK_MODULES([FUSE], [fuse >= 2.9.0],
110 [have_fuse=yes], [have_fuse=no])
111 AC_SUBST(FUSE_CFLAGS)
114 PKG_CHECK_MODULES([CAIRO], [cairo],
115 [have_cairo=yes], [have_cairo=no])
116 AC_SUBST(CAIRO_CFLAGS)
119 PKG_CHECK_MODULES([PIXMAN], [pixman-1],
120 [have_pixman=yes], [have_pixman=no])
121 AC_SUBST(PIXMAN_CFLAGS)
122 AC_SUBST(PIXMAN_LIBS)
126 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
127 # saves the results in local variables. This does not check dependencies or
128 # similar but does only parse the arguments.
132 AC_MSG_CHECKING([whether user wants eloop])
133 AC_ARG_ENABLE([eloop],
134 [AS_HELP_STRING([--enable-eloop],
135 [build eloop library])])
136 if test "x$enable_eloop" = "x" ; then
137 enable_eloop="no (default)"
139 AC_MSG_RESULT([$enable_eloop])
142 AC_MSG_CHECKING([whether user wants TSM])
144 [AS_HELP_STRING([--enable-tsm],
145 [build tsm library])])
146 if test "x$enable_tsm" = "x" ; then
147 enable_tsm="no (default)"
149 AC_MSG_RESULT([$enable_tsm])
152 AC_MSG_CHECKING([whether user wants uterm])
153 AC_ARG_ENABLE([uterm],
154 [AS_HELP_STRING([--enable-uterm],
155 [build uterm library])])
156 if test "x$enable_uterm" = "x" ; then
157 enable_uterm="no (default)"
159 AC_MSG_RESULT([$enable_uterm])
162 AC_MSG_CHECKING([whether user wants kmscon])
163 AC_ARG_ENABLE([kmscon],
164 [AS_HELP_STRING([--disable-kmscon],
165 [do not build kmscon])])
166 if test "x$enable_kmscon" = "x" ; then
167 enable_kmscon="yes (default)"
169 AC_MSG_RESULT([$enable_kmscon])
172 AC_MSG_CHECKING([whether user wants wlterm])
173 AC_ARG_ENABLE([wlterm],
174 [AS_HELP_STRING([--enable-wlterm],
176 if test "x$enable_wlterm" = "x" ; then
177 enable_wlterm="no (default)"
179 AC_MSG_RESULT([$enable_wlterm])
182 AC_MSG_CHECKING([whether to build with debugging on])
183 AC_ARG_ENABLE([debug],
184 [AS_HELP_STRING([--enable-debug],
185 [whether to build with debugging on])])
186 if test "x$enable_debug" = "x" ; then
187 enable_debug="yes (default)"
189 AC_MSG_RESULT([$enable_debug])
192 AC_MSG_CHECKING([whether to disable code optimizations])
193 AC_ARG_ENABLE([optimizations],
194 [AS_HELP_STRING([--disable-optimizations],
195 [whether to disable code optimizations])])
196 if test "x$enable_optimizations" = "x" ; then
197 enable_optimizations="yes (default)"
199 AC_MSG_RESULT([$enable_optimizations])
202 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
203 AC_ARG_ENABLE([multi-seat],
204 [AS_HELP_STRING([--enable-multi-seat],
205 [enable multi-seat support with systemd])])
206 if test "x$enable_multi_seat" = "x" ; then
207 enable_multi_seat="yes (default)"
209 AC_MSG_RESULT([$enable_multi_seat])
212 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
213 AC_ARG_ENABLE([hotplug],
214 [AS_HELP_STRING([--enable-hotplug],
215 [enable device hotplug support with udev])])
216 if test "x$enable_hotplug" = "x" ; then
217 enable_hotplug="yes (default)"
219 AC_MSG_RESULT([$enable_hotplug])
222 AC_MSG_CHECKING([whether user wants eloop dbus support])
223 AC_ARG_ENABLE([eloop-dbus],
224 [AS_HELP_STRING([--enable-eloop-dbus],
225 [enable eloop dbus support])])
226 if test "x$enable_eloop_dbus" = "x" ; then
227 enable_eloop_dbus="no (default)"
229 AC_MSG_RESULT([$enable_eloop_dbus])
232 AC_MSG_CHECKING([which video backends the user wants])
234 [AS_HELP_STRING([--with-video],
235 [specify list of optional video backends])])
236 enable_video_fbdev="no"
237 enable_video_drm2d="no"
238 enable_video_drm3d="no"
239 if test "x$with_video" = "x" ; then
240 enable_video_fbdev="yes (default)"
241 enable_video_drm2d="yes (default)"
242 enable_video_drm3d="yes (default)"
243 with_video="fbdev,drm2d,drm3d (default)"
247 for i in $with_video ; do
248 if test "x$i" = "xfbdev" ; then
249 enable_video_fbdev="yes"
250 elif test "x$i" = "xdrm2d" ; then
251 enable_video_drm2d="yes"
252 elif test "x$i" = "xdrm3d" ; then
253 enable_video_drm3d="yes"
256 AC_ERROR([Invalid video backend $i])
261 AC_MSG_RESULT([$with_video])
264 AC_MSG_CHECKING([which render backends the user wants])
265 AC_ARG_WITH([renderers],
266 [AS_HELP_STRING([--with-renderers],
267 [specify list of optional render backends])])
268 enable_renderer_bbulk="no"
269 enable_renderer_gltex="no"
270 enable_renderer_cairo="no"
271 enable_renderer_pixman="no"
272 if test "x$with_renderers" = "x" ; then
273 enable_renderer_bbulk="yes (default)"
274 enable_renderer_gltex="yes (default)"
275 enable_renderer_cairo="no (default)"
276 enable_renderer_pixman="no (default)"
277 with_renderers="bbulk,gltex (default)"
281 for i in $with_renderers ; do
282 if test "x$i" = "xbbulk" ; then
283 enable_renderer_bbulk="yes"
284 elif test "x$i" = "xgltex" ; then
285 enable_renderer_gltex="yes"
286 elif test "x$i" = "xcairo" ; then
287 enable_renderer_cairo="yes"
288 elif test "x$i" = "xpixman" ; then
289 enable_renderer_pixman="yes"
292 AC_ERROR([Unknown renderer $i])
297 AC_MSG_RESULT([$with_renderers])
300 AC_MSG_CHECKING([which font backends the user wants])
302 [AS_HELP_STRING([--with-fonts],
303 [specify list of optional font backends])])
304 enable_font_unifont="no"
305 enable_font_freetype2="no"
306 enable_font_pango="no"
307 if test "x$with_fonts" = "x" ; then
308 enable_font_unifont="yes (default)"
309 enable_font_freetype2="no (default)"
310 enable_font_pango="yes (default)"
311 with_fonts="unifont,pango (default)"
315 for i in $with_fonts ; do
316 if test "x$i" = "xunifont" ; then
317 enable_font_unifont="yes"
318 elif test "x$i" = "xfreetype2" ; then
319 enable_font_freetype2="yes"
320 elif test "x$i" = "xpango" ; then
321 enable_font_pango="yes"
324 AC_ERROR([Unknown font backend $i])
329 AC_MSG_RESULT([$with_fonts])
332 AC_MSG_CHECKING([which sessions the user wants])
333 AC_ARG_WITH([sessions],
334 [AS_HELP_STRING([--with-sessions],
335 [specify list of optional sessions])])
336 enable_session_dummy="no"
337 enable_session_terminal="no"
338 enable_session_cdev="no"
339 if test "x$with_sessions" = "x" ; then
340 enable_session_dummy="yes (default)"
341 enable_session_terminal="yes (default)"
342 enable_session_cdev="yes (default)"
343 with_sessions="dummy,terminal,cdev (default)"
347 for i in $with_sessions ; do
348 if test "x$i" = "xdummy" ; then
349 enable_session_dummy="yes"
350 elif test "x$i" = "xterminal" ; then
351 enable_session_terminal="yes"
352 elif test "x$i" = "xcdev" ; then
353 enable_session_cdev="yes"
356 AC_ERROR([Unknown session type $i])
361 AC_MSG_RESULT([$with_sessions])
364 # Check what can be built
365 # This checks each configuration option and tests whether all dependencies are
366 # met. This is done from bottom up to ensure the right order.
372 if test ! "x$enable_debug" = "xno" ; then
375 debug_missing="enable-debug"
379 optimizations_avail=no
380 optimizations_missing=""
381 if test ! "x$enable_optimizations" = "xno" ; then
382 optimizations_avail=yes
384 optimizations_missing="enable-optimizations"
389 eloop_dbus_missing=""
390 if test ! "x$enable_eloop_dbus" = "xno" ; then
392 if test "x$have_dbus" = "xno" ; then
394 eloop_dbus_missing="libdbus"
397 if test "x$eloop_dbus_avail" = "xno" ; then
398 if test "x$enable_eloop_dbus" = "xyes" ; then
399 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
403 eloop_dbus_missing="enable-eloop-dbus"
409 if test ! "x$enable_eloop" = "xno" ; then
412 eloop_missing="enable-eloop"
418 if test ! "x$enable_tsm" = "xno" ; then
420 if test "x$have_xkbcommon" = "xno" ; then
422 tsm_missing="libxkbcommon"
425 if test "x$tsm_avail" = "xno" ; then
426 if test "x$enable_tsm" = "xyes" ; then
427 AC_ERROR([missing for TSM: $tsm_missing])
431 tsm_missing="enable-tsm"
436 video_fbdev_missing=""
437 if test ! "x$enable_video_fbdev" = "xno" ; then
438 # TODO: check for kernel headers
439 video_fbdev_avail=yes
441 video_fbdev_missing="enable-video-fbdev"
446 video_drm2d_missing=""
447 if test ! "x$enable_video_drm2d" = "xno" ; then
448 video_drm2d_avail=yes
449 if test "x$have_drm3d" = "xno" ; then
451 video_drm2d_missing="libdrm3d"
454 if test "x$video_drm2d_avail" = "xno" ; then
455 if test "x$enable_video_drm2d" = "xyes" ; then
456 AC_ERROR([missing for drm2d video backend: $video_drm2d_missing])
460 video_drm2d_missing="enable-video-drm2d"
465 video_drm3d_missing=""
466 if test ! "x$enable_video_drm3d" = "xno" ; then
467 video_drm3d_avail=yes
468 if test "x$have_drm3d" = "xno" ; then
470 video_drm3d_missing="libdrm3d,$video_drm3d_missing"
472 if test "x$have_gbm" = "xno" ; then
474 video_drm3d_missing="libgbm,$video_drm3d_missing"
476 if test "x$have_egl" = "xno" ; then
478 video_drm3d_missing="libegl,$video_drm3d_missing"
480 if test "x$have_gles2" = "xno" ; then
482 video_drm3d_missing="libgles2,$video_drm3d_missing"
485 if test "x$video_drm3d_avail" = "xno" ; then
486 if test "x$enable_video_drm3d" = "xyes" ; then
487 AC_ERROR([missing for drm3d video backend: $video_drm3d_missing])
491 video_drm3d_missing="enable-video-drm3d"
497 if test ! "x$enable_uterm" = "xno" ; then
500 uterm_missing="enable-uterm"
505 multi_seat_missing=""
506 if test ! "x$enable_multi_seat" = "xno" ; then
508 if test "x$have_systemd" = "xno" ; then
510 multi_seat_missing="libsystemd"
513 if test "x$multi_seat_avail" = "xno" ; then
514 if test "x$enable_multi_seat" = "xyes" ; then
515 AC_ERROR([missing for multi-seat support: $multi_seat_missing])
519 multi_seat_missing="enable-multi-seat"
525 if test ! "x$enable_hotplug" = "xno" ; then
527 if test "x$have_udev" = "xno" ; then
529 hotplug_missing="libudev"
532 if test "x$hotplug_avail" = "xno" ; then
533 if test "x$enable_hotplug" = "xyes" ; then
534 AC_ERROR([missing for hotplug-support: $hotplug_missing])
538 hotplug_missing="enable-hotplug"
542 renderer_bbulk_avail=no
543 renderer_bbulk_missing=""
544 if test ! "x$enable_renderer_bbulk" = "xno" ; then
545 renderer_bbulk_avail=yes
547 renderer_bbulk_missing="enable-renderer-bbulk"
551 renderer_gltex_avail=no
552 renderer_gltex_missing=""
553 if test ! "x$enable_renderer_gltex" = "xno" ; then
554 renderer_gltex_avail=yes
555 if test "x$have_gles2" = "xno" ; then
556 renderer_gltex_avail=no
557 renderer_gltex_missing="libgles2"
560 if test "x$renderer_gltex_avail" = "xno" ; then
561 if test "x$enable_renderer_gltex" = "xyes" ; then
562 AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
566 renderer_gltex_missing="enable-renderer-gltex"
570 renderer_cairo_avail=no
571 renderer_cairo_missing=""
572 if test ! "x$enable_renderer_cairo" = "xno" ; then
573 renderer_cairo_avail=yes
574 if test "x$have_cairo" = "xno" ; then
575 renderer_cairo_avail=no
576 renderer_cairo_missing="cairo"
579 if test "x$renderer_cairo_avail" = "xno" ; then
580 if test "x$enable_renderer_cairo" = "xyes" ; then
581 AC_ERROR([missing for renderer-cairo: $renderer_cairo_missing])
585 renderer_cairo_missing="enable-renderer-cairo"
589 renderer_pixman_avail=no
590 renderer_pixman_missing=""
591 if test ! "x$enable_renderer_pixman" = "xno" ; then
592 renderer_pixman_avail=yes
593 if test "x$have_pixman" = "xno" ; then
594 renderer_pixman_avail=no
595 renderer_pixman_missing="pixman"
598 if test "x$renderer_pixman_avail" = "xno" ; then
599 if test "x$enable_renderer_pixman" = "xyes" ; then
600 AC_ERROR([missing for renderer-pixman: $renderer_pixman_missing])
604 renderer_pixman_missing="enable-renderer-pixman"
608 font_unifont_avail=no
609 font_unifont_missing=""
610 if test ! "x$enable_font_unifont" = "xno" ; then
611 font_unifont_avail=yes
613 font_unifont_missing="enable-font-unifont"
617 font_freetype2_avail=no
618 font_freetype2_missing=""
619 if test ! "x$enable_font_freetype2" = "xno" ; then
620 font_freetype2_avail=yes
621 if test "x$have_freetype2" = "xno" ; then
622 font_freetype2_avail=no
623 font_freetype2_missing="libfontconfig,libfreetype2"
626 if test "x$font_freetype2_avail" = "xno" ; then
627 if test "x$enable_font_freetype2" = "xyes" ; then
628 AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
632 font_freetype2_missing="enable-font-freetype2"
637 font_pango_missing=""
638 if test ! "x$enable_font_pango" = "xno" ; then
640 if test "x$have_pango" = "xno" ; then
642 font_pango_missing="libpango"
645 if test "x$font_pango_avail" = "xno" ; then
646 if test "x$enable_font_pango" = "xyes" ; then
647 AC_ERROR([missing for font-pango: $font_pango_missing])
651 font_pango_missing="enable-font-pango"
655 session_dummy_avail=no
656 session_dummy_missing=""
657 if test ! "x$enable_session_dummy" = "xno" ; then
658 session_dummy_avail=yes
660 session_dummy_missing="enable-session-dummy"
664 session_terminal_avail=no
665 session_terminal_missing=""
666 if test ! "x$enable_session_terminal" = "xno" ; then
667 session_terminal_avail=yes
668 if test "x$tsm_avail" = "xno" ; then
669 session_terminal_avail=no
670 session_terminal_missing="$tsm_missing"
673 if test "x$session_terminal_avail" = "xno" ; then
674 if test "x$enable_session_terminal" = "xyes" ; then
675 AC_ERROR([missing for session-terminal: $session_terminal_missing])
679 session_terminal_missing="enable-session-terminal"
683 session_cdev_avail=no
684 session_cdev_missing=""
685 if test ! "x$enable_session_cdev" = "xno" ; then
686 session_cdev_avail=yes
687 if test "x$have_fuse" = "xno" ; then
688 session_cdev_avail=no
689 session_cdev_missing="libfuse,$session_cdev_missing"
692 if test "x$tsm_avail" = "xno" ; then
693 session_cdev_avail=no
694 session_cdev_missing="$tsm_missing,$session_cdev_missing"
697 if test "x$session_cdev_avail" = "xno" ; then
698 if test "x$enable_session_cdev" = "xyes" ; then
699 AC_ERROR([missing for session-cdev: $session_cdev_missing])
703 session_cdev_missing="enable-session-cdev"
709 if test ! "x$enable_kmscon" = "xno" ; then
711 if test "x$eloop_avail" = "xno" ; then
713 kmscon_missing="$eloop_missing,$kmscon_missing"
716 if test "x$tsm_avail" = "xno" ; then
718 kmscon_missing="$tsm_missing,$kmscon_missing"
721 if test "x$uterm_avail" = "xno" ; then
723 kmscon_missing="$uterm_missing,$kmscon_missing"
726 if test "x$kmscon_avail" = "xno" ; then
727 if test "x$enable_kmscon" = "xyes" ; then
728 AC_ERROR([missing for kmscon: $kmscon_missing])
732 kmscon_missing="enable-kmscon"
738 if test ! "x$enable_wlterm" = "xno" ; then
740 if test "x$tsm_avail" = "xno" ; then
742 wlterm_missing="$tsm_missing,$wlterm_missing"
745 if test "x$eloop_avail" = "xno" ; then
747 wlterm_missing="$eloop_missing,$wlterm_missing"
750 if test "x$font_pango_avail" = "xno" ; then
752 wlterm_missing="$font_pango_missing,$wlterm_missing"
755 if test "x$have_wayland" = "xno" ; then
757 wlterm_missing="libwayland,$wlterm_missing"
760 if test "x$wlterm_avail" = "xno" ; then
761 if test "x$enable_wlterm" = "xyes" ; then
762 AC_ERROR([missing for wlterm: $wlterm_missing])
766 wlterm_missing="enable-wlterm"
770 # Enable all required modules
771 # We now know which modules can be built by checking the *_avail variables set
772 # above. We now only have to disable all modules that are disabled by default
773 # and the user didn't force-enable them and no other module that is enabled
774 # needs them. This is done top-down of course.
779 if test "x$wlterm_avail" = "xyes" ; then
780 if test "x${enable_wlterm% *}" = "xyes" ; then
784 enable_font_pango=yes
790 if test "x$kmscon_avail" = "xyes" ; then
791 if test "x${enable_kmscon% *}" = "xyes" ; then
799 session_cdev_enabled=no
800 if test "x$session_cdev_avail" = "xyes" ; then
801 if test "x${enable_session_cdev% *}" = "xyes" ; then
802 session_cdev_enabled=yes
807 session_terminal_enabled=no
808 if test "x$session_terminal_avail" = "xyes" ; then
809 if test "x${enable_session_terminal% *}" = "xyes" ; then
810 session_terminal_enabled=yes
816 session_dummy_enabled=no
817 if test "x$session_dummy_avail" = "xyes" ; then
818 if test "x${enable_session_dummy% *}" = "xyes" ; then
819 session_dummy_enabled=yes
824 font_pango_enabled=no
825 if test "x$font_pango_avail" = "xyes" ; then
826 if test "x${enable_font_pango% *}" = "xyes" ; then
827 font_pango_enabled=yes
832 font_freetype2_enabled=no
833 if test "x$font_freetype2_avail" = "xyes" ; then
834 if test "x${enable_font_freetype2% *}" = "xyes" ; then
835 font_freetype2_enabled=yes
840 font_unifont_enabled=no
841 if test "x$font_unifont_avail" = "xyes" ; then
842 if test "x${enable_font_unifont% *}" = "xyes" ; then
843 font_unifont_enabled=yes
848 renderer_gltex_enabled=no
849 if test "x$renderer_gltex_avail" = "xyes" ; then
850 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
851 renderer_gltex_enabled=yes
856 renderer_cairo_enabled=no
857 if test "x$renderer_cairo_avail" = "xyes" ; then
858 if test "x${enable_renderer_cairo% *}" = "xyes" ; then
859 renderer_cairo_enabled=yes
864 renderer_pixman_enabled=no
865 if test "x$renderer_pixman_avail" = "xyes" ; then
866 if test "x${enable_renderer_pixman% *}" = "xyes" ; then
867 renderer_pixman_enabled=yes
872 renderer_bbulk_enabled=no
873 if test "x$renderer_bbulk_avail" = "xyes" ; then
874 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
875 renderer_bbulk_enabled=yes
881 if test "x$hotplug_avail" = "xyes" ; then
882 if test "x${enable_hotplug% *}" = "xyes" ; then
888 multi_seat_enabled=no
889 if test "x$multi_seat_avail" = "xyes" ; then
890 if test "x${enable_multi_seat% *}" = "xyes" ; then
891 multi_seat_enabled=yes
897 if test "x$uterm_avail" = "xyes" ; then
898 if test "x${enable_uterm% *}" = "xyes" ; then
904 video_drm3d_enabled=no
905 if test "x$video_drm3d_avail" = "xyes" ; then
906 if test "x${enable_video_drm3d% *}" = "xyes" ; then
907 video_drm3d_enabled=yes
912 video_drm2d_enabled=no
913 if test "x$video_drm2d_avail" = "xyes" ; then
914 if test "x${enable_video_drm2d% *}" = "xyes" ; then
915 video_drm2d_enabled=yes
920 video_fbdev_enabled=no
921 if test "x$video_fbdev_avail" = "xyes" ; then
922 if test "x${enable_video_fbdev% *}" = "xyes" ; then
923 video_fbdev_enabled=yes
929 if test "x$tsm_avail" = "xyes" ; then
930 if test "x${enable_tsm% *}" = "xyes" ; then
937 if test "x$eloop_avail" = "xyes" ; then
938 if test "x${enable_eloop% *}" = "xyes" ; then
944 eloop_dbus_enabled=no
945 if test "x$eloop_dbus_avail" = "xyes" ; then
946 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
947 eloop_dbus_enabled=yes
952 optimizations_enabled=no
953 if test "x$optimizations_avail" = "xyes" ; then
954 if test "x${enable_optimizations% *}" = "xyes" ; then
955 optimizations_enabled=yes
961 if test "x$debug_avail" = "xyes" ; then
962 if test "x${enable_debug% *}" = "xyes" ; then
968 # Module Configuration
969 # We have now done all dependency checking and default-value validation and we
970 # now know which modules are enabled via the *_enabled variables.
971 # Everything below is related to the configuration of each module and setting
972 # the correct flags for the build process.
976 if test "x$debug_enabled" = "xyes" ; then
977 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
979 AC_DEFINE([NDEBUG], [1], [No Debug])
982 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
983 [test "x$debug_enabled" = "xyes"])
986 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
987 [test "x$optimizations_enabled" = "xyes"])
990 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
991 [test "x$eloop_dbus_enabled" = "xyes"])
994 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
995 [test "x$eloop_enabled" = "xyes"])
998 AM_CONDITIONAL([BUILD_ENABLE_TSM],
999 [test "x$tsm_enabled" = "xyes"])
1002 if test "x$video_fbdev_enabled" = "xyes" ; then
1003 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
1004 [Build uterm fbdev video backend])
1007 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
1008 [test "x$video_fbdev_enabled" = "xyes"])
1011 if test "x$video_drm2d_enabled" = "xyes" ; then
1012 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
1013 [Build uterm drm2d drm3d video backend])
1016 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
1017 [test "x$video_drm2d_enabled" = "xyes"])
1020 if test "x$video_drm3d_enabled" = "xyes" ; then
1021 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
1022 [Build uterm drm3d video backend])
1025 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
1026 [test "x$video_drm3d_enabled" = "xyes"])
1029 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1030 [test "x$uterm_enabled" = "xyes"])
1033 if test "x$multi_seat_enabled" = "xyes" ; then
1034 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1035 [Use systemd for multi-seat support])
1038 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1039 [test "x$multi_seat_enabled" = "xyes"])
1042 if test "x$hotplug_enabled" = "xyes" ; then
1043 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1044 [Use udev for hotplug support])
1047 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1048 [test "x$hotplug_enabled" = "xyes"])
1051 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1052 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1053 [Build bbulk rendering backend])
1056 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1057 [test "x$renderer_bbulk_enabled" = "xyes"])
1060 if test "x$renderer_gltex_enabled" = "xyes" ; then
1061 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1062 [Build gltex rendering backend])
1065 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1066 [test "x$renderer_gltex_enabled" = "xyes"])
1069 if test "x$renderer_cairo_enabled" = "xyes" ; then
1070 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
1071 [Build cairo rendering backend])
1074 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
1075 [test "x$renderer_cairo_enabled" = "xyes"])
1078 if test "x$renderer_pixman_enabled" = "xyes" ; then
1079 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
1080 [Build pixman rendering backend])
1083 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
1084 [test "x$renderer_pixman_enabled" = "xyes"])
1087 if test "x$font_unifont_enabled" = "xyes" ; then
1088 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1089 [Build static unifont backend])
1092 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1093 [test "x$font_unifont_enabled" = "xyes"])
1096 if test "x$font_freetype2_enabled" = "xyes" ; then
1097 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1098 [Build freetype2 font backend])
1101 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1102 [test "x$font_freetype2_enabled" = "xyes"])
1105 if test "x$font_pango_enabled" = "xyes" ; then
1106 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1107 [Build pango font backend])
1110 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1111 [test "x$font_pango_enabled" = "xyes"])
1114 if test "x$session_dummy_enabled" = "xyes" ; then
1115 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1116 [Build dummy session])
1119 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1120 [test "x$session_dummy_enabled" = "xyes"])
1123 if test "x$session_terminal_enabled" = "xyes" ; then
1124 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1125 [Build terminal session])
1128 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1129 [test "x$session_terminal_enabled" = "xyes"])
1132 if test "x$session_cdev_enabled" = "xyes" ; then
1133 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1134 [Build cdev session])
1137 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1138 [test "x$session_cdev_enabled" = "xyes"])
1141 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1142 [test "x$kmscon_enabled" = "xyes"])
1145 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1146 [test "x$wlterm_enabled" = "xyes"])
1149 # Miscellaneous Checks
1150 # All checks below are independent of module checking or depend on the results
1151 # of it. They do not have any dependencies themselves so they are not part of the
1152 # module infrastructure.
1155 # check for _Static_assert
1156 AC_MSG_CHECKING([whether _Static_assert() is supported])
1158 have_static_assert=yes
1159 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1160 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1162 [Define to 1 if _Static_assert() is supported])],
1163 [have_static_assert=no])
1164 AC_MSG_RESULT([$have_static_assert])
1166 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1167 if test x$have_gbm = xyes ; then
1168 save_CFLAGS="$CFLAGS"
1170 save_LDFLAGS="$LDFLAGS"
1171 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1172 LIBS="$DRM_LIBS $GBM_LIBS"
1176 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1178 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1179 CFLAGS="$save_CFLAGS"
1181 LDFLAGS="$save_LDFLAGS"
1184 # check for xsltproc
1185 AC_PATH_PROG(XSLTPROC, xsltproc)
1186 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1188 # check for offline man-pages stylesheet
1189 AC_MSG_CHECKING([for docbook manpages stylesheet])
1190 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1191 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1192 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1193 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1194 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1195 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1196 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1197 AC_MSG_RESULT([yes])
1199 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1205 # After everything is configured, we correctly substitute the values for the
1209 AC_CONFIG_FILES([Makefile
1212 docs/pc/libuterm.pc])
1216 # Configuration output
1217 # Show configuration to the user so they can check whether everything was
1218 # configured as expected.
1221 AC_MSG_NOTICE([Build configuration:
1224 exec-prefix: $exec_prefix
1226 includedir: $includedir
1228 Applications and Libraries:
1229 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1230 wlterm: $wlterm_enabled ($wlterm_avail: $wlterm_missing)
1231 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1232 tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1233 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1235 Miscellaneous Options:
1236 debug: $debug_enabled ($debug_avail: $debug_missing)
1237 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1238 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1239 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1240 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1243 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1244 drm2d: $video_drm2d_enabled ($video_drm2d_avail: $video_drm2d_missing)
1245 drm3d: $video_drm3d_enabled ($video_drm3d_avail: $video_drm3d_missing)
1248 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1249 freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1250 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1253 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1254 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1255 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1256 pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1259 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1260 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1261 cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
1263 Run "${MAKE-make}" to start compilation process])