File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,16 @@ public function patchBeforeSharedConfigure(): bool
208208 return false ;
209209 }
210210
211+ /**
212+ * Patch code before shared extension make
213+ * If you need to patch some code, overwrite this
214+ * return true if you patched something, false if not
215+ */
216+ public function patchBeforeSharedMake (): bool
217+ {
218+ return false ;
219+ }
220+
211221 /**
212222 * @return string
213223 * returns a command line string with all required shared extensions to load
@@ -408,6 +418,10 @@ public function buildUnixShared(): void
408418 '$1 ' . $ staticLibString
409419 );
410420
421+ if ($ this ->patchBeforeSharedMake ()) {
422+ logger ()->info ('ext [ . ' . $ this ->getName () . '] patching before shared make ' );
423+ }
424+
411425 shell ()->cd ($ this ->source_dir )
412426 ->setEnv ($ env )
413427 ->exec ('make clean ' )
Original file line number Diff line number Diff line change 55namespace SPC \builder \extension ;
66
77use SPC \builder \Extension ;
8+ use SPC \builder \linux \SystemUtil ;
9+ use SPC \store \FileSystem ;
810use SPC \util \CustomExt ;
911
1012#[CustomExt('uv ' )]
@@ -17,10 +19,12 @@ public function validate(): void
1719 }
1820 }
1921
20- public function getStaticAndSharedLibs (): array
22+ public function patchBeforeSharedMake (): bool
2123 {
22- [$ static , $ shared ] = parent ::getStaticAndSharedLibs ();
23- $ shared .= ' -lpthread ' ;
24- return [$ static , $ shared ];
24+ if (SystemUtil::getLibcVersionIfExists () >= '2.17 ' ) {
25+ return false ;
26+ }
27+ FileSystem::replaceFileRegex ($ this ->source_dir . '/Makefile ' , '/^(LDFLAGS =.*)$/ ' , '$1 -luv -ldl -lrt -pthread ' );
28+ return true ;
2529 }
2630}
You can’t perform that action at this time.
0 commit comments