]> git.0d.be Git - empathy.git/blob - configure.ac
Make use of gtk_init_with_args for command line parsing. Fixes bug #491985
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 0.21.2, 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=5
22 LIBEMPATHY_AGE=0
23 LIBEMPATHY_REVISION=0
24
25 LIBEMPATHY_GTK_CURRENT=6
26 LIBEMPATHY_GTK_AGE=0
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.14.0
49 GTK_REQUIRED=2.12.0
50 GCONF_REQUIRED=1.2.0
51 LIBGLADE_REQUIRED=2.0.0
52 LIBPANELAPPLET_REQUIRED=2.10.0
53 TELEPATHY_REQUIRED=0.0.57
54 MISSION_CONTROL_REQUIRED=4.37
55
56 IDT_COMPILE_WARNINGS
57
58 dnl Uncomment that to build without deprecated GTK and GLib symbols
59 dnl AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [Disable deprecated GTK symbols])
60 dnl AC_DEFINE(G_DISABLE_DEPRECATED, 1, [Disable deprecated GLib symbols])
61
62 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
63 AC_SUBST(GLIB_GENMARSHAL)
64
65 dnl -----------------------------------------------------------
66 dnl Language Support
67 dnl -----------------------------------------------------------
68
69 GETTEXT_PACKAGE=empathy
70 AC_SUBST(GETTEXT_PACKAGE)
71 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
72
73 AM_GLIB_GNU_GETTEXT
74
75 dnl -----------------------------------------------------------
76 dnl Pkg-Config dependency checks
77 dnl -----------------------------------------------------------
78
79 PKG_CHECK_MODULES(LIBEMPATHY,
80 [
81    glib-2.0 >= $GLIB_REQUIRED
82    gobject-2.0
83    gconf-2.0 >= $GCONF_REQUIRED
84    libxml-2.0
85    libtelepathy >= $TELEPATHY_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    gconf-2.0 >= $GCONF_REQUIRED
94    libxml-2.0
95    gnome-vfs-2.0
96    libtelepathy >= $TELEPATHY_REQUIRED
97    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
98    gtk+-2.0 >= $GTK_REQUIRED
99    libglade-2.0 >= $LIBGLADE_REQUIRED
100    libebook-1.2
101 ])
102
103 dnl -----------------------------------------------------------
104 dnl ISO codes, used for aspell support
105 dnl -----------------------------------------------------------
106 AC_MSG_CHECKING([whether iso-codes exists and has iso-639 domain])
107 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 ; then
108    AC_MSG_RESULT([yes])
109    iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes`
110    iso_codes_pkgconfig=iso-codes
111    have_iso_codes=yes
112 else
113    AC_MSG_RESULT([no])
114    iso_codes_prefix=
115    iso_codes_pkgconfig=
116    have_iso_codes=no
117 fi
118
119 AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["$iso_codes_prefix"],[ISO codes prefix])
120
121 dnl -----------------------------------------------------------
122 dnl ASpell
123 dnl -----------------------------------------------------------
124 AC_ARG_ENABLE(aspell,
125               AS_HELP_STRING([--enable-aspell=@<:@no/yes/auto@:>@],
126                              [compile with aspell support]), ,
127                              enable_aspell=auto)
128
129 if test "x$enable_aspell" = "xyes" -a "x$have_iso_codes" != "xyes"; then
130    AC_MSG_ERROR([You must have iso-codes with the iso-639 domain to use aspell.])
131 fi
132
133 if test "x$enable_aspell" != "xno" -a "x$have_iso_codes" = "xyes"; then
134    AC_CHECK_LIB(aspell, aspell_speller_check,have_aspell=yes,have_aspell=no,)
135
136    if test "x$have_aspell" = "xyes"; then
137       AC_DEFINE(HAVE_ASPELL, 1, [Define if we have aspell])
138       EMPATHY_LIBS="$EMPATHY_LIBS -laspell"
139    else
140       have_aspell=no
141    fi
142 else
143    have_aspell=no
144 fi
145
146 if test "x$enable_aspell" = "xyes" -a "x$have_aspell" != "xyes"; then
147    AC_MSG_ERROR([Couldn't find aspell.])
148 fi
149
150
151 dnl -----------------------------------------------------------
152 dnl Megaphone
153 dnl -----------------------------------------------------------
154 AC_ARG_ENABLE(megaphone,
155               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
156                              [build megaphone applet]), ,
157                              enable_megaphone=auto)
158
159 if test "x$enable_megaphone" != "xno"; then
160    PKG_CHECK_MODULES(MEGAPHONE, 
161    [
162       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
163       glib-2.0 >= $GLIB_REQUIRED
164       gtk+-2.0 >= $GTK_REQUIRED
165       gconf-2.0 >= $GCONF_REQUIRED
166       libglade-2.0 >= $LIBGLADE_REQUIRED 
167       gnome-vfs-2.0
168       libtelepathy >= $TELEPATHY_REQUIRED
169       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
170    ], have_megaphone="yes", have_megaphone="no")
171 else
172    have_megaphone=no
173 fi
174
175 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
176    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
177 fi
178
179 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
180
181 dnl -----------------------------------------------------------
182 dnl Nothere
183 dnl -----------------------------------------------------------
184 AC_ARG_ENABLE(nothere,
185               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
186                              [build nothere applet]), ,
187                              enable_nothere=no)
188
189 if test "x$enable_nothere" != "xno"; then
190    PKG_CHECK_MODULES(NOTHERE, 
191    [
192       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
193       glib-2.0 >= $GLIB_REQUIRED
194       gtk+-2.0 >= $GTK_REQUIRED
195       gconf-2.0 >= $GCONF_REQUIRED
196       libglade-2.0 >= $LIBGLADE_REQUIRED 
197       libtelepathy >= $TELEPATHY_REQUIRED
198       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
199    ], have_nothere="yes", have_nothere="no")
200 else
201    have_nothere=no
202 fi
203
204 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
205    AC_MSG_ERROR([Couldn't find nothere dependencies.])
206 fi
207
208 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
209
210 dnl -----------------------------------------------------------
211 dnl Tests
212 dnl -----------------------------------------------------------
213 AC_ARG_ENABLE(tests,
214               AS_HELP_STRING([--enable-tests=@<:@no/yes@:>@],
215                              [build tests]), ,
216                              enable_tests=no)
217
218 AM_CONDITIONAL(HAVE_TESTS, test "x$enable_tests" = "xyes")
219
220 dnl -----------------------------------------------------------
221 dnl Python Bindings
222 dnl -----------------------------------------------------------
223 AC_ARG_ENABLE(python,
224               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
225                              [build python bindings to libempathy and libempathy-gtk]), ,
226                              enable_python=auto)
227
228 if test "x$enable_python" != "xno"; then
229    AM_PATH_PYTHON
230    if test -z "$PYTHON" ; then
231       have_python="no"
232    else
233       PKG_CHECK_MODULES(PYTHON_BINDING,
234       [
235          pygtk-2.0,
236          glib-2.0 >= $GLIB_REQUIRED
237          gobject-2.0
238          gconf-2.0 >= $GCONF_REQUIRED
239          libxml-2.0
240          gnome-vfs-2.0
241          libtelepathy >= $TELEPATHY_REQUIRED
242          libmissioncontrol >= $MISSION_CONTROL_REQUIRED
243          gtk+-2.0 >= $GTK_REQUIRED
244          libglade-2.0 >= $LIBGLADE_REQUIRED
245       ], have_python="yes", have_python="no")
246    fi
247 else
248    have_python=no
249 fi
250
251 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
252    AC_MSG_ERROR([Couldn't find python.])
253 fi
254
255 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
256
257 dnl -----------------------------------------------------------
258 dnl VoIP support
259 dnl -----------------------------------------------------------
260 AC_ARG_ENABLE(voip,
261               AS_HELP_STRING([--enable-voip=@<:@no/yes@:>@],
262                              [Add support for Voice and Video call]), ,
263                              enable_voip=no)
264
265 if test "x$enable_voip" = "xyes"; then
266    AC_DEFINE(HAVE_VOIP, 1, [Define if we have voip])
267 fi
268
269 AM_CONDITIONAL(HAVE_VOIP, test "x$enable_voip" = "xyes")
270
271 dnl -----------------------------------------------------------
272
273 AC_OUTPUT([
274    Makefile
275    data/Makefile
276    data/empathy.desktop.in
277    data/icons/Makefile
278    po/Makefile.in
279    libempathy/Makefile
280    libempathy/libempathy.pc
281    libempathy-gtk/Makefile
282    libempathy-gtk/libempathy-gtk.pc
283    src/Makefile
284    megaphone/Makefile
285    megaphone/src/Makefile
286    megaphone/data/Makefile
287    nothere/Makefile
288    nothere/src/Makefile
289    nothere/data/Makefile
290    doc/Makefile
291    doc/libempathy/Makefile
292    doc/libempathy-gtk/Makefile
293    python/Makefile
294    python/pyempathy/Makefile
295    python/pyempathygtk/Makefile
296    tests/Makefile
297 ])