mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
Use backup file function to avoid multiple build conflict
This commit is contained in:
parent
643926886c
commit
f1a9a28ed7
@ -87,8 +87,8 @@ class SourcePatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
// patch configure.ac
|
// patch configure.ac
|
||||||
/*
|
|
||||||
$musl = SPCTarget::getLibc() === 'musl';
|
$musl = SPCTarget::getLibc() === 'musl';
|
||||||
|
FileSystem::backupFile(SOURCE_PATH . '/php-src/configure.ac');
|
||||||
FileSystem::replaceFileStr(
|
FileSystem::replaceFileStr(
|
||||||
SOURCE_PATH . '/php-src/configure.ac',
|
SOURCE_PATH . '/php-src/configure.ac',
|
||||||
'if command -v ldd >/dev/null && ldd --version 2>&1 | grep ^musl >/dev/null 2>&1',
|
'if command -v ldd >/dev/null && ldd --version 2>&1 | grep ^musl >/dev/null 2>&1',
|
||||||
@ -97,7 +97,6 @@ class SourcePatcher
|
|||||||
if (getenv('SPC_LIBC') === false && ($libc = SPCTarget::getLibc()) !== null) {
|
if (getenv('SPC_LIBC') === false && ($libc = SPCTarget::getLibc()) !== null) {
|
||||||
putenv("SPC_LIBC={$libc}");
|
putenv("SPC_LIBC={$libc}");
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// patch php-src/build/php.m4 PKG_CHECK_MODULES -> PKG_CHECK_MODULES_STATIC
|
// patch php-src/build/php.m4 PKG_CHECK_MODULES -> PKG_CHECK_MODULES_STATIC
|
||||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/build/php.m4', 'PKG_CHECK_MODULES(', 'PKG_CHECK_MODULES_STATIC(');
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/build/php.m4', 'PKG_CHECK_MODULES(', 'PKG_CHECK_MODULES_STATIC(');
|
||||||
@ -132,6 +131,11 @@ class SourcePatcher
|
|||||||
if (is_unix()) {
|
if (is_unix()) {
|
||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/have_capstone="yes"/', 'have_capstone="no"');
|
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/have_capstone="yes"/', 'have_capstone="no"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file_exists(SOURCE_PATH . '/php-src/configure.ac.bak')) {
|
||||||
|
// restore configure.ac
|
||||||
|
FileSystem::restoreBackupFile(SOURCE_PATH . '/php-src/configure.ac');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user