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
208
208
return false ;
209
209
}
210
210
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
+
211
221
/**
212
222
* @return string
213
223
* returns a command line string with all required shared extensions to load
@@ -408,6 +418,10 @@ public function buildUnixShared(): void
408
418
'$1 ' . $ staticLibString
409
419
);
410
420
421
+ if ($ this ->patchBeforeSharedMake ()) {
422
+ logger ()->info ('ext [ . ' . $ this ->getName () . '] patching before shared make ' );
423
+ }
424
+
411
425
shell ()->cd ($ this ->source_dir )
412
426
->setEnv ($ env )
413
427
->exec ('make clean ' )
Original file line number Diff line number Diff line change 5
5
namespace SPC \builder \extension ;
6
6
7
7
use SPC \builder \Extension ;
8
+ use SPC \builder \linux \SystemUtil ;
9
+ use SPC \store \FileSystem ;
8
10
use SPC \util \CustomExt ;
9
11
10
12
#[CustomExt('uv ' )]
@@ -17,10 +19,12 @@ public function validate(): void
17
19
}
18
20
}
19
21
20
- public function getStaticAndSharedLibs (): array
22
+ public function patchBeforeSharedMake (): bool
21
23
{
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 ;
25
29
}
26
30
}
You can’t perform that action at this time.
0 commit comments