[Dovecot] Define custom ldap libraries when building Dovecot
Hello,
I would like to compile Dovecot using custom ldap libraries, located at a particular custom system location.
How should I alter the config process to specify that the include dir is "/usr/local/openldap/include" and the lib dir is "/usr/local/openldap/lib64" and not the standard ones (/usr/include/ and /usr/lib64/ respectively) on RHEL/CentOS 5 (x86_64). Note that all of the above files/folders exist on the file system at the same time.
The idea is to build dovecot against current openldap v2.4.x libraries and not against the available (by the OS) ancient openldap v.2.3.x libs.
Please, advise.
Thanks, Nick
On 11/1/2013 11:02 μμ, Nikolaos Milas wrote:
I would like to compile Dovecot using custom OpenLDAP libraries, located at a particular custom system location.
Clarification 1: I am trying to compile Dovecot 2.1.13.
How should I alter the config process to specify that the include dir is ... and the lib dir is ...
Clarification 2: The custom include (if needed) and lib dirs are for OpenLDAP-linking only. All other required includes/libraries are to be found at the standard system locations.
So, how should I declare them?
Thanks and Regards, Nick
On 11/1/2013 11:02 μμ, Nikolaos Milas wrote:
I would like to compile Dovecot using custom ldap libraries, located at a particular custom system location.
Sorry, I got it. According to http://wiki2.dovecot.org/CompilingSource I should use:
CPPFLAGS="-I/usr/local/openldap/include" LDFLAGS="-L/usr/local/openldap/lib64 -lldap -llber" ./configure
I found (coincidentally) that it also works simply with "LDFLAGS="-L/usr/local/openldap/lib64" but I guess it is more correct to use the full syntax: LDFLAGS="-L/usr/local/openldap/lib64 -lldap -llber" (or even "... -lldap" only). However, I can't tell the real difference.
If you can shed some light on it, that would be very useful to me.
Thanks and regards, Nick
On 12/01/2013 4:50 AM, Nikolaos Milas wrote:
On 11/1/2013 11:02 μμ, Nikolaos Milas wrote:
I would like to compile Dovecot using custom ldap libraries, located at a particular custom system location. Sorry, I got it. According to http://wiki2.dovecot.org/CompilingSource I should use: CPPFLAGS="-I/usr/local/openldap/include" LDFLAGS="-L/usr/local/openldap/lib64 -lldap -llber" ./configure
Check the binaries with ldd to make sure they are loading the expected libraries at run-time.
On 12/1/2013 5:13 μμ, Oscar del Rio wrote:
Check the binaries with ldd to make sure they are loading the expected libraries at run-time.
They do:
# ldd /usr/sbin/dovecot linux-vdso.so.1 => (0x00007fffa01fd000) libcap.so.1 => /lib64/libcap.so.1 (0x00000039bd600000) libdovecot.so.0 => /usr/lib64/dovecot/libdovecot.so.0 (0x00002b3a664a0000) libc.so.6 => /lib64/libc.so.6 (0x00000039b8a00000) libldap-2.4.so.2 => /usr/local/openldap/lib64/libldap-2.4.so.2 (0x00002b3a6672e000) libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00000039bae00000) libssl.so.6 => /lib64/libssl.so.6 (0x00000039bd200000) libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00000039bca00000) liblber-2.4.so.2 => /usr/local/openldap/lib64/liblber-2.4.so.2 (0x00002b3a66973000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00000039ba600000) librt.so.1 => /lib64/librt.so.1 (0x00002b3a66b81000) /lib64/ld-linux-x86-64.so.2 (0x00000039b8600000) libdl.so.2 => /lib64/libdl.so.2 (0x00000039b8e00000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00000039bc200000) libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00000039bba00000) libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00000039bbe00000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00000039baa00000) libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00000039bb600000) libz.so.1 => /lib64/libz.so.1 (0x00000039b9600000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00000039b9200000) libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00000039bce00000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00000039bb200000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00000039b9e00000) libsepol.so.1 => /lib64/libsepol.so.1 (0x00000039ba200000)
Thanks, Nick
On Sat, 2013-01-12 at 11:50 +0200, Nikolaos Milas wrote:
On 11/1/2013 11:02 μμ, Nikolaos Milas wrote:
I would like to compile Dovecot using custom ldap libraries, located at a particular custom system location.
Sorry, I got it. According to http://wiki2.dovecot.org/CompilingSource I should use:
CPPFLAGS="-I/usr/local/openldap/include" LDFLAGS="-L/usr/local/openldap/lib64 -lldap -llber" ./configure
I found (coincidentally) that it also works simply with "LDFLAGS="-L/usr/local/openldap/lib64" but I guess it is more correct to use the full syntax: LDFLAGS="-L/usr/local/openldap/lib64 -lldap -llber" (or even "... -lldap" only). However, I can't tell the real difference.
No, it's better to not include the -llibs in there. The -ldl in the wiki page was kind of a special case, and since it only served to confuse things I removed it.
If you add the -lldap -llber for LDFLAGS then all of the Dovecot binaries are linked with those, which is unnecessary.
participants (3)
-
Nikolaos Milas
-
Oscar del Rio
-
Timo Sirainen