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
70 AC_ARG_WITH(krb5, [AC_HELP_STRING([--with-krb5=PREFIX], [compile sipe plugin with Kerberos 5 support])], kerberos="$withval", kerberos="no")
72 dnl check for Kerberos
74 AC_SUBST(KRB5_LDFLAGS)
77 if test "$kerberos" != "no" ; then
78 if test "$kerberos" != "yes" ; then
79 KRB5_CFLAGS="-I${kerberos}/include"
80 KRB5_LDFLAGS="-L${kerberos}/lib"
82 orig_LDFLAGS="$LDFLAGS"
83 LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
84 AC_CHECK_LIB(krb5, krb5_rd_req,
86 [AC_CHECK_LIB(krb5, krb5_rd_req,
88 [AC_ERROR(Kerberos 5 libraries not found)],
91 AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
92 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
93 [AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
94 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
95 [AC_ERROR(GSSAPI libraries not found)],
99 LIBS="$KRB5_LIBS $LIBS"
100 AC_CHECK_FUNCS([krb5_get_error_message])
102 AC_DEFINE(USE_KERBEROS, 1, [Define if kerberos should be used in sipe.])
104 AM_CONDITIONAL(SIP_SEC_KRB5, test "$kerberos" != "no")
106 dnl check for libpurple
107 PKG_CHECK_MODULES(PURPLE, [purple >= 2.3.1],
108 [AC_DEFINE(HAVE_PIDGIN, 1, [Define if we've found libpurple])])
109 dnl unfortunately PURPLE_MAJOR_VERSION is not exported by purple.m4
110 PURPLE_MAJOR_VERSION=`$PKG_CONFIG --modversion purple | cut -d. -f 1`
111 AC_SUBST(PURPLE_MAJOR_VERSION)
113 dnl let user now if he has a 32- and 64-bit header conflict...
114 AC_MSG_CHECKING([for 32- and 64-bit header conflicts])
115 ac_save_CFLAGS=$CFLAGS
116 CFLAGS="$PURPLE_CFLAGS -Werror -Wall -Wextra"
123 /* Compile some code that has caused trouble in the past */
124 void testfunc(unsigned long len)
126 PurpleCipherContext *rc4 = NULL;
127 purple_cipher_context_set_option(rc4, "key_len", GUINT_TO_POINTER(len));
131 [AC_MSG_RESULT(none)],
132 [AC_MSG_RESULT(failed)
133 AC_ERROR(conflicts found.
135 Check that you have the correct glib/libpurple headers installed for
136 your architecture or set PURPLE_CFLAGS to override the system defaults.
138 CFLAGS=$ac_save_CFLAGS
140 dnl check for inet_aton
141 AC_CHECK_FUNC(inet_aton,,
142 [AC_CHECK_LIB(resolv, inet_aton,, [AC_ERROR(inet_aton not found)])])
145 SIPE_LIBA=`$PKG_CONFIG sipe --variable=libarchive`
148 AC_ARG_ENABLE(static-sipe,
149 [AS_HELP_STRING([--enable-static-sipe],
150 [statically linked plugin [default=no]])],
154 AM_CONDITIONAL(SIPE_STATIC, test $sipe_static = yes)
157 AC_MSG_CHECKING([locale_CPPFLAGS])
158 LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
159 AC_SUBST([LOCALE_CPPFLAGS])
160 AC_MSG_RESULT([$LOCALE_CPPFLAGS])
162 GETTEXT_PACKAGE=$PACKAGE
163 AC_SUBST(GETTEXT_PACKAGE)
164 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
170 dnl substitutions and generated files
186 dnl additional info for the user
188 echo -n "Simple SIPE linking mode : "
189 if test "$sipe_static" = "yes" ; then
191 echo "Simple SIPE library... : $SIPE_LIBA"
196 if test "$kerberos" != "no" ; then
198 echo "Compiling with kerberos 5 support"
199 echo "KRB5_LDFLAGS : $KRB5_LDFLAGS"
200 echo "KRB5_CFLAGS : $KRB5_CFLAGS"
201 echo "KRB5_LIBS : $KRB5_LIBS"
204 if test "$enable_debug" != "no"; then
206 echo "Compiling with debugging enabled"
207 echo "DEBUG_CFLAGS : $DEBUG_CFLAGS"
210 if test -n "${QUALITY_CFLAGS}"; then
212 echo "Compiling with compiler checks enabled"
213 echo "QUALITY_CFLAGS : $QUALITY_CFLAGS"
217 echo "configure complete, now run 'make'"