mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
remove -Wl,--as-needed for imagemagick build
This commit is contained in:
parent
927d7f55ba
commit
44399cd185
@ -12,6 +12,11 @@ trait imagemagick
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
$original_ldflags = $this->builder->arch_ld_flags;
|
||||
if (str_contains($this->builder->arch_ld_flags, '-Wl,--as-needed')) {
|
||||
$this->builder->arch_ld_flags = str_replace('-Wl,--as-needed', '', $original_ldflags);
|
||||
}
|
||||
|
||||
$ac = UnixAutoconfExecutor::create($this)
|
||||
->optionalLib('libzip', ...ac_with_args('zip'))
|
||||
->optionalLib('libjpeg', ...ac_with_args('jpeg'))
|
||||
@ -33,9 +38,6 @@ trait imagemagick
|
||||
|
||||
// special: linux-static target needs `-static`
|
||||
$ldflags = SPCTarget::isStatic() ? '-static -ldl' : '-ldl';
|
||||
if (str_contains($this->builder->arch_ld_flags, '-Wl,--as-needed')) {
|
||||
$ldflags = str_replace('-ldl', '-Wl,--no-as-needed -ldl -Wl,--as-needed', $ldflags);
|
||||
}
|
||||
|
||||
// special: macOS needs -iconv
|
||||
$libs = SPCTarget::getTargetOS() === 'Darwin' ? '-liconv' : '';
|
||||
@ -48,6 +50,8 @@ trait imagemagick
|
||||
|
||||
$ac->configure()->make();
|
||||
|
||||
$this->builder->arch_ld_flags = $original_ldflags;
|
||||
|
||||
$filelist = [
|
||||
'ImageMagick.pc',
|
||||
'ImageMagick-7.Q16HDRI.pc',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user