mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 16:25:39 +08:00
Use existing pkg-config builds and pre-built contents for packages
This commit is contained in:
@@ -7,7 +7,6 @@ namespace SPC\util;
|
||||
use SPC\builder\macos\SystemUtil;
|
||||
use SPC\exception\SPCInternalException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\pkg\PkgConfig;
|
||||
use SPC\toolchain\ToolchainManager;
|
||||
|
||||
/**
|
||||
@@ -40,7 +39,7 @@ class GlobalEnvManager
|
||||
// Define env vars for unix
|
||||
if (is_unix()) {
|
||||
self::addPathIfNotExists(BUILD_BIN_PATH);
|
||||
self::putenv('PKG_CONFIG=' . PkgConfig::getEnvironment()['PATH'] . '/pkg-config');
|
||||
self::addPathIfNotExists(PKG_ROOT_PATH . '/bin');
|
||||
self::putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
|
||||
}
|
||||
|
||||
@@ -123,6 +122,14 @@ class GlobalEnvManager
|
||||
self::putenv("YACC={$yacc}");
|
||||
}
|
||||
}
|
||||
|
||||
// init pkg-config for unix
|
||||
if (is_unix()) {
|
||||
if (($found = PkgConfigUtil::findPkgConfig()) === null) {
|
||||
throw new WrongUsageException('Cannot find pkg-config executable. Please run `doctor` to fix this.');
|
||||
}
|
||||
self::putenv("PKG_CONFIG={$found}");
|
||||
}
|
||||
}
|
||||
|
||||
private static function readIniFile(): array
|
||||
|
||||
Reference in New Issue
Block a user