]> git.0d.be Git - empathy.git/blob - configure.ac
Add python binding. Fixes bug #457660 (Michael Sheldon).
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 0.12, http://bugzilla.gnome.org/browse.cgi?product=empathy)
2 AC_PREREQ(2.59)
3 AC_COPYRIGHT([
4   Copyright (C) 2003-2007 Imendio AB
5   Copyright (C) 2007 Collabora Ltd.
6 ])
7
8 AM_CONFIG_HEADER(config.h)
9 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define)
10
11 AM_MAINTAINER_MODE
12
13 AC_ISC_POSIX
14 AC_PROG_CC
15 AC_HEADER_STDC
16
17 # LT Version numbers, remember to change them just *before* a release.
18 #   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
19 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
20 #   (No interfaces changed:                   REVISION++)
21 LIBEMPATHY_CURRENT=2
22 LIBEMPATHY_AGE=0
23 LIBEMPATHY_REVISION=0
24
25 LIBEMPATHY_GTK_CURRENT=2
26 LIBEMPATHY_GTK_AGE=1
27 LIBEMPATHY_GTK_REVISION=0
28
29 AC_SUBST(LIBEMPATHY_CURRENT)
30 AC_SUBST(LIBEMPATHY_AGE)
31 AC_SUBST(LIBEMPATHY_REVISION)
32 AC_SUBST(LIBEMPATHY_GTK_CURRENT)
33 AC_SUBST(LIBEMPATHY_GTK_AGE)
34 AC_SUBST(LIBEMPATHY_GTK_REVISION)
35
36 AM_PROG_LIBTOOL
37 AM_PATH_GLIB_2_0
38 AC_PATH_XTRA
39
40 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
41 AC_PATH_PROG(GCONFTOOL, gconftool-2)
42 AM_GCONF_SOURCE_2
43
44 IT_PROG_INTLTOOL([0.35.0])
45
46 GTK_DOC_CHECK([1.3])
47
48 GLIB_REQUIRED=2.12.0
49 GTK_REQUIRED=2.10.0
50 GCONF_REQUIRED=1.2.0
51 LIBGLADE_REQUIRED=2.0.0
52 TELEPATHY_REQUIRED=0.0.51
53 MISSION_CONTROL_REQUIRED=4.33
54
55 IDT_COMPILE_WARNINGS
56
57 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
58 AC_SUBST(GLIB_GENMARSHAL)
59
60 pluginlibdir=`$PKG_CONFIG mission-control --variable=pluginlibdir`
61 AC_SUBST(pluginlibdir)
62
63 dnl -----------------------------------------------------------
64 dnl Language Support
65 dnl -----------------------------------------------------------
66
67 GETTEXT_PACKAGE=empathy
68 AC_SUBST(GETTEXT_PACKAGE)
69 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
70
71 AM_GLIB_GNU_GETTEXT
72
73 dnl -----------------------------------------------------------
74 dnl Pkg-Config dependency checks
75 dnl -----------------------------------------------------------
76
77 PKG_CHECK_MODULES(LIBEMPATHY,
78 [
79    glib-2.0 >= $GLIB_REQUIRED
80    gobject-2.0
81    gconf-2.0 >= $GCONF_REQUIRED
82    libxml-2.0
83    libtelepathy >= $TELEPATHY_REQUIRED
84    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
85 ])
86
87 PKG_CHECK_MODULES(EMPATHY,
88 [
89    glib-2.0 >= $GLIB_REQUIRED
90    gobject-2.0
91    gconf-2.0 >= $GCONF_REQUIRED
92    libxml-2.0
93    gnome-vfs-2.0
94    libtelepathy >= $TELEPATHY_REQUIRED
95    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
96    gtk+-2.0 >= $GTK_REQUIRED
97    libglade-2.0 >= $LIBGLADE_REQUIRED
98    libgnomeui-2.0
99 ])
100
101 dnl -----------------------------------------------------------
102 dnl ISO codes, used for aspell support
103 dnl -----------------------------------------------------------
104 AC_MSG_CHECKING([whether iso-codes exists and has iso-639 domain])
105 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 ; then
106    AC_MSG_RESULT([yes])
107    iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes`
108    iso_codes_pkgconfig=iso-codes
109    have_iso_codes=yes
110 else
111    AC_MSG_RESULT([no])
112    iso_codes_prefix=
113    iso_codes_pkgconfig=
114    have_iso_codes=no
115 fi
116
117 AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["$iso_codes_prefix"],[ISO codes prefix])
118
119 dnl -----------------------------------------------------------
120 dnl ASpell
121 dnl -----------------------------------------------------------
122 AC_ARG_ENABLE(aspell,
123               AS_HELP_STRING([--enable-aspell=@<:@no/yes/auto@:>@],
124                              [compile with aspell support]), ,
125                              enable_aspell=auto)
126
127 if test "x$enable_aspell" = "xyes" -a "x$have_iso_codes" != "xyes"; then
128    AC_MSG_ERROR([You must have iso-codes with the iso-639 domain to use aspell.])
129 fi
130
131 if test "x$enable_aspell" != "xno" -a "x$have_iso_codes" = "xyes"; then
132    AC_CHECK_LIB(aspell, aspell_speller_check,have_aspell=yes,have_aspell=no,)
133
134    if test "x$have_aspell" = "xyes"; then
135       AC_DEFINE(HAVE_ASPELL, 1, [Define if we have aspell])
136       EMPATHY_LIBS="$EMPATHY_LIBS -laspell"
137    else
138       have_aspell=no
139    fi
140 else
141    have_aspell=no
142 fi
143
144 if test "x$enable_aspell" = "xyes" -a "x$have_aspell" != "xyes"; then
145    AC_MSG_ERROR([Couldn't find aspell.])
146 fi
147
148
149 dnl -----------------------------------------------------------
150 dnl Python Bindings
151 dnl -----------------------------------------------------------
152 AC_ARG_ENABLE(python,
153               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
154                              [build python bindings to libempathy and libempathy-gtk]), ,
155                              enable_python=auto)
156
157 PKG_CHECK_MODULES(PYTHON_BINDING,
158 [
159    pygtk-2.0,
160    glib-2.0 >= $GLIB_REQUIRED
161    gobject-2.0
162    gconf-2.0 >= $GCONF_REQUIRED
163    libxml-2.0
164    gnome-vfs-2.0
165    libtelepathy >= $TELEPATHY_REQUIRED
166    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
167    gtk+-2.0 >= $GTK_REQUIRED
168    libglade-2.0 >= $LIBGLADE_REQUIRED
169    libgnomeui-2.0
170 ], have_python="yes", have_python="no")
171
172 if test "x$have_python" = "xno"; then
173         if test "x$enable_python" = "xyes"; then
174                 AC_MSG_ERROR([Could not find python dependencies])
175         fi
176         enable_python="no (missing dependencies)"
177 else
178         if test "x$enable_python" != "xno"; then
179                 enable_python="yes"
180         else
181                 enable_python="no (disabled)"
182         fi
183 fi
184 AM_CONDITIONAL(HAVE_PYTHON, test x$enable_python = xyes)
185
186 dnl -----------------------------------------------------------
187
188 AC_OUTPUT([
189   Makefile
190   data/Makefile
191   data/empathy.desktop.in
192   data/16x16/Makefile
193   data/22x22/Makefile
194   data/32x32/Makefile
195   data/48x48/Makefile
196   data/scalable/Makefile
197   po/Makefile.in
198   libempathy/Makefile
199   libempathy/libempathy.pc
200   libempathy-gtk/Makefile
201   libempathy-gtk/libempathy-gtk.pc
202   src/Makefile
203   doc/Makefile
204   doc/libempathy/Makefile
205   doc/libempathy-gtk/Makefile
206   python/Makefile
207   python/pyempathy/Makefile
208   python/pyempathygtk/Makefile
209 ])