1 dnl ensure recent enough version of Autoconf
4 dnl Use `VERSION' files to get version.
5 m4_define([SIPE_VERSION_DATA], m4_include([VERSION]))
7 dnl Strip off newline characters.
8 m4_define([SIPE_VERSION],
9 m4_substr(SIPE_VERSION_DATA,
10 [0], m4_decr(m4_len(SIPE_VERSION_DATA))))
13 m4_define([SIPE_HOMEPAGE], [http://sipe.sourceforge.net/])
15 dnl initialize package name, version, bugtracker & homepage
16 AC_INIT([pidgin-sipe], SIPE_VERSION,
17 [https://sourceforge.net/tracker/?atid=949931&group_id=194563], [],
20 dnl setup automake and require recent enough version
21 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-define tar-ustar])
23 dnl set PACKAGE_URL for autoconf < 2.64
24 if test "x${PACKAGE_URL}" = "x"; then
25 AC_MSG_NOTICE([set PACKAGE_URL for autoconf < 2.64])
26 AC_DEFINE(PACKAGE_URL, "SIPE_HOMEPAGE",
27 [Define to the home page for this package.])
30 dnl set programming language
35 dnl setup shared library generation
36 LT_INIT([disable-static])
39 IT_PROG_INTLTOOL([0.35.0])
43 dnl checks for header files
44 AC_CHECK_HEADERS([sys/sockio.h])
46 dnl checks for library functions
49 dnl tell pkgconfig to look in the same prefix where we're installing this to,
50 dnl as that is likely where libpurple will be found if it is not in the default
52 PREFIX=$ac_default_prefix
53 if test "$prefix" != "NONE"; then
57 PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$PREFIX/lib/pkgconfig"
58 export PKG_CONFIG_PATH
62 [AS_HELP_STRING([--enable-debug],
63 [compile with debugging support [default=no]])],
67 if test "$enable_debug" = yes; then
68 AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
71 DEBUG_CFLAGS="${DEBUG_CFLAGS}"
72 AC_SUBST(DEBUG_CFLAGS)
74 dnl quality check mode
75 dnl For people who are interested in finding bugs and not hiding them
76 AC_ARG_ENABLE(quality-check,
77 [AS_HELP_STRING([--enable-quality-check],
78 [compile with compiler checks enabled [default=yes]])],
80 enable_quality_check="yes")
83 if test "$enable_quality_check" = yes; then
84 QUALITY_CFLAGS="$QUALITY_CFLAGS -Werror -Wall"
85 ac_save_CFLAGS=$CFLAGS
88 AC_MSG_CHECKING([if $CC supports -Wextra])
89 CFLAGS="$QUALITY_CFLAGS -Wextra"
93 QUALITY_CFLAGS="$QUALITY_CFLAGS -Wextra"],
97 dnl declaration-after-statement (ISO C90 behaviour, as on Windows & GCC < 3)
98 AC_MSG_CHECKING([if $CC supports -Werror=declaration-after-statement])
99 CFLAGS="$QUALITY_CFLAGS -Werror=declaration-after-statement"
103 QUALITY_CFLAGS="$QUALITY_CFLAGS -Werror=declaration-after-statement"],
106 CFLAGS=$ac_save_CFLAGS
108 QUALITY_CFLAGS="$QUALITY_CFLAGS"
110 AC_SUBST(QUALITY_CFLAGS)
112 dnl Check for pkg-config before using it
116 [AC_HELP_STRING([--with-krb5=PREFIX],
117 [compile sipe plugin with Kerberos 5 support @<:@default=no@:>@])],
118 [test "$withval" = "no" || kerberos="$withval"],
121 dnl check for Kerberos
122 AC_SUBST(KRB5_CFLAGS)
123 AC_SUBST(KRB5_LDFLAGS)
126 AM_CONDITIONAL(SIP_SEC_KRB5, test "$kerberos" != "no")
127 if test "$kerberos" != "no" ; then
128 if test "$kerberos" != "yes" ; then
129 KRB5_CFLAGS="-I${kerberos}/include"
130 KRB5_LDFLAGS="-L${kerberos}/lib"
132 orig_LDFLAGS="$LDFLAGS"
133 LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
134 AC_CHECK_LIB(krb5, krb5_rd_req,
135 [KRB5_LIBS="-lkrb5"],
136 [AC_CHECK_LIB(krb5, krb5_rd_req,
137 [KRB5_LIBS="-lkrb5"],
138 [AC_ERROR(Kerberos 5 libraries not found)],
141 AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
142 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
143 [AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
144 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
145 [AC_ERROR(GSSAPI libraries not found)],
149 LIBS="$KRB5_LIBS $LIBS"
150 AC_CHECK_FUNCS([krb5_get_error_message])
152 AC_DEFINE(HAVE_KERBEROS, 1, [Define if kerberos should be used in sipe.])
156 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.12.0])
159 dnl See also: https://bugzilla.gnome.org/show_bug.cgi?id=613653#c8
160 PKG_CHECK_MODULES(GMIME, [gmime-2.6 >= 2.5.2],
162 [PKG_CHECK_MODULES(GMIME, [gmime-2.4 >= 2.4.16],
166 AM_CONDITIONAL(SIPE_MIME_GMIME, [test x$ac_have_gmime = xyes])
167 AM_COND_IF(SIPE_MIME_GMIME,
168 [AC_DEFINE(HAVE_GMIME, 1, [Define if gmime should be used in sipe.])])
170 dnl check for libxml2
171 PKG_CHECK_MODULES(LIBXML2, [libxml-2.0])
173 dnl assumption check: sizof(uuid_t) must be 16 (see uuid.c)
174 AC_MSG_CHECKING([that sizeof(uuid_t) is 16])
175 ac_save_CFLAGS=$CFLAGS
176 CFLAGS="$GLIB_CFLAGS $QUALITY_CFLAGS"
177 dnl note the [[[ quoting: our code contains []!
184 /* Copied from uuid.c */
188 guint16 time_hi_and_version;
189 guint8 clock_seq_hi_and_reserved;
190 guint8 clock_seq_low;
194 [return(sizeof(uuid_t) == 16 ? 0 : 1);]),
195 [AC_MSG_RESULT(yes)],
196 [AC_MSG_RESULT(failed)
197 AC_ERROR(sizeof(uuid_t) is not 16
199 Please notify the SIPE developers and provide the following information:
205 CFLAGS=$ac_save_CFLAGS
207 dnl check for libpurple
209 AC_ARG_WITH([purple],
210 [AC_HELP_STRING([--with-purple],
211 [compile sipe plugin for libpurple clients @<:@default=autodetect@:>@])],
212 [test "$withval" = "yes" || purple="no"],
214 if test "$purple" != "no"; then
215 PKG_CHECK_MODULES(PURPLE, [purple >= 2.4.0],
220 dnl support for libpurple plugin
221 AM_CONDITIONAL(SIPE_INCLUDE_PURPLE, test "$purple" != "no")
222 if test "$purple" != "no"; then
224 dnl unfortunately PURPLE_MAJOR_VERSION is not exported by purple.m4
225 PURPLE_MAJOR_VERSION=`$PKG_CONFIG --modversion purple | cut -d. -f 1`
226 AC_SUBST(PURPLE_MAJOR_VERSION)
228 dnl let user now if he has a 32- and 64-bit header conflict...
229 AC_MSG_CHECKING([for 32- and 64-bit header conflicts])
230 ac_save_CFLAGS=$CFLAGS
231 CFLAGS="$PURPLE_CFLAGS $QUALITY_CFLAGS"
238 /* Compile some code that has caused trouble in the past */
239 void testfunc(unsigned long len)
241 PurpleCipherContext *rc4 = NULL;
242 purple_cipher_context_set_option(rc4, "key_len", GUINT_TO_POINTER(len));
246 [AC_MSG_RESULT(none)],
247 [AC_MSG_RESULT(failed)
248 AC_ERROR(conflicts found.
250 Check that you have the correct glib/libpurple headers installed for
251 your architecture or set PURPLE_CFLAGS to override the system defaults.
253 CFLAGS=$ac_save_CFLAGS
256 dnl check for telepathy
258 AC_ARG_WITH([telepathy],
259 [AC_HELP_STRING([--with-telepathy],
260 [compile sipe plugin for telepathy clients @<:@default=autodetect@:>@])],
261 [test "$withval" = "yes" || telepathy="no"],
263 if test "$telepathy" != "no"; then
264 PKG_CHECK_MODULES(TELEPATHY, [telepathy-glib],
269 dnl support for telepathy plugin
270 AM_CONDITIONAL(SIPE_INCLUDE_TELEPATHY, test "$telepathy" != "no")
271 if test "$telepathy" != "no"; then
272 AM_COND_IF(SIPE_MIME_GMIME, [],
273 [AC_ERROR(GMIME package is required for telepathy plugin)])
274 dnl NOTHING IMPLEMENTED YET!!!
278 AS_IF([test "$purple" = "no" -a "$telepathy" = "no"],
279 [AC_ERROR(at least one plugin must be selected
281 If you didn't use a --without option then please check that you have
282 the headers for the packages "purple" or "telepathy-glib" installed.
287 AC_MSG_CHECKING([locale_CPPFLAGS])
288 LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
289 AC_SUBST([LOCALE_CPPFLAGS])
290 AC_MSG_RESULT([$LOCALE_CPPFLAGS])
292 AC_SUBST(GETTEXT_PACKAGE, "${PACKAGE_NAME}")
297 dnl substitutions and generated files
298 AC_CONFIG_HEADERS([config.h])
307 pixmaps/scalable/Makefile
312 src/telepathy/Makefile
318 dnl additional info for the user
320 if test "$purple" != "no" ; then
321 echo "Compiling libpurple plugin"
322 echo "PURPLE_CFLAGS : $PURPLE_CFLAGS"
323 echo "PURPLE_LIBS : $PURPLE_LIBS"
325 echo "Skipping libpurple plugin"
329 if test "$telepathy" != "no" ; then
330 echo "Compiling telepathy plugin"
332 echo "NOTHING IMPLEMENTED YET!!!"
334 echo "TELEPATHY_CFLAGS: $TELEPATHY_CFLAGS"
335 echo "TELEPATHY_LIBS : $TELEPATHY_LIBS"
337 echo "Skipping telepathy plugin"
339 if test "$kerberos" != "no" ; then
341 echo "Compiling with kerberos 5 support"
342 echo "KRB5_CFLAGS : $KRB5_CFLAGS"
343 echo "KRB5_LDFLAGS : $KRB5_LDFLAGS"
344 echo "KRB5_LIBS : $KRB5_LIBS"
347 if test "$enable_debug" != "no"; then
349 echo "Compiling with debugging enabled"
350 echo "DEBUG_CFLAGS : $DEBUG_CFLAGS"
353 if test -n "$QUALITY_CFLAGS"; then
355 echo "Compiling with compiler checks enabled"
356 echo "QUALITY_CFLAGS : $QUALITY_CFLAGS"
360 echo "configure complete, now run 'make'"