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.])
110 dnl check for libpurple
112 AC_ARG_WITH([purple],
113 [AC_HELP_STRING([--with-purple],
114 [compile sipe plugin for libpurple clients @<:@default=autodetect@:>@])],
115 [test "$withval" = yes || purple="no"],
116 [test "$withval" = no && purple="no"])
117 if test "$purple" != "no"; then
118 PKG_CHECK_MODULES(PURPLE, [purple >= 2.3.1],
123 dnl support for libpurple plugin
124 AM_CONDITIONAL(SIPE_INCLUDE_PURPLE, test "$purple" != "no")
125 if test "$purple" != "no"; then
127 dnl unfortunately PURPLE_MAJOR_VERSION is not exported by purple.m4
128 PURPLE_MAJOR_VERSION=`$PKG_CONFIG --modversion purple | cut -d. -f 1`
129 AC_SUBST(PURPLE_MAJOR_VERSION)
131 dnl let user now if he has a 32- and 64-bit header conflict...
132 AC_MSG_CHECKING([for 32- and 64-bit header conflicts])
133 ac_save_CFLAGS=$CFLAGS
134 CFLAGS="$PURPLE_CFLAGS -Werror -Wall -Wextra"
141 /* Compile some code that has caused trouble in the past */
142 void testfunc(unsigned long len)
144 PurpleCipherContext *rc4 = NULL;
145 purple_cipher_context_set_option(rc4, "key_len", GUINT_TO_POINTER(len));
149 [AC_MSG_RESULT(none)],
150 [AC_MSG_RESULT(failed)
151 AC_ERROR(conflicts found.
153 Check that you have the correct glib/libpurple headers installed for
154 your architecture or set PURPLE_CFLAGS to override the system defaults.
156 CFLAGS=$ac_save_CFLAGS
159 dnl check for telepathy
161 AC_ARG_WITH([telepathy],
162 [AC_HELP_STRING([--with-telepathy],
163 [compile sipe plugin for telepathy clients @<:@default=autodetect@:>@])],
164 [test "$withval" = yes || telepathy="no"],
165 [test "$withval" = no && telepathy="no"])
166 if test "$telepathy" != "no"; then
167 PKG_CHECK_MODULES(TELEPATHY, [telepathy-glib],
172 dnl support for libpurple plugin
173 AM_CONDITIONAL(SIPE_INCLUDE_TELEPATHY, test "$telepathy" != "no")
174 dnl NOTHING IMPLEMENTED YET!!!
175 dnl if test "$telepathy" != "no"; then
178 dnl check for inet_aton
179 AC_CHECK_FUNC(inet_aton,,
180 [AC_CHECK_LIB(resolv, inet_aton,, [AC_ERROR(inet_aton not found)])])
183 AC_MSG_CHECKING([locale_CPPFLAGS])
184 LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
185 AC_SUBST([LOCALE_CPPFLAGS])
186 AC_MSG_RESULT([$LOCALE_CPPFLAGS])
188 GETTEXT_PACKAGE=$PACKAGE
189 AC_SUBST(GETTEXT_PACKAGE)
190 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
196 dnl substitutions and generated files
210 src/telepathy/Makefile]
216 dnl additional info for the user
218 if test "$purple" != "no" ; then
219 echo "Compiling libpurple plugin"
220 echo "PURPLE_CFLAGS : $PURPLE_CFLAGS"
221 echo "PURPLE_LIBS : $PURPLE_LIBS"
223 echo "Skipping libpurple plugin"
227 if test "$telepathy" != "no" ; then
228 echo "Compiling telepathy plugin"
230 echo "NOTHING IMPLEMENTED YET!!!"
232 echo "TELEPATHY_CFLAGS: $TELEPATHY_CFLAGS"
233 echo "TELEPATHY_LIBS : $TELEPATHY_LIBS"
235 echo "Skipping telepathy plugin"
237 if test "$kerberos" != "no" ; then
239 echo "Compiling with kerberos 5 support"
240 echo "KRB5_CFLAGS : $KRB5_CFLAGS"
241 echo "KRB5_LDFLAGS : $KRB5_LDFLAGS"
242 echo "KRB5_LIBS : $KRB5_LIBS"
245 if test "$enable_debug" != "no"; then
247 echo "Compiling with debugging enabled"
248 echo "DEBUG_CFLAGS : $DEBUG_CFLAGS"
251 if test -n "${QUALITY_CFLAGS}"; then
253 echo "Compiling with compiler checks enabled"
254 echo "QUALITY_CFLAGS : $QUALITY_CFLAGS"
258 echo "configure complete, now run 'make'"