Prepare for 0.10.1 release
[vd_agent.git] / configure.ac
blob41042b3064392d8ea0743f16361247eae01c5521
1 AC_PREREQ(2.59)
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])])
10 AC_PROG_CC
11 AM_PROG_CC_C_O
12 AC_HEADER_STDC
13 AC_PROG_INSTALL
14 AC_PROG_LN_S
15 AC_DEFINE(_GNU_SOURCE, [1], [Enable GNU extensions])
17 AC_ARG_WITH([session-info],
18   [AS_HELP_STRING([--with-session-info=@<:@auto/console-kit/systemd/none@:>@],
19                   [Session-info source to use @<:@default=auto@:>@])],
20   [case "$with_session_info" in
21      auto|console-kit|systemd|none) ;;
22      *) AC_MSG_ERROR([invalid session-info type specified]) ;;
23    esac],
24   [with_session_info="auto"])
26 AC_ARG_ENABLE([pciaccess],
27               [AS_HELP_STRING([--enable-pciaccess], [Enable libpciaccess use for auto generation of Xinerama xorg.conf (default: yes)])],
28               [enable_pciaccess="$enableval"],
29               [enable_pciaccess="yes"])
31 AC_ARG_ENABLE([static-uinput],
32               [AS_HELP_STRING([--enable-statis-uinput], [Enable use of a fixed, static uinput device for X-servers without hotplug support (default: no)])],
33               [enable_static_uinput="$enableval"],
34               [enable_static_uinput="no"])
36 PKG_PROG_PKG_CONFIG
37 PKG_CHECK_MODULES(X, [xfixes xrandr xinerama x11])
38 PKG_CHECK_MODULES(SPICE, [spice-protocol >= 0.8.0])
40 if test "$with_session_info" = "auto" || test "$with_session_info" = "systemd"; then
41     PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
42                       [libsystemd-login >= 42],
43                       [have_libsystemd_login="yes"],
44                       [have_libsystemd_login="no"])
45     if test x"$have_libsystemd_login" = "xno" && test "$with_session_info" = "systemd"; then
46         AC_MSG_ERROR([libsystemd-login support explicitly requested, but some required packages are not available])
47     fi
48     if test x"$have_libsystemd_login" = "xyes"; then
49         AC_DEFINE(HAVE_LIBSYSTEMD_LOGIN, [1], [If defined, vdagentd will be compiled with libsystemd-login support])
50         with_session_info="systemd"
51     fi
52 else
53     have_libsystemd_login="no"
55 AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, test x"$have_libsystemd_login" = "xyes")
57 if test "$with_session_info" = "auto" || test "$with_session_info" = "console-kit"; then
58     PKG_CHECK_MODULES([DBUS],
59                       [dbus-1],
60                       [have_console_kit="yes"],
61                       [have_console_kit="no"])
62     if test x"$have_console_kit" = "xno" && test "$with_session_info" = "console-kit"; then
63         AC_MSG_ERROR([console-kit support explicitly requested, but some required packages are not available])
64     fi
65     if test x"$have_console_kit" = "xyes"; then
66         AC_DEFINE([HAVE_CONSOLE_KIT], [1], [If defined, vdagentd will be compiled with ConsoleKit support])
67         with_session_info="console-kit"
68     else
69         with_session_info="none"
70     fi
71 else
72     have_console_kit="no"
74 AM_CONDITIONAL(HAVE_CONSOLE_KIT, test x"$have_console_kit" = "xyes")
76 if test x"$enable_pciaccess" = "xyes" ; then
77     PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
78     AC_DEFINE([HAVE_PCIACCESS], [1], [If defined, vdagentd will be compiled with pciaccess support] )
80 AM_CONDITIONAL(HAVE_PCIACCESS, test x"$enable_pciaccess" = "xyes")
82 if test x"$enable_static_uinput" = "xyes" ; then
83     AC_DEFINE([WITH_STATIC_UINPUT], [1], [If defined, vdagentd will use a static uinput device] )
86 AC_CONFIG_FILES([
87 Makefile
89 AC_OUTPUT
91 dnl ==========================================================================
92 AC_MSG_NOTICE([
94         spice-vdagent $VERSION
95         ====================
97         prefix:                   ${prefix}
98         c compiler:               ${CC}
100         session-info:             ${with_session_info}
101         pciaccess:                ${enable_pciaccess}
102         static uinput:            ${enable_static_uinput}
104         Now type 'make' to build $PACKAGE