1
dnl CLucene detection m4
2
AC_DEFUN([ACX_CLUCENE], [
7
# Ask user for path to clucene-core stuff:.
9
AC_HELP_STRING([ --with-clucene=<path>],
10
[prefix of CLucene-Core installation. e.g. /usr/local or /usr]),,)
12
AC_MSG_CHECKING([how to include clucene])
13
if test "x$with_clucene" = "xno"; then
14
AC_MSG_RESULT(excluding support)
16
#try some default locations
17
if test -z "$with_clucene" || test "x$with_clucene" = "xyes"; then
18
#use parent of this directory, and some common library paths
19
with_clucene=$(cd "../" && pwd)
20
with_clucene="$with_clucene /usr /usr/local"
23
with_clucene=$(cd "$with_clucene" && pwd)
28
for flag in $with_clucene; do
29
if test -z "$clucene_set_failed"; then
30
if test -e "$flag/include/CLucene.h"; then
32
if test -e "$flag/lib64/libclucene.la" || test -e "$flag/lib64/libclucene.so"; then
33
clucene_set_failed=$flag
34
CLUCENE_LIBS="-L$flag/lib64 -lclucene"
35
if test -e "$flag/include/CLucene/clucene-config.h"; then
36
CLUCENE_CXXFLAGS="-I$flag/include"
38
CLUCENE_CXXFLAGS="-I$flag/include -I$flag/lib64"
42
if test -e "$flag/lib/libclucene.la" || test -e "$flag/lib/libclucene.so"; then
43
clucene_set_failed=$flag
44
CLUCENE_LIBS="-L$flag/lib -lclucene"
45
if test -e "$flag/include/CLucene/clucene-config.h"; then
46
CLUCENE_CXXFLAGS="-I$flag/include"
48
CLUCENE_CXXFLAGS="-I$flag/include -I$flag/lib"
55
if test -z "$clucene_set_failed"; then
56
if test -e "$flag/src/CLucene/StdHeader.h"; then
57
if test -e "$flag/src/libclucene.la"; then
58
CLUCENE_LIBS="-L$flag/src/ -lclucene"
59
CLUCENE_CXXFLAGS="-I$flag/src/"
60
clucene_set_failed=$flag/src/
66
if test -z "$clucene_set_failed"; then
67
clucene_set_failed="true"
69
AC_MSG_RESULT(excluding support)
71
AC_MSG_RESULT($clucene_set_failed)
74
if test "$clucene_set_failed" = "true"; then
75
AC_MSG_WARN([Could not detect clucene location. To enable clucene, you must
76
call configure with the --with-clucene option specifying the location.
77
This tells configure where to find the CLucene Core library and headers.
78
e.g. --with-clucene=/usr/local or --with-clucene=/usr])
80
AC_SUBST(CLUCENE_LIBS)
81
AC_SUBST(CLUCENE_CXXFLAGS)