Friday, September 5, 2014

Fixing Berkeley DB version conflict while building openldap on Mac OSX

While building openldap on Mac OSX 10.9.4, i got this error: 
checking for Berkeley DB major version in db.h... 1
checking for Berkeley DB minor version in db.h... 0
checking if Berkeley DB version supported by BDB/HDB backends... no

The answer was at the end of  a looong Google search:, which translates to:
$ LD_LIBRARY_PATH="/usr/lib:/usr/local/lib:/opt/local/lib/db46:/usr/local/ssl/lib" LDFLAGS="-L/usr/local/lib -L/opt/local/lib/db46 -L/usr/local/ssl/lib" CPPFLAGS="-I/usr/local/include -I/opt/local/include/db46 -I/usr/local/ssl/include" ./configure $OTHER_OPTIONS

In a buildout using zc.recipe.cmmi, it looks like this:
parts =

recipe = zc.recipe.cmmi
url =
extra_options =
    --with-sasl --with-tls --enable-slapd=yes

environment =
    LDFLAGS=-L/usr/local/lib -L/opt/local/lib/db46 -L/usr/local/ssl/lib
    CPPFLAGS=-I/usr/local/include -I/opt/local/include/db46 -I/usr/local/ssl/include