use configure libdir to search for aspell lib (mainly for 64 bits machines)
This commit is contained in:
parent
855b4ca6bf
commit
baae55ac95
@ -1,6 +1,6 @@
|
|||||||
#ifndef TEST_RCLASPELL
|
#ifndef TEST_RCLASPELL
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclaspell.cpp,v 1.6 2006-11-30 13:38:43 dockes Exp $ (C) 2006 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rclaspell.cpp,v 1.7 2007-02-01 15:01:08 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
@ -12,6 +12,8 @@ static char rcsid[] = "@(#$Id: rclaspell.cpp,v 1.6 2006-11-30 13:38:43 dockes Ex
|
|||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include ASPELL_INCLUDE
|
#include ASPELL_INCLUDE
|
||||||
|
|
||||||
#include "pathut.h"
|
#include "pathut.h"
|
||||||
@ -115,21 +117,39 @@ bool Aspell::init(string &reason)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For now, the aspell library has to live under the same prefix as the
|
// We first look for the aspell library in libdir, and also try to
|
||||||
|
// be clever with ASPELL_PROG.
|
||||||
|
vector<string> libdirs;
|
||||||
|
libdirs.push_back(LIBDIR);
|
||||||
|
#ifdef ASPELL_PROG
|
||||||
|
// The aspell library has to live under the same prefix as the
|
||||||
// aspell program.
|
// aspell program.
|
||||||
string aspellPrefix = path_getfather(path_getfather(m_data->m_exec));
|
{
|
||||||
string libbase = path_cat(aspellPrefix, "lib");
|
string aspellPrefix = path_getfather(path_getfather(m_data->m_exec));
|
||||||
libbase = path_cat(libbase, "libaspell");
|
// This would probably require some more tweaking on solaris/irix etc.
|
||||||
string lib;
|
string dir = sizeof(long) > 4 ? "lib64" : "lib";
|
||||||
reason = "Could not open shared library [";
|
string libaspell = path_cat(aspellPrefix, dir);
|
||||||
for (unsigned int i = 0; i < nlibsuffs; i++) {
|
if (libaspell != LIBDIR)
|
||||||
lib = libbase + aspell_lib_suffixes[i];
|
libdirs.push_back(libaspell);
|
||||||
reason += lib + "]";
|
|
||||||
if ((m_data->m_handle = dlopen(lib.c_str(), RTLD_LAZY)) != 0) {
|
|
||||||
reason.erase();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
reason = "Could not open shared library ";
|
||||||
|
for (vector<string>::iterator it = libdirs.begin();
|
||||||
|
it != libdirs.end(); it++) {
|
||||||
|
string libbase = path_cat(*it, "libaspell");
|
||||||
|
string lib;
|
||||||
|
for (unsigned int i = 0; i < nlibsuffs; i++) {
|
||||||
|
lib = libbase + aspell_lib_suffixes[i];
|
||||||
|
reason += string("[") + lib + "] ";
|
||||||
|
if ((m_data->m_handle = dlopen(lib.c_str(), RTLD_LAZY)) != 0) {
|
||||||
|
reason.erase();
|
||||||
|
goto found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
found:
|
||||||
if (m_data->m_handle == 0) {
|
if (m_data->m_handle == 0) {
|
||||||
reason += string(" : ") + dlerror();
|
reason += string(" : ") + dlerror();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
# @(#$Id: localdefs.in,v 1.12 2007-02-01 15:01:08 dockes Exp $ (C) 2006 J.F.Dockes
|
||||||
|
|
||||||
|
# 'Make' definitions which depend on local configuration.
|
||||||
|
|
||||||
LIBXAPIAN=@LIBXAPIAN@
|
LIBXAPIAN=@LIBXAPIAN@
|
||||||
XAPIANCXXFLAGS=@XAPIANCXXFLAGS@
|
XAPIANCXXFLAGS=@XAPIANCXXFLAGS@
|
||||||
@ -13,10 +16,15 @@ X_LIBS=@X_LIBS@
|
|||||||
X_EXTRA_LIBS=@X_EXTRA_LIBS@
|
X_EXTRA_LIBS=@X_EXTRA_LIBS@
|
||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
datadir = @datadir@
|
datadir = @datadir@
|
||||||
|
libdir = @libdir@
|
||||||
|
|
||||||
RECOLL_DATADIR = ${datadir}/recoll
|
RECOLL_DATADIR = ${datadir}/recoll
|
||||||
|
|
||||||
LOCALCXXFLAGS = $(INCICONV) $(XAPIANCXXFLAGS) $(X_CFLAGS) \
|
LOCALCXXFLAGS = $(INCICONV) $(XAPIANCXXFLAGS) $(X_CFLAGS) \
|
||||||
-DRECOLL_DATADIR=\"$(RECOLL_DATADIR)\" @DEFS@
|
-DRECOLL_DATADIR=\"$(RECOLL_DATADIR)\" \
|
||||||
|
-DLIBDIR=\"$(libdir)\" \
|
||||||
|
@DEFS@
|
||||||
|
|
||||||
CXXFLAGS = -g -O2 -Wall -Wno-unused
|
CXXFLAGS = -g -O2 -Wall -Wno-unused
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user