1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

configure.ac: add additional check for libstrophe

After the library is found by pkg-config, try to build a simple program
to check the installation. The motivation of this check is that the
chance that users manually install libstrophe/libmesode is higher than
for other libs.

Fixes #1334.
This commit is contained in:
Dmitry Podgorny 2020-05-31 20:02:48 +03:00
parent ac5ce105ac
commit 75bb00368f

View File

@ -130,11 +130,22 @@ AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])
### Check for libmesode, fall back to libstrophe
PKG_CHECK_MODULES([libmesode], [libmesode >= 0.9.2],
[LIBS="$libmesode_LIBS $LIBS" CFLAGS="$CFLAGS $libmesode_CFLAGS" AC_DEFINE([HAVE_LIBMESODE], [1], [libmesode])],
[LIBS="$libmesode_LIBS $LIBS" CFLAGS="$CFLAGS $libmesode_CFLAGS" XMPP_LIB="libmesode" AC_DEFINE([HAVE_LIBMESODE], [1], [libmesode])],
[PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.9.2],
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" XMPP_LIB="libstrophe" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
[AC_MSG_ERROR([Neither libmesode or libstrophe in version >= 0.9.2 found, either is required for profanity])])])
AC_MSG_CHECKING([whether ${XMPP_LIB} works])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <strophe.h>
int main() {
xmpp_initialize();
return 0;
}
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([${XMPP_LIB} is broken, check config.log for details])])
### Check for ncurses library
PKG_CHECK_MODULES([ncursesw], [ncursesw],
[NCURSES_CFLAGS="$ncursesw_CFLAGS"; NCURSES_LIBS="$ncursesw_LIBS"; NCURSES="ncursesw"],