summaryrefslogtreecommitdiff
path: root/components/libc/pthreads/SConscript
diff options
context:
space:
mode:
authorchenjh <[email protected]>2021-02-26 18:23:52 +0800
committerchenjh <[email protected]>2021-02-26 18:23:52 +0800
commit055c3d3e1d75fedac44ffb41943350d9844f5b7e (patch)
treeab7ee8660930048e93cc2dcc944db40c59f08b5d /components/libc/pthreads/SConscript
parent5f17cf9204e501d971cd28486e0a7193d2f1fae4 (diff)
[Update] Sync from v4.0.3
Diffstat (limited to 'components/libc/pthreads/SConscript')
-rw-r--r--components/libc/pthreads/SConscript22
1 files changed, 17 insertions, 5 deletions
diff --git a/components/libc/pthreads/SConscript b/components/libc/pthreads/SConscript
index 1b7b75bfd1..767b406d4c 100644
--- a/components/libc/pthreads/SConscript
+++ b/components/libc/pthreads/SConscript
@@ -1,10 +1,22 @@
from building import *
+from utils import VersionCmp
-cwd = GetCurrentDir()
-src = Glob('*.c')
-CPPPATH = [cwd]
+cwd = GetCurrentDir()
+src = Glob('*.c')
+CPPPATH = [cwd]
+CPPDEFINES = []
-group = DefineGroup('pthreads', src,
- depend = ['RT_USING_PTHREADS', 'RT_USING_LIBC'], CPPPATH = CPPPATH)
+# only enable POSIX.1b-1993 Real-time extensions
+libc_ver = GetDepend('LIBC_VERSION')
+try:
+ ver = libc_ver.split(' ')
+ ver = ver[1]
+ if VersionCmp(ver, "2.5.0") == 1:
+ CPPDEFINES = ['_POSIX_C_SOURCE=199309L']
+except :
+ pass
+
+group = DefineGroup('libc', src,
+ depend = ['RT_USING_PTHREADS', 'RT_USING_LIBC'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
Return('group')