mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
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:
parent
161a3924d2
commit
3ba215c35c
@ -426,6 +426,17 @@
|
||||
},
|
||||
"notes": true
|
||||
},
|
||||
"odbc": {
|
||||
"support": {
|
||||
"BSD": "wip",
|
||||
"Windows": "wip"
|
||||
},
|
||||
"type": "builtin",
|
||||
"arg-type-unix": "custom",
|
||||
"lib-depends-unix": [
|
||||
"unixodbc"
|
||||
]
|
||||
},
|
||||
"opcache": {
|
||||
"type": "builtin",
|
||||
"arg-type-unix": "custom"
|
||||
@ -492,6 +503,20 @@
|
||||
"mysqlnd"
|
||||
]
|
||||
},
|
||||
"pdo_odbc": {
|
||||
"support": {
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "builtin",
|
||||
"arg-type": "custom",
|
||||
"lib-depends-unix": [
|
||||
"unixodbc"
|
||||
],
|
||||
"ext-depends": [
|
||||
"pdo",
|
||||
"odbc"
|
||||
]
|
||||
},
|
||||
"pdo_pgsql": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
|
||||
17
src/SPC/builder/extension/odbc.php
Normal file
17
src/SPC/builder/extension/odbc.php
Normal 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;
|
||||
}
|
||||
}
|
||||
29
src/SPC/builder/extension/pdo_odbc.php
Normal file
29
src/SPC/builder/extension/pdo_odbc.php
Normal 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';
|
||||
}
|
||||
}
|
||||
@ -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',
|
||||
'macos-13',
|
||||
'macos-14',
|
||||
'ubuntu-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`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => '',
|
||||
'Windows' => 'mbstring,tokenizer,phar,curl,openssl',
|
||||
'Linux', 'Darwin' => 'odbc,pdo_odbc',
|
||||
'Windows' => 'odbc,pdo_odbc',
|
||||
};
|
||||
|
||||
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user