From 1708c689a815e374fc647bb449e1bce6191c5f6e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 27 Jun 2024 11:52:39 +0200 Subject: [PATCH] os: fix FTBS on Illumos due missing symbols Several feature defines need to be set before including system headers, otherwise build breaks: > /usr/include/X11/Xtrans/Xtranssock.c: In function '_XSERVTransSocketRead': > /usr/include/X11/Xtrans/Xtranssock.c:2161:14: error: 'struct msghdr' has no member named 'msg_control' > 2161 | .msg_control = cmsgbuf.buf, > | ^~~~~~~~~~~ > /usr/include/X11/Xtrans/Xtranssock.c:2162:14: error: 'struct msghdr' has no member named 'msg_controllen' > 2162 | .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int)) > | ^~~~~~~~~~~~~~ > > ../os/access.c:339:14: error: implicit declaration of function 'asprintf'; did you mean 'Xasprintf'? [-Werror=implicit-function-declaration] > 339 | length = asprintf(addr, "%s%c%s", type, delimiter, value); > | ^~~~~~~~ > | Xasprintf Signed-off-by: Enrico Weigelt, metux IT consult --- os/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/os/meson.build b/os/meson.build index e12e2c9e7..f8c060f08 100644 --- a/os/meson.build +++ b/os/meson.build @@ -60,6 +60,13 @@ endif os_dep = [] os_c_args = [] +# eg. struct msghdr -> msg_control +if host_machine.system() == 'sunos' + os_c_args += '-D_XOPEN_SOURCE=1' + os_c_args += '-D_XOPEN_SOURCE_EXTENDED=1' + os_c_args += '-D__EXTENSIONS__' +endif + if get_option('xres') # Only the XRes extension cares about the client ID. os_c_args += '-DCLIENTIDS'