Move the hardcode debug flags from src/Makefile.am file to configure.ac file.
[siplcs.git] / configure.ac
blob5e1291c07a83cf9ff755993f2aa4462af92f3fd6
1 # version of this package
2 m4_define(pidgin_sipe_version,  1.5.0)
4 # lower and upper-bound versions of Pidgin
5 m4_define(pidgin_version_max,           2.0.0)
7 AC_INIT([pidgin-sipe], [1.5.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
20 AC_CHECK_HEADER([zlib.h], 
21                 [], 
22                 [AC_MSG_ERROR([You must have zlib.h and zlib installed])])
26 GAIM_MIN=pidgin_version_min
27 GAIM_MAX=pidgin_version_max
28 AC_SUBST(PIDGIN_MIN)
29 AC_SUBST(PIDGIN_MAX)
31 # tell pkgconfig to look in the same prefix we're installing this to,
32 # as that's likely where gaim will be found if it's not in the default
33 # pkgconfig path
34 PREFIX=$ac_default_prefix
35 if test "$prefix" != "NONE"; then
36    PREFIX=$prefix
39 PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$PREFIX/lib/pkgconfig"
40 export PKG_CONFIG_PATH
42 # debug mode
43 AC_ARG_ENABLE(debug,
44         [  --enable-debug         compile with debugging support],,
45         enable_debug=no)
47 if test "$enable_debug" = yes; then
48    AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
51 DEBUG_CFLAGS="${DEBUG_CFLAGS} -Wall -Wextra -Wno-unused-parameter"
52 AC_SUBST(DEBUG_CFLAGS)
54 AC_ARG_WITH(krb5, [AC_HELP_STRING([--with-krb5=PREFIX], [compile sipe plugin with Kerberos 5 support])], kerberos="$withval", kerberos="no")
56 dnl #######################################################################
57 dnl # Check for Kerberos
58 dnl #######################################################################
59 AC_SUBST(KRB5_CFLAGS)
60 AC_SUBST(KRB5_LDFLAGS)
61 AC_SUBST(KRB5_LIBS)
63 if test "$kerberos" != "no" ; then
64         if test "$kerberos" != "yes" ; then
65                 KRB5_CFLAGS="-I${kerberos}/include"
66                 KRB5_LDFLAGS="-L${kerberos}/lib"
67         fi
68         orig_LDFLAGS="$LDFLAGS"
69         LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
70         AC_CHECK_LIB(krb5, krb5_rd_req,
71                         [KRB5_LIBS="-lkrb5"],
72                         [AC_CHECK_LIB(krb5, krb5_rd_req,
73                                 [KRB5_LIBS="-lkrb5"],
74                                 [AC_ERROR(Kerberos 5 libraries not found)],
75                                 )],
76                         -lkrb5)
77         AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
78                         [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
79                         [AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
80                                 [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
81                                 [AC_ERROR(GSSAPI libraries not found)],
82                                 )],
83                         -lgssapi_krb5)
84         AC_DEFINE(USE_KERBEROS, 1, [Define if kerberos should be used in sipe.])
86 AM_CONDITIONAL(SIP_SEC_KRB5, test "$kerberos" != "no")
88 # Check for Purple
89 PKG_CHECK_MODULES(PURPLE,
90 [purple >= pidgin_version_max],
92         AC_DEFINE(HAVE_PIDGIN, 1, [Define if we've found pidgin.])
95 AC_SUBST(PURPLE_CFLAGS)
96 AC_SUBST(PURPLE_LIBS)
98 dnl Check for com_err
99 PKG_CHECK_MODULES(COM_ERR, [com_err],,)
101 dnl Check for inet_aton
102 AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, ,
103                                          [AC_ERROR(inet_aton not found)])])
105 SIPE_LIBA=`$PKG_CONFIG sipe --variable=libarchive`
106 AC_SUBST(SIPE_LIBA)
108 AC_ARG_ENABLE(static-sipe,
109         [  --enable-static-sipe  statically link in Simple Exchange],
110                 sipe_static="yes", sipe_static="no")
112 AM_CONDITIONAL(SIPE_STATIC, test $sipe_static = yes)
114 AC_MSG_CHECKING([locale_CPPFLAGS])
115 LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
116 AC_SUBST([LOCALE_CPPFLAGS])
117 AC_MSG_RESULT([$LOCALE_CPPFLAGS])
119 dnl i18n
120 GETTEXT_PACKAGE=$PACKAGE
121 AC_SUBST(GETTEXT_PACKAGE)
122 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
123 AM_GLIB_GNU_GETTEXT
125 dnl codeset
126 AM_LANGINFO_CODESET
128 dnl substitutions and generated files
129 AC_CONFIG_FILES(
130         [src/config.h]
131         [Makefile 
132         pixmaps/Makefile 
133         m4macros/Makefile
134         po/Makefile.in
135         pixmaps/16/Makefile 
136         pixmaps/22/Makefile 
137         pixmaps/48/Makefile 
138         src/Makefile]
141 AC_OUTPUT()
144 echo
145 echo -n "Simple SIPE linking mode... : "
146 if test "$sipe_static" = "yes" ; then
147    echo "static"
148    echo "Simple SIPE library...      : $SIPE_LIBA"
149 else
150    echo "dynamic"
153 if test "$kerberos" != "no" ; then
154 echo
155 echo "Compiled with kerberos 5 support"
156 echo "LDFLAGS :$KRB5_LDFLAGS"
157 echo "CFLAGS  :$KRB5_CFLAGS"
158 echo "LIBS    :$KRB5_LIBS"
159 echo
161 echo
162 echo configure complete, now run \`make\`
163 echo
165 # The End.