From 9c08e1ab3f53de9f2d582664a0c7d5415b793ef0 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 24 Jan 2024 13:19:11 +0100 Subject: [PATCH] Fix out of sources tree build (#5239) * Fix out of sources tree build * check in CI is extension can be loaded --- config.m4 | 7 ++++++- scripts/pecl-install.sh | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.m4 b/config.m4 index 2e8c1660211..d68d06b6dff 100644 --- a/config.m4 +++ b/config.m4 @@ -1009,14 +1009,19 @@ EOF AC_DEFINE(SW_USE_MYSQLND, 1, [use mysqlnd]) fi - if test -f "ext-src/php_swoole.cc"; then + AC_MSG_CHECKING([for sources]) + if test -f "$abs_srcdir/ext-src/php_swoole.cc"; then + swoole_source_dir=$abs_srcdir + elif test -f "ext-src/php_swoole.cc"; then swoole_source_dir=$(pwd) else swoole_source_dir="ext/swoole" fi + AC_MSG_RESULT([$swoole_source_dir]) ext_src_files=$(cd $swoole_source_dir && find ext-src/ -name *.cc) lib_src_files=$(cd $swoole_source_dir && find src/ -name *.cc) + swoole_source_file="${ext_src_files} ${lib_src_files}" swoole_source_file="$swoole_source_file \ diff --git a/scripts/pecl-install.sh b/scripts/pecl-install.sh index 41793657348..d13fa0fffd6 100755 --- a/scripts/pecl-install.sh +++ b/scripts/pecl-install.sh @@ -7,5 +7,6 @@ pecl config-show && \ php tools/pecl-package.php && package_file="`ls | grep swoole-*tgz`" && \ echo "\n" | pecl install -f ${package_file} | tee pecl.log && \ cat pecl.log | grep "successfully" && \ +php -d extension=swoole --ri swoole && \ pecl uninstall swoole && \ rm -f pecl.log