mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
our memcache patch prevents shared building
This commit is contained in:
@@ -410,8 +410,7 @@
|
|||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"zlib",
|
"zlib",
|
||||||
"session"
|
"session"
|
||||||
],
|
]
|
||||||
"build-with-php": true
|
|
||||||
},
|
},
|
||||||
"memcached": {
|
"memcached": {
|
||||||
"support": {
|
"support": {
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ class memcache extends Extension
|
|||||||
|
|
||||||
public function patchBeforeBuildconf(): bool
|
public function patchBeforeBuildconf(): bool
|
||||||
{
|
{
|
||||||
|
if (!$this->isBuildStatic()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
FileSystem::replaceFileStr(
|
FileSystem::replaceFileStr(
|
||||||
SOURCE_PATH . '/php-src/ext/memcache/config9.m4',
|
SOURCE_PATH . '/php-src/ext/memcache/config9.m4',
|
||||||
'if test -d $abs_srcdir/src ; then',
|
'if test -d $abs_srcdir/src ; then',
|
||||||
@@ -44,6 +47,38 @@ EOF
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function patchBeforeSharedConfigure(): bool
|
||||||
|
{
|
||||||
|
if (!$this->isBuildShared()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
SOURCE_PATH . '/php-src/ext/memcache/config9.m4',
|
||||||
|
'if test -d $abs_srcdir/main ; then',
|
||||||
|
'if test -d $abs_srcdir/src ; then',
|
||||||
|
);
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
SOURCE_PATH . '/php-src/ext/memcache/config9.m4',
|
||||||
|
'export CPPFLAGS="$CPPFLAGS $INCLUDES -I$abs_srcdir/main"',
|
||||||
|
'export CPPFLAGS="$CPPFLAGS $INCLUDES"',
|
||||||
|
);
|
||||||
|
// add for in-tree building
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
SOURCE_PATH . '/php-src/ext/memcache/php_memcache.h',
|
||||||
|
<<<'EOF'
|
||||||
|
#ifndef PHP_MEMCACHE_H
|
||||||
|
#define PHP_MEMCACHE_H
|
||||||
|
|
||||||
|
extern zend_module_entry memcache_module_entry;
|
||||||
|
#define phpext_memcache_ptr &memcache_module_entry
|
||||||
|
|
||||||
|
#endif
|
||||||
|
EOF,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getExtraEnv(): array
|
protected function getExtraEnv(): array
|
||||||
{
|
{
|
||||||
return ['CFLAGS' => '-std=c17'];
|
return ['CFLAGS' => '-std=c17'];
|
||||||
|
|||||||
Reference in New Issue
Block a user