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
|
Index: kopete/protocols/configure.in.in
===================================================================
--- kopete/protocols/configure.in.in (revision 433553)
+++ kopete/protocols/configure.in.in (working copy)
@@ -10,6 +10,11 @@
ac_libgadu_includes=""
ac_libgadu_libs=""
+AC_ARG_WITH(external-libgadu,
+ [AS_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" ])
@@ -26,12 +31,12 @@
LIBGG_LIBS="-L$ac_libgadu_libs"
fi
-
-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])
+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(
[
@@ -61,29 +66,38 @@
], [
LIBGG_LIBS="$LIBGG_LIBS -lgadu $LIBPTHREAD"
AC_MSG_RESULT([yes])
- AC_SUBST(LIBGG_INCLUDES)
- AC_SUBST(LIBGG_LIBS)
COMPILE_GADU=true
- AC_SUBST(COMPILE_GADU)
use_libgadu_copy=
], [
- if test "$kde_use_threading" = "yes" ; then
- AC_MSG_RESULT([no, falling back on supplied libgadu-copy])
- use_libgadu_copy=yes
- COMPILE_GADU=true
+ 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_FAILURE([--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
- use_libgadu_copy=
- AC_MSG_RESULT([no, cannot fall back on libgadu-copy (no pthread)])
- COMPILE_GADU=
+ AC_MSG_RESULT([no (no pthread), support for Gadu-Gadu will be disabled])
+ use_libgadu_copy=
+ COMPILE_GADU=
fi
- AC_SUBST(COMPILE_GADU)
- ])
+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")
-LIBS="$ac_save_LIBS"
-CFLAGS="$ac_save_CFLAGS"
-
if test "$use_libgadu_copy" = "yes"; then
cp ${srcdir}/kopete/protocols/gadu/libgadu/libgadu-config.h.in \
${srcdir}/kopete/protocols/gadu/libgadu/libgadu-config.h
|