From a53ff7460ef6f03d8e602186b721baea16bfef9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Wed, 20 Mar 2019 18:52:48 +0000 Subject: [PATCH] Check for RTLD_NEXT Check for RTLD_NEXT being present, and disable the gsocketclient-slow test if it's absent, since the shlib dependency of that test requires RTLD_NEXT to function. This allows the testsuite to be built on Cygwin, which behaves exactly like UNIX, but doesn't have RTLD_NEXT. --- gio/tests/meson.build | 39 ++++++++++++++++++++++----------------- meson.build | 6 ++++++ 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index bdd76f0f8..a3efd33ab 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -136,27 +136,32 @@ if host_machine.system() != 'windows' 'unix-mounts' : {}, 'unix-streams' : {}, 'g-file-info-filesystem-readonly' : {}, - 'gsocketclient-slow' : { - 'depends' : [ - shared_library('slow-connect-preload', - 'slow-connect-preload.c', - name_prefix : '', - dependencies: cc.find_library('dl'), - install_dir : installed_tests_execdir, - install: installed_tests_enabled, - ) - ], - 'env' : { - 'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(meson.current_build_dir()) - }, - 'installed_tests_env' : { - 'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(installed_tests_execdir), - }, - }, 'gschema-compile' : {'install' : false}, 'trash' : {}, } + if have_rtld_next + gio_tests += { + 'gsocketclient-slow' : { + 'depends' : [ + shared_library('slow-connect-preload', + 'slow-connect-preload.c', + name_prefix : '', + dependencies: cc.find_library('dl'), + install_dir : installed_tests_execdir, + install: installed_tests_enabled, + ) + ], + 'env' : { + 'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(meson.current_build_dir()) + }, + 'installed_tests_env' : { + 'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(installed_tests_execdir), + }, + }, + } + endif + # Uninstalled because of the check-for-executable logic in DesktopAppInfo # unable to find the installed executable if not glib_have_cocoa diff --git a/meson.build b/meson.build index d937b5fa3..75659888c 100644 --- a/meson.build +++ b/meson.build @@ -584,6 +584,12 @@ if cc.has_header_symbol('dlfcn.h', 'RTLD_GLOBAL') glib_conf.set('HAVE_RTLD_GLOBAL', 1) endif +have_rtld_next = false +if cc.has_header_symbol('dlfcn.h', 'RTLD_NEXT') + have_rtld_next = true + glib_conf.set('HAVE_RTLD_NEXT', 1) +endif + # Check whether to use statfs or statvfs # Some systems have both statfs and statvfs, pick the most "native" for these if have_func_statfs and have_func_statvfs