summaryrefslogtreecommitdiff
path: root/configure.ac
blob: ae8be87104bf2a586978358e37887a448dffe7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
AC_INIT(ytstenut-plugins, 0.1)

AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_LIBTOOL

GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The name of the gettext package.])
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT

PKG_CHECK_MODULES(TELEPATHY_GLIB, telepathy-glib)
AC_SUBST(TELEPATHY_GLIB_CFLAGS)
AC_SUBST(TELEPATHY_GLIB_LIBS)

PKG_CHECK_MODULES(TELEPATHY_YTSTENUT, [telepathy-ytstenut-glib])
AC_SUBST(TELEPATHY_YTSTENUT_CFLAGS)
AC_SUBST(TELEPATHY_YTSTENUT_LIBS)

# ------------------------------------------------------------------------------
# MISSION CONTROL PLUGIN

PKG_CHECK_MODULES(MISSION_CONTROL_MODULE, mission-control-plugins >= 5.7.7+)

AC_ARG_WITH([mission-control-plugins-dir],
	[AC_HELP_STRING([--with-mission-control-plugins-dir],
		[directory to install mission-control plugins])],
		[with_mc_plugins_dir=$withval], [with_mc_plugins_dir=""])

if test -z "$with_mc_plugins_dir"; then
	AC_MSG_CHECKING([Mission Control plugins dir])
	MISSION_CONTROL_PLUGINS_DIR=`pkg-config --variable=plugindir mission-control-plugins`
else
	MISSION_CONTROL_PLUGINS_DIR="$with_mc_plugins_dir"
fi

if test "x$MISSION_CONTROL_PLUGINS_DIR" = "x"; then
	AC_MSG_ERROR([could not determine plugindir])
else
	AC_MSG_RESULT([$MISSION_CONTROL_PLUGINS_DIR])
fi
AC_SUBST(MISSION_CONTROL_PLUGINS_DIR)

AC_MSG_CHECKING([Mission Control executable])
MISSION_CONTROL_EXECUTABLE=`pkg-config --variable=missioncontrolpath mission-control-plugins`
if test "x$MISSION_CONTROL_EXECUTABLE" = "x"; then
	AC_MSG_ERROR([could not determine location of mission control executable])
else
	AC_MSG_RESULT([$MISSION_CONTROL_EXECUTABLE])
fi
AC_SUBST(MISSION_CONTROL_EXECUTABLE)

# ------------------------------------------------------------------------------
# SALUT PLUGIN

PKG_CHECK_MODULES(SALUT, telepathy-salut, HAVE_SALUT=yes, HAVE_SALUT=no)
AC_SUBST(SALUT_LIBS)
AC_SUBST(SALUT_CFLAGS)
salutplugindir=`pkg-config --variable=plugindir telepathy-salut`
AC_SUBST(salutplugindir)

AC_MSG_CHECKING([telepathy-salut executable])
SALUT_EXECUTABLE=`pkg-config --variable=salutpath telepathy-salut`
if test "$SALUT_EXECUTABLE" = ""; then
	AC_MSG_ERROR([could not determine location of telepathy-salut executable])
else
	AC_MSG_RESULT([$SALUT_EXECUTABLE])
fi
AC_SUBST(SALUT_EXECUTABLE)

AM_PATH_PYTHON([2.5])

# Check for a python >= 2.5 with twisted to run python tests
AC_MSG_CHECKING([for Python with Avahi, Twisted and XMPP protocol support])
if $PYTHON -c "import twisted.words.xish.domish, twisted.words.protocols.jabber, twisted.internet.reactor, avahi" >/dev/null 2>&1; then
    TEST_PYTHON="$PYTHON"
else
    TEST_PYTHON=false
fi
AC_MSG_RESULT([$TEST_PYTHON])
AC_SUBST(TEST_PYTHON)
AM_CONDITIONAL([WANT_TWISTED_TESTS], test false != "$TEST_PYTHON")

# ------------------------------------------------------------------------------

AC_ARG_ENABLE(debug,
	AC_HELP_STRING([--enable-debug],
	[Compile binaries in debug mode]))

AC_MSG_CHECKING(for DEBUG mode)
if test "$enable_debug" = "yes"; then
	CFLAGS="$CFLAGS -g -O0 -Werror -DG_DISABLE_DEPRECATED"
	AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi

CFLAGS="$CFLAGS -Werror -Wall -Wextra -Wno-missing-field-initializers \
	-Wno-unused-parameter -Wdeclaration-after-statement -Wshadow \
	-Wmissing-prototypes -Wmissing-declarations"

AC_SUBST(CFLAGS)

AC_OUTPUT([
	Makefile
	mission-control/Makefile
	salut/Makefile
	tests/Makefile
	tests/twisted/Makefile
	tests/twisted/tools/Makefile
	tests/twisted/tools/exec-with-log.sh
	tests/twisted/tools/salut-exec-with-log.sh
	tests/twisted/tools/tmp-session-bus.conf
	tests/twisted/tools/org.freedesktop.Telepathy.MissionControl5.service
	tests/twisted/tools/org.freedesktop.Telepathy.Client.Logger.service
	tests/twisted/tools/org.freedesktop.Telepathy.ConnectionManager.salut.service
])