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,28 +155,35 @@ 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
AC_CHECK_PROG(XAPIAN_CONFIG,xapian-config,xapian-config,no) PKG_CHECK_MODULES(XAPIAN,xapian-core >= 1.4,[
AM_CONDITIONAL(HAVE_XAPIAN,test "x$XAPIAN_CONFIG" != "xno") have_xapian=yes
AS_IF([test "x$XAPIAN_CONFIG" = "xno"],[ xapian_version=$($PKG_CONFIG xapian-core --modversion)
AC_MSG_ERROR([ AC_SUBST(XAPIAN_CXXFLAGS,${XAPIAN_CFLAGS})
*** xapian could not be found; please install it ],[
*** e.g., in debian/ubuntu the package would be 'libxapian-dev' # fall back to the xapian-config script. Not sure if there are cases where the
*** If you compiled it yourself, you should ensure that xapian-config # pkgconfig does not work, but xapian-config does, so keep this for now.
*** is in your PATH.])], AC_MSG_NOTICE([falling back to xapian-config])
[xapian_version=$($XAPIAN_CONFIG --version | sed -e 's/.* //')]) AC_CHECK_PROG(XAPIAN_CONFIG,xapian-config,xapian-config,no)
AS_IF([test "x$XAPIAN_CONFIG" = "xno"],[
AC_MSG_ERROR([
*** xapian could not be found; please install it
*** e.g., in debian/ubuntu the package would be 'libxapian-dev'
*** If you compiled it yourself, you should ensure that xapian-config
*** is in your PATH.])],
[xapian_version=$($XAPIAN_CONFIG --version | sed -e 's/.* //')])
AS_CASE([$xapian_version], AS_CASE([$xapian_version],
[1.[[4-9]].[[0-9]]*], [1.[[4-9]].[[0-9]]*],
[AC_DEFINE([XAPIAN_HAVE_OP_WILDCARD],[1],[Xapian::Query::OP_WILDCARD?])], [AC_DEFINE([XAPIAN_HAVE_OP_WILDCARD],[1],[Xapian::Query::OP_WILDCARD?])],
[AC_MSG_ERROR([*** xapian version >= 1.4 needed, but version $xapian_version found.])]) [AC_MSG_ERROR([*** xapian version >= 1.4 needed, but version $xapian_version found.])])
XAPIAN_CXXFLAGS="$($XAPIAN_CONFIG --cxxflags)" XAPIAN_CXXFLAGS="$($XAPIAN_CONFIG --cxxflags)"
XAPIAN_LIBS="$($XAPIAN_CONFIG --libs)" XAPIAN_LIBS="$($XAPIAN_CONFIG --libs)"
have_xapian="yes" have_xapian="yes"
AC_SUBST(XAPIAN_CXXFLAGS)
AC_SUBST(XAPIAN_LIBS)
AC_SUBST(XAPIAN_CXXFLAGS)
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