LDAP C SDK

The Mozilla LDAP C SDK

Contact: Mark Smith <mcs@pearlcrescent.com> Discussion: mozilla.dev.tech.ldap

Latest News - 1/17/2007

Version 6.0.2 has been released! This version contains the completed merge of the Sun LDAP C SDK back into Mozilla. This version also exports libldif as a public interface and shared library. Now you can get rid of that old, crufty LDIF parsing code you've been maintaining :-) The CVS tag is LDAPCSDK_6_0_2_RTM. You can find the source here: ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v6.0.2/src

Latest News - 10/12/2006

Version 6.0.0 has been released! This is the first release that contains the code contributed from Sun, including support for SASL/Kerberos BIND and use of the LDAP standard BER types. This version also contains support for IPv6 when using NSPR for I/O. The CVS tag for the code is LDAPCSDK_6_0_0_RTM. You can find the source here: ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v6.0.0/src

Latest News - 5/16/2006

Sun Microsystems is merging their forked LDAP C SDK code back into the mozilla codebase. The page LDAPSunMerge will track those efforts.

Latest News - 2/13/2006

New release - 5.17 - CVS tag LDAPCSDK_5_1_7_RTM. This release has support for building on Windows using cygwin and the free MSVC compilers and SDKs. It also has support for HP-UX on IPF (32 bit and 64 bit). 5.17 has support for building with the Mozilla client and the client team has used 5.17 as their branch point for new client work.

News (updated 1/17/2006)

There is a lot of bug fixing going on now, so if you have any requests, now is a good time to get them in to be examined.

New platform support - The CVS head now has support for building on linux x86_64, HP-UX IA64, and Solaris using gcc. See below for build instructions.

Latest news (updated 5/10/2005)

The latest release is 5.16. This release contains a fix for using startTLS with the command line tools as well as some configuration and Makefile changes for building with gcc on Solaris (32 bit and 64 bit) - bugs 291993, 293042, and 293199. The CVS tag is LDAPCSDK_5_1_6_RTM.

The previous release was 5.15, CVS tag LDAPCSDK_5_1_5_RTM.

Roadmap

LDAP Roadmap

Documentation

Checking Out the Source Code

  1. Get the CVS client and set your computer up mozilla work. Read through the instructions on using CVS. Make sure you have set your CVSROOT environment variable and that you have successfully executed the cvs login command.
  2. Pull the current LDAP C SDK code (which is located on the CVS trunk) using this command: cvs co -P [-r currentrelease] DirectorySDKSourceC The most current release is LDAPCSDK_6_0_2_RTM, so to pull this version (recommended), use this command: cvs co -P -r LDAPCSDK_6_0_2_RTM DirectorySDKSourceC
  3. Pull the code for libraries that LDAP C SDK depends on. Pull NSPR and NSS using these commands:
cvs co -r NSPR_4_6_4_RTM mozilla/nsprpub
cvs co -r NSS_3_11_4_RTM mozilla/security/coreconf mozilla/security/nss mozilla/security/dbm mozilla/dbm

There is an optional package called SVRCORE which provides secure PIN management for the command line and Windows clients. This is recommended for using the command line tools with SSL, for a more secure environment.

cvs co -r SVRCORE_4_0_3_RTM mozilla/security/svrcore [mozilla/security/coreconf]

Add mozilla/security/coreconf on Windows only. Alternatively, you can download stable binary releases of NSPR and NSS and drop them into your source tree under mozilla/dist. See ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/ for NSPR releases and ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/ for NSS releases.

Obtaining Build Tools and Setting Up Your Environment

Follow these instructions to obtain the necessary build tools:

Follow these instructions to set up your environment:

  • Microsoft Windows - Note that MOZCONFIG is not used for LDAP C SDK builds, so it is safe to leave it unset.
  • Solaris using GCC (instead of the Sun/Forte compiler)
    • Requires GCC 3.4 or later
    • Make sure the GNU gcc, g++, ld, ar, and ranlib are in your PATH ahead of the ones in /usr/ccs/bin or elsewhere.
    • LD_LIBRARY_PATH must include the libgcc and libstdc++ libraries - note that if you are building 64 bit binaries, you must use the 64 bit libraries in the lib/sparcv9 directory instead of the 32 bit versions in the lib directory.
    • Use CXX=g++ CC=gcc when calling configure - also add CXXFLAGS=-m64 CFLAGS=-m64 if building 64 bit binaries
  • Other Linux and Unix. No environment variables need to be set.

Building using autoconf (preferred method)

NOTE: You must use GNU make (called gmake on some platforms).

  • Build NSPR and NSS (if not using binary releases of those components) by executing these commands:
cd mozilla/security/nss
make nss_build_all [USE_64=1]
  • [Optional - see above] Build the SVRCORE module:
cd mozilla/security/svrcore
./configure [--with-nspr=/path] [--with-nss=/path]
make [USE_64=1]
  • Read the NSS Build Instructions and the NSPR Build Instructions if you run into problems. Note that the instructions for NSS say to use the NSS_3_9_RTM tag to pull the source, but use NSS_3_11_4_RTM instead. Build the LDAP C SDK libraries:
cd mozilla/directory/c-sdk
./configure --with-nss [--enable-64bit]
make
  • Build the LDAP C SDK libraries and command line tools:
cd mozilla/directory/c-sdk
./configure --with-nss --enable-clu [--enable-64bit]
make
  • Build the LDAP C SDK libraries and command line tools with SVRCORE:
cd mozilla/directory/c-sdk
./configure --with-svrcore --enable-clu [--enable-64bit]
make
  • Build with SASL support:
cd mozilla/directory/c-sdk
./configure ...other options above... --with-sasl

Note that since svrcore requires NSS, --with-svrcore implies --with-nss

If your build is successful, the LDAP C SDK libraries, command line tools, and header files will be placed under mozilla/dist/<OSNAME>.OBJ/.

Note that you can build without SSL support by skipping the NSS related build steps and omitting the --with-nss on the configure command. You will still need a binary copy of NSPR or you will need to build NSPR from source.

Building without using autoconf (deprecated - older method - use autoconf method)

This method is deprecated, but the instructions are here for historical reasons.

  1. Build NSPR and NSS (if not using binary releases of those components) by executing these commands:
cd mozilla/security/nss
gmake nss_build_all
  1. Read the NSS Build Instructions and the NSPR Build Instructions if you run into problems. Note that the instructions for NSS say to use the NSS_3_9_RTM tag to pull the source, but use NSS_3_9_3_RTM instead.
  2. Build the LDAP C SDK (libraries and tools):
cd mozilla/directory
gmake buildLdapClientSDK BUILD_CLU=1 COMPS_FROM_OBJDIR=1 [HAVE_SVRCORE=1]

Other things can be included on the gmake command line used to build the LDAP C SDK. Execute a gmake command by itself (without any targets) to see the list of allowed options. HAVE_SVRCORE=1 is optional but recommended if using NSS.

If your build is successful, the LDAP C SDK libraries, command line tools, and header files will be placed under mozilla/dist/<OSNAME>.OBJ/.

More Information

If you have questions or want to discuss issues about the LDAP C SDK or any of the Mozilla LDAP source products, post a message to the mozilla.dev.tech.ldap newsgroup.

For more information about the available newsgroups and mailing lists, see the Mozilla community page.