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 tell pkgconfig to look in the same prefix we're installing this to,
28 dnl as that's likely where libpurple will be found if it's not in the default
30 PREFIX=$ac_default_prefix
31 if test "$prefix" != "NONE"; then
35 PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$PREFIX/lib/pkgconfig"
36 export PKG_CONFIG_PATH
40 [AS_HELP_STRING([--enable-debug],
41 [compile with debugging support [default=no]])],
45 if test "$enable_debug" = yes; then
46 AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
49 DEBUG_CFLAGS="${DEBUG_CFLAGS}"
50 AC_SUBST(DEBUG_CFLAGS)
52 dnl quality check mode
53 dnl For people who are interested in finding bugs and not hiding them
54 AC_ARG_ENABLE(quality-check,
55 [AS_HELP_STRING([--enable-quality-check],
56 [compile with compiler checks enabled [default=yes]])],
58 enable_quality_check="yes")
60 if test "$enable_quality_check" = yes; then
61 QUALITY_CFLAGS="${QUALITY_CFLAGS} -Werror -Wall -Wextra"
63 QUALITY_CFLAGS="${QUALITY_CFLAGS}"
65 AC_SUBST(QUALITY_CFLAGS)
67 dnl Check for pkg-config before using it
71 [AC_HELP_STRING([--with-krb5=PREFIX],
72 [compile sipe plugin with Kerberos 5 support @<:@default=no@:>@])],
73 [test "$withval" = no || kerberos="$withval"],
76 dnl check for Kerberos
78 AC_SUBST(KRB5_LDFLAGS)
81 AM_CONDITIONAL(SIP_SEC_KRB5, test "$kerberos" != "no")
82 if test "$kerberos" != "no" ; then
83 if test "$kerberos" != "yes" ; then
84 KRB5_CFLAGS="-I${kerberos}/include"
85 KRB5_LDFLAGS="-L${kerberos}/lib"
87 orig_LDFLAGS="$LDFLAGS"
88 LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
89 AC_CHECK_LIB(krb5, krb5_rd_req,
91 [AC_CHECK_LIB(krb5, krb5_rd_req,
93 [AC_ERROR(Kerberos 5 libraries not found)],
96 AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
97 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
98 [AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
99 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
100 [AC_ERROR(GSSAPI libraries not found)],
104 LIBS="$KRB5_LIBS $LIBS"
105 AC_CHECK_FUNCS([krb5_get_error_message])
107 AC_DEFINE(USE_KERBEROS, 1, [Define if kerberos should be used in sipe.])
111 PKG_CHECK_MODULES(GLIB, [glib-2.0])
113 dnl assumption check: sizof(uuid_t) must be 16 (see uuid.c)
114 AC_MSG_CHECKING([that sizeof(uuid_t) is 16])
115 ac_save_CFLAGS=$CFLAGS
116 CFLAGS="$GLIB_CFLAGS -Werror -Wall -Wextra"
117 dnl note the [[[ quoting: our code contains []!
124 /* Copied from uuid.c */
128 guint16 time_hi_and_version;
129 guint8 clock_seq_hi_and_reserved;
130 guint8 clock_seq_low;
134 [return(sizeof(uuid_t) == 16 ? 0 : 1);]),
135 [AC_MSG_RESULT(yes)],
136 [AC_MSG_RESULT(failed)
137 AC_ERROR(sizeof(uuid_t) is not 16
139 Please notify the SIPE developers and provide the following information:
145 CFLAGS=$ac_save_CFLAGS
147 dnl check for libpurple
149 AC_ARG_WITH([purple],
150 [AC_HELP_STRING([--with-purple],
151 [compile sipe plugin for libpurple clients @<:@default=autodetect@:>@])],
152 [test "$withval" = yes || purple="no"],
153 [test "$withval" = no && purple="no"])
154 if test "$purple" != "no"; then
155 PKG_CHECK_MODULES(PURPLE, [purple >= 2.3.1],
160 dnl support for libpurple plugin
161 AM_CONDITIONAL(SIPE_INCLUDE_PURPLE, test "$purple" != "no")
162 if test "$purple" != "no"; then
164 dnl unfortunately PURPLE_MAJOR_VERSION is not exported by purple.m4
165 PURPLE_MAJOR_VERSION=`$PKG_CONFIG --modversion purple | cut -d. -f 1`
166 AC_SUBST(PURPLE_MAJOR_VERSION)
168 dnl let user now if he has a 32- and 64-bit header conflict...
169 AC_MSG_CHECKING([for 32- and 64-bit header conflicts])
170 ac_save_CFLAGS=$CFLAGS
171 CFLAGS="$PURPLE_CFLAGS -Werror -Wall -Wextra"
178 /* Compile some code that has caused trouble in the past */
179 void testfunc(unsigned long len)
181 PurpleCipherContext *rc4 = NULL;
182 purple_cipher_context_set_option(rc4, "key_len", GUINT_TO_POINTER(len));
186 [AC_MSG_RESULT(none)],
187 [AC_MSG_RESULT(failed)
188 AC_ERROR(conflicts found.
190 Check that you have the correct glib/libpurple headers installed for
191 your architecture or set PURPLE_CFLAGS to override the system defaults.
193 CFLAGS=$ac_save_CFLAGS
196 dnl check for telepathy
198 AC_ARG_WITH([telepathy],
199 [AC_HELP_STRING([--with-telepathy],
200 [compile sipe plugin for telepathy clients @<:@default=autodetect@:>@])],
201 [test "$withval" = yes || telepathy="no"],
202 [test "$withval" = no && telepathy="no"])
203 if test "$telepathy" != "no"; then
204 PKG_CHECK_MODULES(TELEPATHY, [telepathy-glib],
209 dnl support for telepathy plugin
210 AM_CONDITIONAL(SIPE_INCLUDE_TELEPATHY, test "$telepathy" != "no")
211 dnl NOTHING IMPLEMENTED YET!!!
212 dnl if test "$telepathy" != "no"; then
215 dnl check for inet_aton
216 AC_CHECK_FUNC(inet_aton,,
217 [AC_CHECK_LIB(resolv, inet_aton,, [AC_ERROR(inet_aton not found)])])
220 AC_MSG_CHECKING([locale_CPPFLAGS])
221 LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
222 AC_SUBST([LOCALE_CPPFLAGS])
223 AC_MSG_RESULT([$LOCALE_CPPFLAGS])
225 GETTEXT_PACKAGE=$PACKAGE
226 AC_SUBST(GETTEXT_PACKAGE)
227 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
233 dnl substitutions and generated files
247 src/telepathy/Makefile]
253 dnl additional info for the user
255 if test "$purple" != "no" ; then
256 echo "Compiling libpurple plugin"
257 echo "PURPLE_CFLAGS : $PURPLE_CFLAGS"
258 echo "PURPLE_LIBS : $PURPLE_LIBS"
260 echo "Skipping libpurple plugin"
264 if test "$telepathy" != "no" ; then
265 echo "Compiling telepathy plugin"
267 echo "NOTHING IMPLEMENTED YET!!!"
269 echo "TELEPATHY_CFLAGS: $TELEPATHY_CFLAGS"
270 echo "TELEPATHY_LIBS : $TELEPATHY_LIBS"
272 echo "Skipping telepathy plugin"
274 if test "$kerberos" != "no" ; then
276 echo "Compiling with kerberos 5 support"
277 echo "KRB5_CFLAGS : $KRB5_CFLAGS"
278 echo "KRB5_LDFLAGS : $KRB5_LDFLAGS"
279 echo "KRB5_LIBS : $KRB5_LIBS"
282 if test "$enable_debug" != "no"; then
284 echo "Compiling with debugging enabled"
285 echo "DEBUG_CFLAGS : $DEBUG_CFLAGS"
288 if test -n "${QUALITY_CFLAGS}"; then
290 echo "Compiling with compiler checks enabled"
291 echo "QUALITY_CFLAGS : $QUALITY_CFLAGS"
295 echo "configure complete, now run 'make'"