On 21 Mar 2025, at 22:09, Eric Covener <cove...@gmail.com> wrote:

> libtool port: https://github.com/covener/zlibtool
> patch attached to get apr-trunk compiling and linking, but ran out of
> time before getting the dlsym in th stub working.
> (./configure --prefix=$PWD/built  --with-expat=$HOME/expat/
> --with-ldap-include=/usr/include --with-ldap-lib=/usr/lib/GLDCLD64.x
> --with-ldap)

I've updated the patch to detect the missing symbols generically, and return 
APR_ENOTIMPL where unsupported.

Can you confirm is this patch works for you? It currently builds fine across 
COPR.

Regards,
Graham
--

Index: ldap/apr_ldap.c
===================================================================
--- ldap/apr_ldap.c     (revision 1924547)
+++ ldap/apr_ldap.c     (working copy)
@@ -770,6 +770,7 @@
 
     switch (option) {
     case APR_LDAP_OPT_API_INFO: {
+#if defined(LDAP_OPT_API_INFO)
         LDAPAPIInfo info = { 0 };
 
         info.ldapai_info_version = LDAP_API_INFO_VERSION;
@@ -783,9 +784,15 @@
         outvalue->info.vendor_version = info.ldapai_vendor_version;
 
         break;
-
+#else
+        result->reason = "LDAP: API info not yet supported by APR on this "
+                         "LDAP SDK";
+        result->rc = LDAP_UNWILLING_TO_PERFORM;
+        return APR_ENOTIMPL;
+#endif
     }
     case APR_LDAP_OPT_API_FEATURE_INFO: {
+#if defined(LDAP_OPT_API_FEATURE_INFO)
         LDAPAPIFeatureInfo ldfi = { 0 };
 
         ldfi.ldapaif_info_version = LDAP_FEATURE_INFO_VERSION;
@@ -797,6 +804,12 @@
 
         break;
 
+#else
+        result->reason = "LDAP: API feature info not yet supported by APR on 
this "
+                         "LDAP SDK";
+        result->rc = LDAP_UNWILLING_TO_PERFORM;
+        return APR_ENOTIMPL;
+#endif
     }
     case APR_LDAP_OPT_PROTOCOL_VERSION: {
 
@@ -811,6 +824,7 @@
         return APR_SUCCESS;
     }
     case APR_LDAP_OPT_DESC: {
+#if defined(LDAP_OPT_DESC)
 
         apr_status_t status = APR_SUCCESS;
 
@@ -829,6 +843,12 @@
         outvalue->socket = ldap->socket;
 
         return status;
+#else
+        result->reason = "LDAP: LDAP_OPT_DESC not yet supported by APR on this 
"
+                         "LDAP SDK";
+        result->rc = LDAP_UNWILLING_TO_PERFORM;
+        return APR_ENOTIMPL;
+#endif
     }
     case APR_LDAP_OPT_URI: {
 #if APR_HAS_OPENLDAP_LDAPSDK
@@ -1035,7 +1055,7 @@
         break;
 
     case APR_LDAP_OPT_PROTOCOL_VERSION:
-        rc = ldap_set_option(ldap ? ldap->ld : NULL, 
LDAP_OPT_PROTOCOL_VERSION, &invalue->pv);
+        rc = ldap_set_option(ldap ? ldap->ld : NULL, 
LDAP_OPT_PROTOCOL_VERSION, (void*)&invalue->pv);
         break;
 
     case APR_LDAP_OPT_HANDLE:
@@ -1054,9 +1074,10 @@
 #endif
 
     case APR_LDAP_OPT_DEREF:
-        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_DEREF, 
&invalue->deref);
+        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_DEREF, 
(void*)&invalue->deref);
         break;
 
+#if !APR_HAS_ZOS_LDAPSDK
     case APR_LDAP_OPT_REFERRALS: {
         void *refs = invalue->refs ? LDAP_OPT_ON : LDAP_OPT_OFF;
 
@@ -1066,6 +1087,7 @@
         break;
 
     }
+#endif
     case APR_LDAP_OPT_REFHOPLIMIT:
 #if defined(LDAP_OPT_REFERRAL_HOP_LIMIT)
         /* Microsoft SDK defines LDAP_OPT_REFERRAL_HOP_LIMIT
@@ -1074,7 +1096,7 @@
 #elif defined(LDAP_OPT_REFHOPLIMIT)
         /* Setting this option is supported on TIVOLI_SDK.
          */
-        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_REFHOPLIMIT, 
&invalue->refhoplimit);
+        rc = ldap_set_option(ldap ? ldap->ld : NULL, LDAP_OPT_REFHOPLIMIT, 
(void*)&invalue->refhoplimit);
 #else
         /* If the LDAP_OPT_REFHOPLIMIT symbol is missing, assume that the
          * particular LDAP library has a reasonable default. So far certain

Reply via email to