Skip to content

Commit c2cad20

Browse files
cfriedtfabiobaltieri
authored andcommitted
posix: xsi_streams: add tc-provides-xsi-streams kconfig option
Enable the toolchain to provide the XSI_STREAMS Option Group. Signed-off-by: Chris Friedt <chris@fr4.co>
1 parent 25c2aae commit c2cad20

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

‎lib/posix/Kconfig.toolchain‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ config TC_PROVIDES_XSI_SIGNALS
219219
config TC_PROVIDES_XSI_SINGLE_PROCESS
220220
bool
221221

222+
config TC_PROVIDES_XSI_STREAMS
223+
bool
224+
222225
config TC_PROVIDES_XSI_SYSTEM_DATABASE
223226
bool
224227

‎lib/posix/options/CMakeLists.txt‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
set(POSIX_VERSION 200809L)
4+
set(XOPEN_VERSION 700)
45
set(GEN_DIR ${ZEPHYR_BINARY_DIR}/include/generated)
56

67
zephyr_compile_definitions(-D_POSIX_C_SOURCE=${POSIX_VERSION})
@@ -165,15 +166,20 @@ if(NOT CONFIG_TC_PROVIDES_XSI_REALTIME)
165166
zephyr_library_sources_ifdef(CONFIG_POSIX_SHARED_MEMORY_OBJECTS shm.c)
166167
endif()
167168

168-
zephyr_library_sources_ifdef(CONFIG_XSI_STREAMS stropts.c)
169-
170169
if(NOT CONFIG_TC_PROVIDES_XSI_SINGLE_PROCESS)
171170
zephyr_library_sources_ifdef(CONFIG_XSI_SINGLE_PROCESS
172171
env_common.c
173172
xsi_single_process.c
174173
)
175174
endif()
176175

176+
if(NOT CONFIG_TC_PROVIDES_XSI_STREAMS)
177+
zephyr_library_sources_ifdef(CONFIG_XSI_STREAMS stropts.c)
178+
endif()
179+
if(CONFIG_XSI_STREAMS)
180+
zephyr_compile_definitions(-D_XOPEN_STREAMS=${XOPEN_VERSION})
181+
endif()
182+
177183
if(NOT CONFIG_TC_PROVIDES_XSI_SYSTEM_LOGGING)
178184
zephyr_library_sources_ifdef(CONFIG_XSI_SYSTEM_LOGGING syslog.c)
179185
endif()

0 commit comments

Comments
 (0)