@@ -175,6 +175,18 @@ jobs:
175
175
zlib \
176
176
libiconv
177
177
178
+ # Verify readline installation
179
+ echo "Checking readline installation:"
180
+ ls -la $(brew --prefix readline)/include/readline/readline.h || echo "readline.h not found in expected location"
181
+ ls -la $(brew --prefix readline)/lib/libreadline.* || echo "libreadline not found in expected location"
182
+
183
+ # Create symlinks to help PHP find readline
184
+ echo "Creating symlinks for readline:"
185
+ sudo mkdir -p /usr/local/include/readline
186
+ sudo ln -sf $(brew --prefix readline)/include/readline/readline.h /usr/local/include/readline/readline.h
187
+ sudo ln -sf $(brew --prefix readline)/include/readline/history.h /usr/local/include/readline/history.h
188
+ sudo ln -sf $(brew --prefix readline)/lib/libreadline.* /usr/local/lib/
189
+
178
190
- name : Create build configuration
179
191
run : |
180
192
mkdir -p ${{ env.BUILD_DIR }} ${{ env.OUTPUT_DIR }}
@@ -212,6 +224,10 @@ jobs:
212
224
echo "LDFLAGS=-L$(brew --prefix)/lib -L$(brew --prefix openssl@3)/lib" >> $GITHUB_ENV
213
225
echo "CPPFLAGS=-I$(brew --prefix)/include -I$(brew --prefix openssl@3)/include" >> $GITHUB_ENV
214
226
227
+ # Set readline-specific paths
228
+ echo "READLINE_CFLAGS=-I$(brew --prefix readline)/include" >> $GITHUB_ENV
229
+ echo "READLINE_LIBS=-L$(brew --prefix readline)/lib -lreadline" >> $GITHUB_ENV
230
+
215
231
- name : Download and extract PHP source
216
232
run : |
217
233
cd ${{ env.BUILD_DIR }}
@@ -235,7 +251,20 @@ jobs:
235
251
# Configure with platform-specific options
236
252
if [[ "${{ matrix.platform }}" == "darwin" ]]; then
237
253
# On macOS, use Homebrew-installed libraries
238
- EXTRA_CONFIG="--with-iconv=$(brew --prefix libiconv)"
254
+ # Set environment variables for readline detection
255
+ export CPPFLAGS="$CPPFLAGS -I$(brew --prefix readline)/include"
256
+ export LDFLAGS="$LDFLAGS -L$(brew --prefix readline)/lib"
257
+ export LIBS="$LIBS -lreadline"
258
+
259
+ # Try to find readline.h and set the path explicitly
260
+ READLINE_PATH=$(brew --prefix readline)
261
+ if [[ -f "$READLINE_PATH/include/readline/readline.h" ]]; then
262
+ echo "Found readline.h at $READLINE_PATH/include/readline/readline.h"
263
+ EXTRA_CONFIG="--with-iconv=$(brew --prefix libiconv) --with-readline=$READLINE_PATH"
264
+ else
265
+ echo "readline.h not found, disabling readline support"
266
+ EXTRA_CONFIG="--with-iconv=$(brew --prefix libiconv) --disable-readline"
267
+ fi
239
268
else
240
269
# On Linux, use system-installed libraries
241
270
# System libraries should be available via apt-get installation
@@ -248,6 +277,17 @@ jobs:
248
277
echo " Prefix: $INSTALL_PREFIX"
249
278
echo " Extra config: $EXTRA_CONFIG"
250
279
280
+ # Debug: Check readline installation on macOS
281
+ if [[ "${{ matrix.platform }}" == "darwin" ]]; then
282
+ echo "Debug: Checking readline installation on macOS:"
283
+ echo " READLINE_CFLAGS: $READLINE_CFLAGS"
284
+ echo " READLINE_LIBS: $READLINE_LIBS"
285
+ echo " CPPFLAGS: $CPPFLAGS"
286
+ echo " LDFLAGS: $LDFLAGS"
287
+ echo " Checking if readline.h exists:"
288
+ find $(brew --prefix) -name "readline.h" 2>/dev/null || echo " No readline.h found"
289
+ fi
290
+
251
291
# Check if libcurl is found via pkg-config
252
292
if pkg-config --exists libcurl; then
253
293
echo "libcurl found via pkg-config"
0 commit comments