[Pdns-users] Building pdns RPMs using custom LDAP libraries/headers

a b tripivceta at hotmail.com
Thu Apr 11 13:20:52 UTC 2013

> I am still puzzled why in my case the above "export" statement was 
> needed, but anyway...

Because a variable setting is only good within the current process; if you do not export (or setenv in C-shells) a variable, the child process(es) will not inherit it.
When you build software, a lot of child processes get created; it does not normally happen within only one process.
> And, if we want to link against the custom ldap libraries:
> CXXFLAGS="${CXXFLAGS} -I/usr/local/openldap/include"; export CXXFLAGS
> LDFLAGS="${LDFLAGS} -L/usr/local/openldap/lib64 -lldap -llber"; export 
> %configure <options>
Please add "-rpath /usr/local/openldap/lib64" to your LDFLAGS so that you do not have to resort to LD_LIBRARY_PATH or ld.so.conf hacks.
>     export CPPFLAGS="-DLDAP_DEPRECATED %{optflags}"
> ...??
> What does "-DLDAP_DEPRECATED" signify?

It sets the LDAP_DEPRECATED macro, which is likely to have a conditional statement somewhere in the code, like this:
#ifdef LDAP_DEPRECATED.........#endif
...or like this:
#if defined (LDAP_DEPRECATED).........#endif
This is used by the C pre-processor (cpp(1)) to decide what to include / omit / expand during the source code pre-processing stage, before that code is passed onto the compiler back end.
To know exactly what that particular macro setting does, you have to find it in the header or program files and see what logic is in there. The answer is in the code. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20130411/1719d39f/attachment-0001.html>

More information about the Pdns-users mailing list