Change to --enable-shared --disable-static

This commit is contained in:
crazywhalecc 2025-03-25 13:29:55 +08:00
parent fc08e5cf23
commit 8459754692
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -254,6 +254,12 @@ class Extension
// do nothing, just throw wrong usage exception if not valid
}
/**
* Build shared extension
*
* @throws WrongUsageException
* @throws RuntimeException
*/
public function buildShared(): void
{
match (PHP_OS_FAMILY) {
@ -262,13 +268,18 @@ class Extension
};
}
/**
* Build shared extension for Unix
*
* @throws RuntimeException
*/
public function buildUnixShared(): void
{
// prepare configure args
shell()->cd($this->source_dir)
->setEnv(['CFLAGS' => $this->builder->arch_c_flags ?? ''])
->execWithEnv(BUILD_BIN_PATH . '/phpize')
->execWithEnv('./configure ' . $this->getUnixConfigureArg() . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-static --disable-shared')
->execWithEnv('./configure ' . $this->getUnixConfigureArg() . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static')
->execWithEnv('make clean')
->execWithEnv('make -j' . $this->builder->concurrency);