Cleanup username handling in sipe_login()
[siplcs.git] / configure.ac
blobd0470e0a3d8cb8ffb523b2138c8838fb21ba0406
1 # version of this package
2 m4_define(pidgin_sipe_version,  1.6.0)
4 # lower and upper-bound versions of Pidgin
5 m4_define(pidgin_version_max,           2.0.0)
7 AC_INIT([pidgin-sipe], [1.6.0])
9 AC_PREREQ([2.50])
10 AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])
12 AC_DISABLE_STATIC
14 AC_PROG_CC
15 IT_PROG_INTLTOOL([0.35.0])
16 AC_PROG_LIBTOOL
17 AC_PROG_INSTALL
19 AC_HEADER_STDC
21 GAIM_MIN=pidgin_version_min
22 GAIM_MAX=pidgin_version_max
23 AC_SUBST(PIDGIN_MIN)
24 AC_SUBST(PIDGIN_MAX)
26 # tell pkgconfig to look in the same prefix we're installing this to,
27 # as that's likely where gaim will be found if it's not in the default
28 # pkgconfig path
29 PREFIX=$ac_default_prefix
30 if test "$prefix" != "NONE"; then
31    PREFIX=$prefix
34 PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$PREFIX/lib/pkgconfig"
35 export PKG_CONFIG_PATH
37 # debug mode
38 AC_ARG_ENABLE(debug,
39         [AS_HELP_STRING([--enable-debug],
40                         [compile with debugging support [default=no]])],
41         ,
42         enable_debug="no")
44 if test "$enable_debug" = yes; then
45    AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
48 DEBUG_CFLAGS="${DEBUG_CFLAGS}"
49 AC_SUBST(DEBUG_CFLAGS)
51 # quality check mode
52 # For people who are interested in finding bugs and not hiding them
53 AC_ARG_ENABLE(quality-check,
54         [AS_HELP_STRING([--enable-quality-check],
55                         [compile with compiler checks enabled [default=yes]])],
56         ,
57         enable_quality_check="yes")
59 if test "$enable_quality_check" = yes; then
60         QUALITY_CFLAGS="${QUALITY_CFLAGS} -Werror -Wall -Wextra"
61 else
62         QUALITY_CFLAGS="${QUALITY_CFLAGS}"
64 AC_SUBST(QUALITY_CFLAGS)
66 AC_ARG_WITH(krb5, [AC_HELP_STRING([--with-krb5=PREFIX], [compile sipe plugin with Kerberos 5 support])], kerberos="$withval", kerberos="no")
68 dnl #######################################################################
69 dnl # Check for Kerberos
70 dnl #######################################################################
71 AC_SUBST(KRB5_CFLAGS)
72 AC_SUBST(KRB5_LDFLAGS)
73 AC_SUBST(KRB5_LIBS)
75 if test "$kerberos" != "no" ; then
76         if test "$kerberos" != "yes" ; then
77                 KRB5_CFLAGS="-I${kerberos}/include"
78                 KRB5_LDFLAGS="-L${kerberos}/lib"
79         fi
80         orig_LDFLAGS="$LDFLAGS"
81         LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
82         AC_CHECK_LIB(krb5, krb5_rd_req,
83                         [KRB5_LIBS="-lkrb5"],
84                         [AC_CHECK_LIB(krb5, krb5_rd_req,
85                                 [KRB5_LIBS="-lkrb5"],
86                                 [AC_ERROR(Kerberos 5 libraries not found)],
87                                 )],
88                         -lkrb5)
89         AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
90                         [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
91                         [AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
92                                 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
93                                 [AC_ERROR(GSSAPI libraries not found)],
94                                 )],
95                         -lgssapi_krb5)
96         AC_DEFINE(USE_KERBEROS, 1, [Define if kerberos should be used in sipe.])
98 AM_CONDITIONAL(SIP_SEC_KRB5, test "$kerberos" != "no")
100 # Check for Purple
101 PKG_CHECK_MODULES(PURPLE,
102 [purple >= pidgin_version_max],
104         AC_DEFINE(HAVE_PIDGIN, 1, [Define if we've found pidgin.])
107 AC_SUBST(PURPLE_CFLAGS)
108 AC_SUBST(PURPLE_LIBS)
110 dnl Check for com_err
111 PKG_CHECK_MODULES(COM_ERR, [com_err],,)
113 dnl Check for inet_aton
114 AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, ,
115                                          [AC_ERROR(inet_aton not found)])])
117 SIPE_LIBA=`$PKG_CONFIG sipe --variable=libarchive`
118 AC_SUBST(SIPE_LIBA)
120 AC_ARG_ENABLE(static-sipe,
121         [AS_HELP_STRING([--enable-static-sipe],
122                         [statically linked plugin [default=no]])],
123         ,
124         sipe_static="no")
126 AM_CONDITIONAL(SIPE_STATIC, test $sipe_static = yes)
128 AC_MSG_CHECKING([locale_CPPFLAGS])
129 LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
130 AC_SUBST([LOCALE_CPPFLAGS])
131 AC_MSG_RESULT([$LOCALE_CPPFLAGS])
133 dnl i18n
134 GETTEXT_PACKAGE=$PACKAGE
135 AC_SUBST(GETTEXT_PACKAGE)
136 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
137 AM_GLIB_GNU_GETTEXT
139 dnl codeset
140 AM_LANGINFO_CODESET
142 dnl substitutions and generated files
143 AC_CONFIG_FILES(
144         [src/config.h]
145         [Makefile 
146         pixmaps/Makefile 
147         m4macros/Makefile
148         po/Makefile.in
149         pixmaps/16/Makefile 
150         pixmaps/22/Makefile 
151         pixmaps/48/Makefile 
152         src/Makefile]
155 AC_OUTPUT()
158 echo
159 echo -n "Simple SIPE linking mode : "
160 if test "$sipe_static" = "yes" ; then
161    echo "static"
162    echo "Simple SIPE library...      : $SIPE_LIBA"
163 else
164    echo "dynamic"
167 if test "$kerberos" != "no" ; then
168   echo
169   echo "Compiling with kerberos 5 support"
170   echo "KRB5_LDFLAGS   : $KRB5_LDFLAGS"
171   echo "KRB5_CFLAGS    : $KRB5_CFLAGS"
172   echo "KRB5_LIBS      : $KRB5_LIBS"
175 if test "$enable_debug" != "no"; then
176   echo
177   echo "Compiling with debugging enabled"
178   echo "DEBUG_CFLAGS   : $DEBUG_CFLAGS"
181 if test -n "${QUALITY_CFLAGS}"; then
182   echo
183   echo "Compiling with compiler checks enabled"
184   echo "QUALITY_CFLAGS : $QUALITY_CFLAGS"
187 echo
188 echo configure complete, now run \`make\`
189 echo
191 # The End.