mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 17:35:36 +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:
@@ -77,6 +77,9 @@
|
|||||||
],
|
],
|
||||||
"ext-depends-windows": [
|
"ext-depends-windows": [
|
||||||
"xml"
|
"xml"
|
||||||
|
],
|
||||||
|
"shared-ext-depends": [
|
||||||
|
"xml"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ds": {
|
"ds": {
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ class Extension
|
|||||||
foreach (Config::getExt($this->name, 'ext-suggests', []) as $name) {
|
foreach (Config::getExt($this->name, 'ext-suggests', []) as $name) {
|
||||||
$this->addExtensionDependency($name, true);
|
$this->addExtensionDependency($name, true);
|
||||||
}
|
}
|
||||||
|
foreach (Config::getExt($this->name, 'shared-ext-depends', []) as $name) {
|
||||||
|
$this->addExtensionDependency($name);
|
||||||
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,6 +303,13 @@ class Extension
|
|||||||
logger()->info('extension ' . $this->getName() . ' already built, skipping');
|
logger()->info('extension ' . $this->getName() . ' already built, skipping');
|
||||||
return;
|
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) {
|
match (PHP_OS_FAMILY) {
|
||||||
'Darwin', 'Linux' => $this->buildUnixShared(),
|
'Darwin', 'Linux' => $this->buildUnixShared(),
|
||||||
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build shared extensions is not supported yet'),
|
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)
|
shell()->cd($this->source_dir)
|
||||||
->setEnv($env)
|
->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 clean')
|
||||||
->execWithEnv('make -j' . $this->builder->concurrency)
|
->execWithEnv('make -j' . $this->builder->concurrency)
|
||||||
->execWithEnv('make install');
|
->execWithEnv('make install');
|
||||||
|
|||||||
@@ -26,11 +26,12 @@ class xml extends Extension
|
|||||||
'soap' => '--enable-soap',
|
'soap' => '--enable-soap',
|
||||||
'xmlreader' => '--enable-xmlreader',
|
'xmlreader' => '--enable-xmlreader',
|
||||||
'xmlwriter' => '--enable-xmlwriter',
|
'xmlwriter' => '--enable-xmlwriter',
|
||||||
'dom' => '--enable-dom',
|
|
||||||
'simplexml' => '--enable-simplexml',
|
'simplexml' => '--enable-simplexml',
|
||||||
default => throw new RuntimeException('Not accept non-xml extension'),
|
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;
|
return $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +48,6 @@ class xml extends Extension
|
|||||||
'soap' => '--enable-soap',
|
'soap' => '--enable-soap',
|
||||||
'xmlreader' => '--enable-xmlreader',
|
'xmlreader' => '--enable-xmlreader',
|
||||||
'xmlwriter' => '--enable-xmlwriter',
|
'xmlwriter' => '--enable-xmlwriter',
|
||||||
'dom' => '--with-dom',
|
|
||||||
'simplexml' => '--with-simplexml',
|
'simplexml' => '--with-simplexml',
|
||||||
default => throw new RuntimeException('Not accept non-xml extension'),
|
default => throw new RuntimeException('Not accept non-xml extension'),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user