fix krb5 (can't do shared build with zig)

This commit is contained in:
henderkes 2026-02-20 16:47:01 +07:00
parent 17d699d4a5
commit 2511ee8a4c
3 changed files with 14 additions and 12 deletions

View File

@ -98,7 +98,7 @@ LD=${SPC_LINUX_DEFAULT_LD}
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
SPC_DEFAULT_LD_FLAGS="-Wl,--as-needed"
SPC_DEFAULT_LD_FLAGS="-Wl,--as-needed -Wl,--undefined-version"
; upx executable path
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches

View File

@ -40,6 +40,16 @@ trait krb5
->appendEnv($extraEnv)
->optionalLib('ldap', '--with-ldap', '--without-ldap')
->optionalLib('libedit', '--with-libedit', '--without-libedit')
->removeConfigureArgs(
'--enable-static',
'--disable-static',
'--enable-shared',
'--disable-shared'
)
->addConfigureArgs(
'--enable-static',
'--disable-shared'
)
->configure(...$args)
->make();
$this->patchPkgconfPrefix([

View File

@ -16,12 +16,11 @@ class UnixAutoconfExecutor extends Executor
protected array $configure_args = [];
protected array $ignore_args = [];
public function __construct(protected BSDLibraryBase|LinuxLibraryBase|MacOSLibraryBase $library)
{
parent::__construct($library);
$this->initShell();
$this->configure_args = $this->getDefaultConfigureArgs();
}
/**
@ -29,19 +28,12 @@ class UnixAutoconfExecutor extends Executor
*/
public function configure(...$args): static
{
// remove all the ignored args
$args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args);
$args = array_diff($args, $this->ignore_args);
$args = array_merge($args, $this->configure_args);
$configure_args = implode(' ', $args);
return $this->seekLogFileOnException(fn () => $this->shell->exec("./configure {$configure_args}"));
}
public function getConfigureArgsString(): string
{
return implode(' ', array_merge($this->getDefaultConfigureArgs(), $this->configure_args));
}
/**
* Run make
*
@ -111,7 +103,7 @@ class UnixAutoconfExecutor extends Executor
*/
public function removeConfigureArgs(...$args): static
{
$this->ignore_args = [...$this->ignore_args, ...$args];
$this->configure_args = array_diff($this->configure_args, $args);
return $this;
}