Skip to content

Commit 09073c5

Browse files
committed
sort config and remove lonesome configure cflags
1 parent cff6ec1 commit 09073c5

File tree

5 files changed

+21
-25
lines changed

5 files changed

+21
-25
lines changed

config/env.ini

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable
110110
; *** default build vars for building php ***
111111
; embed type for php, static (libphp.a) or shared (libphp.so)
112112
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
113-
; CFLAGS for configuring php
114-
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
115-
; EXTRA_CFLAGS for `make` php
113+
; EXTRA_CFLAGS for `configure` and `make` php
116114
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
117115
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
118116
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
@@ -142,10 +140,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-
142140
; *** default build vars for building php ***
143141
; embed type for php, static (libphp.a) or shared (libphp.dylib)
144142
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
145-
; CFLAGS for configuring php
146-
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -Werror=unknown-warning-option"
147-
; EXTRA_CFLAGS for `make` php
148-
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie ${SPC_DEFAULT_C_FLAGS}"
143+
; EXTRA_CFLAGS for `configure` and `make` php
144+
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
149145

150146
[freebsd]
151147
; compiler environments

config/lib.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
"watcher"
2727
]
2828
},
29+
"frankenphp": {
30+
"source": "frankenphp",
31+
"type": "target"
32+
},
2933
"micro": {
3034
"type": "target",
3135
"source": "micro"
@@ -970,9 +974,5 @@
970974
"zstd.h",
971975
"zstd_errors.h"
972976
]
973-
},
974-
"frankenphp": {
975-
"source": "frankenphp",
976-
"type": "target"
977977
}
978978
}

config/source.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@
301301
"path": "LICENSE.MIT"
302302
}
303303
},
304+
"frankenphp": {
305+
"type": "ghtar",
306+
"repo": "php/frankenphp",
307+
"prefer-stable": true,
308+
"provide-pre-built": false,
309+
"license": {
310+
"type": "file",
311+
"path": "LICENSE"
312+
}
313+
},
304314
"freetype": {
305315
"type": "ghtagtar",
306316
"repo": "freetype/freetype",
@@ -363,16 +373,6 @@
363373
"path": "LICENSE"
364374
}
365375
},
366-
"frankenphp": {
367-
"type": "ghtar",
368-
"repo": "php/frankenphp",
369-
"prefer-stable": true,
370-
"provide-pre-build": false,
371-
"license": {
372-
"type": "file",
373-
"path": "LICENSE"
374-
}
375-
},
376376
"icu-static-win": {
377377
"type": "url",
378378
"url": "https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip",

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
9191
// prepare build php envs
9292
// $musl_flag = SPCTarget::getLibc() === 'musl' ? ' -D__MUSL__' : ' -U__MUSL__';
9393
$php_configure_env = SystemUtil::makeEnvVarString([
94-
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'),
94+
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
9595
'CPPFLAGS' => '-I' . BUILD_INCLUDE_PATH, // . ' -Dsomethinghere', // . $musl_flag,
9696
'LDFLAGS' => '-L' . BUILD_LIB_PATH,
9797
// 'LIBS' => SPCTarget::getRuntimeLibs(), // do not pass static libraries here yet, they may contain polyfills for libc functions!
@@ -284,10 +284,10 @@ protected function buildEmbed(): void
284284
// process libphp.so for shared embed
285285
$libphpSo = BUILD_LIB_PATH . '/libphp.so';
286286
if (file_exists($libphpSo)) {
287-
// deploy libphp.so
288-
$this->deployBinary($libphpSo, $libphpSo, false);
289287
// post actions: rename libphp.so to libphp-<release>.so if -release is set in LDFLAGS
290288
$this->processLibphpSoFile($libphpSo);
289+
// deploy libphp.so
290+
$this->deployBinary($libphpSo, $libphpSo, false);
291291
}
292292

293293
// process shared extensions build-with-php

src/SPC/builder/macos/MacOSBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
106106

107107
// prepare build php envs
108108
$envs_build_php = SystemUtil::makeEnvVarString([
109-
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'),
109+
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
110110
'CPPFLAGS' => '-I' . BUILD_INCLUDE_PATH,
111111
'LDFLAGS' => '-L' . BUILD_LIB_PATH,
112112
]);

0 commit comments

Comments
 (0)