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])
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
30 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
36 # pkg-config dependencies
37 # This unconditionally checks for all dependencies even if they are disabled. We
38 # later look whether all required depedencies are met and finish the
39 # configuration. We group similar packages into one logical group here to avoid
40 # having variables for each single library.
41 # This, however, makes ./configure output very unintuitive error messages if a
42 # package is not found so we must make sure we print more verbose messages
46 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
47 [have_xkbcommon=yes], [have_xkbcommon=no])
48 AC_SUBST(XKBCOMMON_CFLAGS)
49 AC_SUBST(XKBCOMMON_LIBS)
51 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server wayland-cursor],
52 [have_wayland=yes], [have_wayland=no])
53 AC_SUBST(WAYLAND_CFLAGS)
54 AC_SUBST(WAYLAND_LIBS)
56 PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
57 [have_systemd=yes], [have_systemd=no])
58 AC_SUBST(SYSTEMD_CFLAGS)
59 AC_SUBST(SYSTEMD_LIBS)
61 PKG_CHECK_MODULES([UDEV], [libudev],
62 [have_udev=yes], [have_udev=no])
66 PKG_CHECK_MODULES([DBUS], [dbus-1],
67 [have_dbus=yes], [have_dbus=no])
71 PKG_CHECK_MODULES([DRM], [libdrm],
72 [have_drm=yes], [have_drm=no])
76 PKG_CHECK_MODULES([GBM], [gbm],
77 [have_gbm=yes], [have_gbm=no])
81 PKG_CHECK_MODULES([EGL], [egl],
82 [have_egl=yes], [have_egl=no])
86 PKG_CHECK_MODULES([GLES2], [glesv2],
87 [have_gles2=yes], [have_gles2=no])
88 AC_SUBST(GLES2_CFLAGS)
91 PKG_CHECK_MODULES([FREETYPE2], [freetype2 fontconfig],
92 [have_freetype2=yes], [have_freetype2=no])
93 AC_SUBST(FREETYPE2_CFLAGS)
94 AC_SUBST(FREETYPE2_LIBS)
96 PKG_CHECK_MODULES([PANGO], [pango pangoft2],
97 [have_pango=yes], [have_pango=no])
98 AC_SUBST(PANGO_CFLAGS)
101 PKG_CHECK_MODULES([FUSE], [fuse],
102 [have_fuse=yes], [have_fuse=no])
103 AC_SUBST(FUSE_CFLAGS)
106 PKG_CHECK_MODULES([PCIACCESS], [pciaccess],
107 [have_pciaccess=yes], [have_pciaccess=no])
108 AC_SUBST(PCIACCESS_CFLAGS)
109 AC_SUBST(PCIACCESS_LIBS)
113 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
114 # saves the results in local variables. This does not check dependencies or
115 # similar but does only parse the arguments.
119 AC_MSG_CHECKING([whether user wants eloop])
120 AC_ARG_ENABLE([eloop],
121 [AS_HELP_STRING([--enable-eloop],
122 [build eloop library])])
123 if test "x$enable_eloop" = "x" ; then
124 enable_eloop="no (default)"
126 AC_MSG_RESULT([$enable_eloop])
129 AC_MSG_CHECKING([whether user wants TSM])
131 [AS_HELP_STRING([--enable-tsm],
132 [build tsm library])])
133 if test "x$enable_tsm" = "x" ; then
134 enable_tsm="no (default)"
136 AC_MSG_RESULT([$enable_tsm])
139 AC_MSG_CHECKING([whether user wants uterm])
140 AC_ARG_ENABLE([uterm],
141 [AS_HELP_STRING([--enable-uterm],
142 [build uterm library])])
143 if test "x$enable_uterm" = "x" ; then
144 enable_uterm="no (default)"
146 AC_MSG_RESULT([$enable_uterm])
149 AC_MSG_CHECKING([whether user wants kmscon])
150 AC_ARG_ENABLE([kmscon],
151 [AS_HELP_STRING([--disable-kmscon],
152 [do not build kmscon])])
153 if test "x$enable_kmscon" = "x" ; then
154 enable_kmscon="yes (default)"
156 AC_MSG_RESULT([$enable_kmscon])
159 AC_MSG_CHECKING([whether user wants wlterm])
160 AC_ARG_ENABLE([wlterm],
161 [AS_HELP_STRING([--enable-wlterm],
163 if test "x$enable_wlterm" = "x" ; then
164 enable_wlterm="yes (default)"
166 AC_MSG_RESULT([$enable_wlterm])
169 AC_MSG_CHECKING([whether to build with debugging on])
170 AC_ARG_ENABLE([debug],
171 [AS_HELP_STRING([--enable-debug],
172 [whether to build with debugging on])])
173 if test "x$enable_debug" = "x" ; then
174 enable_debug="yes (default)"
176 AC_MSG_RESULT([$enable_debug])
179 AC_MSG_CHECKING([whether to disable code optimizations])
180 AC_ARG_ENABLE([optimizations],
181 [AS_HELP_STRING([--disable-optimizations],
182 [whether to disable code optimizations])])
183 if test "x$enable_optimizations" = "x" ; then
184 enable_optimizations="yes (default)"
186 AC_MSG_RESULT([$enable_optimizations])
189 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
190 AC_ARG_ENABLE([multi-seat],
191 [AS_HELP_STRING([--enable-multi-seat],
192 [enable multi-seat support with systemd])])
193 if test "x$enable_multi_seat" = "x" ; then
194 enable_multi_seat="yes (default)"
196 AC_MSG_RESULT([$enable_multi_seat])
199 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
200 AC_ARG_ENABLE([hotplug],
201 [AS_HELP_STRING([--enable-hotplug],
202 [enable device hotplug support with udev])])
203 if test "x$enable_hotplug" = "x" ; then
204 enable_hotplug="yes (default)"
206 AC_MSG_RESULT([$enable_hotplug])
209 AC_MSG_CHECKING([whether user wants pciaccess device detection])
210 AC_ARG_ENABLE([pciaccess],
211 [AS_HELP_STRING([--enable-pciaccess],
212 [enable device detection via pciaccess])])
213 if test "x$enable_pciaccess" = "x" ; then
214 enable_pciaccess="yes (default)"
216 AC_MSG_RESULT([$enable_pciaccess])
219 AC_MSG_CHECKING([whether user wants eloop dbus support])
220 AC_ARG_ENABLE([eloop-dbus],
221 [AS_HELP_STRING([--enable-eloop-dbus],
222 [enable eloop dbus support])])
223 if test "x$enable_eloop_dbus" = "x" ; then
224 enable_eloop_dbus="no (default)"
226 AC_MSG_RESULT([$enable_eloop_dbus])
229 AC_MSG_CHECKING([which video backends the user wants])
231 [AS_HELP_STRING([--with-video],
232 [specify list of optional video backends])])
233 enable_video_fbdev="no"
234 enable_video_dumb="no"
235 enable_video_drm="no"
236 if test "x$with_video" = "x" ; then
237 enable_video_fbdev="yes (default)"
238 enable_video_dumb="yes (default)"
239 enable_video_drm="yes (default)"
240 with_video="fbdev,dumb,drm (default)"
244 for i in $with_video ; do
245 if test "x$i" = "xfbdev" ; then
246 enable_video_fbdev="yes"
247 elif test "x$i" = "xdumb" ; then
248 enable_video_dumb="yes"
249 elif test "x$i" = "xdrm" ; then
250 enable_video_drm="yes"
253 AC_ERROR([Invalid video backend $i])
258 AC_MSG_RESULT([$with_video])
261 AC_MSG_CHECKING([which render backends the user wants])
262 AC_ARG_WITH([renderers],
263 [AS_HELP_STRING([--with-renderers],
264 [specify list of optional render backends])])
265 enable_renderer_bblit="no"
266 enable_renderer_bbulk="no"
267 enable_renderer_gltex="no"
268 if test "x$with_renderers" = "x" ; then
269 enable_renderer_bblit="yes (default)"
270 enable_renderer_bbulk="yes (default)"
271 enable_renderer_gltex="yes (default)"
272 with_renderers="bblit,bbulk,gltex (default)"
276 for i in $with_renderers ; do
277 if test "x$i" = "xbblit" ; then
278 enable_renderer_bblit="yes"
279 elif test "x$i" = "xbbulk" ; then
280 enable_renderer_bbulk="yes"
281 elif test "x$i" = "xgltex" ; then
282 enable_renderer_gltex="yes"
285 AC_ERROR([Unknown renderer $i])
290 AC_MSG_RESULT([$with_renderers])
293 AC_MSG_CHECKING([which font backends the user wants])
295 [AS_HELP_STRING([--with-fonts],
296 [specify list of optional font backends])])
297 enable_font_8x16="no"
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_8x16="yes (default)"
303 enable_font_unifont="no (default)"
304 enable_font_freetype2="yes (default)"
305 enable_font_pango="yes (default)"
306 with_fonts="8x16,freetype2,pango (default)"
310 for i in $with_fonts ; do
311 if test "x$i" = "x8x16" ; then
312 enable_font_8x16="yes"
313 elif test "x$i" = "xunifont" ; then
314 enable_font_unifont="yes"
315 elif test "x$i" = "xfreetype2" ; then
316 enable_font_freetype2="yes"
317 elif test "x$i" = "xpango" ; then
318 enable_font_pango="yes"
321 AC_ERROR([Unknown font backend $i])
326 AC_MSG_RESULT([$with_fonts])
329 AC_MSG_CHECKING([which sessions the user wants])
330 AC_ARG_WITH([sessions],
331 [AS_HELP_STRING([--with-sessions],
332 [specify list of optional sessions])])
333 enable_session_dummy="no"
334 enable_session_terminal="no"
335 enable_session_cdev="no"
336 enable_session_compositor="no"
337 if test "x$with_sessions" = "x" ; then
338 enable_session_dummy="yes (default)"
339 enable_session_terminal="yes (default)"
340 enable_session_cdev="yes (default)"
341 enable_session_compositor="no (default)"
342 with_sessions="dummy,terminal,cdev (default)"
346 for i in $with_sessions ; do
347 if test "x$i" = "xdummy" ; then
348 enable_session_dummy="yes"
349 elif test "x$i" = "xterminal" ; then
350 enable_session_terminal="yes"
351 elif test "x$i" = "xcdev" ; then
352 enable_session_cdev="yes"
353 elif test "x$i" = "xcompositor" ; then
354 enable_session_compositor="yes"
357 AC_ERROR([Unknown session type $i])
362 AC_MSG_RESULT([$with_sessions])
365 # Check what can be built
366 # This checks each configuration option and tests whether all dependencies are
367 # met. This is done from bottom up to ensure the right order.
372 if test ! "x$enable_debug" = "xno" ; then
377 optimizations_avail=no
378 if test ! "x$enable_optimizations" = "xno" ; then
379 optimizations_avail=yes
384 if test ! "x$enable_eloop_dbus" = "xno" ; then
385 if test "x$have_dbus" = "xyes" ; then
387 elif test "x$enable_eloop_dbus" = "xyes" ; then
388 AC_ERROR([DBus libraries not found for eloop-dbus])
394 if test ! "x$enable_eloop" = "xno" ; then
400 if test ! "x$enable_tsm" = "xno" ; then
401 if test "x$have_xkbcommon" = "xyes" ; then
403 elif test "x$enable_tsm" = "xyes" ; then
404 AC_ERROR([xkbcommon libraries not found for TSM])
410 if test ! "x$enable_video_fbdev" = "xno" ; then
411 # TODO: check for kernel headers
412 video_fbdev_avail=yes
417 if test ! "x$enable_video_dumb" = "xno" ; then
418 if test "x$have_drm" = "xyes" ; then
420 elif test "x$enable_video_dumb" = "xyes" ; then
421 AC_ERROR([DRM libraries not found for dumb video backend])
427 if test ! "x$enable_video_drm" = "xno" ; then
428 if test "x$have_drm" = "xno" ; then
430 elif test "x$have_gbm" = "xno" ; then
432 elif test "x$have_egl" = "xno" ; then
434 elif test "x$have_gles2" = "xno" ; then
440 if test "x$video_drm_avail" = "xno" ; then
441 if test "x$enable_video_drm" = "xyes" ; then
442 AC_ERROR([DRM, gbm or EGL libraries not found for DRM video backend])
449 if test ! "x$enable_uterm" = "xno" ; then
455 if test ! "x$enable_multi_seat" = "xno" ; then
456 if test "x$have_systemd" = "xyes" ; then
458 elif test "x$enable_multi_seat" = "xyes" ; then
459 AC_ERROR([systemd libraries not found for multi-seat support])
465 if test ! "x$enable_hotplug" = "xno" ; then
466 if test "x$have_udev" = "xyes" ; then
468 elif test "x$enable_hotplug" = "xyes" ; then
469 AC_ERROR([udev libraries not found for hotplug support])
475 if test ! "x$enable_pciaccess" = "xno" ; then
476 if test "x$have_pciaccess" = "xyes" ; then
478 elif test "x$enable_pciaccess" = "xyes" ; then
479 AC_ERROR([pciaccess libraries not found for pciaccess device detection])
484 renderer_bblit_avail=no
485 if test ! "x$enable_renderer_bblit" = "xno" ; then
486 renderer_bblit_avail=yes
490 renderer_bbulk_avail=no
491 if test ! "x$enable_renderer_bbulk" = "xno" ; then
492 renderer_bbulk_avail=yes
496 renderer_gltex_avail=no
497 if test ! "x$enable_renderer_gltex" = "xno" ; then
498 if test "x$have_gles2" = "xyes" ; then
499 renderer_gltex_avail=yes
500 elif test "x$enable_renderer_gltex" = "xyes" ; then
501 AC_ERROR([OpenGLESv2 libraries not found for gltex renderer])
507 if test ! "x$enable_font_8x16" = "xno" ; then
512 font_unifont_avail=no
513 if test ! "x$enable_font_unifont" = "xno" ; then
514 font_unifont_avail=yes
518 font_freetype2_avail=no
519 if test ! "x$enable_font_freetype2" = "xno" ; then
520 if test "x$have_freetype2" ; then
521 font_freetype2_avail=yes
522 elif test "x$enable_font_freetype2" = "xyes" ; then
523 AC_ERROR([freetype2 or fontconfig libs not found for freetype2 font backend])
529 if test ! "x$enable_font_pango" = "xno" ; then
530 if test "x$have_pango" ; then
532 elif test "x$enable_font_pango" = "xyes" ; then
533 AC_ERROR([pango libraries not found for pango font backend])
538 session_dummy_avail=no
539 if test ! "x$enable_session_dummy" = "xno" ; then
540 session_dummy_avail=yes
544 session_terminal_avail=no
545 if test ! "x$enable_session_terminal" = "xno" ; then
546 if test "x$tsm_avail" = "xyes" ; then
547 session_terminal_avail=yes
548 elif test "x$enable_session_terminal" = "xyes" ; then
549 AC_ERROR([TSM cannot be built for kmscon terminal session])
554 session_cdev_avail=no
555 if test ! "x$enable_session_cdev" = "xno" ; then
556 if test "x$have_fuse" = "xno" ; then
557 session_cdev_avail=no
558 elif test "x$tsm_avail" = "xno" ; then
559 session_cdev_avail=no
561 session_cdev_avail=yes
564 if "x$session_cdev_avail" = "xno" ; then
565 if test "x$enable_session_cdev" = "xyes" ; then
566 AC_ERROR([TSM or FUSE libraries not built/found for kmscon cdev session])
572 session_compositor_avail=no
573 if test ! "x$enable_session_compositor" = "xno" ; then
574 if test "x$have_wayland" = "xyes" ; then
575 session_compositor_avail=yes
576 elif test "x$enable_session_compositor" = "xyes" ; then
577 AC_ERROR([wayland libraries not found for kmscon compositor session])
583 if test ! "x$enable_kmscon" = "xno" ; then
584 if test "x$eloop_avail" = "xno" ; then
586 elif test "x$tsm_avail" = "xno" ; then
588 elif test "x$uterm_avail" = "xno" ; then
594 if test "x$enable_kmscon" = "xyes" ; then
595 if test "x$kmscon_avail" = "xno" ; then
596 AC_ERROR([eloop, TSM or uterm cannot be built for kmscon])
603 if test ! "x$enable_wlterm" = "xno" ; then
604 if test "x$tsm_avail" = "xno" ; then
606 elif test "x$eloop_avail" = "xno" ; then
612 if test "x$enable_wlterm" = "xyes" ; then
613 if test "x$wlterm_avail" = "xno" ; then
614 AC_ERROR([eloop or TSM cannot be built for wlterm])
618 if test "x$have_wayland" = "xyes" ; then
620 elif test "x$enable_wlterm" = "xyes" ; then
621 AC_ERROR([wayland libraries not found for wlterm])
626 # Enable all required modules
627 # We now know which modules can be built by checking the *_avail variables set
628 # above. We now only have to disable all modules that are disabled by default
629 # and the user didn't force-enable them and no other module that is enabled
630 # needs them. This is done top-down of course.
635 if test "x$wlterm_avail" = "xyes" ; then
636 if test "x${enable_wlterm% *}" = "xyes" ; then
645 if test "x$kmscon_avail" = "xyes" ; then
646 if test "x${enable_kmscon% *}" = "xyes" ; then
654 session_compositor_enabled=no
655 if test "x$session_compositor_avail" = "xyes" ; then
656 if test "x${enable_session_compositor% *}" = "xyes" ; then
657 session_compositor_enabled=yes
662 session_cdev_enabled=no
663 if test "x$session_cdev_avail" = "xyes" ; then
664 if test "x${enable_session_cdev% *}" = "xyes" ; then
665 session_cdev_enabled=yes
670 session_terminal_enabled=no
671 if test "x$session_terminal_avail" = "xyes" ; then
672 if test "x${enable_session_terminal% *}" = "xyes" ; then
673 session_terminal_enabled=yes
679 session_dummy_enabled=no
680 if test "x$session_dummy_avail" = "xyes" ; then
681 if test "x${enable_session_dummy% *}" = "xyes" ; then
682 session_dummy_enabled=yes
687 font_pango_enabled=no
688 if test "x$font_pango_avail" = "xyes" ; then
689 if test "x${enable_font_pango% *}" = "xyes" ; then
690 font_pango_enabled=yes
695 font_freetype2_enabled=no
696 if test "x$font_freetype2_avail" = "xyes" ; then
697 if test "x${enable_font_freetype2% *}" = "xyes" ; then
698 font_freetype2_enabled=yes
703 font_unifont_enabled=no
704 if test "x$font_unifont_avail" = "xyes" ; then
705 if test "x${enable_font_unifont% *}" = "xyes" ; then
706 font_unifont_enabled=yes
712 if test "x$font_8x16_avail" = "xyes" ; then
713 if test "x${enable_font_8x16% *}" = "xyes" ; then
714 font_8x16_enabled=yes
719 renderer_gltex_enabled=no
720 if test "x$renderer_gltex_avail" = "xyes" ; then
721 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
722 renderer_gltex_enabled=yes
727 renderer_bbulk_enabled=no
728 if test "x$renderer_bbulk_avail" = "xyes" ; then
729 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
730 renderer_bbulk_enabled=yes
735 renderer_bblit_enabled=no
736 if test "x$renderer_bblit_avail" = "xyes" ; then
737 if test "x${enable_renderer_bblit% *}" = "xyes" ; then
738 renderer_bblit_enabled=yes
744 if test "x$pciaccess_avail" = "xyes" ; then
745 if test "x${enable_pciaccess% *}" = "xyes" ; then
746 pciaccess_enabled=yes
752 if test "x$hotplug_avail" = "xyes" ; then
753 if test "x${enable_hotplug% *}" = "xyes" ; then
759 multi_seat_enabled=no
760 if test "x$multi_seat_avail" = "xyes" ; then
761 if test "x${enable_multi_seat% *}" = "xyes" ; then
762 multi_seat_enabled=yes
768 if test "x$uterm_avail" = "xyes" ; then
769 if test "x${enable_uterm% *}" = "xyes" ; then
776 if test "x$video_drm_avail" = "xyes" ; then
777 if test "x${enable_video_drm% *}" = "xyes" ; then
778 video_drm_enabled=yes
783 video_dumb_enabled=no
784 if test "x$video_dumb_avail" = "xyes" ; then
785 if test "x${enable_video_dumb% *}" = "xyes" ; then
786 video_dumb_enabled=yes
791 video_fbdev_enabled=no
792 if test "x$video_fbdev_avail" = "xyes" ; then
793 if test "x${enable_video_fbdev% *}" = "xyes" ; then
794 video_fbdev_enabled=yes
800 if test "x$tsm_avail" = "xyes" ; then
801 if test "x${enable_tsm% *}" = "xyes" ; then
808 if test "x$eloop_avail" = "xyes" ; then
809 if test "x${enable_eloop% *}" = "xyes" ; then
815 eloop_dbus_enabled=no
816 if test "x$eloop_dbus_avail" = "xyes" ; then
817 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
818 eloop_dbus_enabled=yes
823 optimizations_enabled=no
824 if test "x$optimizations_avail" = "xyes" ; then
825 if test "x${enable_optimizations% *}" = "xyes" ; then
826 optimizations_enabled=yes
832 if test "x$debug_avail" = "xyes" ; then
833 if test "x${enable_debug% *}" = "xyes" ; then
839 # Module Configuration
840 # We have now done all dependency checking and default-value validation and we
841 # now know which modules are enabled via the *_enabled variables.
842 # Everything below is related to the configuration of each module and setting
843 # the correct flags for the build process.
847 if test "x$debug_enabled" = "xyes" ; then
848 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
850 AC_DEFINE([NDEBUG], [1], [No Debug])
853 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
854 [test "x$debug_enabled" = "xyes"])
857 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
858 [test "x$optimizations_enabled" = "xyes"])
861 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
862 [test "x$eloop_dbus_enabled" = "xyes"])
865 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
866 [test "x$eloop_enabled" = "xyes"])
869 AM_CONDITIONAL([BUILD_ENABLE_TSM],
870 [test "x$tsm_enabled" = "xyes"])
873 if test "x$video_fbdev_enabled" = "xyes" ; then
874 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
875 [Build uterm fbdev video backend])
878 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
879 [test "x$video_fbdev_enabled" = "xyes"])
882 if test "x$video_dumb_enabled" = "xyes" ; then
883 AC_DEFINE([BUILD_ENABLE_VIDEO_DUMB], [1],
884 [Build uterm dumb drm video backend])
887 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DUMB],
888 [test "x$video_dumb_enabled" = "xyes"])
891 if test "x$video_drm_enabled" = "xyes" ; then
892 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM], [1],
893 [Build uterm drm video backend])
896 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM],
897 [test "x$video_drm_enabled" = "xyes"])
900 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
901 [test "x$uterm_enabled" = "xyes"])
904 if test "x$multi_seat_enabled" = "xyes" ; then
905 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
906 [Use systemd for multi-seat support])
909 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
910 [test "x$multi_seat_enabled" = "xyes"])
913 if test "x$hotplug_enabled" = "xyes" ; then
914 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
915 [Use udev for hotplug support])
918 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
919 [test "x$hotplug_enabled" = "xyes"])
922 if test "x$pciaccess_enabled" = "xyes" ; then
923 AC_DEFINE([BUILD_ENABLE_PCIACCESS], [1],
924 [Use pciaccess for device detection])
927 AM_CONDITIONAL([BUILD_ENABLE_PCIACCESS],
928 [test "x$pciaccess_enabled" = "xyes"])
931 if test "x$renderer_bblit_enabled" = "xyes" ; then
932 AC_DEFINE([BUILD_ENABLE_RENDERER_BBLIT], [1],
933 [Build bblit rendering backend])
936 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBLIT],
937 [test "x$renderer_bblit_enabled" = "xyes"])
940 if test "x$renderer_bbulk_enabled" = "xyes" ; then
941 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
942 [Build bbulk rendering backend])
945 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
946 [test "x$renderer_bbulk_enabled" = "xyes"])
949 if test "x$renderer_gltex_enabled" = "xyes" ; then
950 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
951 [Build gltex rendering backend])
954 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
955 [test "x$renderer_gltex_enabled" = "xyes"])
958 if test "x$font_8x16_enabled" = "xyes" ; then
959 AC_DEFINE([BUILD_ENABLE_FONT_8X16], [1],
960 [Build static 8x16 font backend])
963 AM_CONDITIONAL([BUILD_ENABLE_FONT_8X16],
964 [test "x$font_8x16_enabled" = "xyes"])
967 if test "x$font_unifont_enabled" = "xyes" ; then
968 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
969 [Build static unifont backend])
972 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
973 [test "x$font_unifont_enabled" = "xyes"])
976 if test "x$font_freetype2_enabled" = "xyes" ; then
977 AC_DEFINE([BUILD_ENABLE_FONT_FREETYPE2], [1],
978 [Build freetype2 font backend])
981 AM_CONDITIONAL([BUILD_ENABLE_FONT_FREETYPE2],
982 [test "x$font_freetype2_enabled" = "xyes"])
985 if test "x$font_pango_enabled" = "xyes" ; then
986 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
987 [Build pango font backend])
990 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
991 [test "x$font_pango_enabled" = "xyes"])
994 if test "x$session_dummy_enabled" = "xyes" ; then
995 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
996 [Build dummy session])
999 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
1000 [test "x$session_dummy_enabled" = "xyes"])
1003 if test "x$session_terminal_enabled" = "xyes" ; then
1004 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
1005 [Build terminal session])
1008 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1009 [test "x$session_terminal_enabled" = "xyes"])
1012 if test "x$session_cdev_enabled" = "xyes" ; then
1013 AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
1014 [Build cdev session])
1017 AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
1018 [test "x$session_cdev_enabled" = "xyes"])
1020 # session compositor
1021 if test "x$session_compositor_enabled" = "xyes" ; then
1022 AC_DEFINE([BUILD_ENABLE_SESSION_COMPOSITOR], [1],
1023 [Build compositor session])
1026 AM_CONDITIONAL([BUILD_ENABLE_SESSION_COMPOSITOR],
1027 [test "x$session_compositor_enabled" = "xyes"])
1030 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1031 [test "x$kmscon_enabled" = "xyes"])
1034 AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
1035 [test "x$wlterm_enabled" = "xyes"])
1038 # Miscellaneous Checks
1039 # All checks below are independent of module checking or depend on the results
1040 # of it. They do not have any dependencies themself so they are not part of the
1041 # module infrastructure.
1044 # check for _Static_assert
1045 AC_MSG_CHECKING([whether _Static_assert() is supported])
1047 have_static_assert=yes
1048 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1049 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1051 [Define to 1 if _Static_assert() is supported])],
1052 [have_static_assert=no])
1053 AC_MSG_RESULT([$have_static_assert])
1055 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1056 if test x$have_gbm = xyes ; then
1057 save_CFLAGS="$CFLAGS"
1059 save_LDFLAGS="$LDFLAGS"
1060 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1061 LIBS="$DRM_LIBS $GBM_LIBS"
1065 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1067 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1068 CFLAGS="$save_CFLAGS"
1070 LDFLAGS="$save_LDFLAGS"
1075 # After everything is configured, we correctly substitute the values for the
1079 AC_CONFIG_FILES([Makefile
1086 # Configuration output
1087 # Show configuration to the user so they can check whether everything was
1088 # configured as expected.
1091 AC_MSG_NOTICE([Build configuration:
1093 Applications and Libraries:
1094 kmscon: $kmscon_enabled ($kmscon_avail)
1095 wlterm: $wlterm_enabled ($wlterm_avail)
1096 uterm: $uterm_enabled ($uterm_avail)
1097 tsm: $tsm_enabled ($tsm_avail)
1098 eloop: $eloop_enabled ($eloop_avail)
1100 Miscellaneous Options:
1101 debug: $debug_enabled ($debug_avail)
1102 optimizations: $optimizations_enabled ($optimizations_avail)
1103 multi-seat: $multi_seat_enabled ($multi_seat_avail)
1104 hotplug: $hotplug_enabled ($hotplug_avail)
1105 pciaccess: $pciaccess_enabled ($pciaccess_avail)
1106 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail)
1109 fbdev: $video_fbdev_enabled ($video_fbdev_avail)
1110 dumb drm: $video_dumb_enabled ($video_dumb_avail)
1111 drm: $video_drm_enabled ($video_drm_avail)
1114 8x16: $font_8x16_enabled ($font_8x16_avail)
1115 unifont: $font_unifont_enabled ($font_unifont_avail)
1116 freetype2: $font_freetype2_enabled ($font_freetype2_avail)
1117 pango: $font_pango_enabled ($font_pango_avail)
1120 bblit: $renderer_bblit_enabled ($renderer_bblit_avail)
1121 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail)
1122 gltex: $renderer_gltex_enabled ($renderer_gltex_avail)
1125 dummy: $session_dummy_enabled ($session_dummy_avail)
1126 terminal: $session_terminal_enabled ($session_terminal_avail)
1127 cdev: $session_cdev_enabled ($session_cdev_avail)
1128 compositor: $session_compositor_enabled ($session_compositor_avail)
1130 Run "make" to start compilation process])