mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
try something with static
This commit is contained in:
parent
be3d68cebe
commit
40ea306008
@ -13,9 +13,14 @@ trait attr
|
|||||||
*/
|
*/
|
||||||
protected function build(): void
|
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)
|
shell()->cd($this->source_dir)
|
||||||
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
->setEnv([
|
||||||
->execWithEnv('./autogen.sh')
|
'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('./configure --prefix= --enable-static --disable-shared')
|
||||||
->execWithEnv("make -j {$this->builder->concurrency}")
|
->execWithEnv("make -j {$this->builder->concurrency}")
|
||||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||||
|
|||||||
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder\unix\library;
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
|
||||||
use SPC\exception\FileSystemException;
|
use SPC\exception\FileSystemException;
|
||||||
use SPC\exception\RuntimeException;
|
use SPC\exception\RuntimeException;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
@ -31,7 +30,7 @@ trait libacl
|
|||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
$cflags = PHP_OS_FAMILY !== 'Linux' ? '-Wimplicit-function-declaration -Wno-int-conversion' : '';
|
$cflags = PHP_OS_FAMILY !== 'Linux' ? '-Wimplicit-function-declaration -Wno-int-conversion' : '';
|
||||||
$ldflags = !($this instanceof LinuxLibraryBase) ? '' : '--static';
|
$ldflags = '--static';
|
||||||
shell()->cd($this->source_dir)
|
shell()->cd($this->source_dir)
|
||||||
->setEnv([
|
->setEnv([
|
||||||
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags() . ' ' . $cflags),
|
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags() . ' ' . $cflags),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user