enable PDO_ODBC and ODBC extension statically (#661)

* enable PDO_ODBC and ODBC extension statically

* fix sorting of ext.json

* add odbc and pdo_odbc extension to tests

* Add full tests, remove pdo_odbc from bulk

* Remove windows support for docs

* Add ODBC and PDO_ODBC extension

* Revert curl static lib

* Add full tests

* Add iconv for macOS

* Add tests

* Fix linux pdo_odbc patch

* Sort config

---------

Co-authored-by: crazywhalecc <jesse2061@outlook.com>
This commit is contained in:
tricker 2025-03-23 16:26:36 +01:00 committed by GitHub
parent 161a3924d2
commit 3ba215c35c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 75 additions and 4 deletions

View File

@ -426,6 +426,17 @@
}, },
"notes": true "notes": true
}, },
"odbc": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "builtin",
"arg-type-unix": "custom",
"lib-depends-unix": [
"unixodbc"
]
},
"opcache": { "opcache": {
"type": "builtin", "type": "builtin",
"arg-type-unix": "custom" "arg-type-unix": "custom"
@ -492,6 +503,20 @@
"mysqlnd" "mysqlnd"
] ]
}, },
"pdo_odbc": {
"support": {
"BSD": "wip"
},
"type": "builtin",
"arg-type": "custom",
"lib-depends-unix": [
"unixodbc"
],
"ext-depends": [
"pdo",
"odbc"
]
},
"pdo_pgsql": { "pdo_pgsql": {
"support": { "support": {
"Windows": "wip", "Windows": "wip",

View File

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('odbc')]
class odbc extends Extension
{
public function getUnixConfigureArg(): string
{
return '--with-unixODBC=' . BUILD_ROOT_PATH;
}
}

View File

@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('pdo_odbc')]
class pdo_odbc extends Extension
{
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/pdo_odbc/config.m4', 'PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags', 'PDO_ODBC_LDFLAGS="-liconv $pdo_odbc_def_ldflags');
return true;
}
public function getUnixConfigureArg(): string
{
return '--with-pdo-odbc=unixODBC,' . BUILD_ROOT_PATH;
}
public function getWindowsConfigureArg(): string
{
return '--with-pdo-odbc';
}
}

View File

@ -21,8 +21,8 @@ $test_php_version = [
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available) // test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
$test_os = [ $test_os = [
// 'macos-13', 'macos-13',
// 'macos-14', 'macos-14',
'ubuntu-latest', 'ubuntu-latest',
'windows-latest', 'windows-latest',
]; ];
@ -40,8 +40,8 @@ $prefer_pre_built = false;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) { $extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => '', 'Linux', 'Darwin' => 'odbc,pdo_odbc',
'Windows' => 'mbstring,tokenizer,phar,curl,openssl', 'Windows' => 'odbc,pdo_odbc',
}; };
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).