(Answer) (Category) OpenLDAP Faq-O-Matic : (Category) OpenLDAP Software FAQ : (Category) Installation : (Answer) What is prerequisite for building OpenLDAP software?
OpenLDAP 2.x is designed to "configure" and "build" on UNIX (and UNIX-like) systems. The prerequisites depending upon the which features you desire.
General prerequisites include:
  C Development Environment
  POSIX REGEX routines
  Berkeley Networking (e.g., socket(2)) routines

SLAPD (with BDB or HDB database) prerequisites includes:
  Berkeley Database 4.2 from Sleepycat (http://www.sleepycat.com/)
Latest version with patches is recommended.
SLAPD (with LDBM database) prerequisites include suitable database support. One of following packages can fulfill the prerequisite.
  Berkeley Database from Sleepycat (http://www.sleepycat.com/)
  GNU Database Manager (GDBM) from FSF (http://www.gnu.org/)

For OpenLDAP 2.1 (or later), Berkeley DB 4.1 is recommended.

SLURPD prerequisites include:
  Thread support (Posix Threads and others)

SSL/TLS prerequisites:
  OpenSSL 0.9.6 from http://www.openssl.org
The OpenSSL library usually needs to be patched before it will work correctly. See this FAQ article for details: http://www.openldap.org/faq/index.cgi?file=185 (Note about OpenSSL and crypt())
SASL prerequisites:
  Cyrus-SASL from http://asg.web.cmu.edu/sasl/

SSL/TLS - Using Mozilla NSS (MozNSS)
The OpenLDAP interface to MozNSS is in the file libraries/libldap/tls_m.c. Many platforms include MozNSS (and its prerequisite, NSPR). There is currently (January 30, 2011) no configure directive to build with OpenLDAP, so the options must be specified manually.
For general information about using TLS/SSL with OpenLDAP see http://www.openldap.org/faq/index.cgi?file=185
For information about using Mozilla NSS with OpenLDAP see http://www.openldap.org/faq/index.cgi?file=1514
The following assumes you have the openldap source in a directory called openldap-2.4.23 and a directory you will be building from called built. It also assumes you have your platform's NSPR and NSS development packages installed (e.g. nss-devel or libnss-dev or etc.). In this example, the NSPR include files are installed in /usr/include/nspr4 and the NSS files in /usr/include/nss3 (common on Fedora/Red Hat derivatives).
 ls
  openldap-2.4.23/ built/
 cd built
 # NOTE: openldap uses #include <nss/filename.h> in some places - we have
 # to use this symlink hack so that the MozNSS and NSPR include files will
 # be found in the standard include path openldap uses
 # if your MozNSS include files are in a sub directory called /nss/ and
 # your NSPR include files are in a sub directory called /nspr/ you can
 # skip the symlink hack
 if [ ! -d include/nss ] ; then
   mkdir include ; cd include ; ln -s /usr/include/nss3 nss ; cd ..
 fi
 if [ ! -d include/nspr ] ; then
   mkdir include ; cd include ; ln -s /usr/include/nspr4 nspr ; cd ..
 fi
 EXTRA_CFLAGS="-I/usr/include/nss3 -I/usr/include/nspr4 -DHAVE_TLS -DHAVE_MOZNSS"
 TLS_LIBS="-lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4"
 OTHER_CFLAGS="your platform cflags go here"
 LIBS="$TLS_LIBS" CFLAGS="$OTHER_CFLAGS $EXTRA_CFLAGS" ../openldap-2.4.23/configure \
        --with-tls=no \
        ... other configure flags ...
 make install
# NOTE that we use --with-tls=no because we are using a TLS implementation # not currently supported by OpenLDAP configure
If you need to build NSPR and NSS from source:
NSPR: http://developer.mozilla.org/en/NSPR
NSS: http://developer.mozilla.org/en/NSS
[Append to This Answer]
Previous: (Category) Why did 'cd tests; make test' fail?
Next: (Answer) How do I install OpenLDAP?
This document is: http://www.openldap.org/faq/index.cgi?file=196
[Search] [Appearance]
This is a Faq-O-Matic 2.721.test.
© Copyright 1998-2013, OpenLDAP Foundation, info@OpenLDAP.org