mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
fix libffi compiling without -fPIC because of missing env (#657)
Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
This commit is contained in:
parent
146a4d334b
commit
8a4ba7a876
@ -18,22 +18,22 @@ class libffi extends LinuxLibraryBase
|
|||||||
public function build(): void
|
public function build(): void
|
||||||
{
|
{
|
||||||
[$lib, , $destdir] = SEPARATED_PATH;
|
[$lib, , $destdir] = SEPARATED_PATH;
|
||||||
|
|
||||||
$arch = getenv('SPC_ARCH');
|
$arch = getenv('SPC_ARCH');
|
||||||
|
|
||||||
shell()->cd($this->source_dir)
|
shell()->cd($this->source_dir)
|
||||||
->exec(
|
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
||||||
|
->execWithEnv(
|
||||||
'./configure ' .
|
'./configure ' .
|
||||||
'--enable-static ' .
|
'--enable-static ' .
|
||||||
'--disable-shared ' .
|
'--disable-shared ' .
|
||||||
"--host={$arch}-unknown-linux " .
|
"--host={$arch}-unknown-linux " .
|
||||||
"--target={$arch}-unknown-linux " .
|
"--target={$arch}-unknown-linux " .
|
||||||
'--prefix= ' . // use prefix=/
|
'--prefix= ' .
|
||||||
"--libdir={$lib}"
|
"--libdir={$lib}"
|
||||||
)
|
)
|
||||||
->exec('make clean')
|
->execWithEnv('make clean')
|
||||||
->exec("make -j{$this->builder->concurrency}")
|
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||||
->exec("make install DESTDIR={$destdir}");
|
->execWithEnv("make install DESTDIR={$destdir}");
|
||||||
|
|
||||||
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
|
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
|
||||||
copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a');
|
copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user