summaryrefslogtreecommitdiffstats
path: root/clucene.m4
diff options
context:
space:
mode:
Diffstat (limited to 'clucene.m4')
-rw-r--r--clucene.m418
1 files changed, 15 insertions, 3 deletions
diff --git a/clucene.m4 b/clucene.m4
index 09817d8..e643e75 100644
--- a/clucene.m4
+++ b/clucene.m4
@@ -28,7 +28,8 @@ AC_ARG_ENABLE(static-clucene,
dnl try to find CLucene library files
AC_MSG_CHECKING([for CLucene library files])
-ac_clucene_library_dirs="$ac_clucene_dir/lib $exec_prefix/lib $prefix/lib /usr/lib /usr/lib64 /usr/local/lib"
+clucene_multiarch_libs="/usr/lib/`uname -m`-linux-gnu"
+ac_clucene_library_dirs="$ac_clucene_dir/lib $exec_prefix/lib $prefix/lib /usr/lib /usr/lib64 /usr/local/lib $clucene_multiarch_libs"
if test "x$ac_static_clucene" = "xYES"; then
SEARCH_LIBS="libclucene.a";
@@ -40,13 +41,24 @@ fi
AC_CACHE_VAL(ac_cv_clucene_libdir, AC_FIND_FILE($SEARCH_LIBS, $ac_clucene_library_dirs, ac_cv_clucene_libdir))
if test "x$ac_cv_clucene_libdir" = "xNO"; then
- AC_MSG_ERROR(CLucene library not found. Try to use configure with --with-clucene-dir=/path/to/clucene);
+ AC_MSG_CHECKING([for CLucene 2.x library files])
+ SEARCH_LIBS="libclucene-shared.so libclucene-shared.so.1";
+ AC_CACHE_VAL(ac_cv_clucene2_libdir, AC_FIND_FILE($SEARCH_LIBS, $ac_clucene_library_dirs, ac_cv_clucene_libdir))
+
+ if test "x$ac_cv_clucene2_libdir" = "xNO"; then
+ AC_MSG_ERROR(CLucene library not found. Try to use configure with --with-clucene-dir=/path/to/clucene);
+ fi
fi
if test "x$ac_static_clucene" = "xYES"; then
LIB_CLUCENE="$ac_cv_clucene_libdir/libclucene.a";
else
- LIB_CLUCENE="-lclucene";
+ if test "x$ac_cv_clucene2_libdir" = "xNO"; then
+ LIB_CLUCENE="-lclucene";
+ else
+ CXXFLAGS="$CXXFLAGS -DCLUCENE_V2"
+ LIB_CLUCENE="-lclucene-shared";
+ fi
fi
AC_SUBST(CLUCENE_LIBRARY_PATH)