mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
fix imagemagick linking issue
This commit is contained in:
parent
9dcda873f3
commit
cee1346bec
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\builder\linux\LinuxBuilder;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('imagick')]
|
#[CustomExt('imagick')]
|
||||||
@ -14,7 +15,9 @@ class imagick extends Extension
|
|||||||
{
|
{
|
||||||
// imagick may call omp_pause_all which requires -lgomp
|
// imagick may call omp_pause_all which requires -lgomp
|
||||||
$extra_libs = $this->builder->getOption('extra-libs', '');
|
$extra_libs = $this->builder->getOption('extra-libs', '');
|
||||||
|
if ($this->builder instanceof LinuxBuilder) {
|
||||||
$extra_libs .= ' -lgomp ';
|
$extra_libs .= ' -lgomp ';
|
||||||
|
}
|
||||||
$this->builder->setOption('extra-libs', $extra_libs);
|
$this->builder->setOption('extra-libs', $extra_libs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\unix\library;
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
use SPC\builder\linux\library\LinuxLibraryBase;
|
||||||
|
use SPC\builder\macos\library\MacOSLibraryBase;
|
||||||
use SPC\exception\FileSystemException;
|
use SPC\exception\FileSystemException;
|
||||||
use SPC\exception\RuntimeException;
|
use SPC\exception\RuntimeException;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
@ -39,8 +40,12 @@ trait imagemagick
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ldflags = $this instanceof LinuxLibraryBase ? ('LDFLAGS="-static" ') : '';
|
$ldflags = $this instanceof LinuxLibraryBase ? ('LDFLAGS="-static" ') : '';
|
||||||
|
|
||||||
|
// libxml iconv patch
|
||||||
|
$required_libs .= $this instanceof MacOSLibraryBase ? (' -liconv') : '';
|
||||||
shell()->cd($this->source_dir)
|
shell()->cd($this->source_dir)
|
||||||
->exec(
|
->exec(
|
||||||
|
'PKG_CONFIG="$PKG_CONFIG --static" ' .
|
||||||
$ldflags .
|
$ldflags .
|
||||||
"LIBS='{$required_libs}' " .
|
"LIBS='{$required_libs}' " .
|
||||||
'./configure ' .
|
'./configure ' .
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user