mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 23:35:37 +08:00
fix macos, for real this time
This commit is contained in:
@@ -49,13 +49,9 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
throw new WrongUsageException('You must build libphp.a before calling this function.');
|
throw new WrongUsageException('You must build libphp.a before calling this function.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = (SPCTarget::getTargetOS() === 'Linux')
|
if ($out = shell_exec('nm -g --defined-only -P ' . escapeshellarg($libphp) . ' 2>/dev/null')) {
|
||||||
? 'nm -g --defined-only -P ' . escapeshellarg($libphp) . ' 2>/dev/null'
|
|
||||||
: 'nm -gUj ' . escapeshellarg($libphp) . ' 2>/dev/null';
|
|
||||||
$out = shell_exec($cmd) ?: '';
|
|
||||||
if ($out !== '') {
|
|
||||||
foreach (preg_split('/\R/', trim($out)) as $line) {
|
foreach (preg_split('/\R/', trim($out)) as $line) {
|
||||||
if ($line === '') {
|
if ($line === '' || str_ends_with($line, '.o:')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$name = strtok($line, " \t");
|
$name = strtok($line, " \t");
|
||||||
|
|||||||
@@ -50,13 +50,13 @@ $prefer_pre_built = false;
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'swoole,swoole-hook-mysql,swoole-hook-pgsql,swoole-hook-sqlite,swoole-hook-odbc,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib',
|
'Linux', 'Darwin' => 'bcmath',
|
||||||
'Windows' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip',
|
'Windows' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip',
|
||||||
};
|
};
|
||||||
|
|
||||||
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
||||||
$shared_extensions = match (PHP_OS_FAMILY) {
|
$shared_extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux' => '',
|
'Linux' => 'zip',
|
||||||
'Darwin' => '',
|
'Darwin' => '',
|
||||||
'Windows' => '',
|
'Windows' => '',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user