mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 16:55:38 +08:00
add fastlz, libmemcached for linux
This commit is contained in:
22
src/SPC/builder/unix/library/fastlz.php
Normal file
22
src/SPC/builder/unix/library/fastlz.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
trait fastlz
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec((getenv('CC') ?? 'cc') . ' -c -O3 -fPIC fastlz.c -o fastlz.o')
|
||||
->exec((getenv('AR') ?? 'ar') . ' rcs libfastlz.a fastlz.o');
|
||||
|
||||
if (!copy($this->source_dir . '/fastlz.h', BUILD_INCLUDE_PATH . '/fastlz.h')) {
|
||||
throw new \RuntimeException('Failed to copy fastlz.h');
|
||||
}
|
||||
if (!copy($this->source_dir . '/libfastlz.a', BUILD_LIB_PATH . '/libfastlz.a')) {
|
||||
throw new \RuntimeException('Failed to copy libfastlz.a');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user