]> git.0d.be Git - empathy.git/blob - configure.ac
Update gitignore
[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 ])
88
89 PKG_CHECK_MODULES(EMPATHY,
90 [
91    glib-2.0 >= $GLIB_REQUIRED
92    gobject-2.0
93    gio-2.0 >= $GLIB_REQUIRED
94    gconf-2.0 >= $GCONF_REQUIRED
95    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
96    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
97    gtk+-2.0 >= $GTK_REQUIRED
98    x11
99    libglade-2.0 >= $LIBGLADE_REQUIRED
100    libebook-1.2
101 ])
102
103 # -----------------------------------------------------------
104 # Enable debug
105 # -----------------------------------------------------------
106
107 AC_ARG_ENABLE(debug,
108   AC_HELP_STRING([--disable-debug],[compile without debug code]),
109     enable_debug=$enableval, enable_debug=yes )
110
111 if test x$enable_debug = xyes; then
112   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
113 fi
114
115 # -----------------------------------------------------------
116 # Language Support
117 # -----------------------------------------------------------
118
119 GETTEXT_PACKAGE=empathy
120 AC_SUBST(GETTEXT_PACKAGE)
121 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
122
123 AM_GLIB_GNU_GETTEXT
124
125 # -----------------------------------------------------------
126 # spellchecking checks: enchant and iso-codes
127 # -----------------------------------------------------------
128 AC_ARG_ENABLE(spell,
129               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
130                              [Enable spell checking]), ,
131                              enable_spell=auto)
132
133 if test "x$enable_spell" != "xno"; then
134    PKG_CHECK_MODULES(ENCHANT,
135    [
136       enchant >= $ENCHANT_REQUIRED,
137       iso-codes >= $ISO_CODES_REQUIRED
138    ], have_enchant="yes", have_enchant="no")
139
140    if test "x$have_enchant" = "xyes"; then
141       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
142       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
143          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
144             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
145             AC_DEFINE(HAVE_ENCHANT, 1, [Define if you have libenchant])
146             result=yes
147       else
148             result=no
149             have_enchant="no"
150       fi
151       AC_MSG_RESULT([$result])
152    fi
153 else
154    have_enchant=no
155 fi
156
157 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
158    AC_MSG_ERROR([Couldn't find spell dependencies.])
159 fi
160
161 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
162
163 # -----------------------------------------------------------
164 # Megaphone
165 # -----------------------------------------------------------
166 AC_ARG_ENABLE(megaphone,
167               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
168                              [build megaphone applet]), ,
169                              enable_megaphone=auto)
170
171 if test "x$enable_megaphone" != "xno"; then
172    PKG_CHECK_MODULES(MEGAPHONE, 
173    [
174       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
175       glib-2.0 >= $GLIB_REQUIRED
176       gtk+-2.0 >= $GTK_REQUIRED
177       gconf-2.0 >= $GCONF_REQUIRED
178       libglade-2.0 >= $LIBGLADE_REQUIRED 
179       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
180    ], have_megaphone="yes", have_megaphone="no")
181 else
182    have_megaphone=no
183 fi
184
185 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
186    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
187 fi
188
189 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
190
191 # -----------------------------------------------------------
192 # Nothere
193 # -----------------------------------------------------------
194 AC_ARG_ENABLE(nothere,
195               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
196                              [build nothere applet]), ,
197                              enable_nothere=auto)
198
199 if test "x$enable_nothere" != "xno"; then
200    PKG_CHECK_MODULES(NOTHERE, 
201    [
202       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
203       glib-2.0 >= $GLIB_REQUIRED
204       gtk+-2.0 >= $GTK_REQUIRED
205       gconf-2.0 >= $GCONF_REQUIRED
206       libglade-2.0 >= $LIBGLADE_REQUIRED 
207       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
208    ], have_nothere="yes", have_nothere="no")
209 else
210    have_nothere=no
211 fi
212
213 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
214    AC_MSG_ERROR([Couldn't find nothere dependencies.])
215 fi
216
217 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
218
219 # -----------------------------------------------------------
220 # Tests
221 # -----------------------------------------------------------
222 AC_ARG_ENABLE(tests,
223               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
224                              [build tests]), ,
225                              enable_tests=auto)
226
227 if test "x$enable_tests" != "xno"; then
228    PKG_CHECK_MODULES(CHECK,
229    [
230       check >= 0.9.4
231    ], have_check="yes", have_check="no")
232 else
233    have_check=no
234 fi
235
236 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
237    AC_MSG_ERROR([Couldn't find check dependencies.])
238 fi
239
240 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
241
242 # -----------------------------------------------------------
243 # Python Bindings
244 # -----------------------------------------------------------
245 AC_ARG_ENABLE(python,
246               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
247                              [build python bindings to libempathy and libempathy-gtk]), ,
248                              enable_python=auto)
249
250 if test "x$enable_python" != "xno"; then
251    PKG_CHECK_MODULES(PYTHON_BINDING,
252    [
253       pygtk-2.0,
254       glib-2.0 >= $GLIB_REQUIRED
255       gobject-2.0
256       gconf-2.0 >= $GCONF_REQUIRED
257       libxml-2.0
258       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
259       gtk+-2.0 >= $GTK_REQUIRED
260       libglade-2.0 >= $LIBGLADE_REQUIRED
261    ], have_python="yes", have_python="no")
262    if test "x$have_python" = "xyes" ; then
263       AM_CHECK_PYTHON_HEADERS(,have_python="no")
264       AC_CHECK_PROGS([PYGOBJECTCODEGEN], [pygobject-codegen-2.0 pygtk-codegen-2.0])
265    fi
266 else
267    have_python=no
268 fi
269
270 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
271    AC_MSG_ERROR([Couldn't find python.])
272 fi
273
274 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
275
276 # -----------------------------------------------------------
277
278 AC_OUTPUT([
279    Makefile
280    data/Makefile
281    data/empathy.desktop.in
282    data/icons/Makefile
283    extensions/Makefile
284    po/Makefile.in
285    libempathy/Makefile
286    libempathy/libempathy.pc
287    libempathy-gtk/Makefile
288    libempathy-gtk/libempathy-gtk.pc
289    src/Makefile
290    megaphone/Makefile
291    megaphone/src/Makefile
292    megaphone/data/Makefile
293    nothere/Makefile
294    nothere/src/Makefile
295    nothere/data/Makefile
296    docs/Makefile
297    docs/libempathy/Makefile
298    docs/libempathy/version.xml
299    docs/libempathy-gtk/Makefile
300    docs/libempathy-gtk/version.xml
301    help/Makefile
302    python/Makefile
303    python/pyempathy/Makefile
304    python/pyempathygtk/Makefile
305    tests/Makefile
306    tests/xml/Makefile
307    tools/Makefile
308 ])