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