1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
LIBGG_INCLUDES=""
LIBGG_LIBS=""
ac_libgadu_includes=""
ac_libgadu_libs=""
AC_ARG_WITH(external-libgadu,
[AC_HELP_STRING(--with-external-libgadu,
[use external libgadu library @<:@default=check@:>@])],
[], with_external_libgadu=check)
AC_ARG_WITH(libgadu-includes,
AC_HELP_STRING([--with-libgadu-includes=DIR], [where the libgadu includes are.]),
[ ac_libgadu_includes="$withval" ])
if test "$ac_libgadu_includes" != "" ; then
LIBGG_INCLUDES="-I$ac_libgadu_includes"
fi
AC_ARG_WITH(libgadu-libs,
AC_HELP_STRING([--with-libgadu-libs=DIR], [where the libgadu libraries are.]),
[ ac_libgadu_libs="$withval" ])
if test "$ac_libgadu_libs" != "" ; then
LIBGG_LIBS="-L$ac_libgadu_libs"
fi
if test "x$with_external_libgadu" != xno; then
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="$LIBGG_LIBS -lgadu $LIBPTHREAD"
CFLAGS="$CFLAGS $LIBGG_INCLUDES"
AC_MSG_CHECKING([libgadu version 1.5(rcX) with pthread support])
AC_TRY_RUN(
[
#include <libgadu.h>
#include <stdio.h>
#include <string.h>
int main()
{
#if defined __GG_LIBGADU_HAVE_PTHREAD && defined GG_LOGIN60
int maj, min, date;
sscanf( gg_libgadu_version(), "%u.%u.%u", &maj,&min,&date );
if ( maj != 1 ) {
return 1;
}
if ( ( min == 4 || min == 5 ) && date < 20040520 ) {
return 1;
}
if ( min == 5 || min == 6 ){
return 0;
}
#endif
return 1;
}
], [
LIBGG_LIBS="$LIBGG_LIBS -lgadu $LIBPTHREAD"
AC_MSG_RESULT([yes])
COMPILE_GADU=true
use_libgadu_copy=
], [
AC_MSG_RESULT([no])
])
LIBS="$ac_save_LIBS"
CFLAGS="$ac_save_CFLAGS"
if test "x$with_external_libgadu" != xcheck && test -z "$COMPILE_GADU"; then
AC_MSG_ERROR([--with-external-libgadu was given, but test for libgadu failed])
fi
fi
if test -z "$COMPILE_GADU"; then
AC_MSG_CHECKING([if supplied libgadu-copy can be used])
if test "$kde_use_threading" = "yes"; then
AC_MSG_RESULT([yes])
use_libgadu_copy=yes
COMPILE_GADU=true
else
AC_MSG_RESULT([no (no pthread), support for Gadu-Gadu will be disabled])
use_libgadu_copy=
COMPILE_GADU=
fi
fi
AC_SUBST(LIBGG_INCLUDES)
AC_SUBST(LIBGG_LIBS)
AC_SUBST(COMPILE_GADU)
AM_CONDITIONAL(include_gadu, test -n "$COMPILE_GADU")
AM_CONDITIONAL(include_libggcopy, test -n "$use_libgadu_copy")
if test "$use_libgadu_copy" = "yes"; then
AM_CONFIG_HEADER(kopete/protocols/gadu/libgadu/libgadu-config.h)
if test "$ac_cv_c_bigendian" = "yes"; then
AC_DEFINE_UNQUOTED([__GG_LIBGADU_BIGENDIAN], 1, [Define if big endian])
fi
KDE_CHECK_LONG_LONG()
if test "$kde_cv_c_long_long" = "yes"; then
AC_DEFINE_UNQUOTED([__GG_LIBGADU_HAVE_LONG_LONG], 1, [long long support])
fi
KDE_CHECK_SSL()
if test "$have_ssl" = "yes"; then
AC_DEFINE_UNQUOTED([__GG_LIBGADU_HAVE_OPENSSL], 1, [Define if SSL support is available])
fi
AC_MSG_CHECKING([for C99-compatible vsnprintf()])
AC_TRY_RUN(
[
#include <stdio.h>
int main()
{
char tmp;
return (snprintf(&tmp, sizeof(tmp), "test") != 4);
}
],[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([__GG_LIBGADU_HAVE_C99_VSNPRINTF], 1, [C99 vsnprintf() available])
], [
AC_MSG_RESULT([no])
])
AC_CHECK_FUNCS([va_copy],
[AC_DEFINE_UNQUOTED([__GG_LIBGADU_HAVE_VA_COPY], 1, [va_copy])],[])
AC_CHECK_FUNCS([_va_copy],
[AC_DEFINE_UNQUOTED([__GG_LIBGADU_HAVE__VA_COPY], 1, [__va_copy])],[])
fi
KDE_PKG_CHECK_MODULES(IDN, libidn, have_libidn=yes, have_libidn=no)
if test x$have_libidn = xno; then
AC_MSG_WARN([Libidn not found, Kopete Jabber plugin will not be compiled])
else
AC_DEFINE(LIBIDN, 1, [Define to 1 if you want IDN support.])
fi
AC_SUBST(IDN_CFLAGS)
AC_SUBST(IDN_LIBS)
AC_MSG_CHECKING([if Libidn can be used])
AC_MSG_RESULT($have_libidn)
AM_CONDITIONAL(include_jabber, test "$have_libidn" = "yes")
# Sametime support
# lower and upper-bound versions of Meanwhile library
m4_define(libmeanwhile_version_min, 1.0.1)
m4_define(libmeanwhile_version_max, 1.1.0)
# Let the user disable the plugin
AC_ARG_ENABLE(meanwhile,
AC_HELP_STRING([--disable-meanwhile],
[disable the Kopete Meanwhile plugin (Lotus Sametime support) @<:@default=enabled@:>@]),
)
if test "x$enable_meanwhile" != "xno"; then
# Check and setup for libmeanwhile
KDE_PKG_CHECK_MODULES(MEANWHILE,
[meanwhile >= libmeanwhile_version_min meanwhile < libmeanwhile_version_max],
[have_libmeanwhile=yes], [have_libmeanwhile=no])
if test "x$have_libmeanwhile" = "xno"; then
enable_meanwhile=no
AC_MSG_RESULT([not found])
else
AC_MSG_RESULT([found])
fi
fi
AC_SUBST(MEANWHILE_CFLAGS)
AC_SUBST(MEANWHILE_LIBS)
AC_MSG_CHECKING([if Meanwhile plugin should be compiled])
if test "x$enable_meanwhile" != "xno"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
# Set the flag to compile meanwhile
AM_CONDITIONAL(include_meanwhile, [test "x$enable_meanwhile" != "xno"])
# testbed protocol
dnl define the configure option that disables testbed protocol
AC_ARG_ENABLE(testbed, [ --disable-testbed disable kopete testbed protocol compilation ], with_testbed=$enableval, with_testbed=yes)
AM_CONDITIONAL(include_testbed, test "$with_testbed" = "yes")
PKG_CHECK_MODULES(GLIB, glib-2.0 gmodule-2.0, have_glib=yes, have_glib=no)
if test x$have_glib = xno; then
AC_MSG_WARN([GLib 2.0 is required for MSN webcam and Jabber Jingle. You can get it from http://www.gtk.org/])
else
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_DEFINE(HAVE_GLIB, 1, [Glib is required for oRTP code and libmimic code])
fi
if test "x$have_glib" != "xyes"; then
compile_msn_webcam=no
msn_webcam_val=0
else
compile_msn_webcam=yes
msn_webcam_val=1
fi
AC_MSG_CHECKING([if MSN webcam support should be enabled])
AC_MSG_RESULT($compile_msn_webcam)
AC_DEFINE_UNQUOTED(MSN_WEBCAM, $msn_webcam_val, [Define if MSN webcam support can be enabled])
AM_CONDITIONAL(include_msn_webcam, test "x$compile_msn_webcam" = "xyes")
# Check for sms protocol
AC_ARG_ENABLE(smsgsm,
AC_HELP_STRING([--disable-smsgsm], [disable the GSM SMS protocol]),
[compile_smsgsm=$enableval],
[compile_smsgsm=yes]
)
AC_LANG_PUSH(C++)
ac_save_LIBS="$LIBS"
LIBS="-lgsmme $LIBS"
AC_TRY_LINK([#include <gsmlib/gsm_util.h>],[(void)gsmlib::latin1ToGsm("text");],
[have_smsgsm_lib=yes],
[have_smsgsm_lib=no])
LIBS=$ac_save_LIBS
AC_CHECK_HEADER(gsmlib/gsm_util.h,
[have_smsgsm_inc=yes],
[have_smsgsm_inc=no])
if test "x$have_smsgsm_lib" != "xyes" || test "x$have_smsgsm_inc" != "xyes"; then
compile_smsgsm=no
fi
AC_LANG_POP(C++)
# Let the user know
AC_MSG_CHECKING([if SMSGSM Plugin should be compiled])
AC_MSG_RESULT($compile_smsgsm)
# Here we go
AM_CONDITIONAL(include_smsgsm, [test "x$compile_smsgsm" = "xyes"])
if test "x$compile_smsgsm" = "xyes"; then
AC_DEFINE(INCLUDE_SMSGSM, 1, [Define to compile with GSM SMS support])
fi
|