Skip to content

Commit 3ba215c

Browse files
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 <[email protected]>
1 parent 161a392 commit 3ba215c

File tree

4 files changed

+75
-4
lines changed

4 files changed

+75
-4
lines changed

config/ext.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,17 @@
426426
},
427427
"notes": true
428428
},
429+
"odbc": {
430+
"support": {
431+
"BSD": "wip",
432+
"Windows": "wip"
433+
},
434+
"type": "builtin",
435+
"arg-type-unix": "custom",
436+
"lib-depends-unix": [
437+
"unixodbc"
438+
]
439+
},
429440
"opcache": {
430441
"type": "builtin",
431442
"arg-type-unix": "custom"
@@ -492,6 +503,20 @@
492503
"mysqlnd"
493504
]
494505
},
506+
"pdo_odbc": {
507+
"support": {
508+
"BSD": "wip"
509+
},
510+
"type": "builtin",
511+
"arg-type": "custom",
512+
"lib-depends-unix": [
513+
"unixodbc"
514+
],
515+
"ext-depends": [
516+
"pdo",
517+
"odbc"
518+
]
519+
},
495520
"pdo_pgsql": {
496521
"support": {
497522
"Windows": "wip",

src/SPC/builder/extension/odbc.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\extension;
6+
7+
use SPC\builder\Extension;
8+
use SPC\util\CustomExt;
9+
10+
#[CustomExt('odbc')]
11+
class odbc extends Extension
12+
{
13+
public function getUnixConfigureArg(): string
14+
{
15+
return '--with-unixODBC=' . BUILD_ROOT_PATH;
16+
}
17+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\extension;
6+
7+
use SPC\builder\Extension;
8+
use SPC\store\FileSystem;
9+
use SPC\util\CustomExt;
10+
11+
#[CustomExt('pdo_odbc')]
12+
class pdo_odbc extends Extension
13+
{
14+
public function patchBeforeBuildconf(): bool
15+
{
16+
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');
17+
return true;
18+
}
19+
20+
public function getUnixConfigureArg(): string
21+
{
22+
return '--with-pdo-odbc=unixODBC,' . BUILD_ROOT_PATH;
23+
}
24+
25+
public function getWindowsConfigureArg(): string
26+
{
27+
return '--with-pdo-odbc';
28+
}
29+
}

src/globals/test-extensions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
2323
$test_os = [
24-
// 'macos-13',
25-
// 'macos-14',
24+
'macos-13',
25+
'macos-14',
2626
'ubuntu-latest',
2727
'windows-latest',
2828
];
@@ -40,8 +40,8 @@
4040

4141
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
4242
$extensions = match (PHP_OS_FAMILY) {
43-
'Linux', 'Darwin' => '',
44-
'Windows' => 'mbstring,tokenizer,phar,curl,openssl',
43+
'Linux', 'Darwin' => 'odbc,pdo_odbc',
44+
'Windows' => 'odbc,pdo_odbc',
4545
};
4646

4747
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).

0 commit comments

Comments
 (0)