summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-04-27 11:47:11 -0400
committerAdam Jackson <ajax@redhat.com>2017-04-27 15:19:29 -0400
commit5d785693a8843d18be806ea9f8caecc2dcbf1007 (patch)
treed4bb04320543ab1a8b19fe961165f81edd6cb862 /os
parent8659aac2ccc6649477f601908e1a4062fad8635e (diff)
meson: Factor out the AC_REPLACE_FUNCS stuff to its own library
This is all just stuff we wish we had in libc, and some of this gets used in eg. the dmx utilities build, so split it to its own library to avoid pulling in xserver stuff. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'os')
-rw-r--r--os/meson.build24
1 files changed, 17 insertions, 7 deletions
diff --git a/os/meson.build b/os/meson.build
index e26778a43..e1741bb50 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -20,26 +20,27 @@ srcs_os = [
]
# Wrapper code for missing C library functions
+srcs_libc = []
if not cc.has_function('reallocarray')
- srcs_os += 'reallocarray.c'
+ srcs_libc += 'reallocarray.c'
endif
if not cc.has_function('strcasecmp')
- srcs_os += 'strcasecmp.c'
+ srcs_libc += 'strcasecmp.c'
endif
if not cc.has_function('strcasestr')
- srcs_os += 'strcasestr.c'
+ srcs_libc += 'strcasestr.c'
endif
if not cc.has_function('strlcat')
- srcs_os += 'strlcat.c'
+ srcs_libc += 'strlcat.c'
endif
if not cc.has_function('strlcpy')
- srcs_os += 'strlcpy.c'
+ srcs_libc += 'strlcpy.c'
endif
if not cc.has_function('strndup')
- srcs_os += 'strndup.c'
+ srcs_libc += 'strndup.c'
endif
if not cc.has_function('timingsafe_memcmp')
- srcs_os += 'timingsafe_memcmp.c'
+ srcs_libc += 'timingsafe_memcmp.c'
endif
if cc.has_function('poll')
@@ -53,6 +54,14 @@ if get_option('xdmcp')
srcs_os += 'xdmcp.c'
endif
+libxlibc = []
+if srcs_libc.length() > 0
+ libxlibc = static_library('libxlibc',
+ srcs_libc,
+ include_directories: inc,
+ )
+endif
+
libxserver_os = static_library('libxserver_os',
srcs_os,
include_directories: inc,
@@ -62,4 +71,5 @@ libxserver_os = static_library('libxserver_os',
sha1_dep,
dependency('xau')
],
+ link_with: libxlibc,
)