mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 17:35:36 +08:00
libraries: honour SPC_DEFAULT_CFLAGS/CXXFLAGS/LDFLAGS and bug fixes
bzip2, fastlz, jbig, qdbm: thread SPC_DEFAULT_CFLAGS into the
hand-rolled Makefile patches and shell compile commands. Backward
compatible when the env var is empty.
icu: append SPC_DEFAULT_CXXFLAGS/LDFLAGS to runConfigureICU's CXXFLAGS
and LDFLAGS so user flags reach the bundled cxx invocation.
openssl: append user CFLAGS/LDFLAGS after the target name on Configure
so options like -flto and -fprofile-* reach the openssl build.
libheif: rewrite libheif 1.22+'s C-incompatible
`struct heif_bad_pixel { uint32_t row; uint32_t column; };` as a
typedef so C consumers compile.
ncurses: filter the clang/zig-cc "N warning(s) generated." stdout line
out of MKlib_gen.sh's preprocessor pipe before sed turns it into
invalid C in lib_gen.c.
libaom: detect target CPU from SystemTarget instead of hard-coding
generic, fall back to generic only when neither nasm nor yasm is
available, and turn off examples/tests/tools/docs.
This commit is contained in:
@@ -17,7 +17,9 @@ class bzip2
|
||||
#[PatchBeforeBuild]
|
||||
public function patchBeforeBuild(LibraryPackage $lib): void
|
||||
{
|
||||
FileSystem::replaceFileStr($lib->getSourceDir() . '/Makefile', 'CFLAGS=-Wall', 'CFLAGS=-fPIC -Wall');
|
||||
// Makefile pins -O2 -fPIC; inject SPC_DEFAULT_CFLAGS
|
||||
$extra = deduplicate_flags(trim((string) getenv('SPC_DEFAULT_CFLAGS')) . ' -fPIC -Wall');
|
||||
FileSystem::replaceFileStr($lib->getSourceDir() . '/Makefile', 'CFLAGS=-Wall', "CFLAGS={$extra}");
|
||||
}
|
||||
|
||||
#[BuildFor('Windows')]
|
||||
|
||||
Reference in New Issue
Block a user