mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 16:55:38 +08:00
try something with static
This commit is contained in:
@@ -13,9 +13,14 @@ trait attr
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$cflags = PHP_OS_FAMILY !== 'Linux' ? '-Wimplicit-function-declaration -Wno-int-conversion' : '';
|
||||
$ldflags = PHP_OS_FAMILY !== 'Linux' ? '' : '--static';
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
||||
->execWithEnv('./autogen.sh')
|
||||
->setEnv([
|
||||
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags() . ' ' . $cflags),
|
||||
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags() . ' ' . $ldflags),
|
||||
'LIBS' => $this->getLibExtraLibs(),
|
||||
])->execWithEnv('./autogen.sh')
|
||||
->execWithEnv('./configure --prefix= --enable-static --disable-shared')
|
||||
->execWithEnv("make -j {$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
|
||||
Reference in New Issue
Block a user