mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
add dist name getter for extension
This commit is contained in:
parent
84daa9b151
commit
f4ebca927b
@ -112,6 +112,17 @@ class Extension
|
|||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns extension dist name
|
||||||
|
*/
|
||||||
|
public function getDistName(): string
|
||||||
|
{
|
||||||
|
return match ($this->name) {
|
||||||
|
'mbregex' => 'mbstring',
|
||||||
|
default => $this->name,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@ -183,6 +194,21 @@ class Extension
|
|||||||
$arg .= ' --with-event-openssl --with-openssl-dir="' . BUILD_ROOT_PATH . '"';
|
$arg .= ' --with-event-openssl --with-openssl-dir="' . BUILD_ROOT_PATH . '"';
|
||||||
}
|
}
|
||||||
break;*/
|
break;*/
|
||||||
|
case 'enchant':
|
||||||
|
$glibs = [
|
||||||
|
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libgio-2.0.a',
|
||||||
|
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libglib-2.0.a',
|
||||||
|
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libgmodule-2.0.a',
|
||||||
|
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libgobject-2.0.a',
|
||||||
|
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libgthread-2.0.a',
|
||||||
|
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libintl.a',
|
||||||
|
];
|
||||||
|
$arg = ' --with-enchant="' . BUILD_ROOT_PATH . '"';
|
||||||
|
$arg .= ' ENCHANT2_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '/enchant-2"';
|
||||||
|
$arg .= ' ENCHANT2_LIBS="' . $this->getLibFilesString() . '"';
|
||||||
|
$arg .= ' GLIB_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '"';
|
||||||
|
$arg .= ' GLIB_LIBS="' . implode(' ', $glibs) . '"';
|
||||||
|
break;
|
||||||
case 'iconv':
|
case 'iconv':
|
||||||
$arg = ' --with-iconv="' . BUILD_ROOT_PATH . '"';
|
$arg = ' --with-iconv="' . BUILD_ROOT_PATH . '"';
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -68,7 +68,7 @@ trait UnixBuilderTrait
|
|||||||
}
|
}
|
||||||
foreach ($this->exts as $ext) {
|
foreach ($this->exts as $ext) {
|
||||||
logger()->debug('testing ext: ' . $ext->getName());
|
logger()->debug('testing ext: ' . $ext->getName());
|
||||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri ' . $ext->getName(), false);
|
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri ' . $ext->getDistName(), false);
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new RuntimeException('extension ' . $ext->getName() . ' failed compile check');
|
throw new RuntimeException('extension ' . $ext->getName() . ' failed compile check');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user