Skip to content

Commit 766c4d1

Browse files
committed
chore: wip
1 parent 965c647 commit 766c4d1

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

.github/workflows/precompile-php.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ jobs:
201201
echo "Checking OpenLDAP installation:"
202202
ls -la $(brew --prefix openldap)/include/ldap.h || echo "ldap.h not found in expected location"
203203
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
204209
205210
# Create symlinks to help PHP find readline, bzip2, gettext, and openldap
206211
echo "Creating symlinks for readline, bzip2, gettext, and openldap:"
@@ -214,6 +219,7 @@ jobs:
214219
sudo ln -sf $(brew --prefix gettext)/lib/libintl.* /usr/local/lib/
215220
sudo ln -sf $(brew --prefix openldap)/include/ldap.h /usr/local/include/ldap.h
216221
sudo ln -sf $(brew --prefix openldap)/lib/libldap.* /usr/local/lib/
222+
sudo ln -sf $(brew --prefix openldap)/lib/liblber.* /usr/local/lib/
217223
218224
- name: Create build configuration
219225
run: |
@@ -359,9 +365,35 @@ jobs:
359365
export GETTEXT_CFLAGS="-I$(brew --prefix gettext)/include"
360366
export GETTEXT_LIBS="-L$(brew --prefix gettext)/lib -lintl"
361367
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
365397
366398
# Set C++17 flag for ICU4C compatibility
367399
export CXXFLAGS="$CXXFLAGS -std=c++17"

0 commit comments

Comments
 (0)