Skip to content

Commit 51566dd

Browse files
committed
chore: wip
1 parent e613ce1 commit 51566dd

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

scripts/build-php.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,31 @@ export php_cv_func_shm_open_ok=yes
16881688
export php_cv_shm_ipc=yes
16891689
export php_cv_shm_mmap_anon=yes
16901690
export php_cv_shm_mmap_posix=yes
1691+
# Additional library-specific cache variables for older PHP versions (8.2.x, 8.3.x)
1692+
# On macOS, shm_open is in the system C library, not in separate -lrt or -lroot libraries
1693+
# Skip the problematic library tests entirely by setting function tests to yes
1694+
export ac_cv_lib_rt_shm_open=no
1695+
export ac_cv_lib_rt___shm_open=no
1696+
export ac_cv_lib_rt_shm_unlink=no
1697+
export ac_cv_lib_root_shm_open=no
1698+
export ac_cv_lib_root___shm_open=no
1699+
# For PHP 8.2.x, patch the configure script to fix shared memory detection
1700+
# Since environment variables are overridden, we need to patch the actual checks
1701+
if [ ! -f configure.patched ]; then
1702+
# Backup original configure script
1703+
cp configure configure.original
1704+
1705+
# Patch the configure script to override shared memory detection results
1706+
# Replace the cross-compilation fallbacks with forced "yes" values
1707+
sed -i.bak \\
1708+
-e 's/have_shm_ipc=no/have_shm_ipc=yes/g' \\
1709+
-e 's/have_shm_mmap_anon=no/have_shm_mmap_anon=yes/g' \\
1710+
-e 's/have_shm_mmap_posix=no/have_shm_mmap_posix=yes/g' \\
1711+
configure
1712+
1713+
# Mark as patched
1714+
touch configure.patched
1715+
fi
16911716
16921717
exec ./configure "$@"
16931718
`
@@ -1820,6 +1845,31 @@ export php_cv_func_shm_open_ok=yes
18201845
export php_cv_shm_ipc=yes
18211846
export php_cv_shm_mmap_anon=yes
18221847
export php_cv_shm_mmap_posix=yes
1848+
# Additional library-specific cache variables for older PHP versions (8.2.x, 8.3.x)
1849+
# On macOS, shm_open is in the system C library, not in separate -lrt or -lroot libraries
1850+
# Skip the problematic library tests entirely by setting function tests to yes
1851+
export ac_cv_lib_rt_shm_open=no
1852+
export ac_cv_lib_rt___shm_open=no
1853+
export ac_cv_lib_rt_shm_unlink=no
1854+
export ac_cv_lib_root_shm_open=no
1855+
export ac_cv_lib_root___shm_open=no
1856+
# For PHP 8.2.x, patch the configure script to fix shared memory detection
1857+
# Since environment variables are overridden, we need to patch the actual checks
1858+
if [ ! -f configure.patched ]; then
1859+
# Backup original configure script
1860+
cp configure configure.original
1861+
1862+
# Patch the configure script to override shared memory detection results
1863+
# Replace the cross-compilation fallbacks with forced "yes" values
1864+
sed -i.bak \\
1865+
-e 's/have_shm_ipc=no/have_shm_ipc=yes/g' \\
1866+
-e 's/have_shm_mmap_anon=no/have_shm_mmap_anon=yes/g' \\
1867+
-e 's/have_shm_mmap_posix=no/have_shm_mmap_posix=yes/g' \\
1868+
configure
1869+
1870+
# Mark as patched
1871+
touch configure.patched
1872+
fi
18231873
18241874
exec ./configure "$@"
18251875
`

0 commit comments

Comments
 (0)