summaryrefslogtreecommitdiff
path: root/components/libc/pthreads/SConscript
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-03-02 15:00:43 +0800
committerGitHub <[email protected]>2021-03-02 15:00:43 +0800
commit2c12493ff342ea9ba808311c3f6835eba31a8d3e (patch)
treeb1e1dfbeaead7c08ab8d7d0f34066154c125841b /components/libc/pthreads/SConscript
parent5f17cf9204e501d971cd28486e0a7193d2f1fae4 (diff)
parent19871ac32e41590b1f3e3742d9ab023dc3147ba0 (diff)
Merge pull request #4404 from KyleChenjh/lts-v3.1.x
[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')