2023-05-10 02:04:08 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
2025-06-09 19:32:31 +08:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
2025-06-28 16:36:05 +08:00
|
|
|
use SPC\util\SPCTarget;
|
2025-01-28 19:37:50 +08:00
|
|
|
|
2023-05-10 02:04:08 +08:00
|
|
|
trait pkgconfig
|
|
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
protected function build(): void
|
2023-05-10 02:04:08 +08:00
|
|
|
{
|
2025-06-09 19:32:31 +08:00
|
|
|
UnixAutoconfExecutor::create($this)
|
2025-07-01 11:02:20 +07:00
|
|
|
->appendEnv([
|
2025-06-22 15:52:01 +07:00
|
|
|
'CFLAGS' => '-Wimplicit-function-declaration -Wno-int-conversion',
|
2025-06-29 22:49:48 +08:00
|
|
|
'LDFLAGS' => SPCTarget::isStatic() ? '--static' : '',
|
2025-06-09 19:32:31 +08:00
|
|
|
])
|
|
|
|
|
->configure(
|
|
|
|
|
'--with-internal-glib',
|
|
|
|
|
'--disable-host-tool',
|
|
|
|
|
'--without-sysroot',
|
|
|
|
|
'--without-system-include-path',
|
|
|
|
|
'--without-system-library-path',
|
|
|
|
|
'--without-pc-path',
|
2023-05-10 02:04:08 +08:00
|
|
|
)
|
2025-06-09 19:32:31 +08:00
|
|
|
->make(with_install: 'install-exec');
|
|
|
|
|
|
2024-02-20 14:03:44 +08:00
|
|
|
shell()->exec('strip ' . BUILD_ROOT_PATH . '/bin/pkg-config');
|
2023-05-10 02:04:08 +08:00
|
|
|
}
|
|
|
|
|
}
|