xserver: Branch 'master' - 4 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed May 10 19:25:35 UTC 2017


 include/meson.build |   11 +++++++++--
 include/os.h        |    6 ++++++
 os/meson.build      |   18 +++++++++---------
 3 files changed, 24 insertions(+), 11 deletions(-)

New commits:
commit 0ff2fb128bf35dffaa302f15e9ae004b65ee0827
Author: Peter Harris <pharris at opentext.com>
Date:   Tue May 9 19:39:47 2017 -0400

    meson: Detect strlcat/strlcpy/reallocarray in libbsd
    
    If we're linking with libbsd anyway, we might as well use the functions
    it provides instead of compiling our replacements.
    
    Signed-off-by: Peter Harris <pharris at opentext.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/include/meson.build b/include/meson.build
index c3d7a8150..358e04976 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -112,15 +112,15 @@ conf_data.set('HAVE_GETZONEID', cc.has_function('getzoneid'))
 conf_data.set('HAVE_MMAP', cc.has_function('mmap'))
 conf_data.set('HAVE_POLL', cc.has_function('poll'))
 conf_data.set('HAVE_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
-conf_data.set('HAVE_REALLOCARRAY', cc.has_function('reallocarray'))
+conf_data.set('HAVE_REALLOCARRAY', cc.has_function('reallocarray', dependencies: libbsd_dep))
 conf_data.set('HAVE_SETEUID', cc.has_function('seteuid'))
 conf_data.set('HAVE_SETITIMER', cc.has_function('setitimer'))
 conf_data.set('HAVE_SHMCTL64', cc.has_function('shmctl64'))
 conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction'))
 conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp'))
 conf_data.set('HAVE_STRCASESTR', cc.has_function('strcasestr'))
-conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat'))
-conf_data.set('HAVE_STRLCPY', cc.has_function('strlcpy'))
+conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat', dependencies: libbsd_dep))
+conf_data.set('HAVE_STRLCPY', cc.has_function('strlcpy', dependencies: libbsd_dep))
 conf_data.set('HAVE_STRNCASECMP', cc.has_function('strncasecmp'))
 conf_data.set('HAVE_STRNDUP', cc.has_function('strndup'))
 conf_data.set('HAVE_TIMINGSAFE_MEMCMP', cc.has_function('timingsafe_memcmp'))
diff --git a/include/os.h b/include/os.h
index fb09d00c7..e141a6b02 100644
--- a/include/os.h
+++ b/include/os.h
@@ -54,6 +54,12 @@ SOFTWARE.
 #ifdef MONOTONIC_CLOCK
 #include <time.h>
 #endif
+#if defined(HAVE_LIBBSD) && defined(HAVE_REALLOCARRAY)
+#include <bsd/stdlib.h>       /* for reallocarray */
+#endif
+#if defined(HAVE_LIBBSD) && defined(HAVE_STRLCPY)
+#include <bsd/string.h>       /* for strlcpy, strlcat */
+#endif
 
 #define SCREEN_SAVER_ON   0
 #define SCREEN_SAVER_OFF  1
commit c4c002d1ca80bd69776387dafb9c5bb082c72e48
Author: Peter Harris <pharris at opentext.com>
Date:   Tue May 9 19:39:46 2017 -0400

    meson: Only detect each function once
    
    Use conf_data outside of include/ to avoid re-running detection of the
    same functions.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Peter Harris <pharris at opentext.com>

diff --git a/os/meson.build b/os/meson.build
index 724e6d1a8..940c6f4d0 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -21,32 +21,32 @@ srcs_os = [
 
 # Wrapper code for missing C library functions
 srcs_libc = []
-if not cc.has_function('reallocarray')
+if not conf_data.get('HAVE_REALLOCARRAY')
     srcs_libc += 'reallocarray.c'
 endif
-if not cc.has_function('strcasecmp')
+if not conf_data.get('HAVE_STRCASECMP')
     srcs_libc += 'strcasecmp.c'
 endif
-if not cc.has_function('strcasestr')
+if not conf_data.get('HAVE_STRCASESTR')
     srcs_libc += 'strcasestr.c'
 endif
-if not cc.has_function('strlcat')
+if not conf_data.get('HAVE_STRLCAT')
     srcs_libc += 'strlcat.c'
 endif
-if not cc.has_function('strlcpy')
+if not conf_data.get('HAVE_STRLCPY')
     srcs_libc += 'strlcpy.c'
 endif
-if not cc.has_function('strndup')
+if not conf_data.get('HAVE_STRNDUP')
     srcs_libc += 'strndup.c'
 endif
-if not cc.has_function('timingsafe_memcmp')
+if not conf_data.get('HAVE_TIMINGSAFE_MEMCMP')
     srcs_libc += 'timingsafe_memcmp.c'
 endif
-if not cc.has_function('poll')
+if not conf_data.get('HAVE_POLL')
     srcs_os += 'xserver_poll.c'
 endif
 
-if cc.has_function('sigaction')
+if conf_data.get('BUSFAULT')
     srcs_os += 'busfault.c'
 endif
 
commit 03d6275e6094a5ede5a70f05bbbdde653a9fd9e0
Author: Peter Harris <pharris at opentext.com>
Date:   Tue May 9 19:39:45 2017 -0400

    meson: Detect more functions
    
    Set HAVE_REALLOCARRAY, HAVE_SIGACTION, HAVE_STRCASESTR, HAVE_STRLCAT,
    HAVE_STRLCPY, HAVE_TIMINGSAFE_MEMCMP, and BUSFAULT.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Peter Harris <pharris at opentext.com>

diff --git a/include/meson.build b/include/meson.build
index dda0b7f04..c3d7a8150 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -59,8 +59,6 @@ conf_data.set('CONFIG_WSCONS', host_machine.system() == 'openbsd')
 # that just uses whatever directory works?
 conf_data.set_quoted('SHMDIR', '/tmp')
 
-conf_data.set('HAVE_SIGACTION', '1') # XXX
-conf_data.set('BUSFAULT', '1') # XXX
 conf_data.set('XSHMFENCE', xshmfence_dep.found())
 conf_data.set('WITH_LIBDRM', libdrm_dep.found())
 conf_data.set('GLAMOR_HAS_DRM_NAME_FROM_FD_2',
@@ -114,16 +112,24 @@ conf_data.set('HAVE_GETZONEID', cc.has_function('getzoneid'))
 conf_data.set('HAVE_MMAP', cc.has_function('mmap'))
 conf_data.set('HAVE_POLL', cc.has_function('poll'))
 conf_data.set('HAVE_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
+conf_data.set('HAVE_REALLOCARRAY', cc.has_function('reallocarray'))
 conf_data.set('HAVE_SETEUID', cc.has_function('seteuid'))
 conf_data.set('HAVE_SETITIMER', cc.has_function('setitimer'))
 conf_data.set('HAVE_SHMCTL64', cc.has_function('shmctl64'))
+conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction'))
 conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp'))
+conf_data.set('HAVE_STRCASESTR', cc.has_function('strcasestr'))
+conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat'))
+conf_data.set('HAVE_STRLCPY', cc.has_function('strlcpy'))
 conf_data.set('HAVE_STRNCASECMP', cc.has_function('strncasecmp'))
 conf_data.set('HAVE_STRNDUP', cc.has_function('strndup'))
+conf_data.set('HAVE_TIMINGSAFE_MEMCMP', cc.has_function('timingsafe_memcmp'))
 conf_data.set('HAVE_VASPRINTF', cc.has_function('vasprintf'))
 conf_data.set('HAVE_VSNPRINTF', cc.has_function('vsnprintf'))
 conf_data.set('HAVE_WALKCONTEXT', cc.has_function('walkcontext'))
 
+conf_data.set('BUSFAULT', conf_data.get('HAVE_SIGACTION'))
+
 # Don't let X dependencies typedef 'pointer'
 conf_data.set('_XTYPEDEF_POINTER', '1')
 conf_data.set('_XITYPEDEF_POINTER', '1')
commit ba1599610b1889545be8a9314dce8a740a2764d3
Author: Peter Harris <pharris at opentext.com>
Date:   Tue May 9 19:39:44 2017 -0400

    meson: Detect arc4random_buf
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Peter Harris <pharris at opentext.com>

diff --git a/include/meson.build b/include/meson.build
index a95cd7a19..dda0b7f04 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -98,6 +98,7 @@ conf_data.set('HAVE_SYS_UTSNAME_H', cc.has_header('sys/utsname.h'))
 conf_data.set('HAVE_SYS_SYSMACROS_H', cc.has_header('sys/sysmacros.h'))
 conf_data.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
 
+conf_data.set('HAVE_ARC4RANDOM_BUF', cc.has_function('arc4random_buf', dependencies: libbsd_dep))
 conf_data.set('HAVE_BACKTRACE', cc.has_function('backtrace'))
 conf_data.set('HAVE_CBRT', cc.has_function('cbrt'))
 conf_data.set('HAVE_EPOLL_CREATE', cc.has_function('epoll_create'))


More information about the xorg-commit mailing list