mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
-lomp on macos
This commit is contained in:
parent
a7771e95f2
commit
a503aaa8a0
@ -15,8 +15,12 @@ class imagick extends Extension
|
|||||||
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
|
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// imagick with calls omp_pause_all which requires -lgomp, on non-musl we build imagick without openmp
|
// imagick with calls omp_pause_all which requires openmp, on non-musl we build imagick without openmp
|
||||||
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp');
|
$extra_libs = match (PHP_OS_FAMILY) {
|
||||||
|
'Linux' => trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp'),
|
||||||
|
'Darwin' => trim(getenv('SPC_EXTRA_LIBS') . ' -lomp'),
|
||||||
|
default => ''
|
||||||
|
};
|
||||||
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ trait imagemagick
|
|||||||
->optionalLib('bzip2', ...ac_with_args('bzlib'))
|
->optionalLib('bzip2', ...ac_with_args('bzlib'))
|
||||||
->addConfigureArgs(
|
->addConfigureArgs(
|
||||||
// TODO: glibc rh 10 toolset's libgomp.a was built without -fPIC so we can't use openmp without depending on libgomp.so
|
// TODO: glibc rh 10 toolset's libgomp.a was built without -fPIC so we can't use openmp without depending on libgomp.so
|
||||||
getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10') ? '--disable-openmp' : '--enable-openmp',
|
getenv('SPC_LIBC') === 'musl' ? '--enable-openmp' : '--disable-openmp',
|
||||||
'--without-jxl',
|
'--without-jxl',
|
||||||
'--without-x',
|
'--without-x',
|
||||||
);
|
);
|
||||||
|
|||||||
@ -146,6 +146,9 @@ class SPCConfigUtil
|
|||||||
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) {
|
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) {
|
||||||
$short_name[] = '-lgomp';
|
$short_name[] = '-lgomp';
|
||||||
}
|
}
|
||||||
|
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Darwin') {
|
||||||
|
$short_name[] = '-lomp';
|
||||||
|
}
|
||||||
return implode(' ', $short_name);
|
return implode(' ', $short_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user