swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.64k stars 3.17k forks source link

#5629 导致静态编译 swoole 时重现无法找到 `PHP_CONFIG` 的问题 #5679

Closed crazywhalecc closed 2 months ago

crazywhalecc commented 2 months ago

5629 导致静态编译阶段还没有 PHP_CONFIG 从而导致不能获取版本的问题又出来了。静态编译时需要 PHP_VERSION 代替 PHP_CONFIG

configure:83526: error: php-config not found
    if test -z "$PHP_CONFIG"; then
        as_fn_error $? "php-config not found" "$LINENO" 5
    fi

config.m4:

if test -z "$PHP_CONFIG"; then
        AC_MSG_ERROR([php-config not found])
    fi

之前的 config.m4:

if test -z "$PHP_VERSION"; then
        if test -z "$PHP_CONFIG"; then
            AC_MSG_ERROR([php-config not found])
        fi
        PHP_VERSION=`$PHP_CONFIG --version`
    fi

    PHP_VERSION_ID=`echo "${PHP_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 10 + [$]2); }'`
matyhtf commented 2 months ago

https://github.com/swoole/swoole-src/commit/32e298ddd82f40c498125394094c4cbb94e1194f