Re: [PATCH xserver] meson: ensure the libc has RPC functions when secure-rpc is enabled

2018-07-03 Thread Adam Jackson
On Fri, 2018-06-22 at 12:49 -0400, Lyude Paul wrote:
> Currently our meson.build just makes the assumption that the libc is
> going to provide RPC functions. This doesn't actually seem to be the
> case on Fedora, which causes compilation to fail unexpectedly:
> 
> ../../Projects/xserver/os/rpcauth.c:47:10: fatal error: rpc/rpc.h: No such 
> file or directory
>  #include 
>   ^~~
> compilation terminated.
> 
> So, in the event that we can't use libtirpc ensure that we actually
> check whether or not the libc provides rpc/rpc.h. If it doesn't, raise
> an error.
> 
> Signed-off-by: Lyude Paul 

Merged, thanks:

remote: I: patch #231304 updated using rev 
d95a1310ef8e08a93a28f9766d1b4093f7891404.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   d83efc47b7..d95a1310ef  master -> master

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver] meson: ensure the libc has RPC functions when secure-rpc is enabled

2018-06-22 Thread Lyude Paul
Currently our meson.build just makes the assumption that the libc is
going to provide RPC functions. This doesn't actually seem to be the
case on Fedora, which causes compilation to fail unexpectedly:

../../Projects/xserver/os/rpcauth.c:47:10: fatal error: rpc/rpc.h: No such file 
or directory
 #include 
  ^~~
compilation terminated.

So, in the event that we can't use libtirpc ensure that we actually
check whether or not the libc provides rpc/rpc.h. If it doesn't, raise
an error.

Signed-off-by: Lyude Paul 
---
 os/meson.build | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/os/meson.build b/os/meson.build
index eb8fcf55d..0e41f9c02 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -56,9 +56,13 @@ endif
 
 rpc_dep = []
 if get_option('secure-rpc')
-# prefer libtirpc (if available), otherwise assume RPC functions are
+# prefer libtirpc (if available), otherwise ensure RPC functions are
 # provided by libc.
 rpc_dep = dependency('libtirpc', required: false)
+if not (rpc_dep.found() or cc.has_header('rpc/rpc.h'))
+error('secure-rpc requested, but neither libtirpc or libc RPC support 
were found')
+endif
+
 srcs_os += 'rpcauth.c'
 endif
 
-- 
2.17.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel