for Samba we really have some pain to get the right compile and linker flags for different architectures, especially there, where OpenLDAP is not a first-class citizen like on AIX.
mozldap offers pkg-config files which we will start to use in Samba soon. It would be great if OpenLDAP would offer a pkg-config file also to not have to make wild guesses which linker/compile flags and which paths to use.