mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
30 lines
899 B
PHP
30 lines
899 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace SPC\builder\unix\library;
|
||
|
|
|
||
|
|
use SPC\exception\RuntimeException;
|
||
|
|
|
||
|
|
trait libacl
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @throws RuntimeException
|
||
|
|
*/
|
||
|
|
protected function build(): void
|
||
|
|
{
|
||
|
|
shell()->cd($this->source_dir)
|
||
|
|
->setEnv([
|
||
|
|
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags()),
|
||
|
|
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags()),
|
||
|
|
'LIBS' => $this->getLibExtraLibs(),
|
||
|
|
])
|
||
|
|
->execWithEnv('./autogen.sh')
|
||
|
|
->execWithEnv('./configure --prefix= --enable-static --disable-shared --disable-tests --disable-nls')
|
||
|
|
->execWithEnv("make -j {$this->builder->concurrency}")
|
||
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||
|
|
|
||
|
|
$this->patchPkgconfPrefix(['libacl.pc'], PKGCONF_PATCH_PREFIX);
|
||
|
|
}
|
||
|
|
}
|