42 lines
1.2 KiB
PHP
Raw Normal View History

2023-12-21 14:02:32 +08:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
trait unixodbc
{
/**
* @throws FileSystemException
* @throws RuntimeException
*/
protected function build(): void
{
shell()->cd($this->source_dir)
2025-05-18 12:19:26 +07:00
->setEnv([
'CFLAGS' => $this->getLibExtraCFlags(),
'LDFLAGS' => $this->getLibExtraLdFlags(),
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv(
2023-12-21 14:02:32 +08:00
'./configure ' .
'--enable-static --disable-shared ' .
'--disable-debug ' .
2025-05-18 12:19:26 +07:00
'--with-pic ' .
2023-12-21 14:02:32 +08:00
'--disable-dependency-tracking ' .
'--with-libiconv-prefix=' . BUILD_ROOT_PATH . ' ' .
2023-12-21 15:02:21 +08:00
'--with-included-ltdl ' .
2023-12-21 14:02:32 +08:00
'--enable-gui=no ' .
'--prefix='
)
2025-05-18 12:19:26 +07:00
->execWithEnv('make clean')
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
2023-12-21 14:02:32 +08:00
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
$this->cleanLaFiles();
}
}