mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 11:12:11 +01:00
Merge branch 'solaris' into 'main'
Build fixes for building on Solaris & illumos See merge request GNOME/glib!4351
This commit is contained in:
commit
b9a39848da
@ -969,6 +969,9 @@ else
|
||||
have_libelf = have_libelf and cc.has_function('elf_getshdrstrndx', dependencies : libelf)
|
||||
have_libelf = have_libelf and cc.has_function('elf_getshdrnum', dependencies : libelf)
|
||||
have_libelf = have_libelf and cc.has_header('libelf.h')
|
||||
# This check is necessary for Solaris & illumos, where 32-bit libelf
|
||||
# is incompatible with large-file mode, which meson forces to be enabled
|
||||
have_libelf = have_libelf and cc.compiles('#include <libelf.h>', name: 'libelf.h')
|
||||
endif
|
||||
|
||||
if have_libelf
|
||||
|
@ -2469,7 +2469,7 @@ test_copy_preserve_mode (void)
|
||||
/* Reset the umask after querying it above. There’s no way to query it without
|
||||
* changing it. */
|
||||
umask (current_umask);
|
||||
g_test_message ("Current umask: %u", current_umask);
|
||||
g_test_message ("Current umask: %u", (unsigned int) current_umask);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (vectors); i++)
|
||||
{
|
||||
|
@ -699,6 +699,7 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data)
|
||||
* fcntl(fd, F_PREVFD)
|
||||
* - return highest allocated file descriptor < fd.
|
||||
*/
|
||||
gint open_max;
|
||||
gint fd;
|
||||
gint res = 0;
|
||||
|
||||
|
@ -228,7 +228,7 @@ test_child_private (void)
|
||||
spawn_flags |= G_SPAWN_DO_NOT_REAP_CHILD;
|
||||
#endif
|
||||
|
||||
g_snprintf (pid, sizeof(pid), "%d", getpid ());
|
||||
g_snprintf (pid, sizeof (pid), "%d", (int) getpid ());
|
||||
child_argv[0] = local_argv[0];
|
||||
child_argv[1] = "mapchild";
|
||||
child_argv[2] = pid;
|
||||
|
21
meson.build
21
meson.build
@ -237,6 +237,8 @@ add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||
|
||||
if host_system == 'qnx'
|
||||
add_project_arguments('-D_QNX_SOURCE', language: 'c')
|
||||
elif host_system == 'sunos'
|
||||
add_project_arguments('-D__EXTENSIONS__', language: 'c')
|
||||
endif
|
||||
|
||||
# dummy/empty dependency() object to declare fallbacks and simpler dependencies
|
||||
@ -2481,10 +2483,23 @@ have_pkg_config = find_program('pkg-config', required: false).found()
|
||||
# Some installed tests require a custom environment
|
||||
env_program = find_program('env', required: installed_tests_enabled)
|
||||
|
||||
# FIXME: How to detect Solaris? https://github.com/mesonbuild/meson/issues/1578
|
||||
# illumos & Solaris may need extra definitions to expose some SUS/POSIX
|
||||
# interfaces in headers that conflict with previous Solaris headers.
|
||||
# But if we define them to request an older version of the standards,
|
||||
# we may hide things introduced in newer versions. We only check the
|
||||
# versions that are supported on systems new enough that meson runs on them.
|
||||
if host_system == 'sunos'
|
||||
glib_conf.set('_XOPEN_SOURCE_EXTENDED', 1)
|
||||
glib_conf.set('_XOPEN_SOURCE', 2)
|
||||
xopen_test_code = '''#include <unistd.h>
|
||||
#if _XOPEN_VERSION != _XOPEN_SOURCE
|
||||
#error "XOPEN_SOURCE of _XOPEN_SOURCE not supported"
|
||||
#endif'''
|
||||
foreach std : ['800', '700', '600']
|
||||
if cc.compiles(xopen_test_code, args: '-D_XOPEN_SOURCE=' + std, name: 'building with _XOPEN_SOURCE=' + std)
|
||||
xopen_version = std
|
||||
break
|
||||
endif
|
||||
endforeach
|
||||
glib_conf.set('_XOPEN_SOURCE', xopen_version)
|
||||
glib_conf.set('__EXTENSIONS__',1)
|
||||
endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user