mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 17:35:36 +08:00
fix last libs to use cflags
This commit is contained in:
@@ -10,8 +10,9 @@ trait fastlz
|
|||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
|
$extra = trim((string) getenv('SPC_DEFAULT_C_FLAGS'));
|
||||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||||
->exec((getenv('CC') ?: 'cc') . ' -c -O3 -fPIC fastlz.c -o fastlz.o')
|
->exec((getenv('CC') ?: 'cc') . " -c {$extra} fastlz.c -o fastlz.o")
|
||||||
->exec((getenv('AR') ?: 'ar') . ' rcs libfastlz.a fastlz.o');
|
->exec((getenv('AR') ?: 'ar') . ' rcs libfastlz.a fastlz.o');
|
||||||
|
|
||||||
if (!copy($this->source_dir . '/fastlz.h', BUILD_INCLUDE_PATH . '/fastlz.h')) {
|
if (!copy($this->source_dir . '/fastlz.h', BUILD_INCLUDE_PATH . '/fastlz.h')) {
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ trait jbig
|
|||||||
{
|
{
|
||||||
public function patchBeforeBuild(): bool
|
public function patchBeforeBuild(): bool
|
||||||
{
|
{
|
||||||
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'CFLAGS = -O2 -W -Wno-unused-result', 'CFLAGS = -O2 -W -Wno-unused-result -fPIC');
|
$extra = trim((string) getenv('SPC_DEFAULT_C_FLAGS'));
|
||||||
|
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'CFLAGS = -O2 -W -Wno-unused-result', "CFLAGS = -W -Wno-unused-result {$extra}");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ trait qdbm
|
|||||||
{
|
{
|
||||||
$ac = UnixAutoconfExecutor::create($this)->configure();
|
$ac = UnixAutoconfExecutor::create($this)->configure();
|
||||||
FileSystem::replaceFileRegex($this->source_dir . '/Makefile', '/MYLIBS = libqdbm.a.*/m', 'MYLIBS = libqdbm.a');
|
FileSystem::replaceFileRegex($this->source_dir . '/Makefile', '/MYLIBS = libqdbm.a.*/m', 'MYLIBS = libqdbm.a');
|
||||||
|
$extra = trim((string) getenv('SPC_DEFAULT_C_FLAGS'));
|
||||||
|
FileSystem::replaceFileRegex($this->source_dir . '/Makefile', '/^CFLAGS = .*$/m', "CFLAGS = -Wall {$extra}");
|
||||||
$ac->make($this instanceof MacOSLibraryBase ? 'mac' : '');
|
$ac->make($this instanceof MacOSLibraryBase ? 'mac' : '');
|
||||||
$this->patchPkgconfPrefix(['qdbm.pc']);
|
$this->patchPkgconfPrefix(['qdbm.pc']);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user