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)
15 AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects dist-bzip2 no-dist-gzip tar-pax -Wall -Werror -Wno-portability])
16 AM_SILENT_RULES([yes])
19 # Don't add a default "-g -O2" if CFLAGS wasn't specified. For debugging it is
20 # often more convenient to have "-g -O0". You can still override it by
21 # explicitely setting it on the command line.
26 AC_USE_SYSTEM_EXTENSIONS
31 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
37 # pkg-config dependencies
38 # This unconditionally checks for all dependencies even if they are disabled. We
39 # later look whether all required depedencies are met and finish the
40 # configuration. We group similar packages into one logical group here to avoid
41 # having variables for each single library.
42 # This, however, makes ./configure output very unintuitive error messages if a
43 # package is not found so we must make sure we print more verbose messages
47 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
48 [have_xkbcommon=yes], [have_xkbcommon=no])
49 AC_SUBST(XKBCOMMON_CFLAGS)
50 AC_SUBST(XKBCOMMON_LIBS)
52 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server wayland-cursor],
53 [have_wayland=yes], [have_wayland=no])
54 AC_SUBST(WAYLAND_CFLAGS)
55 AC_SUBST(WAYLAND_LIBS)
57 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
58 [have_systemd=yes], [have_systemd=no])
59 AC_SUBST(SYSTEMD_CFLAGS)
60 AC_SUBST(SYSTEMD_LIBS)
62 PKG_CHECK_MODULES([UDEV], [libudev >= 172],
63 [have_udev=yes], [have_udev=no])
67 PKG_CHECK_MODULES([DBUS], [dbus-1],
68 [have_dbus=yes], [have_dbus=no])
72 PKG_CHECK_MODULES([DRM], [libdrm],
73 [have_drm=yes], [have_drm=no])
77 PKG_CHECK_MODULES([GBM], [gbm],
78 [have_gbm=yes], [have_gbm=no])
82 PKG_CHECK_MODULES([EGL], [egl],
83 [have_egl=yes], [have_egl=no])
87 PKG_CHECK_MODULES([GLES2], [glesv2],
88 [have_gles2=yes], [have_gles2=no])
89 AC_SUBST(GLES2_CFLAGS)
92 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
93 [have_freetype2=yes], [have_freetype2=no])
94 AC_SUBST(FREETYPE2_CFLAGS)
95 AC_SUBST(FREETYPE2_LIBS)
97 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
98 [have_pango=yes], [have_pango=no])
99 AC_SUBST(PANGO_CFLAGS)
102 PKG_CHECK_MODULES([FUSE], [fuse],
103 [have_fuse=yes], [have_fuse=no])
104 AC_SUBST(FUSE_CFLAGS)
107 PKG_CHECK_MODULES([PCIACCESS], [pciaccess],
108 [have_pciaccess=yes], [have_pciaccess=no])
109 AC_SUBST(PCIACCESS_CFLAGS)
110 AC_SUBST(PCIACCESS_LIBS)
114 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
115 # saves the results in local variables. This does not check dependencies or
116 # similar but does only parse the arguments.
120 AC_MSG_CHECKING([whether user wants eloop])
121 AC_ARG_ENABLE([eloop],
122 [AS_HELP_STRING([--enable-eloop],
123 [build eloop library])])
124 if test "x$enable_eloop" = "x" ; then
125 enable_eloop="no (default)"
127 AC_MSG_RESULT([$enable_eloop])
130 AC_MSG_CHECKING([whether user wants TSM])
132 [AS_HELP_STRING([--enable-tsm],
133 [build tsm library])])
134 if test "x$enable_tsm" = "x" ; then
135 enable_tsm="no (default)"
137 AC_MSG_RESULT([$enable_tsm])
140 AC_MSG_CHECKING([whether user wants uterm])
141 AC_ARG_ENABLE([uterm],
142 [AS_HELP_STRING([--enable-uterm],
143 [build uterm library])])
144 if test "x$enable_uterm" = "x" ; then
145 enable_uterm="no (default)"
147 AC_MSG_RESULT([$enable_uterm])
150 AC_MSG_CHECKING([whether user wants kmscon])
151 AC_ARG_ENABLE([kmscon],
152 [AS_HELP_STRING([--disable-kmscon],
153 [do not build kmscon])])
154 if test "x$enable_kmscon" = "x" ; then
155 enable_kmscon="yes (default)"
157 AC_MSG_RESULT([$enable_kmscon])
160 AC_MSG_CHECKING([whether user wants wlterm])
161 AC_ARG_ENABLE([wlterm],
162 [AS_HELP_STRING([--enable-wlterm],
164 if test "x$enable_wlterm" = "x" ; then
165 enable_wlterm="yes (default)"
167 AC_MSG_RESULT([$enable_wlterm])
170 AC_MSG_CHECKING([whether to build with debugging on])
171 AC_ARG_ENABLE([debug],
172 [AS_HELP_STRING([--enable-debug],
173 [whether to build with debugging on])])
174 if test "x$enable_debug" = "x" ; then
175 enable_debug="yes (default)"
177 AC_MSG_RESULT([$enable_debug])
180 AC_MSG_CHECKING([whether to disable code optimizations])
181 AC_ARG_ENABLE([optimizations],
182 [AS_HELP_STRING([--disable-optimizations],
183 [whether to disable code optimizations])])
184 if test "x$enable_optimizations" = "x" ; then
185 enable_optimizations="yes (default)"
187 AC_MSG_RESULT([$enable_optimizations])
190 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
191 AC_ARG_ENABLE([multi-seat],
192 [AS_HELP_STRING([--enable-multi-seat],
193 [enable multi-seat support with systemd])])
194 if test "x$enable_multi_seat" = "x" ; then
195 enable_multi_seat="yes (default)"
197 AC_MSG_RESULT([$enable_multi_seat])
200 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
201 AC_ARG_ENABLE([hotplug],
202 [AS_HELP_STRING([--enable-hotplug],
203 [enable device hotplug support with udev])])
204 if test "x$enable_hotplug" = "x" ; then
205 enable_hotplug="yes (default)"
207 AC_MSG_RESULT([$enable_hotplug])
210 AC_MSG_CHECKING([whether user wants pciaccess device detection])
211 AC_ARG_ENABLE([pciaccess],
212 [AS_HELP_STRING([--enable-pciaccess],
213 [enable device detection via pciaccess])])
214 if test "x$enable_pciaccess" = "x" ; then
215 enable_pciaccess="yes (default)"
217 AC_MSG_RESULT([$enable_pciaccess])
220 AC_MSG_CHECKING([whether user wants eloop dbus support])
221 AC_ARG_ENABLE([eloop-dbus],
222 [AS_HELP_STRING([--enable-eloop-dbus],
223 [enable eloop dbus support])])
224 if test "x$enable_eloop_dbus" = "x" ; then
225 enable_eloop_dbus="no (default)"
227 AC_MSG_RESULT([$enable_eloop_dbus])
230 AC_MSG_CHECKING([which video backends the user wants])
232 [AS_HELP_STRING([--with-video],
233 [specify list of optional video backends])])
234 enable_video_fbdev="no"
235 enable_video_dumb="no"
236 enable_video_drm="no"
237 if test "x$with_video" = "x" ; then
238 enable_video_fbdev="yes (default)"
239 enable_video_dumb="yes (default)"
240 enable_video_drm="yes (default)"
241 with_video="fbdev,dumb,drm (default)"
245 for i in $with_video ; do
246 if test "x$i" = "xfbdev" ; then
247 enable_video_fbdev="yes"
248 elif test "x$i" = "xdumb" ; then
249 enable_video_dumb="yes"
250 elif test "x$i" = "xdrm" ; then
251 enable_video_drm="yes"
254 AC_ERROR([Invalid video backend $i])
259 AC_MSG_RESULT([$with_video])
262 AC_MSG_CHECKING([which render backends the user wants])
263 AC_ARG_WITH([renderers],
264 [AS_HELP_STRING([--with-renderers],
265 [specify list of optional render backends])])
266 enable_renderer_bblit="no"
267 enable_renderer_bbulk="no"
268 enable_renderer_gltex="no"
269 if test "x$with_renderers" = "x" ; then
270 enable_renderer_bblit="yes (default)"
271 enable_renderer_bbulk="yes (default)"
272 enable_renderer_gltex="yes (default)"
273 with_renderers="bblit,bbulk,gltex (default)"
277 for i in $with_renderers ; do
278 if test "x$i" = "xbblit" ; then
279 enable_renderer_bblit="yes"
280 elif test "x$i" = "xbbulk" ; then
281 enable_renderer_bbulk="yes"
282 elif test "x$i" = "xgltex" ; then
283 enable_renderer_gltex="yes"
286 AC_ERROR([Unknown renderer $i])
291 AC_MSG_RESULT([$with_renderers])
294 AC_MSG_CHECKING([which font backends the user wants])
296 [AS_HELP_STRING([--with-fonts],
297 [specify list of optional font backends])])
298 enable_font_unifont="no"
299 enable_font_freetype2="no"
300 enable_font_pango="no"
301 if test "x$with_fonts" = "x" ; then
302 enable_font_unifont="no (default)"
303 enable_font_freetype2="yes (default)"
304 enable_font_pango="yes (default)"
305 with_fonts="freetype2,pango (default)"
309 for i in $with_fonts ; do
310 if test "x$i" = "xunifont" ; then
311 enable_font_unifont="yes"
312 elif test "x$i" = "xfreetype2" ; then
313 enable_font_freetype2="yes"
314 elif test "x$i" = "xpango" ; then
315 enable_font_pango="yes"
318 AC_ERROR([Unknown font backend $i])
323 AC_MSG_RESULT([$with_fonts])
326 AC_MSG_CHECKING([which sessions the user wants])
327 AC_ARG_WITH([sessions],
328 [AS_HELP_STRING([--with-sessions],
329 [specify list of optional sessions])])
330 enable_session_dummy="no"
331 enable_session_terminal="no"
332 enable_session_cdev="no"
333 if test "x$with_sessions" = "x" ; then
334 enable_session_dummy="yes (default)"
335 enable_session_terminal="yes (default)"
336 enable_session_cdev="yes (default)"
337 with_sessions="dummy,terminal,cdev (default)"
341 for i in $with_sessions ; do
342 if test "x$i" = "xdummy" ; then
343 enable_session_dummy="yes"
344 elif test "x$i" = "xterminal" ; then
345 enable_session_terminal="yes"
346 elif test "x$i" = "xcdev" ; then
347 enable_session_cdev="yes"
350 AC_ERROR([Unknown session type $i])
355 AC_MSG_RESULT([$with_sessions])
358 # Check what can be built
359 # This checks each configuration option and tests whether all dependencies are
360 # met. This is done from bottom up to ensure the right order.
366 if test ! "x$enable_debug" = "xno" ; then
369 debug_missing="enable-debug"
373 optimizations_avail=no
374 optimizations_missing=""
375 if test ! "x$enable_optimizations" = "xno" ; then
376 optimizations_avail=yes
378 optimizations_missing="enable-optimizations"
383 eloop_dbus_missing=""
384 if test ! "x$enable_eloop_dbus" = "xno" ; then
386 if test "x$have_dbus" = "xno" ; then
388 eloop_dbus_missing="libdbus"
391 if test "x$eloop_dbus_avail" = "xno" ; then
392 if test "x$enable_eloop_dbus" = "xyes" ; then
393 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
397 eloop_dbus_missing="enable-eloop-dbus"
403 if test ! "x$enable_eloop" = "xno" ; then
406 eloop_missing="enable-eloop"
412 if test ! "x$enable_tsm" = "xno" ; then
414 if test "x$have_xkbcommon" = "xno" ; then
416 tsm_missing="libxkbcommon"
419 if test "x$tsm_avail" = "xno" ; then
420 if test "x$enable_tsm" = "xyes" ; then
421 AC_ERROR([missing for TSM: $tsm_missing])
425 tsm_missing="enable-tsm"
430 video_fbdev_missing=""
431 if test ! "x$enable_video_fbdev" = "xno" ; then
432 # TODO: check for kernel headers
433 video_fbdev_avail=yes
435 video_fbdev_missing="enable-video-fbdev"
440 video_dumb_missing=""
441 if test ! "x$enable_video_dumb" = "xno" ; then
443 if test "x$have_drm" = "xno" ; then
445 video_dumb_missing="libdrm"
448 if test "x$video_dumb_avail" = "xno" ; then
449 if test "x$enable_video_dumb" = "xyes" ; then
450 AC_ERROR([missing for dumb video backend: $video_dumb_missing])
454 video_dumb_missing="enable-video-dumb"
460 if test ! "x$enable_video_drm" = "xno" ; then
462 if test "x$have_drm" = "xno" ; then
464 video_drm_missing="libdrm,$video_drm_missing"
466 if test "x$have_gbm" = "xno" ; then
468 video_drm_missing="libgbm,$video_drm_missing"
470 if test "x$have_egl" = "xno" ; then
472 video_drm_missing="libegl,$video_drm_missing"
474 if test "x$have_gles2" = "xno" ; then
476 video_drm_missing="libgles2,$video_drm_missing"
479 if test "x$video_drm_avail" = "xno" ; then
480 if test "x$enable_video_drm" = "xyes" ; then
481 AC_ERROR([missing for drm video backend: $video_drm_missing])
485 video_drm_missing="enable-video-drm"
491 if test ! "x$enable_uterm" = "xno" ; then
494 uterm_missing="enable-uterm"
499 multi_seat_missing=""
500 if test ! "x$enable_multi_seat" = "xno" ; then
502 if test "x$have_systemd" = "xno" ; then
504 multi_seat_missing="libsystemd"
507 if test "x$multi_seat_avail" = "xno" ; then
508 if test "x$enable_multi_seat" = "xyes" ; then
509 AC_ERROR([missing for multi-seat support: $multi_seat_missing])
513 multi_seat_missing="enable-multi-seat"
519 if test ! "x$enable_hotplug" = "xno" ; then
521 if test "x$have_udev" = "xno" ; then
523 hotplug_missing="libudev"
526 if test "x$hotplug_avail" = "xno" ; then
527 if test "x$enable_hotplug" = "xyes" ; then
528 AC_ERROR([missing for hotplug-support: $hotplug_missing])
532 hotplug_missing="enable-hotplug"
538 if test ! "x$enable_pciaccess" = "xno" ; then
540 if test "x$have_pciaccess" = "xno" ; then
542 pciaccess_missing="libpciaccess"
545 if test "x$pciaccess_avail" = "xno" ; then
546 if test "x$enable_pciaccess" = "xyes" ; then
547 AC_ERROR([missing for pciaccess: $pciaccess_missing])
551 pciaccess_missing="enable-pciaccess"
555 renderer_bblit_avail=no
556 renderer_bblit_missing=""
557 if test ! "x$enable_renderer_bblit" = "xno" ; then
558 renderer_bblit_avail=yes
560 renderer_bblit_missing="enable-renderer-bblit"
564 renderer_bbulk_avail=no
565 renderer_bbulk_missing=""
566 if test ! "x$enable_renderer_bbulk" = "xno" ; then
567 renderer_bbulk_avail=yes
569 renderer_bbulk_missing="enable-renderer-bbulk"
573 renderer_gltex_avail=no
574 renderer_gltex_missing=""
575 if test ! "x$enable_renderer_gltex" = "xno" ; then
576 renderer_gltex_avail=yes
577 if test "x$have_gles2" = "xno" ; then
578 renderer_gltex_avail=no
579 renderer_gltex_missing="libgles2"
582 if test "x$renderer_gltex_avail" = "xno" ; then
583 if test "x$enable_renderer_gltex" = "xyes" ; then
584 AC_ERROR([missing for renderer-gltex: $renderer_gltex_missing])
588 renderer_gltex_missing="enable-renderer-gltex"
592 font_unifont_avail=no
593 font_unifont_missing=""
594 if test ! "x$enable_font_unifont" = "xno" ; then
595 font_unifont_avail=yes
597 font_unifont_missing="enable-font-unifont"
601 font_freetype2_avail=no
602 font_freetype2_missing=""
603 if test ! "x$enable_font_freetype2" = "xno" ; then
604 font_freetype2_avail=yes
605 if test "x$have_freetype2" = "xno" ; then
606 font_freetype2_avail=no
607 font_freetype2_missing="libfontconfig,libfreetype2"
610 if test "x$font_freetype2_avail" = "xno" ; then
611 if test "x$enable_font_freetype2" = "xyes" ; then
612 AC_ERROR([missing for font-freetype2: $font_freetype2_missing])
616 font_freetype2_missing="enable-font-freetype2"
621 font_pango_missing=""
622 if test ! "x$enable_font_pango" = "xno" ; then
624 if test "x$have_pango" = "xno" ; then
626 font_pango_missing="libpango"
629 if test "x$font_pango_avail" = "xno" ; then
630 if test "x$enable_font_pango" = "xyes" ; then
631 AC_ERROR([missing for font-pango: $font_pango_missing])
635 font_pango_missing="enable-font-pango"
639 session_dummy_avail=no
640 session_dummy_missing=""
641 if test ! "x$enable_session_dummy" = "xno" ; then
642 session_dummy_avail=yes
644 session_dummy_missing="enable-session-dummy"
648 session_terminal_avail=no
649 session_terminal_missing=""
650 if test ! "x$enable_session_terminal" = "xno" ; then
651 session_terminal_avail=yes
652 if test "x$tsm_avail" = "xno" ; then
653 session_terminal_avail=no
654 session_terminal_missing="$tsm_missing"
657 if test "x$session_terminal_avail" = "xno" ; then
658 if test "x$enable_session_terminal" = "xyes" ; then
659 AC_ERROR([missing for session-terminal: $session_terminal_missing])
663 session_terminal_missing="enable-session-terminal"
667 session_cdev_avail=no
668 session_cdev_missing=""
669 if test ! "x$enable_session_cdev" = "xno" ; then
670 session_cdev_avail=yes
671 if test "x$have_fuse" = "xno" ; then
672 session_cdev_avail=no
673 session_cdev_missing="libfuse,$session_cdev_missing"
676 if test "x$tsm_avail" = "xno" ; then
677 session_cdev_avail=no
678 session_cdev_missing="$tsm_missing,$session_cdev_missing"
681 if test "x$session_cdev_avail" = "xno" ; then
682 if test "x$enable_session_cdev" = "xyes" ; then
683 AC_ERROR([missing for session-cdev: $session_cdev_missing])
687 session_cdev_missing="enable-session-cdev"
693 if test ! "x$enable_kmscon" = "xno" ; then
695 if test "x$eloop_avail" = "xno" ; then
697 kmscon_missing="$eloop_missing,$kmscon_missing"
700 if test "x$tsm_avail" = "xno" ; then
702 kmscon_missing="$tsm_missing,$kmscon_missing"
705 if test "x$uterm_avail" = "xno" ; then
707 kmscon_missing="$uterm_missing,$kmscon_missing"
710 if test "x$kmscon_avail" = "xno" ; then
711 if test "x$enable_kmscon" = "xyes" ; then
712 AC_ERROR([missing for kmscon: $kmscon_missing])
716 kmscon_missing="enable-kmscon"
722 if test ! "x$enable_wlterm" = "xno" ; then
724 if test "x$tsm_avail" = "xno" ; then
726 wlterm_missing="$tsm_missing,$wlterm_missing"
729 if test "x$eloop_avail" = "xno" ; then
731 wlterm_missing="$eloop_missing,$wlterm_missing"
734 if test "x$have_wayland" = "xno" ; then
736 wlterm_missing="libwayland,$wlterm_missing"
739 if test "x$wlterm_avail" = "xno" ; then
740 if test "x$enable_wlterm" = "xyes" ; then
741 AC_ERROR([missing for wlterm: $wlterm_missing])
745 wlterm_missing="enable-wlterm"
749 # Enable all required modules
750 # We now know which modules can be built by checking the *_avail variables set
751 # above. We now only have to disable all modules that are disabled by default
752 # and the user didn't force-enable them and no other module that is enabled
753 # needs them. This is done top-down of course.
758 if test "x$wlterm_avail" = "xyes" ; then
759 if test "x${enable_wlterm% *}" = "xyes" ; then
768 if test "x$kmscon_avail" = "xyes" ; then
769 if test "x${enable_kmscon% *}" = "xyes" ; then
777 session_cdev_enabled=no
778 if test "x$session_cdev_avail" = "xyes" ; then
779 if test "x${enable_session_cdev% *}" = "xyes" ; then
780 session_cdev_enabled=yes
785 session_terminal_enabled=no
786 if test "x$session_terminal_avail" = "xyes" ; then
787 if test "x${enable_session_terminal% *}" = "xyes" ; then
788 session_terminal_enabled=yes
794 session_dummy_enabled=no
795 if test "x$session_dummy_avail" = "xyes" ; then
796 if test "x${enable_session_dummy% *}" = "xyes" ; then
797 session_dummy_enabled=yes
802 font_pango_enabled=no
803 if test "x$font_pango_avail" = "xyes" ; then
804 if test "x${enable_font_pango% *}" = "xyes" ; then
805 font_pango_enabled=yes
810 font_freetype2_enabled=no
811 if test "x$font_freetype2_avail" = "xyes" ; then
812 if test "x${enable_font_freetype2% *}" = "xyes" ; then
813 font_freetype2_enabled=yes
818 font_unifont_enabled=no
819 if test "x$font_unifont_avail" = "xyes" ; then
820 if test "x${enable_font_unifont% *}" = "xyes" ; then
821 font_unifont_enabled=yes
826 renderer_gltex_enabled=no
827 if test "x$renderer_gltex_avail" = "xyes" ; then
828 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
829 renderer_gltex_enabled=yes
834 renderer_bbulk_enabled=no
835 if test "x$renderer_bbulk_avail" = "xyes" ; then
836 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
837 renderer_bbulk_enabled=yes
842 renderer_bblit_enabled=no
843 if test "x$renderer_bblit_avail" = "xyes" ; then
844 if test "x${enable_renderer_bblit% *}" = "xyes" ; then
845 renderer_bblit_enabled=yes
851 if test "x$pciaccess_avail" = "xyes" ; then
852 if test "x${enable_pciaccess% *}" = "xyes" ; then
853 pciaccess_enabled=yes
859 if test "x$hotplug_avail" = "xyes" ; then
860 if test "x${enable_hotplug% *}" = "xyes" ; then
866 multi_seat_enabled=no
867 if test "x$multi_seat_avail" = "xyes" ; then
868 if test "x${enable_multi_seat% *}" = "xyes" ; then
869 multi_seat_enabled=yes
875 if test "x$uterm_avail" = "xyes" ; then
876 if test "x${enable_uterm% *}" = "xyes" ; then
883 if test "x$video_drm_avail" = "xyes" ; then
884 if test "x${enable_video_drm% *}" = "xyes" ; then
885 video_drm_enabled=yes
890 video_dumb_enabled=no
891 if test "x$video_dumb_avail" = "xyes" ; then
892 if test "x${enable_video_dumb% *}" = "xyes" ; then
893 video_dumb_enabled=yes
898 video_fbdev_enabled=no
899 if test "x$video_fbdev_avail" = "xyes" ; then
900 if test "x${enable_video_fbdev% *}" = "xyes" ; then
901 video_fbdev_enabled=yes
907 if test "x$tsm_avail" = "xyes" ; then
908 if test "x${enable_tsm% *}" = "xyes" ; then
915 if test "x$eloop_avail" = "xyes" ; then
916 if test "x${enable_eloop% *}" = "xyes" ; then
922 eloop_dbus_enabled=no
923 if test "x$eloop_dbus_avail" = "xyes" ; then
924 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
925 eloop_dbus_enabled=yes
930 optimizations_enabled=no
931 if test "x$optimizations_avail" = "xyes" ; then
932 if test "x${enable_optimizations% *}" = "xyes" ; then
933 optimizations_enabled=yes
939 if test "x$debug_avail" = "xyes" ; then
940 if test "x${enable_debug% *}" = "xyes" ; then
946 # Module Configuration
947 # We have now done all dependency checking and default-value validation and we
948 # now know which modules are enabled via the *_enabled variables.
949 # Everything below is related to the configuration of each module and setting
950 # the correct flags for the build process.
954 if test "x$debug_enabled" = "xyes" ; then
955 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
957 AC_DEFINE([NDEBUG], [1], [No Debug])
960 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
961 [test "x$debug_enabled" = "xyes"])
964 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
965 [test "x$optimizations_enabled" = "xyes"])
968 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
969 [test "x$eloop_dbus_enabled" = "xyes"])
972 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
973 [test "x$eloop_enabled" = "xyes"])
976 AM_CONDITIONAL([BUILD_ENABLE_TSM],
977 [test "x$tsm_enabled" = "xyes"])
980 if test "x$video_fbdev_enabled" = "xyes" ; then
981 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
982 [Build uterm fbdev video backend])
985 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
986 [test "x$video_fbdev_enabled" = "xyes"])
989 if test "x$video_dumb_enabled" = "xyes" ; then
990 AC_DEFINE([BUILD_ENABLE_VIDEO_DUMB], [1],
991 [Build uterm dumb drm video backend])
994 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DUMB],
995 [test "x$video_dumb_enabled" = "xyes"])
998 if test "x$video_drm_enabled" = "xyes" ; then
999 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM], [1],
1000 [Build uterm drm video backend])
1003 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM],
1004 [test "x$video_drm_enabled" = "xyes"])
1007 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
1008 [test "x$uterm_enabled" = "xyes"])
1011 if test "x$multi_seat_enabled" = "xyes" ; then
1012 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
1013 [Use systemd for multi-seat support])
1016 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
1017 [test "x$multi_seat_enabled" = "xyes"])
1020 if test "x$hotplug_enabled" = "xyes" ; then
1021 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
1022 [Use udev for hotplug support])
1025 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
1026 [test "x$hotplug_enabled" = "xyes"])
1029 if test "x$pciaccess_enabled" = "xyes" ; then
1030 AC_DEFINE([BUILD_ENABLE_PCIACCESS], [1],
1031 [Use pciaccess for device detection])
1034 AM_CONDITIONAL([BUILD_ENABLE_PCIACCESS],
1035 [test "x$pciaccess_enabled" = "xyes"])
1038 if test "x$renderer_bblit_enabled" = "xyes" ; then
1039 AC_DEFINE([BUILD_ENABLE_RENDERER_BBLIT], [1],
1040 [Build bblit rendering backend])
1043 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBLIT],
1044 [test "x$renderer_bblit_enabled" = "xyes"])
1047 if test "x$renderer_bbulk_enabled" = "xyes" ; then
1048 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
1049 [Build bbulk rendering backend])
1052 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
1053 [test "x$renderer_bbulk_enabled" = "xyes"])
1056 if test "x$renderer_gltex_enabled" = "xyes" ; then
1057 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
1058 [Build gltex rendering backend])
1061 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
1062 [test "x$renderer_gltex_enabled" = "xyes"])
1065 if test "x$font_unifont_enabled" = "xyes" ; then
1066 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
1067 [Build static unifont backend])
1070 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
1071 [test "x$font_unifont_enabled" = "xyes"])
1074 if test "x$font_freetype2_enabled" = "xyes" ; then
1075 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
1076 [Build freetype2 font backend])
1079 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
1080 [test "x$font_freetype2_enabled" = "xyes"])
1083 if test "x$font_pango_enabled" = "xyes" ; then
1084 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
1085 [Build pango font backend])
1088 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
1089 [test "x$font_pango_enabled" = "xyes"])
1092 if test "x$session_dummy_enabled" = "xyes" ; then
1093 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
1094 [Build dummy session])
1097 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1098 [test "x$session_dummy_enabled" = "xyes"])
1101 if test "x$session_terminal_enabled" = "xyes" ; then
1102 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1103 [Build terminal session])
1106 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1107 [test "x$session_terminal_enabled" = "xyes"])
1110 if test "x$session_cdev_enabled" = "xyes" ; then
1111 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1112 [Build cdev session])
1115 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1116 [test "x$session_cdev_enabled" = "xyes"])
1119 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1120 [test "x$kmscon_enabled" = "xyes"])
1123 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1124 [test "x$wlterm_enabled" = "xyes"])
1127 # Miscellaneous Checks
1128 # All checks below are independent of module checking or depend on the results
1129 # of it. They do not have any dependencies themself so they are not part of the
1130 # module infrastructure.
1133 # check for _Static_assert
1134 AC_MSG_CHECKING([whether _Static_assert() is supported])
1136 have_static_assert=yes
1137 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1138 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1140 [Define to 1 if _Static_assert() is supported])],
1141 [have_static_assert=no])
1142 AC_MSG_RESULT([$have_static_assert])
1144 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1145 if test x$have_gbm = xyes ; then
1146 save_CFLAGS="$CFLAGS"
1148 save_LDFLAGS="$LDFLAGS"
1149 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1150 LIBS="$DRM_LIBS $GBM_LIBS"
1154 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1156 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1157 CFLAGS="$save_CFLAGS"
1159 LDFLAGS="$save_LDFLAGS"
1162 # check for xsltproc
1163 AC_PATH_PROG(XSLTPROC, xsltproc)
1164 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1166 # check for offline man-pages stylesheet
1167 AC_MSG_CHECKING([for docbook manpages stylesheet])
1168 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1169 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1170 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1171 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1172 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1173 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1174 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1175 AC_MSG_RESULT([yes])
1177 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1183 # After everything is configured, we correctly substitute the values for the
1187 AC_CONFIG_FILES([Makefile
1190 docs/pc/libuterm.pc])
1194 # Configuration output
1195 # Show configuration to the user so they can check whether everything was
1196 # configured as expected.
1199 AC_MSG_NOTICE([Build configuration:
1202 exec-prefix: $exec_prefix
1204 includedir: $includedir
1206 Applications and Libraries:
1207 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1208 wlterm: $wlterm_enabled ($wlterm_avail: $wlterm_missing)
1209 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1210 tsm: $tsm_enabled ($tsm_avail: $tsm_missing)
1211 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1213 Miscellaneous Options:
1214 debug: $debug_enabled ($debug_avail: $debug_missing)
1215 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1216 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1217 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1218 pciaccess: $pciaccess_enabled ($pciaccess_avail: $pciaccess_missing)
1219 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1222 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1223 dumb drm: $video_dumb_enabled ($video_dumb_avail: $video_dumb_missing)
1224 drm: $video_drm_enabled ($video_drm_avail: $video_drm_missing)
1227 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1228 freetype2: $font_freetype2_enabled ($font_freetype2_avail: $font_freetype2_missing)
1229 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1232 bblit: $renderer_bblit_enabled ($renderer_bblit_avail: $renderer_bblit_missing)
1233 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1234 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1237 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1238 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1239 cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
1241 Run "${MAKE-make}" to start compilation process])