mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gmodule/meson: Use stdout to communicate return value pf dlsym test code
This commit is contained in:
parent
4a33e2a176
commit
98059d088f
@ -28,11 +28,11 @@ if g_module_impl == 'G_MODULE_IMPL_DL'
|
||||
message('Building for MSVC: assuming that symbols are prefixed with underscore')
|
||||
g_module_need_uscore = 1
|
||||
elif meson.can_run_host_binaries()
|
||||
# FIXME: communicate result via stdout instead of return value, so non-0 return is not printed in bold red
|
||||
rres = cc.run(dlopen_dlsym_test_code,
|
||||
dependencies : libdl_dep,
|
||||
name : 'dlsym() preceding underscores')
|
||||
if host_system == 'windows' or (rres.compiled() and rres.returncode() == 0)
|
||||
if host_system == 'windows' or (rres.compiled() and
|
||||
rres.returncode() == 0 and rres.stdout().to_int() == 0)
|
||||
g_module_need_uscore = 1
|
||||
endif
|
||||
else
|
||||
|
@ -899,6 +899,8 @@ endif
|
||||
|
||||
dlopen_dlsym_test_code = '''
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
int r;
|
||||
int glib_underscore_test (void) { return 42; }
|
||||
int main (int argc, char ** argv) {
|
||||
void *f1 = (void*)0, *f2 = (void*)0, *handle;
|
||||
@ -907,7 +909,8 @@ int main (int argc, char ** argv) {
|
||||
f1 = dlsym (handle, "glib_underscore_test");
|
||||
f2 = dlsym (handle, "_glib_underscore_test");
|
||||
}
|
||||
return (!f2 || f1);
|
||||
r = (!f2 || f1) ? puts ("1") : puts ("0");
|
||||
return r > 0 ? 0 : r;
|
||||
}'''
|
||||
libdl_dep = []
|
||||
if cc.links(dlopen_dlsym_test_code, name : 'dlopen() and dlsym() in system libraries')
|
||||
|
Loading…
Reference in New Issue
Block a user