1 dnl Use `VERSION' files to get version.
2 m4_define([SIPE_VERSION_DATA], m4_include([VERSION]))
4 dnl Strip off newline characters.
5 m4_define([_SIPE_VERSION],
6 m4_substr(SIPE_VERSION_DATA,
7 [0], m4_decr(m4_len(SIPE_VERSION_DATA))))
9 dnl version of this package
10 m4_define(pidgin_sipe_version, _SIPE_VERSION)
12 AC_INIT([pidgin-sipe], _SIPE_VERSION)
13 AC_DEFINE(SIPE_VERSION, "_SIPE_VERSION", [Define sipe version.])
16 AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])
21 IT_PROG_INTLTOOL([0.35.0])
27 dnl checks for library functions
28 AC_CHECK_FUNCS([setenv unsetenv])
30 dnl tell pkgconfig to look in the same prefix we're installing this to,
31 dnl as that's likely where libpurple will be found if it's not in the default
33 PREFIX=$ac_default_prefix
34 if test "$prefix" != "NONE"; then
38 PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$PREFIX/lib/pkgconfig"
39 export PKG_CONFIG_PATH
43 [AS_HELP_STRING([--enable-debug],
44 [compile with debugging support [default=no]])],
48 if test "$enable_debug" = yes; then
49 AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
52 DEBUG_CFLAGS="${DEBUG_CFLAGS}"
53 AC_SUBST(DEBUG_CFLAGS)
55 dnl quality check mode
56 dnl For people who are interested in finding bugs and not hiding them
57 AC_ARG_ENABLE(quality-check,
58 [AS_HELP_STRING([--enable-quality-check],
59 [compile with compiler checks enabled [default=yes]])],
61 enable_quality_check="yes")
63 if test "$enable_quality_check" = yes; then
64 QUALITY_CFLAGS="${QUALITY_CFLAGS} -Werror -Wall -Wextra"
66 QUALITY_CFLAGS="${QUALITY_CFLAGS}"
68 AC_SUBST(QUALITY_CFLAGS)
70 dnl Check for pkg-config before using it
74 [AC_HELP_STRING([--with-krb5=PREFIX],
75 [compile sipe plugin with Kerberos 5 support @<:@default=no@:>@])],
76 [test "$withval" = "no" || kerberos="$withval"],
79 dnl check for Kerberos
81 AC_SUBST(KRB5_LDFLAGS)
84 AM_CONDITIONAL(SIP_SEC_KRB5, test "$kerberos" != "no")
85 if test "$kerberos" != "no" ; then
86 if test "$kerberos" != "yes" ; then
87 KRB5_CFLAGS="-I${kerberos}/include"
88 KRB5_LDFLAGS="-L${kerberos}/lib"
90 orig_LDFLAGS="$LDFLAGS"
91 LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
92 AC_CHECK_LIB(krb5, krb5_rd_req,
94 [AC_CHECK_LIB(krb5, krb5_rd_req,
96 [AC_ERROR(Kerberos 5 libraries not found)],
99 AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
100 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
101 [AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
102 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
103 [AC_ERROR(GSSAPI libraries not found)],
107 LIBS="$KRB5_LIBS $LIBS"
108 AC_CHECK_FUNCS([krb5_get_error_message])
110 AC_DEFINE(USE_KERBEROS, 1, [Define if kerberos should be used in sipe.])
114 PKG_CHECK_MODULES(GLIB, [glib-2.0])
116 dnl assumption check: sizof(uuid_t) must be 16 (see uuid.c)
117 AC_MSG_CHECKING([that sizeof(uuid_t) is 16])
118 ac_save_CFLAGS=$CFLAGS
119 CFLAGS="$GLIB_CFLAGS -Werror -Wall -Wextra"
120 dnl note the [[[ quoting: our code contains []!
127 /* Copied from uuid.c */
131 guint16 time_hi_and_version;
132 guint8 clock_seq_hi_and_reserved;
133 guint8 clock_seq_low;
137 [return(sizeof(uuid_t) == 16 ? 0 : 1);]),
138 [AC_MSG_RESULT(yes)],
139 [AC_MSG_RESULT(failed)
140 AC_ERROR(sizeof(uuid_t) is not 16
142 Please notify the SIPE developers and provide the following information:
148 CFLAGS=$ac_save_CFLAGS
150 dnl check for libpurple
152 AC_ARG_WITH([purple],
153 [AC_HELP_STRING([--with-purple],
154 [compile sipe plugin for libpurple clients @<:@default=autodetect@:>@])],
155 [test "$withval" = "yes" || purple="no"],
157 if test "$purple" != "no"; then
158 PKG_CHECK_MODULES(PURPLE, [purple >= 2.4.0],
163 dnl support for libpurple plugin
164 AM_CONDITIONAL(SIPE_INCLUDE_PURPLE, test "$purple" != "no")
165 if test "$purple" != "no"; then
167 dnl unfortunately PURPLE_MAJOR_VERSION is not exported by purple.m4
168 PURPLE_MAJOR_VERSION=`$PKG_CONFIG --modversion purple | cut -d. -f 1`
169 AC_SUBST(PURPLE_MAJOR_VERSION)
171 dnl let user now if he has a 32- and 64-bit header conflict...
172 AC_MSG_CHECKING([for 32- and 64-bit header conflicts])
173 ac_save_CFLAGS=$CFLAGS
174 CFLAGS="$PURPLE_CFLAGS -Werror -Wall -Wextra"
181 /* Compile some code that has caused trouble in the past */
182 void testfunc(unsigned long len)
184 PurpleCipherContext *rc4 = NULL;
185 purple_cipher_context_set_option(rc4, "key_len", GUINT_TO_POINTER(len));
189 [AC_MSG_RESULT(none)],
190 [AC_MSG_RESULT(failed)
191 AC_ERROR(conflicts found.
193 Check that you have the correct glib/libpurple headers installed for
194 your architecture or set PURPLE_CFLAGS to override the system defaults.
196 CFLAGS=$ac_save_CFLAGS
199 dnl check for telepathy
201 AC_ARG_WITH([telepathy],
202 [AC_HELP_STRING([--with-telepathy],
203 [compile sipe plugin for telepathy clients @<:@default=autodetect@:>@])],
204 [test "$withval" = "yes" || telepathy="no"],
206 if test "$telepathy" != "no"; then
207 PKG_CHECK_MODULES(TELEPATHY, [telepathy-glib],
212 dnl support for telepathy plugin
213 AM_CONDITIONAL(SIPE_INCLUDE_TELEPATHY, test "$telepathy" != "no")
214 dnl NOTHING IMPLEMENTED YET!!!
215 dnl if test "$telepathy" != "no"; then
219 AS_IF([test "$purple" = "no" -a "$telepathy" = "no"],
220 [AC_ERROR(at least one plugin must be selected
222 If you didn't use a --without option then please check that you have
223 the headers for the packages "purple" or "telepathy-glib" installed.
228 AC_MSG_CHECKING([locale_CPPFLAGS])
229 LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
230 AC_SUBST([LOCALE_CPPFLAGS])
231 AC_MSG_RESULT([$LOCALE_CPPFLAGS])
233 GETTEXT_PACKAGE=$PACKAGE
234 AC_SUBST(GETTEXT_PACKAGE)
235 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
241 dnl substitutions and generated files
242 AC_CONFIG_HEADERS([config.h])
255 src/telepathy/Makefile
261 dnl additional info for the user
263 if test "$purple" != "no" ; then
264 echo "Compiling libpurple plugin"
265 echo "PURPLE_CFLAGS : $PURPLE_CFLAGS"
266 echo "PURPLE_LIBS : $PURPLE_LIBS"
268 echo "Skipping libpurple plugin"
272 if test "$telepathy" != "no" ; then
273 echo "Compiling telepathy plugin"
275 echo "NOTHING IMPLEMENTED YET!!!"
277 echo "TELEPATHY_CFLAGS: $TELEPATHY_CFLAGS"
278 echo "TELEPATHY_LIBS : $TELEPATHY_LIBS"
280 echo "Skipping telepathy plugin"
282 if test "$kerberos" != "no" ; then
284 echo "Compiling with kerberos 5 support"
285 echo "KRB5_CFLAGS : $KRB5_CFLAGS"
286 echo "KRB5_LDFLAGS : $KRB5_LDFLAGS"
287 echo "KRB5_LIBS : $KRB5_LIBS"
290 if test "$enable_debug" != "no"; then
292 echo "Compiling with debugging enabled"
293 echo "DEBUG_CFLAGS : $DEBUG_CFLAGS"
296 if test -n "${QUALITY_CFLAGS}"; then
298 echo "Compiling with compiler checks enabled"
299 echo "QUALITY_CFLAGS : $QUALITY_CFLAGS"
303 echo "configure complete, now run 'make'"