Fix up CLucene library detection.

This commit is contained in:
alexhudson
2007-02-08 17:36:57 +00:00
parent 482a9e8a22
commit 43b28267b6
3 changed files with 79 additions and 14 deletions
+7 -12
View File
@@ -590,19 +590,14 @@ AC_DEFINE_UNQUOTED(XPL_POINTER_TO_UINT_CAST, $pui_cast, [How to cast an unsigned
# import libraries
AC_LANG([C++])
AC_CHECK_HEADER(CLucene.h,
[
AC_MSG_RESULT(Using system CLucene)
AC_SUBST(LIBCLUCENE_LIBS, " -lclucene ")
],
[
AC_MSG_RESULT(Using import CLucene)
ACX_CLUCENE()
if test "x$CLUCENE_LIBS" = "x"; then
AC_MSG_RESULT(Using imported CLucene)
AC_CONFIG_SUBDIRS([import/clucene])
AC_SUBST(LIBCLUCENE_LIBS, "\$(top_builddir)/import/clucene/src/libclucene.la")
]
)
AC_LANG([C])
AC_SUBST(CLUCENE_LIBS, "\$(top_builddir)/import/clucene/src/libclucene.la")
else
AC_MSG_RESULT(Using system CLucene)
fi
AC_CHECK_HEADER(curl/curl.h,
[
+70
View File
@@ -0,0 +1,70 @@
dnl CLucene detection m4
dnl Based on version in clucene-contribs
AC_DEFUN([ACX_CLUCENE], [
AC_LANG_SAVE
AC_LANG(C++)
# Ask user for path to clucene-core stuff:.
AC_ARG_WITH(clucene,
AC_HELP_STRING([ --with-clucene=<path>],
[prefix of CLucene-Core installation. e.g. /usr/local or /usr]),,)
#try some default locations
if test -z "$with_clucene"; then
#use parent of this directory, and some common library paths
with_clucene=$(cd "../" && pwd)
with_clucene="$with_clucene /usr /usr/local"
else
#use an absolute path
with_clucene=$(cd "$with_clucene" && pwd)
fi
clucene_set_failed=
AC_MSG_CHECKING([how to include clucene])
CLUCENE_CXXFLAGS=
CLUCENE_LIBS=
for flag in $with_clucene; do
if test -z "$clucene_set_failed"; then
if test -e "$flag/include/CLucene/StdHeader.h"; then
config_path=""
if test -e "$flag/include/CLucene/clucene-config.h"; then
config_path="$flag/include/"
fi
if test -e "$flag/lib/CLucene/clucene-config.h"; then
config_path="$flag/lib/"
fi
if test "x$config_path" != "x"; then
if test -e "$flag/lib/libclucene.so"; then
CLUCENE_LIBS="-L$flag/lib -lclucene"
CLUCENE_CXXFLAGS="-I$flag/include -I$config_path"
clucene_set_failed=$flag
fi
fi
fi
fi
if test -z "$clucene_set_failed"; then
if test -e "$flag/src/CLucene/StdHeader.h"; then
if test -e "$flag/src/libclucene.la"; then
CLUCENE_LIBS="-L$flag/src/ -lclucene"
CLUCENE_CXXFLAGS="-I$flag/src/"
clucene_set_failed=$flag/src/
fi
fi
fi
done
if test -z "$clucene_set_failed"; then
clucene_set_failed="true"
AC_MSG_RESULT("failed")
else
AC_MSG_RESULT($clucene_set_failed)
fi
AC_SUBST(CLUCENE_LIBS)
AC_SUBST(CLUCENE_CXXFLAGS)
AC_LANG_RESTORE
])dnl ACX_CLUCENE
+2 -2
View File
@@ -4,7 +4,7 @@ sbin_PROGRAMS += bongostore
bongostore_CPPFLAGS := $(AM_CPPFLAGS) \
-I$(top_srcdir)/src/agents/store \
-I$(top_srcdir)/import/sqlite3 \
-I$(top_srcdir)/import/clucene/src
$(CLUCENE_CXXFLAGS)
bongostore_SOURCES := \
src/agents/store/alarmdb.c \
@@ -64,7 +64,7 @@ bongostore_LDADD = \
libbongoxpl.la \
$(top_builddir)/import/log4c/log4c/libbongolog4c.la \
$(LIBSQLITE_LIBS) \
$(LIBCLUCENE_LIBS) \
$(CLUCENE_LIBS) \
$(PTHREAD_LIBS) \
$(ALL_LIBS)