@@ -201,6 +201,11 @@ jobs:
201
201
echo "Checking OpenLDAP installation:"
202
202
ls -la $(brew --prefix openldap)/include/ldap.h || echo "ldap.h not found in expected location"
203
203
ls -la $(brew --prefix openldap)/lib/libldap.* || echo "libldap not found in expected location"
204
+ ls -la $(brew --prefix openldap)/lib/liblber.* || echo "liblber not found in expected location"
205
+ echo "OpenLDAP include directory contents:"
206
+ ls -la $(brew --prefix openldap)/include/ | head -10
207
+ echo "OpenLDAP lib directory contents:"
208
+ ls -la $(brew --prefix openldap)/lib/ | head -10
204
209
205
210
# Create symlinks to help PHP find readline, bzip2, gettext, and openldap
206
211
echo "Creating symlinks for readline, bzip2, gettext, and openldap:"
@@ -214,6 +219,7 @@ jobs:
214
219
sudo ln -sf $(brew --prefix gettext)/lib/libintl.* /usr/local/lib/
215
220
sudo ln -sf $(brew --prefix openldap)/include/ldap.h /usr/local/include/ldap.h
216
221
sudo ln -sf $(brew --prefix openldap)/lib/libldap.* /usr/local/lib/
222
+ sudo ln -sf $(brew --prefix openldap)/lib/liblber.* /usr/local/lib/
217
223
218
224
- name : Create build configuration
219
225
run : |
@@ -359,9 +365,35 @@ jobs:
359
365
export GETTEXT_CFLAGS="-I$(brew --prefix gettext)/include"
360
366
export GETTEXT_LIBS="-L$(brew --prefix gettext)/lib -lintl"
361
367
362
- # Set OpenLDAP environment variables
363
- export LDAP_CFLAGS="-I$(brew --prefix openldap)/include"
364
- export LDAP_LIBS="-L$(brew --prefix openldap)/lib -lldap -llber"
368
+ # Check if both LDAP libraries are available
369
+ echo "Debug: Checking for lber library:"
370
+ ls -la $(brew --prefix openldap)/lib/liblber.* 2>/dev/null || echo " lber library not found"
371
+ echo "Debug: Checking for ldap library:"
372
+ ls -la $(brew --prefix openldap)/lib/libldap.* 2>/dev/null || echo " ldap library not found"
373
+
374
+ if [[ -f "$(brew --prefix openldap)/lib/liblber.dylib" ]] && [[ -f "$(brew --prefix openldap)/lib/libldap.dylib" ]]; then
375
+ echo "Both LDAP libraries found, enabling LDAP support"
376
+ LDAP_AVAILABLE=true
377
+ else
378
+ echo "LDAP libraries not found, disabling LDAP support"
379
+ LDAP_AVAILABLE=false
380
+ # Remove LDAP from CONFIGURE_EXTENSIONS
381
+ export CONFIGURE_EXTENSIONS=$(echo "$CONFIGURE_EXTENSIONS" | sed 's/--with-ldap//g' | sed 's/ */ /g')
382
+ echo "Updated CONFIGURE_EXTENSIONS: $CONFIGURE_EXTENSIONS"
383
+ fi
384
+
385
+ # Set OpenLDAP environment variables (only if libraries are available)
386
+ if [[ "$LDAP_AVAILABLE" == "true" ]]; then
387
+ export LDAP_CFLAGS="-I$(brew --prefix openldap)/include"
388
+ export LDAP_LIBS="-L$(brew --prefix openldap)/lib -lldap -llber"
389
+ echo "Debug: LDAP_CFLAGS=$LDAP_CFLAGS"
390
+ echo "Debug: LDAP_LIBS=$LDAP_LIBS"
391
+ else
392
+ # Clear LDAP environment variables if not available
393
+ unset LDAP_CFLAGS
394
+ unset LDAP_LIBS
395
+ echo "Debug: LDAP environment variables cleared"
396
+ fi
365
397
366
398
# Set C++17 flag for ICU4C compatibility
367
399
export CXXFLAGS="$CXXFLAGS -std=c++17"
0 commit comments