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: http://www.openldap.org/faq/data/cache/1113.html, 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:
[buildout]
parts =
    openldap-build
    ...


[openldap-build]
recipe = zc.recipe.cmmi
url = http://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.4.23.tgz
extra_options =
    --with-sasl --with-tls --enable-slapd=yes

environment =
    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

No comments: