mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 14:55:39 +08:00
Some prerequisites for refactor
This commit is contained in:
@@ -106,6 +106,21 @@ class Config
|
||||
return self::$lib;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws WrongUsageException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public static function getExtTarget(string $name): ?array
|
||||
{
|
||||
if (self::$ext === null) {
|
||||
self::$ext = FileSystem::loadConfigArray('ext');
|
||||
}
|
||||
if (!isset(self::$ext[$name])) {
|
||||
throw new WrongUsageException('ext [' . $name . '] is not supported yet');
|
||||
}
|
||||
return self::$ext[$name]['target'] ?? ['static', 'shared'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
* @throws WrongUsageException
|
||||
|
||||
@@ -40,9 +40,6 @@ class GlobalEnvManager
|
||||
self::putenv('PATH=' . BUILD_ROOT_PATH . '/bin:' . getenv('PATH'));
|
||||
self::putenv('PKG_CONFIG=' . BUILD_BIN_PATH . '/pkg-config');
|
||||
self::putenv('PKG_CONFIG_PATH=' . BUILD_ROOT_PATH . '/lib/pkgconfig');
|
||||
if ($builder instanceof BuilderBase) {
|
||||
self::putenv('SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS=' . ($builder->getOption('no-strip') ? '-g -O0' : '-g -fstack-protector-strong -fpic -fpie -Os -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'));
|
||||
}
|
||||
}
|
||||
|
||||
// Define env vars for linux
|
||||
|
||||
Reference in New Issue
Block a user