mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
cs fix, xml building fails now, unsure why, doesn't seem to import expat_compat.h for some reason
This commit is contained in:
parent
03ca3f4f59
commit
f47daac3cc
@ -77,6 +77,9 @@
|
||||
],
|
||||
"ext-depends-windows": [
|
||||
"xml"
|
||||
],
|
||||
"shared-ext-depends": [
|
||||
"xml"
|
||||
]
|
||||
},
|
||||
"ds": {
|
||||
|
||||
@ -127,6 +127,9 @@ class Extension
|
||||
foreach (Config::getExt($this->name, 'ext-suggests', []) as $name) {
|
||||
$this->addExtensionDependency($name, true);
|
||||
}
|
||||
foreach (Config::getExt($this->name, 'shared-ext-depends', []) as $name) {
|
||||
$this->addExtensionDependency($name);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -300,6 +303,13 @@ class Extension
|
||||
logger()->info('extension ' . $this->getName() . ' already built, skipping');
|
||||
return;
|
||||
}
|
||||
foreach (Config::getExt($this->name, 'shared-ext-depends', []) as $name) {
|
||||
$dependencyExt = $this->builder->getExt($name);
|
||||
if ($dependencyExt === null) {
|
||||
throw new RuntimeException("extension {$this->name} requires shared extension {$name}");
|
||||
}
|
||||
$dependencyExt->buildShared();
|
||||
}
|
||||
match (PHP_OS_FAMILY) {
|
||||
'Darwin', 'Linux' => $this->buildUnixShared(),
|
||||
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build shared extensions is not supported yet'),
|
||||
@ -335,7 +345,7 @@ class Extension
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv($env)
|
||||
->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static')
|
||||
->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static --with-pic')
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv('make -j' . $this->builder->concurrency)
|
||||
->execWithEnv('make install');
|
||||
|
||||
@ -26,11 +26,12 @@ class xml extends Extension
|
||||
'soap' => '--enable-soap',
|
||||
'xmlreader' => '--enable-xmlreader',
|
||||
'xmlwriter' => '--enable-xmlwriter',
|
||||
'dom' => '--enable-dom',
|
||||
'simplexml' => '--enable-simplexml',
|
||||
default => throw new RuntimeException('Not accept non-xml extension'),
|
||||
};
|
||||
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
||||
if (!$shared) {
|
||||
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
|
||||
@ -47,7 +48,6 @@ class xml extends Extension
|
||||
'soap' => '--enable-soap',
|
||||
'xmlreader' => '--enable-xmlreader',
|
||||
'xmlwriter' => '--enable-xmlwriter',
|
||||
'dom' => '--with-dom',
|
||||
'simplexml' => '--with-simplexml',
|
||||
default => throw new RuntimeException('Not accept non-xml extension'),
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user