]> git.0d.be Git - empathy.git/blob - configure.ac
Set the ContentType property properly on a new file channel. (Jonny Lamb)
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 2.25.1, 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 # LT Version numbers, remember to change them just *before* a release.
9 #   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
10 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
11 #   (No interfaces changed:                   REVISION++)
12 LIBEMPATHY_CURRENT=16
13 LIBEMPATHY_AGE=2
14 LIBEMPATHY_REVISION=2
15
16 LIBEMPATHY_GTK_CURRENT=15
17 LIBEMPATHY_GTK_AGE=0
18 LIBEMPATHY_GTK_REVISION=4
19
20 AC_SUBST(LIBEMPATHY_CURRENT)
21 AC_SUBST(LIBEMPATHY_AGE)
22 AC_SUBST(LIBEMPATHY_REVISION)
23 AC_SUBST(LIBEMPATHY_GTK_CURRENT)
24 AC_SUBST(LIBEMPATHY_GTK_AGE)
25 AC_SUBST(LIBEMPATHY_GTK_REVISION)
26
27 # Minimal version required
28 GLIB_REQUIRED=2.16.0
29 GTK_REQUIRED=2.12.0
30 GCONF_REQUIRED=1.2.0
31 LIBGLADE_REQUIRED=2.0.0
32 LIBPANELAPPLET_REQUIRED=2.10.0
33 TELEPATHY_GLIB_REQUIRED=0.7.7
34 MISSION_CONTROL_REQUIRED=4.61
35 ENCHANT_REQUIRED=1.2.0
36 ISO_CODES_REQUIRED=0.35
37
38 # Uncomment that to build without deprecated symbols
39 # AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [Disable deprecated GTK symbols])
40 # AC_DEFINE(G_DISABLE_DEPRECATED, 1, [Disable deprecated GLib symbols])
41
42 AC_CONFIG_MACRO_DIR([m4])
43 AC_CONFIG_HEADERS([config.h])
44 AC_CONFIG_SRCDIR([configure.ac])
45 AC_CONFIG_AUX_DIR(.)
46
47 GNOME_COMMON_INIT
48
49 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define -Wno-portability)
50 AM_MAINTAINER_MODE
51 AC_ISC_POSIX
52 AC_PROG_CC
53 AC_HEADER_STDC
54 AM_PROG_LIBTOOL
55 AM_PROG_MKDIR_P
56 AM_PATH_GLIB_2_0
57 AC_PATH_XTRA
58 IT_PROG_INTLTOOL([0.35.0])
59 GTK_DOC_CHECK([1.3])
60 GNOME_DOC_INIT
61 IDT_COMPILE_WARNINGS
62 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
63 AC_PATH_PROG(GCONFTOOL, gconftool-2)
64 AM_GCONF_SOURCE_2
65 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
66 AC_SUBST(GLIB_GENMARSHAL)
67
68 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
69 if test -z "$XSLTPROC"; then
70   AC_MSG_ERROR([xsltproc (from libxslt) is required])
71 fi
72 AM_PATH_PYTHON([2.3])
73
74 EMPATHY_ARG_VALGRIND
75
76 # -----------------------------------------------------------
77 # Pkg-Config dependency checks
78 # -----------------------------------------------------------
79
80 PKG_CHECK_MODULES(LIBEMPATHY,
81 [
82    glib-2.0 >= $GLIB_REQUIRED
83    gobject-2.0
84    libxml-2.0
85    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
86    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
87    gio-2.0 >= $GLIB_REQUIRED
88    gio-unix-2.0 >= $GLIB_REQUIRED
89    gnome-vfs-2.0
90 ])
91
92 PKG_CHECK_MODULES(EMPATHY,
93 [
94    glib-2.0 >= $GLIB_REQUIRED
95    gobject-2.0
96    gio-2.0 >= $GLIB_REQUIRED
97    gconf-2.0 >= $GCONF_REQUIRED
98    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
99    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
100    gtk+-2.0 >= $GTK_REQUIRED
101    x11
102    libglade-2.0 >= $LIBGLADE_REQUIRED
103    libgnomeui-2.0
104    libebook-1.2
105 ])
106
107 # -----------------------------------------------------------
108 # Enable debug
109 # -----------------------------------------------------------
110
111 AC_ARG_ENABLE(debug,
112   AC_HELP_STRING([--disable-debug],[compile without debug code]),
113     enable_debug=$enableval, enable_debug=yes )
114
115 if test x$enable_debug = xyes; then
116   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
117 fi
118
119 # -----------------------------------------------------------
120 # Language Support
121 # -----------------------------------------------------------
122
123 GETTEXT_PACKAGE=empathy
124 AC_SUBST(GETTEXT_PACKAGE)
125 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
126
127 AM_GLIB_GNU_GETTEXT
128
129 # -----------------------------------------------------------
130 # spellchecking checks: enchant and iso-codes
131 # -----------------------------------------------------------
132 AC_ARG_ENABLE(spell,
133               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
134                              [Enable spell checking]), ,
135                              enable_spell=auto)
136
137 if test "x$enable_spell" != "xno"; then
138    PKG_CHECK_MODULES(ENCHANT,
139    [
140       enchant >= $ENCHANT_REQUIRED,
141       iso-codes >= $ISO_CODES_REQUIRED
142    ], have_enchant="yes", have_enchant="no")
143
144    if test "x$have_enchant" = "xyes"; then
145       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
146       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
147          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
148             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
149             AC_DEFINE(HAVE_ENCHANT, 1, [Define if you have libenchant])
150             result=yes
151       else
152             result=no
153             have_enchant="no"
154       fi
155       AC_MSG_RESULT([$result])
156    fi
157 else
158    have_enchant=no
159 fi
160
161 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
162    AC_MSG_ERROR([Couldn't find spell dependencies.])
163 fi
164
165 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
166
167 # -----------------------------------------------------------
168 # Megaphone
169 # -----------------------------------------------------------
170 AC_ARG_ENABLE(megaphone,
171               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
172                              [build megaphone applet]), ,
173                              enable_megaphone=auto)
174
175 if test "x$enable_megaphone" != "xno"; then
176    PKG_CHECK_MODULES(MEGAPHONE, 
177    [
178       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
179       glib-2.0 >= $GLIB_REQUIRED
180       gio-2.0 >= $GLIB_REQUIRED
181       gtk+-2.0 >= $GTK_REQUIRED
182       gconf-2.0 >= $GCONF_REQUIRED
183       libglade-2.0 >= $LIBGLADE_REQUIRED 
184       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
185    ], have_megaphone="yes", have_megaphone="no")
186 else
187    have_megaphone=no
188 fi
189
190 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
191    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
192 fi
193
194 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
195
196 # -----------------------------------------------------------
197 # Nothere
198 # -----------------------------------------------------------
199 AC_ARG_ENABLE(nothere,
200               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
201                              [build nothere applet]), ,
202                              enable_nothere=auto)
203
204 if test "x$enable_nothere" != "xno"; then
205    PKG_CHECK_MODULES(NOTHERE, 
206    [
207       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
208       glib-2.0 >= $GLIB_REQUIRED
209       gio-2.0 >= $GLIB_REQUIRED
210       gtk+-2.0 >= $GTK_REQUIRED
211       gconf-2.0 >= $GCONF_REQUIRED
212       libglade-2.0 >= $LIBGLADE_REQUIRED 
213       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
214    ], have_nothere="yes", have_nothere="no")
215 else
216    have_nothere=no
217 fi
218
219 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
220    AC_MSG_ERROR([Couldn't find nothere dependencies.])
221 fi
222
223 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
224
225 # -----------------------------------------------------------
226 # Tests
227 # -----------------------------------------------------------
228 AC_ARG_ENABLE(tests,
229               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
230                              [build tests]), ,
231                              enable_tests=auto)
232
233 if test "x$enable_tests" != "xno"; then
234    PKG_CHECK_MODULES(CHECK,
235    [
236       check >= 0.9.4
237    ], have_check="yes", have_check="no")
238 else
239    have_check=no
240 fi
241
242 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
243    AC_MSG_ERROR([Couldn't find check dependencies.])
244 fi
245
246 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
247
248 # -----------------------------------------------------------
249 # Python Bindings
250 # -----------------------------------------------------------
251 AC_ARG_ENABLE(python,
252               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
253                              [build python bindings to libempathy and libempathy-gtk]), ,
254                              enable_python=auto)
255
256 if test "x$enable_python" != "xno"; then
257    PKG_CHECK_MODULES(PYTHON_BINDING,
258    [
259       pygtk-2.0,
260       glib-2.0 >= $GLIB_REQUIRED
261       gio-2.0 >= $GLIB_REQUIRED
262       gobject-2.0
263       gconf-2.0 >= $GCONF_REQUIRED
264       libxml-2.0
265       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
266       gtk+-2.0 >= $GTK_REQUIRED
267       libglade-2.0 >= $LIBGLADE_REQUIRED
268    ], have_python="yes", have_python="no")
269    if test "x$have_python" = "xyes" ; then
270       AM_CHECK_PYTHON_HEADERS(,have_python="no")
271       AC_CHECK_PROGS([PYGOBJECTCODEGEN], [pygobject-codegen-2.0 pygtk-codegen-2.0])
272    fi
273 else
274    have_python=no
275 fi
276
277 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
278    AC_MSG_ERROR([Couldn't find python.])
279 fi
280
281 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
282
283 # -----------------------------------------------------------
284
285 AC_OUTPUT([
286    Makefile
287    data/Makefile
288    data/empathy.desktop.in
289    data/icons/Makefile
290    extensions/Makefile
291    po/Makefile.in
292    libempathy/Makefile
293    libempathy/libempathy.pc
294    libempathy-gtk/Makefile
295    libempathy-gtk/libempathy-gtk.pc
296    src/Makefile
297    megaphone/Makefile
298    megaphone/src/Makefile
299    megaphone/data/Makefile
300    nothere/Makefile
301    nothere/src/Makefile
302    nothere/data/Makefile
303    docs/Makefile
304    docs/libempathy/Makefile
305    docs/libempathy/version.xml
306    docs/libempathy-gtk/Makefile
307    docs/libempathy-gtk/version.xml
308    help/Makefile
309    python/Makefile
310    python/pyempathy/Makefile
311    python/pyempathygtk/Makefile
312    tests/Makefile
313    tests/xml/Makefile
314    tools/Makefile
315 ])