'-DG_LOG_DOMAIN="GLib-GIO"',
'-DGIO_COMPILATION',
'-DGIO_MODULE_DIR="@0@"'.format(glib_giomodulesdir),
+ '-DLOCALSTATEDIR="@0@"'.format(glib_localstatedir),
]
gio_c_args += glib_hidden_visibility_args
gnetworking_h_conf = configuration_data()
-gnetworking_h_wspiapi_include = ''
gnetworking_h_nameser_compat_include = ''
-if host_system == 'windows'
- # <wspiapi.h> in the Windows SDK and in mingw-w64 has wrappers for
- # inline workarounds for getaddrinfo, getnameinfo and freeaddrinfo if
- # they aren't present at run-time (on Windows 2000).
- gnetworking_h_wspiapi_include = '#include <wspiapi.h>'
-elif not host_system.contains('android')
+if host_system not in ['windows', 'android']
# Don't check for C_IN on Android since it does not define it in public
# headers, we define it ourselves wherever necessary
if not cc.compiles('''#include <sys/types.h>
elif cc.links(res_query_test, args : '-lbind', name : 'res_query() in -lbind')
network_libs += [ cc.find_library('bind') ]
network_args += [ '-lbind' ]
+ elif cc.links(res_query_test, args : '-lsocket', name : 'res_query() in -lsocket')
+ network_libs += [ cc.find_library('socket') ]
+ network_args += [ '-lsocket' ]
else
error('Could not find res_query()')
endif
endif
-if host_system.contains('android')
+if host_system == 'android'
# struct ip_mreq_source definition is broken on Android NDK <= r16
# See https://bugzilla.gnome.org/show_bug.cgi?id=740791
if not cc.compiles('''#include <netinet/in.h>
endif
endif
-gnetworking_h_conf.set('WSPIAPI_INCLUDE', gnetworking_h_wspiapi_include)
gnetworking_h_conf.set('NAMESER_COMPAT_INCLUDE', gnetworking_h_nameser_compat_include)
gnetworking_h = configure_file(input : 'gnetworking.h.in',
'--output-directory', '@OUTDIR@',
'--generate-c-code', 'xdp-dbus',
'--c-namespace', 'GXdp',
- '--annotate', 'org.freedesktop.portal.Documents.Add()',
- 'org.gtk.GDBus.C.UnixFD', 'true',
- '--annotate', 'org.freedesktop.portal.Documents.AddNamed()',
- 'org.gtk.GDBus.C.UnixFD', 'true',
- '--annotate', 'org.freedesktop.portal.Documents.AddFull()',
- 'org.gtk.GDBus.C.UnixFD', 'true',
- '--annotate', 'org.freedesktop.portal.OpenURI.OpenFile()',
- 'org.gtk.GDBus.C.UnixFD', 'true',
- '--annotate', 'org.freedesktop.portal.Trash.TrashFile()',
- 'org.gtk.GDBus.C.UnixFD', 'true',
'@INPUT@'])
# Generate gdbus-generated.{c,h}
if host_system != 'windows'
unix_sources = files(
'gfiledescriptorbased.c',
+ 'giounix-private.c',
'gunixconnection.c',
'gunixcredentialsmessage.c',
'gunixfdlist.c',
portal_sources = [files(
'gdocumentportal.c',
'gopenuriportal.c',
+ 'gmemorymonitorportal.c',
'gnetworkmonitorportal.c',
+ 'gpowerprofilemonitorportal.c',
'gproxyresolverportal.c',
'gtrashportal.c',
'gportalsupport.c',
contenttype_sources += files('gcontenttype.c')
appinfo_sources += files('gdesktopappinfo.c')
gio_unix_include_headers += files('gdesktopappinfo.h')
-
- executable('gio-launch-desktop', 'gio-launch-desktop.c',
- install : true,
- c_args : gio_c_args,
- # intl.lib is not compatible with SAFESEH
- link_args : noseh_link_args)
endif
subdir('xdgmime')
cc.find_library('dnsapi'),
iphlpapi_dep,
winsock2]
+ platform_deps += uwp_gio_deps
+
win32_sources += files(
'gwin32registrykey.c',
'gwin32mount.c',
'gwin32volumemonitor.c',
'gwin32inputstream.c',
'gwin32outputstream.c',
+ 'gwin32file-sync-stream.c',
+ 'gwin32packageparser.c',
'gwin32networkmonitor.c',
'gwin32networkmonitor.h',
'gwin32notificationbackend.c',
'gloadableicon.c',
'gmarshal-internal.c',
'gmount.c',
+ 'gmemorymonitor.c',
+ 'gmemorymonitordbus.c',
'gmemoryinputstream.c',
'gmemoryoutputstream.c',
'gmountoperation.c',
'gpollableoutputstream.c',
'gpollableutils.c',
'gpollfilemonitor.c',
+ 'gpowerprofilemonitor.c',
+ 'gpowerprofilemonitordbus.c',
'gproxy.c',
'gproxyaddress.c',
'gproxyaddressenumerator.c',
'gzlibdecompressor.c',
'glistmodel.c',
'gliststore.c',
+ '../glib/gtrace.c',
)
gio_sources += appinfo_sources
'gloadableicon.h',
'gmount.h',
'gmemoryinputstream.h',
+ 'gmemorymonitor.h',
'gmemoryoutputstream.h',
'gmountoperation.h',
'gnativesocketaddress.h',
'gpollableinputstream.h',
'gpollableoutputstream.h',
'gpollableutils.h',
+ 'gpowerprofilemonitor.h',
'gproxy.h',
'gproxyaddress.h',
'gproxyaddressenumerator.h',
endif
if have_bash
+ bash_comp_inst_dir = ''
+ if bash_comp_dep.found()
+ bash_comp_dir_override = bash_comp_dep.version().version_compare('>= 2.10') ? ['datadir', get_option('datadir')] : ['prefix', get_option('prefix')]
+ bash_comp_inst_dir = bash_comp_dep.get_pkgconfig_variable('completionsdir', define_variable: bash_comp_dir_override)
+ endif
+
+ if bash_comp_inst_dir == ''
+ message('Found bash-completion but the .pc file did not set \'completionsdir\', fallback to a predefined path')
+ bash_comp_inst_dir = join_paths(get_option('datadir'), 'bash-completion/completions')
+ endif
+
install_data([
'completion/gapplication',
'completion/gdbus',
'completion/gsettings',
'completion/gresource'
],
- install_dir: join_paths(get_option('datadir'), 'bash-completion/completions'))
+ install_dir: bash_comp_inst_dir)
endif
if enable_dtrace
# '$(gio_win32_res_ldflag)',
dependencies : [libz_dep, libdl_dep, libmount_dep, libglib_dep,
libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep,
- platform_deps, network_libs, libdbuspolicy_dep],
+ platform_deps, network_libs, libdbuspolicy_dep, libsysprof_capture_dep],
c_args : gio_c_args,
objc_args : gio_c_args,
# intl.lib is not compatible with SAFESEH
link_args : [noseh_link_args, glib_link_flags],
)
-giomodulesdir = get_option('gio_module_dir')
-if giomodulesdir == ''
- giomodulesdir = join_paths('${libdir}', 'gio', 'modules')
+if get_option('gio_module_dir') != ''
+ pkgconfig_giomodulesdir = join_paths('${prefix}', get_option('gio_module_dir'))
+else
+ pkgconfig_giomodulesdir = join_paths('${libdir}', 'gio', 'modules')
endif
schemas_subdir = join_paths('glib-2.0', 'schemas')
+libgio_dep = declare_dependency(link_with : libgio,
+ dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep],
+ include_directories : [gioinc])
+
pkg.generate(libgio,
libraries_private : [osx_ldflags],
requires : ['glib-2.0', 'gobject-2.0'],
variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')),
'schemasdir=' + join_paths('${datadir}', schemas_subdir),
'bindir=' + join_paths('${prefix}', get_option('bindir')),
- 'giomoduledir=' + giomodulesdir,
+ 'giomoduledir=' + pkgconfig_giomodulesdir,
'gio=' + join_paths('${bindir}', 'gio'),
'gio_querymodules=' + join_paths('${bindir}', 'gio-querymodules'),
'glib_compile_schemas=' + join_paths('${bindir}', 'glib-compile-schemas'),
description : 'glib I/O library',
)
+if meson.version().version_compare('>=0.54.0')
+ meson.override_dependency('gio-2.0', libgio_dep)
+endif
+
+
if host_system == 'windows'
pkg.generate(requires : ['gobject-2.0', 'gmodule-no-export-2.0', 'gio-2.0'],
subdirs : ['gio-win32-2.0'],
name : 'GIO Windows specific APIs',
description : 'Windows specific headers for glib I/O library',
)
+ if meson.version().version_compare('>=0.54.0')
+ meson.override_dependency('gio-win32-2.0', libgio_dep)
+ endif
else
pkg.generate(requires : ['gobject-2.0', 'gio-2.0'],
subdirs : ['gio-unix-2.0'],
name : 'GIO unix specific APIs',
description : 'unix specific headers for glib I/O library',
)
+ if meson.version().version_compare('>=0.54.0')
+ meson.override_dependency('gio-unix-2.0', libgio_dep)
+ endif
endif
-libgio_dep = declare_dependency(link_with : libgio,
- dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep],
- include_directories : [gioinc])
-
if host_system == 'windows'
# Hack till https://github.com/mesonbuild/meson/issues/2324 is fixed
libgiounix_dep = dependency('', required : false)
# Dependencies used by executables below
have_libelf = false
-libelf = dependency('libelf', version : '>= 0.8.12', required : false)
+libelf = dependency('libelf', version : '>= 0.8.12', required : get_option ('libelf'))
if libelf.found()
have_libelf = true
else
# This fallback is necessary on *BSD. elfutils isn't the only libelf
# implementation, and *BSD usually includes their own libelf as a system
# library which doesn't have a corresponding .pc file.
- libelf = cc.find_library('elf', required : false)
+ libelf = cc.find_library('elf', required : get_option ('libelf'))
have_libelf = libelf.found()
have_libelf = have_libelf and cc.has_function('elf_begin', dependencies : libelf)
have_libelf = have_libelf and cc.has_function('elf_getshdrstrndx', dependencies : libelf)
'gio-tool-cat.c',
'gio-tool-copy.c',
'gio-tool-info.c',
+ 'gio-tool-launch.c',
'gio-tool-list.c',
'gio-tool-mime.c',
'gio-tool-mkdir.c',
dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
glib_compile_schemas = executable('glib-compile-schemas',
- [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-schemas.c'],
+ ['gvdb/gvdb-builder.c', 'glib-compile-schemas.c'],
install : true,
# intl.lib is not compatible with SAFESEH
link_args : noseh_link_args,
if not meson.is_cross_build()
meson.override_find_program('glib-compile-schemas', glib_compile_schemas)
meson.override_find_program('glib-compile-resources', glib_compile_resources)
+ meson.override_find_program('gio-querymodules', gio_querymodules)
endif
executable('gsettings', 'gsettings-tool.c',