diff configure.ac @ 18413:68c5e0db61db

configure: Fixed/improved finding and using libexttextcat. libexttextcat wasn't actually being used at all by fts-lucene. Now we'll first prefer finding it via pkg-config, next finding exttextcat and only last look up textcat.
author Timo Sirainen <tss@iki.fi>
date Mon, 20 Apr 2015 15:27:02 +0300
parents 1c516f905152
children 81e5b977e5c5
line wrap: on
line diff
--- a/configure.ac	Mon Apr 20 15:12:14 2015 +0300
+++ b/configure.ac	Mon Apr 20 15:27:02 2015 +0300
@@ -2760,17 +2760,27 @@
 AM_CONDITIONAL(BUILD_FTS_STEMMER, test "$have_fts_stemmer" = "yes")
 
 if test $want_textcat != no; then
-  AC_CHECK_LIB(textcat, special_textcat_Init, [
-    have_fts_textcat=yes
-    AC_DEFINE(HAVE_FTS_TEXTCAT,, Define if you want textcat support for FTS)
-  ], [
+  if test "$PKG_CONFIG" != "" && $PKG_CONFIG --exists libexttextcat 2>/dev/null; then
+    PKG_CHECK_MODULES(LIBEXTTEXTCAT, libexttextcat)
+    have_exttextcat=yes
+  else
     AC_CHECK_LIB(exttextcat, special_textcat_Init, [
       have_fts_exttextcat=yes
-      AC_DEFINE(HAVE_FTS_EXTTEXTCAT,, Define if you want libexttextcat support for FTS)
+      AC_CHECK_HEADERS(libexttextcat/textcat.h)
+      LIBEXTTEXTCAT_LIBS=-lexttextcat
+      AC_SUBST(LIBEXTTEXTCAT_LIBS)
+    ], [
+      AC_CHECK_LIB(textcat, special_textcat_Init, [
+	have_fts_textcat=yes
+        AC_CHECK_HEADERS(libtextcat/textcat.h)
+      ])
     ])
-  ])
-  if test $want_textcat = yes && test "$have_fts_exttextcat" != yes && test "$have_fts_textcat" != yes; then
-    AC_ERROR([Can't build with textcat support: libtextcat or libexttextcat not found])
+    if test $want_textcat = yes && test "$have_fts_exttextcat" != yes && test "$have_fts_textcat" != yes; then
+      AC_ERROR([Can't build with textcat support: libtextcat or libexttextcat not found])
+    fi
+  fi
+  if test "$have_fts_exttextcat" != yes || test "$have_fts_textcat" != yes; then
+    AC_DEFINE(HAVE_FTS_TEXTCAT,, Define if you want textcat support for FTS)
   fi
 fi
 AM_CONDITIONAL(BUILD_FTS_TEXTCAT, test "$have_fts_textcat" = "yes")