mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
add sqlsrv support
This commit is contained in:
parent
a39cd9a238
commit
1e0265e673
@ -391,6 +391,17 @@
|
|||||||
"sqlite"
|
"sqlite"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"sqlsrv": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "sqlsrv",
|
||||||
|
"lib-depends": [
|
||||||
|
"unixodbc"
|
||||||
|
],
|
||||||
|
"cpp-extension": true,
|
||||||
|
"ext-depends-linux": [
|
||||||
|
"pcntl"
|
||||||
|
]
|
||||||
|
},
|
||||||
"ssh2": {
|
"ssh2": {
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-ssh2",
|
"source": "ext-ssh2",
|
||||||
|
|||||||
@ -496,6 +496,17 @@
|
|||||||
"libtidy.a"
|
"libtidy.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"unixodbc": {
|
||||||
|
"source": "unixodbc",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libodbc.a",
|
||||||
|
"libodbccr.a",
|
||||||
|
"libodbcinst.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libiconv"
|
||||||
|
]
|
||||||
|
},
|
||||||
"xz": {
|
"xz": {
|
||||||
"source": "xz",
|
"source": "xz",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@ -457,6 +457,16 @@
|
|||||||
"text": "The author disclaims copyright to this source code. In place of\na legal notice, here is a blessing:\n\n * May you do good and not evil.\n * May you find forgiveness for yourself and forgive others.\n * May you share freely, never taking more than you give."
|
"text": "The author disclaims copyright to this source code. In place of\na legal notice, here is a blessing:\n\n * May you do good and not evil.\n * May you find forgiveness for yourself and forgive others.\n * May you share freely, never taking more than you give."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"sqlsrv": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/sqlsrv",
|
||||||
|
"path": "php-src/ext/sqlsrv",
|
||||||
|
"filename": "sqlsrv.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "text",
|
||||||
|
"text": "TODO"
|
||||||
|
}
|
||||||
|
},
|
||||||
"swoole": {
|
"swoole": {
|
||||||
"type": "ghtar",
|
"type": "ghtar",
|
||||||
"path": "php-src/ext/swoole",
|
"path": "php-src/ext/swoole",
|
||||||
@ -486,6 +496,14 @@
|
|||||||
"path": "README/LICENSE.md"
|
"path": "README/LICENSE.md"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"unixodbc": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://www.unixodbc.org/unixODBC-2.3.12.tar.gz",
|
||||||
|
"license": {
|
||||||
|
"type": "text",
|
||||||
|
"text": "TODO"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xlswriter": {
|
"xlswriter": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/xlswriter",
|
"url": "https://pecl.php.net/get/xlswriter",
|
||||||
|
|||||||
@ -144,6 +144,7 @@ class LinuxBuilder extends BuilderBase
|
|||||||
// prepare build php envs
|
// prepare build php envs
|
||||||
$envs_build_php = SystemUtil::makeEnvVarString([
|
$envs_build_php = SystemUtil::makeEnvVarString([
|
||||||
'CFLAGS' => $cflags,
|
'CFLAGS' => $cflags,
|
||||||
|
'CPPFLAGS' => '-I' . BUILD_INCLUDE_PATH,
|
||||||
'LIBS' => '-ldl -lpthread',
|
'LIBS' => '-ldl -lpthread',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
12
src/SPC/builder/linux/library/unixodbc.php
Normal file
12
src/SPC/builder/linux/library/unixodbc.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class unixodbc extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\unixodbc;
|
||||||
|
|
||||||
|
public const NAME = 'unixodbc';
|
||||||
|
}
|
||||||
@ -163,6 +163,7 @@ class MacOSBuilder extends BuilderBase
|
|||||||
'--enable-shared=no ' .
|
'--enable-shared=no ' .
|
||||||
'--enable-static=yes ' .
|
'--enable-static=yes ' .
|
||||||
"CFLAGS='{$this->arch_c_flags} -Werror=unknown-warning-option' " .
|
"CFLAGS='{$this->arch_c_flags} -Werror=unknown-warning-option' " .
|
||||||
|
"CPPFLAGS='-I" . BUILD_INCLUDE_PATH . "' " .
|
||||||
'--disable-all ' .
|
'--disable-all ' .
|
||||||
'--disable-cgi ' .
|
'--disable-cgi ' .
|
||||||
'--disable-phpdbg ' .
|
'--disable-phpdbg ' .
|
||||||
|
|||||||
12
src/SPC/builder/macos/library/unixodbc.php
Normal file
12
src/SPC/builder/macos/library/unixodbc.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class unixodbc extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\unixodbc;
|
||||||
|
|
||||||
|
public const NAME = 'unixodbc';
|
||||||
|
}
|
||||||
34
src/SPC/builder/unix/library/unixodbc.php
Normal file
34
src/SPC/builder/unix/library/unixodbc.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?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
|
||||||
|
{
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->exec(
|
||||||
|
'./configure ' .
|
||||||
|
'--enable-static --disable-shared ' .
|
||||||
|
'--disable-debug ' .
|
||||||
|
'--disable-dependency-tracking ' .
|
||||||
|
'--with-libiconv-prefix=' . BUILD_ROOT_PATH . ' ' .
|
||||||
|
'--enable-gui=no ' .
|
||||||
|
'--prefix='
|
||||||
|
)
|
||||||
|
->exec('make clean')
|
||||||
|
->exec("make -j{$this->builder->concurrency}")
|
||||||
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||||
|
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
|
||||||
|
$this->cleanLaFiles();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user