framework?

This commit is contained in:
henderkes 2025-11-19 14:48:10 +01:00
parent 2b0a0bdad9
commit 84e9f13688

View File

@ -16,16 +16,15 @@ trait krb5
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true)); $libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]); $spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false)); $config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false));
$make = UnixAutoconfExecutor::create($this) $extraEnv = [
->appendEnv([ 'CFLAGS' => '-fcommon',
'CFLAGS' => '-fcommon', 'LIBS' => $config['libs'],
'LIBS' => $config['libs'], ];
]);
if (getenv('SPC_LD_LIBRARY_PATH') && getenv('SPC_LIBRARY_PATH')) { if (getenv('SPC_LD_LIBRARY_PATH') && getenv('SPC_LIBRARY_PATH')) {
$make->appendEnv([ $extraEnv = [...$extraEnv, ...[
'LD_LIBRARY_PATH' => getenv('SPC_LD_LIBRARY_PATH'), 'LD_LIBRARY_PATH' => getenv('SPC_LD_LIBRARY_PATH'),
'LIBRARY_PATH' => getenv('SPC_LIBRARY_PATH'), 'LIBRARY_PATH' => getenv('SPC_LIBRARY_PATH'),
]); ]];
} }
$args = [ $args = [
'--disable-nls', '--disable-nls',
@ -33,9 +32,11 @@ trait krb5
'--without-system-verto', '--without-system-verto',
]; ];
if (PHP_OS_FAMILY === 'Darwin') { if (PHP_OS_FAMILY === 'Darwin') {
$extraEnv['LDFLAGS'] = '-framework Kerberos';
$args[] = 'ac_cv_func_secure_getenv=no'; $args[] = 'ac_cv_func_secure_getenv=no';
} }
$make UnixAutoconfExecutor::create($this)
->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')
->configure(...$args) ->configure(...$args)