diff --git a/src/external/ldap.m4 b/src/external/ldap.m4 index f42023cd44e..24009e680f4 100644 --- a/src/external/ldap.m4 +++ b/src/external/ldap.m4 @@ -69,6 +69,7 @@ AC_CHECK_FUNCS([ldap_control_create ldap_init_fd \ ldap_parse_derefresponse_control \ ldap_derefresponse_free \ ldap_is_ldapc_url]) +AC_ARG_VAR([LDAP_HAVE_CONNCB_CROSS], [A hint about working LDAP connection callbacks for cross-compilation cases]) AC_CHECK_MEMBERS([struct ldap_conncb.lc_arg], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( @@ -80,7 +81,9 @@ AC_CHECK_MEMBERS([struct ldap_conncb.lc_arg], [AC_DEFINE([HAVE_LDAP_CONNCB], [1], [Define if LDAP connection callbacks are available])], [AC_MSG_WARN([Found broken callback implementation])], - [])], + [AS_IF([test "x$LDAP_HAVE_CONNCB_CROSS" = xyes], + [AC_DEFINE([HAVE_LDAP_CONNCB], [1], + [Define if LDAP connection callbacks are available])])])], [], [[#include ]]) AC_CHECK_TYPE([LDAPDerefRes],