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 ; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="-fPIC -Os" SPC_DEFAULT_C_FLAGS="-fPIC -Os"
SPC_DEFAULT_CXX_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 executable path
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches ; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches

View File

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

View File

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