mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-13 20:05:35 +08:00
remove -Wl,--as-needed for imagemagick build
This commit is contained in:
@@ -12,6 +12,11 @@ trait imagemagick
|
|||||||
{
|
{
|
||||||
protected function build(): void
|
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)
|
$ac = UnixAutoconfExecutor::create($this)
|
||||||
->optionalLib('libzip', ...ac_with_args('zip'))
|
->optionalLib('libzip', ...ac_with_args('zip'))
|
||||||
->optionalLib('libjpeg', ...ac_with_args('jpeg'))
|
->optionalLib('libjpeg', ...ac_with_args('jpeg'))
|
||||||
@@ -33,9 +38,6 @@ trait imagemagick
|
|||||||
|
|
||||||
// special: linux-static target needs `-static`
|
// special: linux-static target needs `-static`
|
||||||
$ldflags = SPCTarget::isStatic() ? '-static -ldl' : '-ldl';
|
$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
|
// special: macOS needs -iconv
|
||||||
$libs = SPCTarget::getTargetOS() === 'Darwin' ? '-liconv' : '';
|
$libs = SPCTarget::getTargetOS() === 'Darwin' ? '-liconv' : '';
|
||||||
@@ -48,6 +50,8 @@ trait imagemagick
|
|||||||
|
|
||||||
$ac->configure()->make();
|
$ac->configure()->make();
|
||||||
|
|
||||||
|
$this->builder->arch_ld_flags = $original_ldflags;
|
||||||
|
|
||||||
$filelist = [
|
$filelist = [
|
||||||
'ImageMagick.pc',
|
'ImageMagick.pc',
|
||||||
'ImageMagick-7.Q16HDRI.pc',
|
'ImageMagick-7.Q16HDRI.pc',
|
||||||
|
|||||||
Reference in New Issue
Block a user