mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
fix icu for relocatable objects (required by libphp.so building)
This commit is contained in:
@@ -14,13 +14,19 @@ class icu extends LinuxLibraryBase
|
|||||||
|
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -fPIC -fPIE -fno-ident"';
|
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -DPIC -fPIC"';
|
||||||
$cxxflags = 'CXXFLAGS="-std=c++17"';
|
$cxxflags = 'CXXFLAGS="-std=c++17 -fPIC -fno-ident"';
|
||||||
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
|
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
|
||||||
shell()->cd($this->source_dir . '/source')
|
shell()->cd($this->source_dir . '/source')
|
||||||
->exec(
|
->setEnv([
|
||||||
|
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||||
|
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||||
|
'LIBS' => $this->getLibExtraLibs(),
|
||||||
|
])
|
||||||
|
->execWithEnv(
|
||||||
"{$cppflags} {$cxxflags} {$ldflags} " .
|
"{$cppflags} {$cxxflags} {$ldflags} " .
|
||||||
'./runConfigureICU Linux ' .
|
'./runConfigureICU Linux ' .
|
||||||
|
'--enable-pic ' .
|
||||||
'--enable-static ' .
|
'--enable-static ' .
|
||||||
'--disable-shared ' .
|
'--disable-shared ' .
|
||||||
'--with-data-packaging=static ' .
|
'--with-data-packaging=static ' .
|
||||||
@@ -33,9 +39,9 @@ class icu extends LinuxLibraryBase
|
|||||||
'--enable-samples=no ' .
|
'--enable-samples=no ' .
|
||||||
'--prefix=' . BUILD_ROOT_PATH
|
'--prefix=' . BUILD_ROOT_PATH
|
||||||
)
|
)
|
||||||
->exec('make clean')
|
->execWithEnv('make clean')
|
||||||
->exec("make -j{$this->builder->concurrency}")
|
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||||
->exec('make install');
|
->execWithEnv('make install');
|
||||||
|
|
||||||
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
|
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
|
||||||
FileSystem::removeDir(BUILD_LIB_PATH . '/icu');
|
FileSystem::removeDir(BUILD_LIB_PATH . '/icu');
|
||||||
|
|||||||
Reference in New Issue
Block a user