6c88627b9c19cdd82a3100defeaf54e507353ec8
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 0.13, 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=1
24
25 LIBEMPATHY_GTK_CURRENT=3
26 LIBEMPATHY_GTK_AGE=2
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.57
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 dnl -----------------------------------------------------------
61 dnl Language Support
62 dnl -----------------------------------------------------------
63
64 GETTEXT_PACKAGE=empathy
65 AC_SUBST(GETTEXT_PACKAGE)
66 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
67
68 AM_GLIB_GNU_GETTEXT
69
70 dnl -----------------------------------------------------------
71 dnl Pkg-Config dependency checks
72 dnl -----------------------------------------------------------
73
74 PKG_CHECK_MODULES(LIBEMPATHY,
75 [
76    glib-2.0 >= $GLIB_REQUIRED
77    gobject-2.0
78    gconf-2.0 >= $GCONF_REQUIRED
79    libxml-2.0
80    libtelepathy >= $TELEPATHY_REQUIRED
81    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
82 ])
83
84 PKG_CHECK_MODULES(EMPATHY,
85 [
86    glib-2.0 >= $GLIB_REQUIRED
87    gobject-2.0
88    gconf-2.0 >= $GCONF_REQUIRED
89    libxml-2.0
90    gnome-vfs-2.0
91    libtelepathy >= $TELEPATHY_REQUIRED
92    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
93    gtk+-2.0 >= $GTK_REQUIRED
94    libglade-2.0 >= $LIBGLADE_REQUIRED
95    libgnomeui-2.0
96    libebook-1.2
97 ])
98
99 dnl -----------------------------------------------------------
100 dnl ISO codes, used for aspell support
101 dnl -----------------------------------------------------------
102 AC_MSG_CHECKING([whether iso-codes exists and has iso-639 domain])
103 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 ; then
104    AC_MSG_RESULT([yes])
105    iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes`
106    iso_codes_pkgconfig=iso-codes
107    have_iso_codes=yes
108 else
109    AC_MSG_RESULT([no])
110    iso_codes_prefix=
111    iso_codes_pkgconfig=
112    have_iso_codes=no
113 fi
114
115 AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["$iso_codes_prefix"],[ISO codes prefix])
116
117 dnl -----------------------------------------------------------
118 dnl ASpell
119 dnl -----------------------------------------------------------
120 AC_ARG_ENABLE(aspell,
121               AS_HELP_STRING([--enable-aspell=@<:@no/yes/auto@:>@],
122                              [compile with aspell support]), ,
123                              enable_aspell=auto)
124
125 if test "x$enable_aspell" = "xyes" -a "x$have_iso_codes" != "xyes"; then
126    AC_MSG_ERROR([You must have iso-codes with the iso-639 domain to use aspell.])
127 fi
128
129 if test "x$enable_aspell" != "xno" -a "x$have_iso_codes" = "xyes"; then
130    AC_CHECK_LIB(aspell, aspell_speller_check,have_aspell=yes,have_aspell=no,)
131
132    if test "x$have_aspell" = "xyes"; then
133       AC_DEFINE(HAVE_ASPELL, 1, [Define if we have aspell])
134       EMPATHY_LIBS="$EMPATHY_LIBS -laspell"
135    else
136       have_aspell=no
137    fi
138 else
139    have_aspell=no
140 fi
141
142 if test "x$enable_aspell" = "xyes" -a "x$have_aspell" != "xyes"; then
143    AC_MSG_ERROR([Couldn't find aspell.])
144 fi
145
146
147 dnl -----------------------------------------------------------
148 dnl Python Bindings
149 dnl -----------------------------------------------------------
150 AC_ARG_ENABLE(python,
151               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
152                              [build python bindings to libempathy and libempathy-gtk]), ,
153                              enable_python=auto)
154
155 if test "x$enable_python" != "xno"; then
156    AM_PATH_PYTHON
157    if test -z "$PYTHON" ; then
158       have_python="no"
159    else
160       PKG_CHECK_MODULES(PYTHON_BINDING,
161       [
162          pygtk-2.0,
163          glib-2.0 >= $GLIB_REQUIRED
164          gobject-2.0
165          gconf-2.0 >= $GCONF_REQUIRED
166          libxml-2.0
167          gnome-vfs-2.0
168          libtelepathy >= $TELEPATHY_REQUIRED
169          libmissioncontrol >= $MISSION_CONTROL_REQUIRED
170          gtk+-2.0 >= $GTK_REQUIRED
171          libglade-2.0 >= $LIBGLADE_REQUIRED
172          libgnomeui-2.0
173       ], have_python="yes", have_python="no")
174    fi
175 else
176    have_python=no
177 fi
178
179 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
180    AC_MSG_ERROR([Couldn't find python.])
181 fi
182
183 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
184
185 dnl -----------------------------------------------------------
186
187 AC_OUTPUT([
188    Makefile
189    data/Makefile
190    data/empathy.desktop.in
191    data/16x16/Makefile
192    data/22x22/Makefile
193    data/24x24/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 ])