mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
31 lines
862 B
PHP
31 lines
862 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
trait libiconv
|
|
{
|
|
protected function build(): void
|
|
{
|
|
[,,$destdir] = SEPARATED_PATH;
|
|
|
|
shell()->cd($this->source_dir)
|
|
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
|
->execWithEnv(
|
|
'./configure ' .
|
|
'--enable-static ' .
|
|
'--disable-shared ' .
|
|
'--enable-extra-encodings ' .
|
|
'--prefix='
|
|
)
|
|
->execWithEnv('make clean')
|
|
->execWithEnv("make -j{$this->builder->concurrency}")
|
|
->execWithEnv('make install DESTDIR=' . $destdir);
|
|
|
|
if (file_exists(BUILD_BIN_PATH . '/iconv')) {
|
|
unlink(BUILD_BIN_PATH . '/iconv');
|
|
}
|
|
}
|
|
}
|