从源代码构建OpenLDAP并缺少BerkelyDB

use*_*829 23 redhat berkeley-db openldap

我正在RHEL 5上构建OpenLDAP; 我使用了http://www.linux.com/archive/feature/113607上的说明.

一切顺利,直到为OpenLDAP运行'./configure' - 记录了以下错误:

*<earlier output snipped>*
checking for gethostbyaddr_r... yes
checking number of arguments of ctime_r... 2
checking number of arguments of gethostbyname_r... 6
checking number of arguments of gethostbyaddr_r... 8
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking for Berkeley DB major version in db.h... 5
checking for Berkeley DB minor version in db.h... 1
checking if Berkeley DB version supported by BDB/HDB backends... yes
**checking for Berkeley DB link (default)... no
configure: error: BDB/HDB: BerkeleyDB not available**
Run Code Online (Sandbox Code Playgroud)

我已经像疯子一样用谷歌搜索但是找不到解决方案是不成功的 - 有关探索领域的任何提示?

谢谢

Nav*_*een 15

看来你正在使用tarball安装,首先你应该安装Berkeley DB.您可以从Oracle Berkeley DB下载的 oracle网站上找到它.编译并安装它.

cd db-4.7.25.NC
../dist/configure
make
make install
cd /usr/local/BerkeleyDB.4.7/
Run Code Online (Sandbox Code Playgroud)

这将安装BerkeleyDB.现在您需要提供成功编译OpenLDAP的位置.

export CPPFLAGS="-I/usr/local/BerkeleyDB.4.7/include"
export LDFLAGS="-L/usr/local/BerkeleyDB.4.7/lib -Wl,-R,/usr/local/BerkeleyDB.4.7/lib -Wl,--enable-new-dtags"
# Build OpenLDAP
... 
Run Code Online (Sandbox Code Playgroud)

如果未设置RPATH,则应添加LD_LIBRARY_PATH到/ etc/profile.

export LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.7/lib"
Run Code Online (Sandbox Code Playgroud)

在编译OpenLDAP之后,如果您遇到任何问题,请与我们联系.


nos*_*nos 14

yum install db4-devel

(或者只是安装预先打包的openldap, yum install openldap-servers openldap-clients


小智 6

debian尝试:

aptitude install libdb5.1 libdb5.1-dev libdb5.1-dbg


小智 6

对于CentOS 7,做yum install libdb-devel.libdb4-devel对我不起作用.