2023-03-18 17:32:21 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\macos;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\BuilderBase;
|
|
|
|
|
use SPC\builder\macos\library\MacOSLibraryBase;
|
|
|
|
|
use SPC\builder\traits\UnixBuilderTrait;
|
|
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
2023-03-29 21:39:36 +08:00
|
|
|
use SPC\exception\WrongUsageException;
|
2023-10-01 01:32:43 +08:00
|
|
|
use SPC\store\FileSystem;
|
2023-04-30 12:42:19 +08:00
|
|
|
use SPC\store\SourcePatcher;
|
2023-03-18 17:32:21 +08:00
|
|
|
|
|
|
|
|
class MacOSBuilder extends BuilderBase
|
|
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
/** Unix compatible builder methods */
|
2023-03-18 17:32:21 +08:00
|
|
|
use UnixBuilderTrait;
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
/** @var bool Micro patch phar flag */
|
2023-03-18 17:32:21 +08:00
|
|
|
private bool $phar_patched = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @throws RuntimeException
|
2023-03-29 21:39:36 +08:00
|
|
|
* @throws WrongUsageException
|
2023-08-20 19:51:45 +08:00
|
|
|
* @throws FileSystemException
|
2023-03-18 17:32:21 +08:00
|
|
|
*/
|
2023-08-20 19:51:45 +08:00
|
|
|
public function __construct(array $options = [])
|
2023-03-18 17:32:21 +08:00
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
$this->options = $options;
|
|
|
|
|
|
|
|
|
|
// ---------- set necessary options ----------
|
|
|
|
|
// set C Compiler (default: clang)
|
2023-10-23 00:37:28 +08:00
|
|
|
f_putenv('CC=' . $this->getOption('cc', 'clang'));
|
2023-08-20 19:51:45 +08:00
|
|
|
// set C++ Composer (default: clang++)
|
2023-10-23 00:37:28 +08:00
|
|
|
f_putenv('CXX=' . $this->getOption('cxx', 'clang++'));
|
|
|
|
|
// set PATH
|
|
|
|
|
f_putenv('PATH=' . BUILD_ROOT_PATH . '/bin:' . getenv('PATH'));
|
|
|
|
|
// set PKG_CONFIG
|
|
|
|
|
f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config');
|
|
|
|
|
// set PKG_CONFIG_PATH
|
|
|
|
|
f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig/');
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
// set arch (default: current)
|
|
|
|
|
$this->setOptionIfNotExist('arch', php_uname('m'));
|
|
|
|
|
$this->setOptionIfNotExist('gnu-arch', arch2gnu($this->getOption('arch')));
|
|
|
|
|
|
|
|
|
|
// ---------- set necessary compile environments ----------
|
|
|
|
|
// concurrency
|
2023-03-18 17:32:21 +08:00
|
|
|
$this->concurrency = SystemUtil::getCpuCount();
|
2023-08-20 19:51:45 +08:00
|
|
|
// cflags
|
|
|
|
|
$this->arch_c_flags = SystemUtil::getArchCFlags($this->getOption('arch'));
|
|
|
|
|
$this->arch_cxx_flags = SystemUtil::getArchCFlags($this->getOption('arch'));
|
|
|
|
|
// cmake toolchain
|
|
|
|
|
$this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile('Darwin', $this->getOption('arch'), $this->arch_c_flags);
|
|
|
|
|
|
|
|
|
|
// create pkgconfig and include dir (some libs cannot create them automatically)
|
2023-03-18 17:32:21 +08:00
|
|
|
f_mkdir(BUILD_LIB_PATH . '/pkgconfig', recursive: true);
|
|
|
|
|
f_mkdir(BUILD_INCLUDE_PATH, recursive: true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-20 19:51:45 +08:00
|
|
|
* [deprecated] 生成库构建采用的 autoconf 参数列表
|
2023-03-18 17:32:21 +08:00
|
|
|
*
|
|
|
|
|
* @param string $name 要构建的 lib 库名,传入仅供输出日志
|
|
|
|
|
* @param array $lib_specs 依赖的 lib 库的 autoconf 文件
|
|
|
|
|
*/
|
|
|
|
|
public function makeAutoconfArgs(string $name, array $lib_specs): string
|
|
|
|
|
{
|
|
|
|
|
$ret = '';
|
|
|
|
|
foreach ($lib_specs as $libName => $arr) {
|
|
|
|
|
$lib = $this->getLib($libName);
|
|
|
|
|
|
|
|
|
|
$arr = $arr ?? [];
|
|
|
|
|
|
|
|
|
|
$disableArgs = $arr[0] ?? null;
|
|
|
|
|
if ($lib instanceof MacOSLibraryBase) {
|
|
|
|
|
logger()->info("{$name} \033[32;1mwith\033[0;1m {$libName} support");
|
2023-04-29 18:59:47 +08:00
|
|
|
$ret .= '--with-' . $libName . '=yes ';
|
2023-03-18 17:32:21 +08:00
|
|
|
} else {
|
|
|
|
|
logger()->info("{$name} \033[31;1mwithout\033[0;1m {$libName} support");
|
|
|
|
|
$ret .= ($disableArgs ?? "--with-{$libName}=no") . ' ';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return rtrim($ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-20 19:51:45 +08:00
|
|
|
* Get dynamically linked macOS frameworks
|
2023-03-18 17:32:21 +08:00
|
|
|
*
|
2023-08-20 19:51:45 +08:00
|
|
|
* @param bool $asString If true, return as string
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
* @throws WrongUsageException
|
2023-03-18 17:32:21 +08:00
|
|
|
*/
|
|
|
|
|
public function getFrameworks(bool $asString = false): array|string
|
|
|
|
|
{
|
|
|
|
|
$libs = [];
|
|
|
|
|
|
|
|
|
|
// reorder libs
|
|
|
|
|
foreach ($this->libs as $lib) {
|
|
|
|
|
foreach ($lib->getDependencies() as $dep) {
|
|
|
|
|
$libs[] = $dep;
|
|
|
|
|
}
|
|
|
|
|
$libs[] = $lib;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$frameworks = [];
|
|
|
|
|
/** @var MacOSLibraryBase $lib */
|
|
|
|
|
foreach ($libs as $lib) {
|
|
|
|
|
array_push($frameworks, ...$lib->getFrameworks());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($asString) {
|
|
|
|
|
return implode(' ', array_map(fn ($x) => "-framework {$x}", $frameworks));
|
|
|
|
|
}
|
|
|
|
|
return $frameworks;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-20 19:51:45 +08:00
|
|
|
* Just start to build statically linked php binary
|
|
|
|
|
*
|
2023-07-24 23:49:52 +08:00
|
|
|
* @param int $build_target build target
|
2023-03-18 17:32:21 +08:00
|
|
|
* @throws FileSystemException
|
2023-07-24 23:49:52 +08:00
|
|
|
* @throws RuntimeException
|
|
|
|
|
* @throws WrongUsageException
|
2023-03-18 17:32:21 +08:00
|
|
|
*/
|
2023-08-20 19:51:45 +08:00
|
|
|
public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
|
2023-03-18 17:32:21 +08:00
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
// ---------- Update extra-libs ----------
|
|
|
|
|
$extra_libs = $this->getOption('extra-libs', '');
|
|
|
|
|
// add macOS frameworks
|
|
|
|
|
$extra_libs .= (empty($extra_libs) ? '' : ' ') . $this->getFrameworks(true);
|
|
|
|
|
// add libc++, some extensions or libraries need it (C++ cannot be linked statically)
|
2023-10-23 00:37:28 +08:00
|
|
|
$extra_libs .= (empty($extra_libs) ? '' : ' ') . ($this->hasCpp() ? '-lc++ ' : '');
|
2023-08-20 19:51:45 +08:00
|
|
|
if (!$this->getOption('bloat', false)) {
|
|
|
|
|
$extra_libs .= (empty($extra_libs) ? '' : ' ') . implode(' ', $this->getAllStaticLibFiles());
|
2023-03-18 17:32:21 +08:00
|
|
|
} else {
|
|
|
|
|
logger()->info('bloat linking');
|
2023-08-20 19:51:45 +08:00
|
|
|
$extra_libs .= (empty($extra_libs) ? '' : ' ') . implode(' ', array_map(fn ($x) => "-Wl,-force_load,{$x}", array_filter($this->getAllStaticLibFiles())));
|
2023-03-18 17:32:21 +08:00
|
|
|
}
|
2023-08-20 19:51:45 +08:00
|
|
|
$this->setOption('extra-libs', $extra_libs);
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-07-28 23:45:39 +08:00
|
|
|
SourcePatcher::patchBeforeBuildconf($this);
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-04-15 18:45:34 +08:00
|
|
|
shell()->cd(SOURCE_PATH . '/php-src')->exec('./buildconf --force');
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-07-28 23:45:39 +08:00
|
|
|
SourcePatcher::patchBeforeConfigure($this);
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
$json_74 = $this->getPHPVersionID() < 80000 ? '--enable-json ' : '';
|
2023-08-21 12:47:06 +02:00
|
|
|
$zts = $this->getOption('enable-zts', false) ? '--enable-zts --disable-zend-signals ' : '';
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-08-21 09:30:46 +02:00
|
|
|
$enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI;
|
|
|
|
|
$enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
|
|
|
|
|
$enableMicro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
|
|
|
|
|
$enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
|
|
|
|
|
|
2024-01-03 10:31:21 +08:00
|
|
|
// prepare build php envs
|
|
|
|
|
$envs_build_php = SystemUtil::makeEnvVarString([
|
|
|
|
|
'CFLAGS' => " {$this->arch_c_flags} -Werror=unknown-warning-option ",
|
|
|
|
|
'CPPFLAGS' => '-I' . BUILD_INCLUDE_PATH,
|
|
|
|
|
'LDFLAGS' => '-L' . BUILD_LIB_PATH,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
if ($this->getLib('postgresql')) {
|
|
|
|
|
shell()
|
|
|
|
|
->cd(SOURCE_PATH . '/php-src')
|
|
|
|
|
->exec(
|
|
|
|
|
'sed -i.backup "s/ac_cv_func_explicit_bzero\" = xyes/ac_cv_func_explicit_bzero\" = x_fake_yes/" ./configure'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-15 18:45:34 +08:00
|
|
|
shell()->cd(SOURCE_PATH . '/php-src')
|
|
|
|
|
->exec(
|
|
|
|
|
'./configure ' .
|
|
|
|
|
'--prefix= ' .
|
2023-08-20 19:51:45 +08:00
|
|
|
'--with-valgrind=no ' . // Not detect memory leak
|
2023-04-15 18:45:34 +08:00
|
|
|
'--enable-shared=no ' .
|
|
|
|
|
'--enable-static=yes ' .
|
|
|
|
|
'--disable-all ' .
|
|
|
|
|
'--disable-cgi ' .
|
|
|
|
|
'--disable-phpdbg ' .
|
2023-09-02 21:25:33 +02:00
|
|
|
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
|
|
|
|
($enableFpm ? '--enable-fpm ' : '--disable-fpm ') .
|
|
|
|
|
($enableEmbed ? '--enable-embed=static ' : '--disable-embed ') .
|
|
|
|
|
($enableMicro ? '--enable-micro ' : '--disable-micro ') .
|
2023-08-20 19:51:45 +08:00
|
|
|
$json_74 .
|
|
|
|
|
$zts .
|
2024-01-03 10:31:21 +08:00
|
|
|
$this->makeExtensionArgs() . ' ' .
|
|
|
|
|
$envs_build_php
|
2023-04-15 18:45:34 +08:00
|
|
|
);
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-07-28 23:45:39 +08:00
|
|
|
SourcePatcher::patchBeforeMake($this);
|
2023-04-30 12:42:19 +08:00
|
|
|
|
2023-03-26 22:27:51 +08:00
|
|
|
$this->cleanMake();
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-08-21 09:30:46 +02:00
|
|
|
if ($enableCli) {
|
2023-04-23 20:31:58 +08:00
|
|
|
logger()->info('building cli');
|
2023-08-20 19:51:45 +08:00
|
|
|
$this->buildCli();
|
2023-04-23 20:31:58 +08:00
|
|
|
}
|
2023-08-21 09:30:46 +02:00
|
|
|
if ($enableFpm) {
|
2023-04-23 20:31:58 +08:00
|
|
|
logger()->info('building fpm');
|
2023-08-20 19:51:45 +08:00
|
|
|
$this->buildFpm();
|
2023-04-23 20:31:58 +08:00
|
|
|
}
|
2023-08-21 09:30:46 +02:00
|
|
|
if ($enableMicro) {
|
2023-04-23 20:31:58 +08:00
|
|
|
logger()->info('building micro');
|
2023-08-20 19:51:45 +08:00
|
|
|
$this->buildMicro();
|
2023-03-18 17:32:21 +08:00
|
|
|
}
|
2023-08-21 09:30:46 +02:00
|
|
|
if ($enableEmbed) {
|
|
|
|
|
logger()->info('building embed');
|
2023-10-01 01:32:43 +08:00
|
|
|
if ($enableMicro) {
|
|
|
|
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/Makefile', 'OVERALL_TARGET =', 'OVERALL_TARGET = libphp.la');
|
|
|
|
|
}
|
2023-08-21 09:30:46 +02:00
|
|
|
$this->buildEmbed();
|
|
|
|
|
}
|
2023-03-18 17:32:21 +08:00
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
if (php_uname('m') === $this->getOption('arch')) {
|
2023-04-23 20:31:58 +08:00
|
|
|
$this->sanityCheck($build_target);
|
2023-03-18 17:32:21 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-20 19:51:45 +08:00
|
|
|
* Build cli sapi
|
2023-03-18 17:32:21 +08:00
|
|
|
*
|
|
|
|
|
* @throws RuntimeException
|
2023-04-23 20:31:58 +08:00
|
|
|
* @throws FileSystemException
|
|
|
|
|
*/
|
2023-08-20 19:51:45 +08:00
|
|
|
public function buildCli(): void
|
2023-04-23 20:31:58 +08:00
|
|
|
{
|
2024-01-03 10:31:21 +08:00
|
|
|
$vars = SystemUtil::makeEnvVarString($this->getBuildVars());
|
2023-08-20 19:51:45 +08:00
|
|
|
|
2023-05-10 21:59:33 +08:00
|
|
|
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
2023-08-20 19:51:45 +08:00
|
|
|
$shell->exec("make -j{$this->concurrency} {$vars} cli");
|
|
|
|
|
if (!$this->getOption('no-strip', false)) {
|
2023-05-10 21:59:33 +08:00
|
|
|
$shell->exec('dsymutil -f sapi/cli/php')->exec('strip sapi/cli/php');
|
|
|
|
|
}
|
2023-04-23 20:31:58 +08:00
|
|
|
$this->deployBinary(BUILD_TARGET_CLI);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-20 19:51:45 +08:00
|
|
|
* Build phpmicro sapi
|
2023-04-23 20:31:58 +08:00
|
|
|
*
|
2023-10-23 00:37:28 +08:00
|
|
|
* @throws FileSystemException
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
* @throws WrongUsageException
|
2023-03-18 17:32:21 +08:00
|
|
|
*/
|
2023-08-20 19:51:45 +08:00
|
|
|
public function buildMicro(): void
|
2023-03-18 17:32:21 +08:00
|
|
|
{
|
2023-03-18 20:08:54 +08:00
|
|
|
if ($this->getPHPVersionID() < 80000) {
|
2023-10-23 00:37:28 +08:00
|
|
|
throw new WrongUsageException('phpmicro only support PHP >= 8.0!');
|
2023-03-18 20:08:54 +08:00
|
|
|
}
|
2023-03-18 17:32:21 +08:00
|
|
|
if ($this->getExt('phar')) {
|
|
|
|
|
$this->phar_patched = true;
|
2023-05-01 12:50:01 +08:00
|
|
|
SourcePatcher::patchMicro(['phar']);
|
2023-03-18 17:32:21 +08:00
|
|
|
}
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
$enable_fake_cli = $this->getOption('with-micro-fake-cli', false) ? ' -DPHP_MICRO_FAKE_CLI' : '';
|
|
|
|
|
$vars = [
|
|
|
|
|
// with debug information, optimize for size, remove identifiers, patch fake cli for micro
|
|
|
|
|
'EXTRA_CFLAGS' => '-g -Os -fno-ident' . $enable_fake_cli,
|
|
|
|
|
];
|
2024-01-03 10:31:21 +08:00
|
|
|
$vars = $this->getBuildVars($vars);
|
2023-08-20 19:51:45 +08:00
|
|
|
if (!$this->getOption('no-strip', false)) {
|
|
|
|
|
$vars['STRIP'] = 'dsymutil -f ';
|
|
|
|
|
}
|
|
|
|
|
$vars = SystemUtil::makeEnvVarString($vars);
|
|
|
|
|
|
2023-04-03 20:47:24 +08:00
|
|
|
shell()->cd(SOURCE_PATH . '/php-src')
|
2023-08-20 19:51:45 +08:00
|
|
|
->exec("make -j{$this->concurrency} {$vars} micro");
|
2023-04-23 20:31:58 +08:00
|
|
|
$this->deployBinary(BUILD_TARGET_MICRO);
|
2023-09-23 17:00:42 +08:00
|
|
|
|
|
|
|
|
if ($this->phar_patched) {
|
|
|
|
|
SourcePatcher::patchMicro(['phar'], true);
|
|
|
|
|
}
|
2023-03-18 17:32:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-20 19:51:45 +08:00
|
|
|
* Build fpm sapi
|
2023-03-18 17:32:21 +08:00
|
|
|
*
|
|
|
|
|
* @throws RuntimeException
|
2023-04-03 20:47:24 +08:00
|
|
|
* @throws FileSystemException
|
2023-03-18 17:32:21 +08:00
|
|
|
*/
|
2023-08-20 19:51:45 +08:00
|
|
|
public function buildFpm(): void
|
2023-03-18 17:32:21 +08:00
|
|
|
{
|
2024-01-03 10:31:21 +08:00
|
|
|
$vars = SystemUtil::makeEnvVarString($this->getBuildVars());
|
2023-08-20 19:51:45 +08:00
|
|
|
|
2023-05-10 21:59:33 +08:00
|
|
|
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
2023-08-20 19:51:45 +08:00
|
|
|
$shell->exec("make -j{$this->concurrency} {$vars} fpm");
|
|
|
|
|
if (!$this->getOption('no-strip', false)) {
|
2023-05-10 21:59:33 +08:00
|
|
|
$shell->exec('dsymutil -f sapi/fpm/php-fpm')->exec('strip sapi/fpm/php-fpm');
|
|
|
|
|
}
|
2023-04-23 20:31:58 +08:00
|
|
|
$this->deployBinary(BUILD_TARGET_FPM);
|
2023-03-18 20:08:54 +08:00
|
|
|
}
|
2023-08-21 09:30:46 +02:00
|
|
|
|
2023-10-23 00:37:28 +08:00
|
|
|
/**
|
|
|
|
|
* Build embed sapi
|
|
|
|
|
*
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
*/
|
2023-08-21 09:30:46 +02:00
|
|
|
public function buildEmbed(): void
|
|
|
|
|
{
|
2024-01-03 10:31:21 +08:00
|
|
|
$vars = SystemUtil::makeEnvVarString($this->getBuildVars());
|
2023-08-21 09:30:46 +02:00
|
|
|
|
|
|
|
|
shell()
|
|
|
|
|
->cd(SOURCE_PATH . '/php-src')
|
2023-08-30 17:47:29 +02:00
|
|
|
->exec('make INSTALL_ROOT=' . BUILD_ROOT_PATH . " -j{$this->concurrency} {$vars} install")
|
2023-08-30 18:14:59 +02:00
|
|
|
// Workaround for https://github.com/php/php-src/issues/12082
|
2023-08-30 17:47:29 +02:00
|
|
|
->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o')
|
|
|
|
|
->exec('mkdir ' . BUILD_ROOT_PATH . '/lib/php-o')
|
|
|
|
|
->cd(BUILD_ROOT_PATH . '/lib/php-o')
|
|
|
|
|
->exec('ar x ' . BUILD_ROOT_PATH . '/lib/libphp.a')
|
|
|
|
|
->exec('rm ' . BUILD_ROOT_PATH . '/lib/libphp.a')
|
|
|
|
|
->exec('ar rcs ' . BUILD_ROOT_PATH . '/lib/libphp.a *.o')
|
|
|
|
|
->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o');
|
2023-08-21 09:30:46 +02:00
|
|
|
}
|
2024-01-03 10:31:21 +08:00
|
|
|
|
|
|
|
|
private function getBuildVars($input = []): array
|
|
|
|
|
{
|
|
|
|
|
$optimization = $this->getOption('no-strip', false) ? '-g -O0' : '-g0 -Os';
|
|
|
|
|
$cflags = isset($input['EXTRA_CFLAGS']) && $input['EXTRA_CFLAGS'] ? " {$input['EXTRA_CFLAGS']}" : '';
|
|
|
|
|
$libs = isset($input['EXTRA_LIBS']) && $input['EXTRA_LIBS'] ? " {$input['EXTRA_LIBS']}" : '';
|
|
|
|
|
return [
|
|
|
|
|
'EXTRA_CFLAGS' => "{$optimization} {$cflags} " . $this->getOption('x-extra-cflags'),
|
|
|
|
|
'EXTRA_LIBS' => "{$this->getOption('extra-libs')} -lresolv {$libs} " . $this->getOption('x-extra-libs'),
|
|
|
|
|
];
|
|
|
|
|
}
|
2023-03-18 17:32:21 +08:00
|
|
|
}
|