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
|
|
|
|
|
{
|
2025-06-09 14:48:05 +07:00
|
|
|
shell()->cd($this->source_dir)->initializeEnv($this)
|
|
|
|
|
->exec(
|
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-06-09 14:48:05 +07:00
|
|
|
->exec('make clean')
|
|
|
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
|
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
2023-12-21 14:02:32 +08:00
|
|
|
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
|
|
|
|
|
$this->cleanLaFiles();
|
|
|
|
|
}
|
|
|
|
|
}
|