[PATCH xserver 6/6] meson: Automatically detect HAVE_PTHREAD_SETNAME_NP
Peter Hutterer
peter.hutterer at who-t.net
Thu Aug 2 05:22:16 UTC 2018
On Wed, Aug 01, 2018 at 01:49:54PM -0700, Eric Anholt wrote:
> Signed-off-by: Eric Anholt <eric at anholt.net>
series Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Cheers,
Peter
> ---
> include/meson.build | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/include/meson.build b/include/meson.build
> index 6ed7cc6ca997..678555692f6d 100644
> --- a/include/meson.build
> +++ b/include/meson.build
> @@ -58,7 +58,23 @@ conf_data.set('HAS_APERTURE_DRV', host_machine.system() == 'openbsd')
> # XXX: HAVE_LIBDISPATCH
> conf_data.set_quoted('OSNAME', 'Linux') # XXX
> conf_data.set('HAVE_INPUTTHREAD', '1') # XXX
> -conf_data.set('HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID', '1') # XXX
> +
> +if cc.compiles('''
> + #define _GNU_SOURCE 1
> + #include <pthread.h>
> + void foo(int bar) { pthread_setname_np(pthread_self(), "example"); }
> +''',
> + name: 'pthread_setname_np(tid, name)')
> + conf_data.set('HAVE_PTHREAD_SETNAME_NP_WITH_TID', 1)
> +elif cc.compiles('''
> + #define _GNU_SOURCE 1
> + #include <pthread.h>
> + void foo(int bar) { pthread_setname_np("example"); }
> +''',
> + name: 'pthread_setname_np(name)')
> + conf_data.set('HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID', 1)
> +endif
> +
> conf_data.set('HAVE_LIBBSD', libbsd_dep.found())
> # XXX: HAVE_SYSTEMD_DAEMON
> conf_data.set('CONFIG_UDEV', build_udev)
> --
> 2.18.0
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list