configure.ac: Use xapian-core.pc when available

Only fall back to xapian-config if it isn't.
This commit is contained in:
Dirk-Jan C. Binnema
2020-02-29 12:16:37 +02:00
parent 1c1dbaf882
commit 19dcf9a98f

View File

@ -155,8 +155,15 @@ AS_IF([test "x$have_json_glib" = "xyes"],[
AM_CONDITIONAL(HAVE_JSON_GLIB,[test "x$have_json_glib" = "xyes"]) AM_CONDITIONAL(HAVE_JSON_GLIB,[test "x$have_json_glib" = "xyes"])
# xapian checking - we need 1.4 at least # xapian checking - we need 1.4 at least
PKG_CHECK_MODULES(XAPIAN,xapian-core >= 1.4,[
have_xapian=yes
xapian_version=$($PKG_CONFIG xapian-core --modversion)
AC_SUBST(XAPIAN_CXXFLAGS,${XAPIAN_CFLAGS})
],[
# fall back to the xapian-config script. Not sure if there are cases where the
# pkgconfig does not work, but xapian-config does, so keep this for now.
AC_MSG_NOTICE([falling back to xapian-config])
AC_CHECK_PROG(XAPIAN_CONFIG,xapian-config,xapian-config,no) AC_CHECK_PROG(XAPIAN_CONFIG,xapian-config,xapian-config,no)
AM_CONDITIONAL(HAVE_XAPIAN,test "x$XAPIAN_CONFIG" != "xno")
AS_IF([test "x$XAPIAN_CONFIG" = "xno"],[ AS_IF([test "x$XAPIAN_CONFIG" = "xno"],[
AC_MSG_ERROR([ AC_MSG_ERROR([
*** xapian could not be found; please install it *** xapian could not be found; please install it
@ -176,7 +183,7 @@ have_xapian="yes"
AC_SUBST(XAPIAN_CXXFLAGS) AC_SUBST(XAPIAN_CXXFLAGS)
AC_SUBST(XAPIAN_LIBS) AC_SUBST(XAPIAN_LIBS)
])
############################################################################### ###############################################################################
# we set the set the version of the MuStore (Xapian database) layout # we set the set the version of the MuStore (Xapian database) layout
# here; it will become part of the db name, so we can automatically # here; it will become part of the db name, so we can automatically