2 AC_INIT([spice-vdagent], [0.10.1])
3 AC_CONFIG_SRCDIR([configure.ac])
5 AM_CONFIG_HEADER([src/config.h])
7 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip subdir-objects])
8 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
15 AC_DEFINE(_GNU_SOURCE, [1], [Enable GNU extensions])
18 AC_ARG_WITH([session-info],
19 [AS_HELP_STRING([--with-session-info=@<:@auto/console-kit/systemd/none@:>@],
20 [Session-info source to use @<:@default=auto@:>@])],
21 [case "$with_session_info" in
22 auto|console-kit|systemd|none) ;;
23 *) AC_MSG_ERROR([invalid session-info type specified]) ;;
25 [with_session_info="auto"])
27 dnl based on libvirt configure --init-script
28 AC_MSG_CHECKING([for init script flavor])
29 AC_ARG_WITH([init-script],
31 [--with-init-script=@<:@redhat/systemd/systemd+redhat/check@:>@],
32 [Style of init script to install @<:@default=check@:>@])],
33 [],[with_init_script=check])
36 case "$with_init_script" in
51 if test "$cross_compiling" != yes && test -f /etc/redhat-release; then
53 with_init_script=redhat
57 AC_MSG_ERROR([Unknown initscript flavour $with_init_script])
60 AM_CONDITIONAL([INIT_SCRIPT_RED_HAT], test "$init_redhat" = "yes")
61 AM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], test "$init_systemd" = "yes")
62 AC_MSG_RESULT($with_init_script)
64 if test "x$init_systemd" = "xyes"; then
65 SYSTEMDSYSTEMUNITDIR=`${PKG_CONFIG} systemd --variable=systemdsystemunitdir`
66 AC_SUBST(SYSTEMDSYSTEMUNITDIR)
69 AC_ARG_ENABLE([pciaccess],
70 [AS_HELP_STRING([--enable-pciaccess], [Enable libpciaccess use for auto generation of Xinerama xorg.conf (default: yes)])],
71 [enable_pciaccess="$enableval"],
72 [enable_pciaccess="yes"])
74 AC_ARG_ENABLE([static-uinput],
75 [AS_HELP_STRING([--enable-statis-uinput], [Enable use of a fixed, static uinput device for X-servers without hotplug support (default: no)])],
76 [enable_static_uinput="$enableval"],
77 [enable_static_uinput="no"])
79 PKG_CHECK_MODULES(X, [xfixes xrandr xinerama x11])
80 PKG_CHECK_MODULES(SPICE, [spice-protocol >= 0.8.0])
82 if test "$with_session_info" = "auto" || test "$with_session_info" = "systemd"; then
83 PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
84 [libsystemd-login >= 42],
85 [have_libsystemd_login="yes"],
86 [have_libsystemd_login="no"])
87 if test x"$have_libsystemd_login" = "xno" && test "$with_session_info" = "systemd"; then
88 AC_MSG_ERROR([libsystemd-login support explicitly requested, but some required packages are not available])
90 if test x"$have_libsystemd_login" = "xyes"; then
91 AC_DEFINE(HAVE_LIBSYSTEMD_LOGIN, [1], [If defined, vdagentd will be compiled with libsystemd-login support])
92 with_session_info="systemd"
95 have_libsystemd_login="no"
97 AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, test x"$have_libsystemd_login" = "xyes")
99 if test "$with_session_info" = "auto" || test "$with_session_info" = "console-kit"; then
100 PKG_CHECK_MODULES([DBUS],
102 [have_console_kit="yes"],
103 [have_console_kit="no"])
104 if test x"$have_console_kit" = "xno" && test "$with_session_info" = "console-kit"; then
105 AC_MSG_ERROR([console-kit support explicitly requested, but some required packages are not available])
107 if test x"$have_console_kit" = "xyes"; then
108 AC_DEFINE([HAVE_CONSOLE_KIT], [1], [If defined, vdagentd will be compiled with ConsoleKit support])
109 with_session_info="console-kit"
111 with_session_info="none"
114 have_console_kit="no"
116 AM_CONDITIONAL(HAVE_CONSOLE_KIT, test x"$have_console_kit" = "xyes")
118 if test x"$enable_pciaccess" = "xyes" ; then
119 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
120 AC_DEFINE([HAVE_PCIACCESS], [1], [If defined, vdagentd will be compiled with pciaccess support] )
122 AM_CONDITIONAL(HAVE_PCIACCESS, test x"$enable_pciaccess" = "xyes")
124 if test x"$enable_static_uinput" = "xyes" ; then
125 AC_DEFINE([WITH_STATIC_UINPUT], [1], [If defined, vdagentd will use a static uinput device] )
133 dnl ==========================================================================
136 spice-vdagent $VERSION
142 session-info: ${with_session_info}
143 pciaccess: ${enable_pciaccess}
144 static uinput: ${enable_static_uinput}
146 install RH initscript: ${init_redhat}
147 install systemd service: ${init_systemd}
149 Now type 'make' to build $PACKAGE