Skip to content

Commit e1e4892

Browse files
committed
Use isStatic instead of isStaticTarget
1 parent 956688d commit e1e4892

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

src/SPC/builder/Extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ protected function getStaticAndSharedLibs(): array
534534
}
535535
}
536536
// move static libstdc++ to shared if we are on non-full-static build target
537-
if (!SPCTarget::isStaticTarget() && in_array(SPCTarget::getLibc(), SPCTarget::LIBC_LIST)) {
537+
if (!SPCTarget::isStatic() && in_array(SPCTarget::getLibc(), SPCTarget::LIBC_LIST)) {
538538
$staticLibString .= ' -lstdc++';
539539
$sharedLibString = str_replace('-lstdc++', '', $sharedLibString);
540540
}

src/SPC/builder/linux/library/icu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function build(): void
1717
{
1818
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -DPIC -fPIC"';
1919
$cxxflags = 'CXXFLAGS="-std=c++17 -DPIC -fPIC -fno-ident"';
20-
$ldflags = SPCTarget::isStaticTarget() ? 'LDFLAGS="-static"' : '';
20+
$ldflags = SPCTarget::isStatic() ? 'LDFLAGS="-static"' : '';
2121
shell()->cd($this->source_dir . '/source')->initializeEnv($this)
2222
->exec(
2323
"{$cppflags} {$cxxflags} {$ldflags} " .

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ protected function sanityCheck(int $build_target): void
201201
$util = new SPCConfigUtil($this);
202202
$config = $util->config($this->ext_list, $this->lib_list, $this->getOption('with-suggested-exts'), $this->getOption('with-suggested-libs'));
203203
$lens = "{$config['cflags']} {$config['ldflags']} {$config['libs']}";
204-
if (SPCTarget::isStaticTarget()) {
204+
if (SPCTarget::isStatic()) {
205205
$lens .= ' -static';
206206
}
207207
[$ret, $out] = shell()->cd($sample_file_path)->execWithResult(getenv('CC') . ' -o embed embed.c ' . $lens);
@@ -335,7 +335,7 @@ protected function buildFrankenphp(): void
335335
$debugFlags = $this->getOption('no-strip') ? "'-w -s' " : '';
336336
$extLdFlags = "-extldflags '-pie'";
337337
$muslTags = '';
338-
if (SPCTarget::isStaticTarget()) {
338+
if (SPCTarget::isStatic()) {
339339
$extLdFlags = "-extldflags '-static-pie -Wl,-z,stack-size=0x80000'";
340340
$muslTags = 'static_build,';
341341
}

src/SPC/builder/unix/library/imagemagick.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function build(): void
3939
);
4040

4141
// special: linux-static target needs `-static`
42-
$ldflags = SPCTarget::isStaticTarget() ? ('-static -ldl') : '-ldl';
42+
$ldflags = SPCTarget::isStatic() ? ('-static -ldl') : '-ldl';
4343

4444
// special: macOS needs -iconv
4545
$libs = SPCTarget::getTargetOS() === 'Darwin' ? '-liconv' : '';

src/SPC/builder/unix/library/pkgconfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function build(): void
1414
UnixAutoconfExecutor::create($this)
1515
->appendEnv([
1616
'CFLAGS' => PHP_OS_FAMILY !== 'Linux' ? '-Wimplicit-function-declaration -Wno-int-conversion' : '',
17-
'LDFLAGS' => SPCTarget::isStaticTarget() ? '--static' : '',
17+
'LDFLAGS' => SPCTarget::isStatic() ? '--static' : '',
1818
])
1919
->configure(
2020
'--with-internal-glib',

src/SPC/builder/unix/library/postgresql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function build(): void
5151
$error_exec_cnt += $output[0] === 0 ? 0 : 1;
5252
if (!empty($output[1][0])) {
5353
$ldflags = $output[1][0];
54-
$envs .= SPCTarget::isStaticTarget() ? " LDFLAGS=\"{$ldflags} -static\" " : " LDFLAGS=\"{$ldflags}\" ";
54+
$envs .= SPCTarget::isStatic() ? " LDFLAGS=\"{$ldflags} -static\" " : " LDFLAGS=\"{$ldflags}\" ";
5555
}
5656
$output = shell()->execWithResult("pkg-config --libs-only-l --static {$packages}");
5757
$error_exec_cnt += $output[0] === 0 ? 0 : 1;

src/SPC/command/BuildPHPCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function handle(): int
6464

6565
// check dynamic extension build env
6666
// linux must build with glibc
67-
if (!empty($shared_extensions) && SPCTarget::isStaticTarget()) {
67+
if (!empty($shared_extensions) && SPCTarget::isStatic()) {
6868
$this->output->writeln('Linux does not support dynamic extension loading with musl-libc full-static build, please build with shared target!');
6969
return static::FAILURE;
7070
}

src/SPC/util/SPCTarget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SPCTarget
2121
/**
2222
* Returns whether the target is a full-static target.
2323
*/
24-
public static function isStaticTarget(): bool
24+
public static function isStatic(): bool
2525
{
2626
$env = getenv('SPC_TARGET');
2727
$libc = getenv('SPC_LIBC');

0 commit comments

Comments
 (0)