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([PANGO], [pango pangoft2],
99 [have_pango=yes], [have_pango=no])
100 AC_SUBST(PANGO_CFLAGS)
103 PKG_CHECK_MODULES([CAIRO], [cairo],
104 [have_cairo=yes], [have_cairo=no])
105 AC_SUBST(CAIRO_CFLAGS)
108 PKG_CHECK_MODULES([PIXMAN], [pixman-1],
109 [have_pixman=yes], [have_pixman=no])
110 AC_SUBST(PIXMAN_CFLAGS)
111 AC_SUBST(PIXMAN_LIBS)
113 PKG_CHECK_MODULES([TSM], [libtsm],
114 [have_tsm=yes], [have_tsm=no])
120 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
121 # saves the results in local variables. This does not check dependencies or
122 # similar but does only parse the arguments.
126 AC_MSG_CHECKING([whether user wants all])
128 [AS_HELP_STRING([--enable-all],
129 [enable all options (used for debugging)])])
130 if test "x$enable_all" = "x" ; then
133 AC_MSG_RESULT([$enable_all])
136 AC_MSG_CHECKING([whether user wants eloop])
137 AC_ARG_ENABLE([eloop],
138 [AS_HELP_STRING([--enable-eloop],
139 [build eloop library])])
140 if test "x$enable_all" = "xyes" ; then
142 elif test "x$enable_eloop" = "x" ; then
143 enable_eloop="no (default)"
145 AC_MSG_RESULT([$enable_eloop])
148 AC_MSG_CHECKING([whether user wants uterm])
149 AC_ARG_ENABLE([uterm],
150 [AS_HELP_STRING([--enable-uterm],
151 [build uterm library])])
152 if test "x$enable_all" = "xyes" ; then
154 elif test "x$enable_uterm" = "x" ; then
155 enable_uterm="no (default)"
157 AC_MSG_RESULT([$enable_uterm])
160 AC_MSG_CHECKING([whether user wants kmscon])
161 AC_ARG_ENABLE([kmscon],
162 [AS_HELP_STRING([--disable-kmscon],
163 [do not build kmscon])])
164 if test "x$enable_all" = "xyes" ; then
166 elif test "x$enable_kmscon" = "x" ; then
167 enable_kmscon="yes (default)"
169 AC_MSG_RESULT([$enable_kmscon])
172 AC_MSG_CHECKING([whether to build with debugging on])
173 AC_ARG_ENABLE([debug],
174 [AS_HELP_STRING([--enable-debug],
175 [whether to build with debugging on])])
176 if test "x$enable_all" = "xyes" ; then
178 elif test "x$enable_debug" = "x" ; then
179 enable_debug="yes (default)"
181 AC_MSG_RESULT([$enable_debug])
184 AC_MSG_CHECKING([whether to disable code optimizations])
185 AC_ARG_ENABLE([optimizations],
186 [AS_HELP_STRING([--disable-optimizations],
187 [whether to disable code optimizations])])
188 if test "x$enable_all" = "xyes" ; then
189 enable_optimizations="yes"
190 elif test "x$enable_optimizations" = "x" ; then
191 enable_optimizations="yes (default)"
193 AC_MSG_RESULT([$enable_optimizations])
196 AC_MSG_CHECKING([whether user wants systemd for multi-seat support])
197 AC_ARG_ENABLE([multi-seat],
198 [AS_HELP_STRING([--enable-multi-seat],
199 [enable multi-seat support with systemd])])
200 if test "x$enable_all" = "xyes" ; then
201 enable_multi_seat="yes"
202 elif test "x$enable_multi_seat" = "x" ; then
203 enable_multi_seat="yes (default)"
205 AC_MSG_RESULT([$enable_multi_seat])
208 AC_MSG_CHECKING([whether user wants udev for device hotplug support])
209 AC_ARG_ENABLE([hotplug],
210 [AS_HELP_STRING([--enable-hotplug],
211 [enable device hotplug support with udev])])
212 if test "x$enable_all" = "xyes" ; then
214 elif test "x$enable_hotplug" = "x" ; then
215 enable_hotplug="yes (default)"
217 AC_MSG_RESULT([$enable_hotplug])
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_all" = "xyes" ; then
225 enable_eloop_dbus="yes"
226 elif 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])],
237 [with_video="default"])
238 enable_video_fbdev="no"
239 enable_video_drm2d="no"
240 enable_video_drm3d="no"
241 if test "x$enable_all" = "xyes" ; then
242 enable_video_fbdev="yes"
243 enable_video_drm2d="yes"
244 enable_video_drm3d="yes"
245 with_video="fbdev,drm2d,drm3d (all)"
246 elif test "x$with_video" = "xdefault" ; then
247 enable_video_fbdev="yes (default)"
248 enable_video_drm2d="yes (default)"
249 enable_video_drm3d="yes (default)"
250 with_video="fbdev,drm2d,drm3d (default)"
251 elif test ! "x$with_video" = "x" ; then
254 for i in $with_video ; do
255 if test "x$i" = "xfbdev" ; then
256 enable_video_fbdev="yes"
257 elif test "x$i" = "xdrm2d" ; then
258 enable_video_drm2d="yes"
259 elif test "x$i" = "xdrm3d" ; then
260 enable_video_drm3d="yes"
263 AC_ERROR([Invalid video backend $i])
268 AC_MSG_RESULT([$with_video])
271 AC_MSG_CHECKING([which render backends the user wants])
272 AC_ARG_WITH([renderers],
273 [AS_HELP_STRING([--with-renderers],
274 [specify list of optional render backends])],
276 [with_renderers="default"])
277 enable_renderer_bbulk="no"
278 enable_renderer_gltex="no"
279 enable_renderer_cairo="no"
280 enable_renderer_pixman="no"
281 if test "x$enable_all" = "xyes" ; then
282 enable_renderer_bbulk="yes"
283 enable_renderer_gltex="yes"
284 enable_renderer_cairo="yes"
285 enable_renderer_pixman="yes"
286 with_renderers="bbulk,gltex,cairo,pixman (all)"
287 elif test "x$with_renderers" = "xdefault" ; then
288 enable_renderer_bbulk="yes (default)"
289 enable_renderer_gltex="yes (default)"
290 enable_renderer_cairo="no (default)"
291 enable_renderer_pixman="no (default)"
292 with_renderers="bbulk,gltex (default)"
293 elif test ! "x$with_renderers" = "x" ; then
296 for i in $with_renderers ; do
297 if test "x$i" = "xbbulk" ; then
298 enable_renderer_bbulk="yes"
299 elif test "x$i" = "xgltex" ; then
300 enable_renderer_gltex="yes"
301 elif test "x$i" = "xcairo" ; then
302 enable_renderer_cairo="yes"
303 elif test "x$i" = "xpixman" ; then
304 enable_renderer_pixman="yes"
307 AC_ERROR([Unknown renderer $i])
312 AC_MSG_RESULT([$with_renderers])
315 AC_MSG_CHECKING([which font backends the user wants])
317 [AS_HELP_STRING([--with-fonts],
318 [specify list of optional font backends])],
320 [with_fonts="default"])
321 enable_font_unifont="no"
322 enable_font_pango="no"
323 if test "x$enable_all" = "xyes" ; then
324 enable_font_unifont="yes"
325 enable_font_pango="yes"
326 with_fonts="unifont,pango (all)"
327 elif test "x$with_fonts" = "xdefault" ; then
328 enable_font_unifont="yes (default)"
329 enable_font_pango="yes (default)"
330 with_fonts="unifont,pango (default)"
331 elif test ! "x$with_fonts" = "x" ; then
334 for i in $with_fonts ; do
335 if test "x$i" = "xunifont" ; then
336 enable_font_unifont="yes"
337 elif test "x$i" = "xpango" ; then
338 enable_font_pango="yes"
341 AC_ERROR([Unknown font backend $i])
346 AC_MSG_RESULT([$with_fonts])
349 AC_MSG_CHECKING([which sessions the user wants])
350 AC_ARG_WITH([sessions],
351 [AS_HELP_STRING([--with-sessions],
352 [specify list of optional sessions])],
354 [with_sessions="default"])
355 enable_session_dummy="no"
356 enable_session_terminal="no"
357 if test "x$enable_all" = "xyes" ; then
358 enable_session_dummy="yes"
359 enable_session_terminal="yes"
360 with_sessions="dummy,terminal (all)"
361 elif test "x$with_sessions" = "xdefault" ; then
362 enable_session_dummy="yes (default)"
363 enable_session_terminal="yes (default)"
364 with_sessions="dummy,terminal (default)"
365 elif test ! "x$with_sessions" = "x" ; then
368 for i in $with_sessions ; do
369 if test "x$i" = "xdummy" ; then
370 enable_session_dummy="yes"
371 elif test "x$i" = "xterminal" ; then
372 enable_session_terminal="yes"
375 AC_ERROR([Unknown session type $i])
380 AC_MSG_RESULT([$with_sessions])
383 # Check what can be built
384 # This checks each configuration option and tests whether all dependencies are
385 # met. This is done from bottom up to ensure the right order.
391 if test ! "x$enable_debug" = "xno" ; then
394 debug_missing="enable-debug"
398 optimizations_avail=no
399 optimizations_missing=""
400 if test ! "x$enable_optimizations" = "xno" ; then
401 optimizations_avail=yes
403 optimizations_missing="enable-optimizations"
408 eloop_dbus_missing=""
409 if test ! "x$enable_eloop_dbus" = "xno" ; then
411 if test "x$have_dbus" = "xno" ; then
413 eloop_dbus_missing="libdbus"
416 if test "x$eloop_dbus_avail" = "xno" ; then
417 if test "x$enable_eloop_dbus" = "xyes" ; then
418 AC_ERROR([missing for eloop-dbus: $eloop_dbus_missing])
422 eloop_dbus_missing="enable-eloop-dbus"
428 if test ! "x$enable_eloop" = "xno" ; then
431 eloop_missing="enable-eloop"
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"
618 font_pango_missing=""
619 if test ! "x$enable_font_pango" = "xno" ; then
621 if test "x$have_pango" = "xno" ; then
623 font_pango_missing="libpango"
626 if test "x$font_pango_avail" = "xno" ; then
627 if test "x$enable_font_pango" = "xyes" ; then
628 AC_ERROR([missing for font-pango: $font_pango_missing])
632 font_pango_missing="enable-font-pango"
636 session_dummy_avail=no
637 session_dummy_missing=""
638 if test ! "x$enable_session_dummy" = "xno" ; then
639 session_dummy_avail=yes
641 session_dummy_missing="enable-session-dummy"
645 session_terminal_avail=no
646 session_terminal_missing=""
647 if test ! "x$enable_session_terminal" = "xno" ; then
648 session_terminal_avail=yes
649 if test "x$have_tsm" = "xno" ; then
650 session_terminal_avail=no
651 session_terminal_missing="libtsm"
654 if test "x$session_terminal_avail" = "xno" ; then
655 if test "x$enable_session_terminal" = "xyes" ; then
656 AC_ERROR([missing for session-terminal: $session_terminal_missing])
660 session_terminal_missing="enable-session-terminal"
666 if test ! "x$enable_kmscon" = "xno" ; then
668 if test "x$eloop_avail" = "xno" ; then
670 kmscon_missing="$eloop_missing,$kmscon_missing"
673 if test "x$have_tsm" = "xno" ; then
675 kmscon_missing="libtsm,$kmscon_missing"
678 if test "x$uterm_avail" = "xno" ; then
680 kmscon_missing="$uterm_missing,$kmscon_missing"
683 if test "x$kmscon_avail" = "xno" ; then
684 if test "x$enable_kmscon" = "xyes" ; then
685 AC_ERROR([missing for kmscon: $kmscon_missing])
689 kmscon_missing="enable-kmscon"
693 # Enable all required modules
694 # We now know which modules can be built by checking the *_avail variables set
695 # above. We now only have to disable all modules that are disabled by default
696 # and the user didn't force-enable them and no other module that is enabled
697 # needs them. This is done top-down of course.
702 if test "x$kmscon_avail" = "xyes" ; then
703 if test "x${enable_kmscon% *}" = "xyes" ; then
711 session_terminal_enabled=no
712 if test "x$session_terminal_avail" = "xyes" ; then
713 if test "x${enable_session_terminal% *}" = "xyes" ; then
714 session_terminal_enabled=yes
719 session_dummy_enabled=no
720 if test "x$session_dummy_avail" = "xyes" ; then
721 if test "x${enable_session_dummy% *}" = "xyes" ; then
722 session_dummy_enabled=yes
727 font_pango_enabled=no
728 if test "x$font_pango_avail" = "xyes" ; then
729 if test "x${enable_font_pango% *}" = "xyes" ; then
730 font_pango_enabled=yes
735 font_unifont_enabled=no
736 if test "x$font_unifont_avail" = "xyes" ; then
737 if test "x${enable_font_unifont% *}" = "xyes" ; then
738 font_unifont_enabled=yes
743 renderer_gltex_enabled=no
744 if test "x$renderer_gltex_avail" = "xyes" ; then
745 if test "x${enable_renderer_gltex% *}" = "xyes" ; then
746 renderer_gltex_enabled=yes
751 renderer_cairo_enabled=no
752 if test "x$renderer_cairo_avail" = "xyes" ; then
753 if test "x${enable_renderer_cairo% *}" = "xyes" ; then
754 renderer_cairo_enabled=yes
759 renderer_pixman_enabled=no
760 if test "x$renderer_pixman_avail" = "xyes" ; then
761 if test "x${enable_renderer_pixman% *}" = "xyes" ; then
762 renderer_pixman_enabled=yes
767 renderer_bbulk_enabled=no
768 if test "x$renderer_bbulk_avail" = "xyes" ; then
769 if test "x${enable_renderer_bbulk% *}" = "xyes" ; then
770 renderer_bbulk_enabled=yes
776 if test "x$hotplug_avail" = "xyes" ; then
777 if test "x${enable_hotplug% *}" = "xyes" ; then
783 multi_seat_enabled=no
784 if test "x$multi_seat_avail" = "xyes" ; then
785 if test "x${enable_multi_seat% *}" = "xyes" ; then
786 multi_seat_enabled=yes
792 if test "x$uterm_avail" = "xyes" ; then
793 if test "x${enable_uterm% *}" = "xyes" ; then
799 video_drm3d_enabled=no
800 if test "x$video_drm3d_avail" = "xyes" ; then
801 if test "x${enable_video_drm3d% *}" = "xyes" ; then
802 video_drm3d_enabled=yes
807 video_drm2d_enabled=no
808 if test "x$video_drm2d_avail" = "xyes" ; then
809 if test "x${enable_video_drm2d% *}" = "xyes" ; then
810 video_drm2d_enabled=yes
815 video_fbdev_enabled=no
816 if test "x$video_fbdev_avail" = "xyes" ; then
817 if test "x${enable_video_fbdev% *}" = "xyes" ; then
818 video_fbdev_enabled=yes
824 if test "x$eloop_avail" = "xyes" ; then
825 if test "x${enable_eloop% *}" = "xyes" ; then
831 eloop_dbus_enabled=no
832 if test "x$eloop_dbus_avail" = "xyes" ; then
833 if test "x${enable_eloop_dbus% *}" = "xyes" ; then
834 eloop_dbus_enabled=yes
839 optimizations_enabled=no
840 if test "x$optimizations_avail" = "xyes" ; then
841 if test "x${enable_optimizations% *}" = "xyes" ; then
842 optimizations_enabled=yes
848 if test "x$debug_avail" = "xyes" ; then
849 if test "x${enable_debug% *}" = "xyes" ; then
855 # Module Configuration
856 # We have now done all dependency checking and default-value validation and we
857 # now know which modules are enabled via the *_enabled variables.
858 # Everything below is related to the configuration of each module and setting
859 # the correct flags for the build process.
863 if test "x$debug_enabled" = "xyes" ; then
864 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
866 AC_DEFINE([NDEBUG], [1], [No Debug])
869 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
870 [test "x$debug_enabled" = "xyes"])
873 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
874 [test "x$optimizations_enabled" = "xyes"])
877 AM_CONDITIONAL([BUILD_ENABLE_ELOOP_DBUS],
878 [test "x$eloop_dbus_enabled" = "xyes"])
881 AM_CONDITIONAL([BUILD_ENABLE_ELOOP],
882 [test "x$eloop_enabled" = "xyes"])
885 if test "x$video_fbdev_enabled" = "xyes" ; then
886 AC_DEFINE([BUILD_ENABLE_VIDEO_FBDEV], [1],
887 [Build uterm fbdev video backend])
890 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_FBDEV],
891 [test "x$video_fbdev_enabled" = "xyes"])
894 if test "x$video_drm2d_enabled" = "xyes" ; then
895 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM2D], [1],
896 [Build uterm drm2d drm3d video backend])
899 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM2D],
900 [test "x$video_drm2d_enabled" = "xyes"])
903 if test "x$video_drm3d_enabled" = "xyes" ; then
904 AC_DEFINE([BUILD_ENABLE_VIDEO_DRM3D], [1],
905 [Build uterm drm3d video backend])
908 AM_CONDITIONAL([BUILD_ENABLE_VIDEO_DRM3D],
909 [test "x$video_drm3d_enabled" = "xyes"])
912 AM_CONDITIONAL([BUILD_ENABLE_UTERM],
913 [test "x$uterm_enabled" = "xyes"])
916 if test "x$multi_seat_enabled" = "xyes" ; then
917 AC_DEFINE([BUILD_ENABLE_MULTI_SEAT], [1],
918 [Use systemd for multi-seat support])
921 AM_CONDITIONAL([BUILD_ENABLE_MULTI_SEAT],
922 [test "x$multi_seat_enabled" = "xyes"])
925 if test "x$hotplug_enabled" = "xyes" ; then
926 AC_DEFINE([BUILD_ENABLE_HOTPLUG], [1],
927 [Use udev for hotplug support])
930 AM_CONDITIONAL([BUILD_ENABLE_HOTPLUG],
931 [test "x$hotplug_enabled" = "xyes"])
934 if test "x$renderer_bbulk_enabled" = "xyes" ; then
935 AC_DEFINE([BUILD_ENABLE_RENDERER_BBULK], [1],
936 [Build bbulk rendering backend])
939 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_BBULK],
940 [test "x$renderer_bbulk_enabled" = "xyes"])
943 if test "x$renderer_gltex_enabled" = "xyes" ; then
944 AC_DEFINE([BUILD_ENABLE_RENDERER_GLTEX], [1],
945 [Build gltex rendering backend])
948 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_GLTEX],
949 [test "x$renderer_gltex_enabled" = "xyes"])
952 if test "x$renderer_cairo_enabled" = "xyes" ; then
953 AC_DEFINE([BUILD_ENABLE_RENDERER_CAIRO], [1],
954 [Build cairo rendering backend])
957 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_CAIRO],
958 [test "x$renderer_cairo_enabled" = "xyes"])
961 if test "x$renderer_pixman_enabled" = "xyes" ; then
962 AC_DEFINE([BUILD_ENABLE_RENDERER_PIXMAN], [1],
963 [Build pixman rendering backend])
966 AM_CONDITIONAL([BUILD_ENABLE_RENDERER_PIXMAN],
967 [test "x$renderer_pixman_enabled" = "xyes"])
970 if test "x$font_unifont_enabled" = "xyes" ; then
971 AC_DEFINE([BUILD_ENABLE_FONT_UNIFONT], [1],
972 [Build static unifont backend])
975 AM_CONDITIONAL([BUILD_ENABLE_FONT_UNIFONT],
976 [test "x$font_unifont_enabled" = "xyes"])
979 if test "x$font_pango_enabled" = "xyes" ; then
980 AC_DEFINE([BUILD_ENABLE_FONT_PANGO], [1],
981 [Build pango font backend])
984 AM_CONDITIONAL([BUILD_ENABLE_FONT_PANGO],
985 [test "x$font_pango_enabled" = "xyes"])
988 if test "x$session_dummy_enabled" = "xyes" ; then
989 AC_DEFINE([BUILD_ENABLE_SESSION_DUMMY], [1],
990 [Build dummy session])
993 AM_CONDITIONAL([BUILD_ENABLE_SESSION_DUMMY],
994 [test "x$session_dummy_enabled" = "xyes"])
997 if test "x$session_terminal_enabled" = "xyes" ; then
998 AC_DEFINE([BUILD_ENABLE_SESSION_TERMINAL], [1],
999 [Build terminal session])
1002 AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
1003 [test "x$session_terminal_enabled" = "xyes"])
1006 AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
1007 [test "x$kmscon_enabled" = "xyes"])
1010 # Miscellaneous Checks
1011 # All checks below are independent of module checking or depend on the results
1012 # of it. They do not have any dependencies themselves so they are not part of the
1013 # module infrastructure.
1016 # check for _Static_assert
1017 AC_MSG_CHECKING([whether _Static_assert() is supported])
1019 have_static_assert=yes
1020 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[_Static_assert(1, "What?");]])],
1021 [AC_DEFINE([BUILD_HAVE_STATIC_ASSERT],
1023 [Define to 1 if _Static_assert() is supported])],
1024 [have_static_assert=no])
1025 AC_MSG_RESULT([$have_static_assert])
1027 # check for gbm_bo_get_pitch() function, otherwise gbm_bo_get_stride() is used
1028 if test x$have_gbm = xyes ; then
1029 save_CFLAGS="$CFLAGS"
1031 save_LDFLAGS="$LDFLAGS"
1032 CFLAGS="$DRM_CFLAGS $GBM_CFLAGS"
1033 LIBS="$DRM_LIBS $GBM_LIBS"
1037 [AC_DEFINE([BUILD_HAVE_GBM_BO_GET_PITCH],
1039 [Define to 1 if your libgbm provides gbm_bo_get_pitch])])
1040 CFLAGS="$save_CFLAGS"
1042 LDFLAGS="$save_LDFLAGS"
1045 # check for xsltproc
1046 AC_PATH_PROG(XSLTPROC, xsltproc)
1047 AM_CONDITIONAL([BUILD_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1049 # check for offline man-pages stylesheet
1050 AC_MSG_CHECKING([for docbook manpages stylesheet])
1051 BUILD_MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
1052 AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
1053 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$BUILD_MANPAGES_STYLESHEET" > /dev/null 2>&1`],
1054 [BUILD_HAVE_MANPAGES_STYLESHEET=yes]))
1055 if test "x$BUILD_HAVE_MANPAGES_STYLESHEET" = "xyes"; then
1056 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], true)
1057 AC_SUBST(BUILD_MANPAGES_STYLESHEET)
1058 AC_MSG_RESULT([yes])
1060 AM_CONDITIONAL([BUILD_HAVE_MANPAGES_STYLESHEET], false)
1066 # After everything is configured, we correctly substitute the values for the
1070 AC_CONFIG_FILES([Makefile
1072 docs/pc/libuterm.pc])
1076 # Configuration output
1077 # Show configuration to the user so they can check whether everything was
1078 # configured as expected.
1081 AC_MSG_NOTICE([Build configuration:
1084 exec-prefix: $exec_prefix
1086 includedir: $includedir
1088 Applications and Libraries:
1089 kmscon: $kmscon_enabled ($kmscon_avail: $kmscon_missing)
1090 uterm: $uterm_enabled ($uterm_avail: $uterm_missing)
1091 eloop: $eloop_enabled ($eloop_avail: $eloop_missing)
1093 Miscellaneous Options:
1094 debug: $debug_enabled ($debug_avail: $debug_missing)
1095 optimizations: $optimizations_enabled ($optimizations_avail: $optimizations_missing)
1096 multi-seat: $multi_seat_enabled ($multi_seat_avail: $multi_seat_missing)
1097 hotplug: $hotplug_enabled ($hotplug_avail: $hotplug_missing)
1098 eloop-dbus: $eloop_dbus_enabled ($eloop_dbus_avail: $eloop_dbus_missing)
1101 fbdev: $video_fbdev_enabled ($video_fbdev_avail: $video_fbdev_missing)
1102 drm2d: $video_drm2d_enabled ($video_drm2d_avail: $video_drm2d_missing)
1103 drm3d: $video_drm3d_enabled ($video_drm3d_avail: $video_drm3d_missing)
1106 unifont: $font_unifont_enabled ($font_unifont_avail: $font_unifont_missing)
1107 pango: $font_pango_enabled ($font_pango_avail: $font_pango_missing)
1110 bbulk: $renderer_bbulk_enabled ($renderer_bbulk_avail: $renderer_bbulk_missing)
1111 gltex: $renderer_gltex_enabled ($renderer_gltex_avail: $renderer_gltex_missing)
1112 cairo: $renderer_cairo_enabled ($renderer_cairo_avail: $renderer_cairo_missing)
1113 pixman: $renderer_pixman_enabled ($renderer_pixman_avail: $renderer_pixman_missing)
1116 dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
1117 terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
1119 Run "${MAKE-make}" to start compilation process])