Skip to content

Commit 8a1689b

Browse files
committed
don't fail build without ldap
1 parent c83e803 commit 8a1689b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/SPC/builder/unix/library/postgresql.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function build(): void
4444
$error_exec_cnt = 0;
4545

4646
foreach ($optional_packages as $lib => $pkg) {
47-
if ($this->getBuilder()->getLib($lib)) {
47+
if ($this->builder->getLib($lib)) {
4848
$packages .= ' ' . $pkg;
4949
$output = shell()->execWithResult("pkg-config --static {$pkg}");
5050
$error_exec_cnt += $output[0] === 0 ? 0 : 1;
@@ -125,10 +125,12 @@ protected function build(): void
125125
'--without-tcl '
126126
);
127127

128-
$libs = PkgConfigUtil::getLibsArray('ldap');
129-
$libs = clean_spaces(implode(' ', $libs));
130-
FileSystem::replaceFileStr($this->source_dir . '/build/config.status', '-lldap', $libs);
131-
FileSystem::replaceFileStr($this->source_dir . '/build/src/Makefile.global', '-lldap', $libs);
128+
if ($this->builder->getLib('ldap')) {
129+
$libs = PkgConfigUtil::getLibsArray('ldap');
130+
$libs = clean_spaces(implode(' ', $libs));
131+
FileSystem::replaceFileStr($this->source_dir . '/build/config.status', '-lldap', $libs);
132+
FileSystem::replaceFileStr($this->source_dir . '/build/src/Makefile.global', '-lldap', $libs);
133+
}
132134

133135
$shell
134136
->exec($envs . ' make -C src/bin/pg_config install')

0 commit comments

Comments
 (0)