How to compile Berkeley DB and OpenLDAP on linux

Hi,
Many times we need to install packages which are available only in form of source code. Or sometimes we need to install couple of different versions of packages on same server... what ever reason it may be, We can achieve this by compiling packages.

Here in this article I will just show you quick steps how to compile berkeley db and openldap.

First of all we need to download Berkeley DB and OpenLDAP. use following links to download latest stable versions.

To download Berkeley DB
http://www.oracle.com/technology/software/products/berkeley-db/index.htm...
To download openldap
http://www.openldap.org/software/download/

After downloading packages, we will first compile and install Berkeley DB and then Open LDAP.

1. Steps to compile and Berkeley DB.

  • Uncompress berkeley-db package in some directory. say in /opt
  • cd to build_unix directory
  • ../dist/configure
  • make
  • make install
  • 2. Steps to compile and install OpenLDAP.

  • Uncompress Openldap-stable in some directory. say /opt
  • cd to directory openldap-stable..
  • LD_LIBRARY_PATH="/usr/lib:/usr/local/lib:/usr/local/BerkeleyDB.4.7/lib" LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.7/lib" CPPFLAGS="-I/usr/local/include -I/usr/local/BerkeleyDB.4.7/include" ./configure --enable-bdb
  • This step is required if your berkeley db libraries and other required libraries are not in path.

  • make depend
  • make
  • make test
  • make install
  • NOTE:

  • Make sure you update /etc/ld.so.conf to reflect location of Berkeley DB libraries, otherwise make test will fail during openldap compilation.
  • Make sure to correct any errors if occurs
  • Back to top