8000 Fix config.m4 when using custom dep paths (#2453) · phpredis/phpredis@ece3f7b · GitHub
[go: up one dir, main page]

Skip to content

Commit ece3f7b

Browse files
Fix config.m4 when using custom dep paths (#2453)
* We need both PHP_ADD_LIBRARY_WITH_PATH and PHP_ADD_INCLUDE Fixes #2452 * Add an initial test block for ./configure correctness.
1 parent 77ab62b commit ece3f7b

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,72 @@
11
on: [push, pull_request]
22

33
jobs:
4+
configured-deps:
5+
runs-on: ubuntu-latest
6+
continue-on-error: false
7+
strategy:
8+
fail-fast: true
9+
matrix:
10+
php: ['8.3']
11+
steps:
12+
- name: Checkout PhpRedis
13+
uses: actions/checkout@v4
14+
15+
- name: Install liblzf
16+
run: |
17+
git clone --depth=1 https://github.com/nemequ/liblzf.git
18+
cd liblzf
19+
autoreconf -vi
20+
CFLAGS=-fPIC ./configure --prefix="$GITHUB_WORKSPACE/liblzf"
21+
make install
22+
23+
- name: Install liblz4
24+
run: |
25+
git clone -b v1.9.4 --depth=1 https://github.com/lz4/lz4
26+
cd lz4/lib
27+
PREFIX="$GITHUB_WORKSPACE/liblz4" make install
28+
29+
- name: Install libzstd
30+
run: |
31+
git clone -b v1.5.5 --depth=1 https://github.com/facebook/zstd
32+
cd zstd
33+
PREFIX="$GITHUB_WORKSPACE/libzstd" make install
34+
35+
- name: Install PHP ${{ matrix.php }}
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: ${{ matrix.php }}
39+
extensions: json, igbinary, msgpack, :redis
40+
coverage: none
41+
tools: none
42+
43+
- name: Configure and build PhpRedis with distinct dep paths
44+
run: |
45+
phpize
46+
./configure \
47+
--enable-redis-lz4 \
48+
--with-liblz4="$GITHUB_WORKSPACE/liblz4" \
49+
--enable-redis-lzf \
50+
--with-liblzf="$GITHUB_WORKSPACE/liblzf" \
51+
--enable-redis-zstd \
52+
--with-libzstd="$GITHUB_WORKSPACE/libzstd"
53+
sudo make -j"$(nproc)"
54+
55+
- name: Make sure we're linking against specific liblz4
56+
run: |
57+
grep "INCLUDES.*$GITHUB_WORKSPACE/liblz4" Makefile
58+
grep "REDIS_SHARED_LIBADD.*-L$GITHUB_WORKSPACE/liblz4" Makefile
59+
60+
- name: Make sure we're linking against specific liblzf
61+
run: |
62+
grep "INCLUDES.*$GITHUB_WORKSPACE/liblzf" Makefile
63+
grep "REDIS_SHARED_LIBADD.*-L$GITHUB_WORKSPACE/liblzf" Makefile
64+
65+
- name: Make sure we're linking against specific libzstd
66+
run: |
67+
grep "INCLUDES.*$GITHUB_WORKSPACE/libzstd" Makefile
68+
grep "REDIS_SHARED_LIBADD.*-L$GITHUB_WORKSPACE/libzstd" Makefile
69+
470
ubuntu:
571
runs-on: ubuntu-latest
672
continue-on-error: false

config.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ if test "$PHP_REDIS" != "no"; then
221221
PHP_CHECK_LIBRARY(lzf, lzf_compress,
222222
[
223223
PHP_ADD_LIBRARY_WITH_PATH(lzf, $LIBLZF_DIR/$PHP_LIBDIR, REDIS_SHARED_LIBADD)
224+
PHP_ADD_INCLUDE($LIBLZF_DIR/include)
224225
], [
225226
AC_MSG_ERROR([could not find usable liblzf])
226227
], [
@@ -263,12 +264,12 @@ if test "$PHP_REDIS" != "no"; then
263264
PHP_CHECK_LIBRARY(lz4, LZ4_compress,
264265
[
265266
PHP_ADD_LIBRARY_WITH_PATH(lz4, $LIBLZ4_DIR/$PHP_LIBDIR, REDIS_SHARED_LIBADD)
267+
PHP_ADD_INCLUDE($LIBLZ4_DIR/include)
266268
], [
267269
AC_MSG_ERROR([could not find usable liblz4])
268270
], [
269271
-L$LIBLZ4_DIR/$PHP_LIBDIR
270272
])
271-
PHP_SUBST(REDIS_SHARED_LIBADD)
272273
else
273274
AC_MSG_ERROR([only system liblz4 is supported])
274275
fi
@@ -307,6 +308,7 @@ if test "$PHP_REDIS" != "no"; then
307308
PHP_CHECK_LIBRARY(zstd, ZSTD_getFrameContentSize,
308309
[
309310
PHP_ADD_LIBRARY_WITH_PATH(zstd, $LIBZSTD_DIR/$PHP_LIBDIR, REDIS_SHARED_LIBADD)
311+
PHP_ADD_INCLUDE($LIBZSTD_DIR/include)
310312
], [
311313
AC_MSG_ERROR([could not find usable libzstd, version 1.3.0 required])
312314
], [

0 commit comments

Comments
 (0)
0