Skip to content

Commit 9ed77c1

Browse files
authored
use the spx upstream version (#931)
2 parents ccf262d + 25d7c72 commit 9ed77c1

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

config/source.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@
10011001
"spx": {
10021002
"type": "git",
10031003
"rev": "master",
1004-
"url": "https://github.com/static-php/php-spx.git",
1004+
"url": "https://github.com/NoiseByNorthwest/php-spx.git",
10051005
"path": "php-src/ext/spx",
10061006
"license": {
10071007
"type": "file",

src/SPC/builder/extension/spx.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class spx extends Extension
1313
{
1414
public function getUnixConfigureArg(bool $shared = false): string
1515
{
16-
$arg = '--enable-spx' . ($shared ? '=shared' : '');
16+
$arg = '--enable-SPX' . ($shared ? '=shared' : '');
1717
if ($this->builder->getLib('zlib') !== null) {
1818
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
1919
}
@@ -29,4 +29,20 @@ public function patchBeforeConfigure(): bool
2929
);
3030
return true;
3131
}
32+
33+
public function patchBeforeBuildconf(): bool
34+
{
35+
FileSystem::replaceFileStr(
36+
$this->source_dir . '/config.m4',
37+
'CFLAGS="$CFLAGS -Werror -Wall -O3 -pthread -std=gnu90"',
38+
'CFLAGS="$CFLAGS -pthread"'
39+
);
40+
FileSystem::replaceFileStr(
41+
$this->source_dir . '/src/php_spx.h',
42+
"extern zend_module_entry spx_module_entry;\n",
43+
"extern zend_module_entry spx_module_entry;;\n#define phpext_spx_ptr &spx_module_entry\n"
44+
);
45+
FileSystem::copy($this->source_dir . '/src/php_spx.h', $this->source_dir . '/php_spx.h');
46+
return true;
47+
}
3248
}

0 commit comments

Comments
 (0)