add (lib)attr and libacl as optional libraries

when libacl is built and --enable-fpm is used, also enable --with-fpm-acl
This commit is contained in:
Marc Henderkes
2025-03-05 11:35:03 +01:00
parent 89e8c152dc
commit 460699c48c
7 changed files with 124 additions and 2 deletions

View File

@@ -174,7 +174,7 @@ class LinuxBuilder extends UnixBuilderBase
->exec(
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
($enable_cli ? '--enable-cli ' : '--disable-cli ') .
($enable_fpm ? '--enable-fpm ' : '--disable-fpm ') .
($enable_fpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
($enable_embed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
($enable_micro ? '--enable-micro=all-static ' : '--disable-micro ') .
$config_file_path .
@@ -287,7 +287,14 @@ class LinuxBuilder extends UnixBuilderBase
*/
protected function buildFpm(): void
{
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
$vars = $this->getMakeExtraVars();
if ($this->getLib('libacl') !== null) {
$ldflags_program = $vars['EXTRA_LDFLAGS_PROGRAM'] ?? '';
if (!str_contains($ldflags_program, '-L' . BUILD_LIB_PATH)) {
$vars['EXTRA_LDFLAGS_PROGRAM'] = trim('-L' . BUILD_LIB_PATH . ' ' . $ldflags_program);
}
}
$vars = $this->getEnvString($vars);
shell()->cd(SOURCE_PATH . '/php-src')
->exec('sed -i "s|//lib|/lib|g" Makefile')
->exec("\$SPC_CMD_PREFIX_PHP_MAKE {$vars} fpm");

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class attr extends LinuxLibraryBase
{
use \SPC\builder\unix\library\attr;
public const NAME = 'attr';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class libacl extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libacl;
public const NAME = 'libacl';
}