bugfix: complete ldap support for macOS and Linux

This commit is contained in:
crazywhalecc
2023-09-23 14:10:35 +08:00
committed by Jerry Ma
parent fe39aecd72
commit f2371d3702

View File

@@ -11,22 +11,22 @@ trait ldap
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
->exec( ->exec(
$this->builder->configure_env . ' ' . $this->builder->configure_env . ' ' .
'CC="musl-gcc -I' . BUILD_INCLUDE_PATH . '" ' . $this->builder->makeAutoconfFlags(AUTOCONF_LDFLAGS | AUTOCONF_CPPFLAGS) .
'LDFLAGS="-static -L' . BUILD_LIB_PATH . '" ' .
($this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? 'LIBS="-lssl -lcrypto -lz" ' : '') .
' ./configure ' . ' ./configure ' .
'--enable-static ' . '--enable-static ' .
'--disable-shared ' . '--disable-shared ' .
'--disable-slapd ' . '--disable-slapd ' .
'--disable-slurpd ' . '--disable-slurpd ' .
'--without-systemd ' . '--without-systemd ' .
'--without-cyrus-sasl ' .
($this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? '--with-tls=openssl ' : '') . ($this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? '--with-tls=openssl ' : '') .
($this->builder->getLib('gmp') ? '--with-mp=gmp ' : '') . ($this->builder->getLib('gmp') ? '--with-mp=gmp ' : '') .
($this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '') . ($this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '') .
'--prefix=' '--prefix='
) )
->exec('make clean') ->exec('make clean')
->exec('make depend') // remove tests and doc to prevent compile failed with error: soelim not found
->exec('sed -i -e "s/SUBDIRS= include libraries clients servers tests doc/SUBDIRS= include libraries clients servers/g" Makefile')
->exec("make -j{$this->builder->concurrency}") ->exec("make -j{$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH); ->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['ldap.pc', 'lber.pc']); $this->patchPkgconfPrefix(['ldap.pc', 'lber.pc']);