2 '-DG_LOG_DOMAIN="GLib-GIO"',
4 '-DGIO_MODULE_DIR="@0@"'.format(glib_giomodulesdir),
5 '-DLOCALSTATEDIR="@0@"'.format(glib_localstatedir),
8 gio_c_args += glib_hidden_visibility_args
10 # FIXME: Install empty glib_giomodulesdir
12 gnetworking_h_conf = configuration_data()
14 gnetworking_h_nameser_compat_include = ''
16 if host_system not in ['windows', 'android']
17 # Don't check for C_IN on Android since it does not define it in public
18 # headers, we define it ourselves wherever necessary
19 if not cc.compiles('''#include <sys/types.h>
20 #include <arpa/nameser.h>
21 int qclass = C_IN;''',
22 name : 'C_IN in public headers (no arpa/nameser_compat.h needed)')
23 if cc.compiles('''#include <sys/types.h>
24 #include <arpa/nameser.h>
25 #include <arpa/nameser_compat.h>
26 int qclass = C_IN;''',
27 name : 'arpa/nameser_compat.h needed for C_IN')
28 gnetworking_h_nameser_compat_include = '#include <arpa/nameser_compat.h>'
30 error('Could not find required includes for ARPA C_IN')
37 if host_system != 'windows'
39 res_query_test = '''#include <resolv.h>
40 int main (int argc, char ** argv) {
41 return res_query("test", 0, 0, (void *)0, 0);
43 res_query_test_full = '''#include <sys/types.h>
44 #include <netinet/in.h>
45 #include <arpa/nameser.h>
47 if not cc.links(res_query_test_full, name : 'res_query()')
48 if cc.links(res_query_test_full, args : '-lresolv', name : 'res_query() in -lresolv')
49 network_libs += [ cc.find_library('resolv') ]
50 network_args += [ '-lresolv' ]
51 elif cc.links(res_query_test, args : '-lbind', name : 'res_query() in -lbind')
52 network_libs += [ cc.find_library('bind') ]
53 network_args += [ '-lbind' ]
54 elif cc.links(res_query_test, args : '-lsocket', name : 'res_query() in -lsocket')
55 network_libs += [ cc.find_library('socket') ]
56 network_args += [ '-lsocket' ]
58 error('Could not find res_query()')
63 socket_test = '''#include <sys/types.h>
64 #include <sys/socket.h>
65 int main (int argc, char ** argv) {
66 return socket(1, 2, 3);
68 if not cc.links(socket_test, name : 'socket()')
69 if cc.links(socket_test, args : '-lsocket', name : 'socket() in -lsocket')
70 network_libs += [ cc.find_library('socket') ]
71 network_args += [ '-lsocket' ]
73 error('Could not find socket()')
78 if cc.links('''#include <sys/types.h>
79 #include <netinet/in.h>
80 #include <arpa/nameser.h>
82 int main (int argc, char ** argv) {
84 }''', args : network_args, name : 'res_init()')
85 glib_conf.set('HAVE_RES_INIT', 1)
89 if cc.links('''#include <sys/types.h>
90 #include <netinet/in.h>
91 #include <arpa/nameser.h>
93 int main (int argc, char ** argv) {
94 struct __res_state res;
97 }''', args : network_args, name : 'res_nclose()')
98 glib_conf.set('HAVE_RES_NCLOSE', 1)
102 if cc.links('''#include <sys/types.h>
103 #include <netinet/in.h>
104 #include <arpa/nameser.h>
106 int main (int argc, char ** argv) {
107 struct __res_state res;
110 }''', args : network_args, name : 'res_ndestroy()')
111 glib_conf.set('HAVE_RES_NDESTROY', 1)
115 if cc.links('''#include <sys/types.h>
116 #include <netinet/in.h>
117 #include <arpa/nameser.h>
119 int main (int argc, char ** argv) {
120 struct __res_state res;
121 return res_ninit(&res);
122 }''', args : network_args, name : 'res_ninit()')
123 glib_conf.set('HAVE_RES_NINIT', 1)
127 if cc.links('''#include <sys/types.h>
128 #include <netinet/in.h>
129 #include <arpa/nameser.h>
131 int main (int argc, char ** argv) {
132 struct __res_state res;
133 return res_nquery(&res, "test", 0, 0, (void *)0, 0);
134 }''', args : network_args, name : 'res_nquery()')
135 glib_conf.set('HAVE_RES_NQUERY', 1)
138 if cc.has_type('struct ip_mreqn', prefix : '#include <netinet/in.h>')
139 glib_conf.set('HAVE_IP_MREQN', 1)
142 if cc.compiles('''#include <sys/ioctl.h>
144 int main (int argc, char ** argv) {
146 ioctl(0, SIOCGIFADDR, &ifr);
149 name : 'ioctl with request SIOCGIFADDR')
150 glib_conf.set('HAVE_SIOCGIFADDR', '/**/')
155 if host_system == 'android'
156 # struct ip_mreq_source definition is broken on Android NDK <= r16
157 # See https://bugzilla.gnome.org/show_bug.cgi?id=740791
158 if not cc.compiles('''#include <netinet/in.h>
159 int main(int argc, char ** argv) {
160 struct ip_mreq_source mc_req_src;
161 mc_req_src.imr_interface.s_addr = 0;
164 name : 'ip_mreq_source.imr_interface has s_addr member')
165 glib_conf.set('BROKEN_IP_MREQ_SOURCE_STRUCT', 1)
169 gnetworking_h_conf.set('NAMESER_COMPAT_INCLUDE', gnetworking_h_nameser_compat_include)
171 gnetworking_h = configure_file(input : 'gnetworking.h.in',
172 output : 'gnetworking.h',
173 install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'),
174 configuration : gnetworking_h_conf)
176 gdbus_headers = files(
177 'gdbusauthobserver.h',
185 'gdbusnamewatching.h',
187 'gdbusintrospection.h',
188 'gdbusmethodinvocation.h',
191 'gdbusinterfaceskeleton.h',
193 'gdbusobjectskeleton.h',
194 'gdbusobjectproxy.h',
195 'gdbusobjectmanager.h',
196 'gdbusobjectmanagerclient.h',
197 'gdbusobjectmanagerserver.h',
201 gdbus_sources = files(
204 'gdbusauthobserver.c',
206 'gdbusauthmechanism.c',
207 'gdbusauthmechanismanon.c',
208 'gdbusauthmechanismexternal.c',
209 'gdbusauthmechanismsha1.c',
214 'gdbusnamewatching.c',
217 'gdbusintrospection.c',
218 'gdbusmethodinvocation.c',
221 'gdbusinterfaceskeleton.c',
223 'gdbusobjectskeleton.c',
224 'gdbusobjectproxy.c',
225 'gdbusobjectmanager.c',
226 'gdbusobjectmanagerclient.c',
227 'gdbusobjectmanagerserver.c',
231 if get_option('kdbus')
232 gdbus_sources += files(
234 'gkdbusfakedaemon.c',
238 # Generate gdbus-codegen
239 subdir('gdbus-2.0/codegen')
241 # Generate xdp-dbus.{c,h}
242 xdp_dbus_generated = custom_target('xdp-dbus',
243 input : ['org.freedesktop.portal.Documents.xml',
244 'org.freedesktop.portal.OpenURI.xml',
245 'org.freedesktop.portal.ProxyResolver.xml',
246 'org.freedesktop.portal.Trash.xml'],
247 output : ['xdp-dbus.h', 'xdp-dbus.c'],
248 depend_files : gdbus_codegen_built_files,
249 command : [python, gdbus_codegen,
250 '--interface-prefix', 'org.freedesktop.portal.',
251 '--output-directory', '@OUTDIR@',
252 '--generate-c-code', 'xdp-dbus',
253 '--c-namespace', 'GXdp',
256 # Generate gdbus-generated.{c,h}
257 gdbus_daemon_generated = custom_target('gdbus-daemon-generated',
258 input : ['dbus-daemon.xml'],
259 output : ['gdbus-daemon-generated.h', 'gdbus-daemon-generated.c'],
260 depend_files : gdbus_codegen_built_files,
261 command : [python, gdbus_codegen,
262 '--interface-prefix', 'org.',
263 '--output-directory', '@OUTDIR@',
264 '--generate-c-code', 'gdbus-daemon-generated',
265 '--c-namespace', '_G', '@INPUT@'])
267 settings_headers = files(
268 'gsettingsbackend.h',
273 settings_sources = files(
274 'gvdb/gvdb-reader.c',
275 'gdelayedsettingsbackend.c',
276 'gkeyfilesettingsbackend.c',
277 'gmemorysettingsbackend.c',
278 'gnullsettingsbackend.c',
279 'gsettingsbackend.c',
281 'gsettings-mapping.c',
285 if host_system == 'windows'
286 settings_sources += files('gregistrysettingsbackend.c')
289 application_headers = files(
291 'gapplicationcommandline.h',
295 'gsimpleactiongroup.h',
296 'gremoteactiongroup.h',
297 'gactiongroupexporter.h',
298 'gdbusactiongroup.h',
310 application_sources = files(
312 'gapplicationcommandline.c',
313 'gapplicationimpl-dbus.c',
317 'gsimpleactiongroup.c',
318 'gremoteactiongroup.c',
319 'gactiongroupexporter.c',
320 'gdbusactiongroup.c',
330 'gnotificationbackend.c',
333 local_sources = files(
336 'glocalfileenumerator.c',
338 'glocalfileinputstream.c',
339 'glocalfilemonitor.c',
340 'glocalfileoutputstream.c',
341 'glocalfileiostream.c',
346 'thumbnail-verify.c',
351 # TODO: internal_objects is a workaround for
352 # <https://github.com/mesonbuild/meson/issues/3934> and
353 # <https://github.com/mesonbuild/meson/issues/3937>. When we can depend
354 # on a meson version where those are fixed, revert the commit that
355 # introduced this workaround.
356 internal_objects = []
358 contenttype_sources = []
363 # This is also used by tests/gdbus-daemon, so use files() to include the path
364 gdbus_daemon_sources = [
365 files('gdbusdaemon.c'),
366 gdbus_daemon_generated,
369 if host_system != 'windows'
370 unix_sources = files(
371 'gfiledescriptorbased.c',
374 'gunixcredentialsmessage.c',
379 'gunixsocketaddress.c',
381 'gunixvolumemonitor.c',
382 'gunixinputstream.c',
383 'gunixoutputstream.c',
384 'gfdonotificationbackend.c',
385 'ggtknotificationbackend.c',
388 portal_sources = [files(
391 'gmemorymonitorportal.c',
392 'gnetworkmonitorportal.c',
393 'gpowerprofilemonitorportal.c',
394 'gproxyresolverportal.c',
397 'gportalnotificationbackend.c'),
401 gio_unix_include_headers = files(
402 'gfiledescriptorbased.h',
404 'gunixcredentialsmessage.h',
408 'gunixinputstream.h',
409 'gunixoutputstream.h',
410 'gunixsocketaddress.h',
414 settings_sources += files('gnextstepsettingsbackend.m')
415 contenttype_sources += files('gosxcontenttype.m')
416 appinfo_sources += files('gosxappinfo.m')
417 if glib_have_os_x_9_or_later
418 unix_sources += files('gcocoanotificationbackend.m')
420 application_headers += files('gosxappinfo.h')
422 contenttype_sources += files('gcontenttype.c')
423 appinfo_sources += files('gdesktopappinfo.c')
424 gio_unix_include_headers += files('gdesktopappinfo.h')
428 internal_deps += [xdgmime_lib]
429 internal_objects += [xdgmime_lib.extract_all_objects()]
431 install_headers(gio_unix_include_headers, subdir : 'gio-unix-2.0/gio')
433 if glib_conf.has('HAVE_NETLINK')
434 unix_sources += files(
435 'gnetworkmonitornetlink.c',
436 'gnetworkmonitornm.c',
440 appinfo_sources += files('gwin32appinfo.c')
441 contenttype_sources += files('gcontenttype-win32.c')
442 platform_deps += [cc.find_library('shlwapi'),
443 cc.find_library('dnsapi'),
446 platform_deps += uwp_gio_deps
448 win32_sources += files(
449 'gwin32registrykey.c',
451 'gwin32volumemonitor.c',
452 'gwin32inputstream.c',
453 'gwin32outputstream.c',
454 'gwin32file-sync-stream.c',
455 'gwin32packageparser.c',
456 'gwin32networkmonitor.c',
457 'gwin32networkmonitor.h',
458 'gwin32notificationbackend.c',
461 gio_win_rc = configure_file(
464 configuration: glibconfig_conf,
466 gio_win_res = windows.compile_resources(gio_win_rc)
467 win32_sources += [gio_win_res]
469 gio_win32_include_headers = files(
470 'gwin32inputstream.h',
471 'gwin32outputstream.h',
473 install_headers(gio_win32_include_headers, subdir : 'gio-win32-2.0/gio')
481 'gbufferedinputstream.c',
482 'gbufferedoutputstream.c',
485 'gcharsetconverter.c',
486 'gcontextspecificgroup.c',
488 'gconverterinputstream.c',
489 'gconverteroutputstream.c',
492 'gdatainputstream.c',
493 'gdataoutputstream.c',
496 'gdummyproxyresolver.c',
497 'gdummytlsbackend.c',
505 'gfileinputstream.c',
507 'gfilenamecompleter.c',
508 'gfileoutputstream.c',
510 'gfilterinputstream.c',
511 'gfilteroutputstream.c',
514 'ginetaddressmask.c',
515 'ginetsocketaddress.c',
524 'gmarshal-internal.c',
527 'gmemorymonitordbus.c',
528 'gmemoryinputstream.c',
529 'gmemoryoutputstream.c',
531 'gnativesocketaddress.c',
532 'gnativevolumemonitor.c',
536 'gnetworkmonitorbase.c',
540 'gpollableinputstream.c',
541 'gpollableoutputstream.c',
543 'gpollfilemonitor.c',
544 'gpowerprofilemonitor.c',
545 'gpowerprofilemonitordbus.c',
548 'gproxyaddressenumerator.c',
554 'gsimpleasyncresult.c',
556 'gsimplepermission.c',
557 'gsimpleproxyresolver.c',
560 'gsocketaddressenumerator.c',
562 'gsocketconnectable.c',
563 'gsocketconnection.c',
564 'gsocketcontrolmessage.c',
565 'gsocketinputstream.c',
567 'gsocketoutputstream.c',
570 'gsubprocesslauncher.c',
574 'gtcpwrapperconnection.c',
576 'gthreadedsocketservice.c',
577 'gthreadedresolver.c',
578 'gthreadedresolver.h',
581 'gtlsclientconnection.c',
584 'gtlsfiledatabase.c',
587 'gtlsserverconnection.c',
589 'gdtlsclientconnection.c',
590 'gdtlsserverconnection.c',
591 'gunionvolumemonitor.c',
596 'gzlibdecompressor.c',
602 gio_sources += appinfo_sources
603 gio_sources += contenttype_sources
604 gio_sources += gdbus_daemon_sources
605 gio_sources += unix_sources
606 gio_sources += win32_sources
607 gio_sources += application_sources
608 gio_sources += settings_sources
609 gio_sources += gdbus_sources
610 gio_sources += portal_sources
611 gio_sources += local_sources
614 # This is read by gobject-introspection/misc/ and gtk-doc
615 gio-public-headers.txt: Makefile
616 '$(AM_V_GEN) echo $(gioinclude_HEADERS) $(giowin32include_HEADERS) $(giounixinclude_HEADERS) > $@.tmp && mv $@.tmp $@
618 gio.def: libgio-2.0.la
619 '$(AM_V_GEN) dumpbin.exe -exports .libs/libgio-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / +[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > gio.def.tmp && mv gio.def.tmp gio.def
621 gio-2.0.lib: libgio-2.0.la gio.def
622 '$(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/gio.def -out:$@
629 'gbufferedinputstream.h',
630 'gbufferedoutputstream.h',
634 'gcharsetconverter.h',
636 'gconverterinputstream.h',
637 'gconverteroutputstream.h',
639 'gdatainputstream.h',
640 'gdataoutputstream.h',
649 'gfileinputstream.h',
651 'gfilenamecompleter.h',
652 'gfileoutputstream.h',
654 'gfilterinputstream.h',
655 'gfilteroutputstream.h',
658 'ginetaddressmask.h',
659 'ginetsocketaddress.h',
663 'gio-autocleanups.h',
672 'gmemoryinputstream.h',
674 'gmemoryoutputstream.h',
676 'gnativesocketaddress.h',
677 'gnativevolumemonitor.h',
683 'gpollableinputstream.h',
684 'gpollableoutputstream.h',
686 'gpowerprofilemonitor.h',
689 'gproxyaddressenumerator.h',
694 'gsimpleasyncresult.h',
696 'gsimplepermission.h',
697 'gsimpleproxyresolver.h',
700 'gsocketaddressenumerator.h',
702 'gsocketconnectable.h',
703 'gsocketconnection.h',
704 'gsocketcontrolmessage.h',
709 'gsubprocesslauncher.h',
712 'gtcpwrapperconnection.h',
714 'gthreadedsocketservice.h',
717 'gtlsclientconnection.h',
720 'gtlsfiledatabase.h',
723 'gtlsserverconnection.h',
725 'gdtlsclientconnection.h',
726 'gdtlsserverconnection.h',
731 'gzlibdecompressor.h',
734 'tizen_header_glib.h',
737 gio_headers += application_headers
738 gio_headers += settings_headers
739 gio_headers += gdbus_headers
740 install_headers(gio_headers, subdir : 'glib-2.0/gio/')
742 # We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums
743 # in PATH, which means you can't bootstrap glib with its own glib-mkenums.
744 gioenumtypes_h = custom_target('gioenumtypes_h',
745 output : 'gioenumtypes.h',
749 install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'),
750 command : [python, glib_mkenums,
751 '--template', files('gioenumtypes.h.template'),
752 '@INPUT@', gnetworking_h])
754 gioenumtypes_c = custom_target('gioenumtypes_c',
755 output : 'gioenumtypes.c',
758 depends : [gioenumtypes_h],
759 command : [python, glib_mkenums,
760 '--template', files('gioenumtypes.c.template'),
761 '@INPUT@', gnetworking_h])
763 gioenumtypes_dep = declare_dependency(sources : [gioenumtypes_h, glib_enumtypes_h])
766 if glib_conf.has('HAVE_SYS_INOTIFY_H') and have_func_inotify_init1
768 internal_deps += [ inotify_lib ]
769 internal_objects += [inotify_lib.extract_all_objects()]
773 if have_func_kqueue and have_func_kevent
775 internal_deps += [ kqueue_lib ]
776 internal_objects += [kqueue_lib.extract_all_objects()]
779 if host_system == 'windows'
781 internal_deps += [ giowin32_lib ]
782 internal_objects += [giowin32_lib.extract_all_objects()]
786 bash_comp_inst_dir = ''
787 if bash_comp_dep.found()
788 bash_comp_dir_override = bash_comp_dep.version().version_compare('>= 2.10') ? ['datadir', get_option('datadir')] : ['prefix', get_option('prefix')]
789 bash_comp_inst_dir = bash_comp_dep.get_pkgconfig_variable('completionsdir', define_variable: bash_comp_dir_override)
792 if bash_comp_inst_dir == ''
793 message('Found bash-completion but the .pc file did not set \'completionsdir\', fallback to a predefined path')
794 bash_comp_inst_dir = join_paths(get_option('datadir'), 'bash-completion/completions')
798 'completion/gapplication',
801 'completion/gsettings',
802 'completion/gresource'
804 install_dir: bash_comp_inst_dir)
808 gio_dtrace_obj = dtrace_obj_gen.process('gio_probes.d')
809 gio_dtrace_hdr = dtrace_hdr_gen.process('gio_probes.d')
815 if get_option('kdbus')
816 gio_c_args += '-DKDBUS'
819 libdbuspolicy_dep = dependency('', required : false)
820 if get_option('libdbuspolicy')
821 libdbuspolicy_dep = dependency('libdbuspolicy1', version : '>=1', required : true)
822 gio_c_args += '-DLIBDBUSPOLICY'
825 libgio = library('gio-2.0',
826 gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources,
827 gio_dtrace_hdr, gio_dtrace_obj,
828 objects : internal_objects,
829 version : library_version,
830 soversion : soversion,
831 darwin_versions : darwin_versions,
833 include_directories : [configinc, gioinc],
834 # '$(gio_win32_res_ldflag)',
835 dependencies : [libz_dep, libdl_dep, libmount_dep, libglib_dep,
836 libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep,
837 platform_deps, network_libs, libdbuspolicy_dep, libsysprof_capture_dep],
839 objc_args : gio_c_args,
840 # intl.lib is not compatible with SAFESEH
841 link_args : [noseh_link_args, glib_link_flags],
844 if get_option('gio_module_dir') != ''
845 pkgconfig_giomodulesdir = join_paths('${prefix}', get_option('gio_module_dir'))
847 pkgconfig_giomodulesdir = join_paths('${libdir}', 'gio', 'modules')
850 schemas_subdir = join_paths('glib-2.0', 'schemas')
852 libgio_dep = declare_dependency(link_with : libgio,
853 dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep],
854 include_directories : [gioinc])
857 libraries_private : [osx_ldflags],
858 requires : ['glib-2.0', 'gobject-2.0'],
859 variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')),
860 'schemasdir=' + join_paths('${datadir}', schemas_subdir),
861 'bindir=' + join_paths('${prefix}', get_option('bindir')),
862 'giomoduledir=' + pkgconfig_giomodulesdir,
863 'gio=' + join_paths('${bindir}', 'gio'),
864 'gio_querymodules=' + join_paths('${bindir}', 'gio-querymodules'),
865 'glib_compile_schemas=' + join_paths('${bindir}', 'glib-compile-schemas'),
866 'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'),
867 'gdbus=' + join_paths('${bindir}', 'gdbus'),
868 'gdbus_codegen=' + join_paths('${bindir}', 'gdbus-codegen'),
869 'gresource=' + join_paths('${bindir}', 'gresource'),
870 'gsettings=' + join_paths('${bindir}', 'gsettings')],
871 version : glib_version,
872 install_dir : glib_pkgconfigreldir,
873 filebase : 'gio-2.0',
875 description : 'glib I/O library',
878 if meson.version().version_compare('>=0.54.0')
879 meson.override_dependency('gio-2.0', libgio_dep)
883 if host_system == 'windows'
884 pkg.generate(requires : ['gobject-2.0', 'gmodule-no-export-2.0', 'gio-2.0'],
885 subdirs : ['gio-win32-2.0'],
886 version : glib_version,
887 install_dir : glib_pkgconfigreldir,
888 filebase : 'gio-windows-2.0',
889 name : 'GIO Windows specific APIs',
890 description : 'Windows specific headers for glib I/O library',
892 if meson.version().version_compare('>=0.54.0')
893 meson.override_dependency('gio-win32-2.0', libgio_dep)
896 pkg.generate(requires : ['gobject-2.0', 'gio-2.0'],
897 subdirs : ['gio-unix-2.0'],
898 version : glib_version,
899 install_dir : glib_pkgconfigreldir,
900 filebase : 'gio-unix-2.0',
901 name : 'GIO unix specific APIs',
902 description : 'unix specific headers for glib I/O library',
904 if meson.version().version_compare('>=0.54.0')
905 meson.override_dependency('gio-unix-2.0', libgio_dep)
909 if host_system == 'windows'
910 # Hack till https://github.com/mesonbuild/meson/issues/2324 is fixed
911 libgiounix_dep = dependency('', required : false)
912 libgiowin32_dep = libgio_dep
914 libgiowin32_dep = dependency('', required : false)
915 libgiounix_dep = libgio_dep
918 # Dependencies used by executables below
920 libelf = dependency('libelf', version : '>= 0.8.12', required : get_option ('libelf'))
924 # This fallback is necessary on *BSD. elfutils isn't the only libelf
925 # implementation, and *BSD usually includes their own libelf as a system
926 # library which doesn't have a corresponding .pc file.
927 libelf = cc.find_library('elf', required : get_option ('libelf'))
928 have_libelf = libelf.found()
929 have_libelf = have_libelf and cc.has_function('elf_begin', dependencies : libelf)
930 have_libelf = have_libelf and cc.has_function('elf_getshdrstrndx', dependencies : libelf)
931 have_libelf = have_libelf and cc.has_function('elf_getshdrnum', dependencies : libelf)
932 have_libelf = have_libelf and cc.has_header('libelf.h')
936 glib_conf.set('HAVE_LIBELF', 1)
941 gconstructor_as_data_h = custom_target('gconstructor_as_data.h',
942 input : ['data-to-c.py', files('../glib/gconstructor.h')],
943 output : ['gconstructor_as_data.h'],
944 command : [python, '@INPUT0@', '@INPUT1@', 'gconstructor_code', '@OUTPUT@'])
946 # Several installed executables
957 'gio-tool-monitor.c',
969 executable('gio', gio_tool_sources,
972 # intl.lib is not compatible with SAFESEH
973 link_args : noseh_link_args,
974 dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
976 executable('gresource', 'gresource-tool.c',
978 # intl.lib is not compatible with SAFESEH
979 link_args : noseh_link_args,
980 dependencies : [libelf, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
982 gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodule-priv.c',
985 # intl.lib is not compatible with SAFESEH
986 link_args : noseh_link_args,
987 dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
989 glib_compile_schemas = executable('glib-compile-schemas',
990 ['gvdb/gvdb-builder.c', 'glib-compile-schemas.c'],
992 # intl.lib is not compatible with SAFESEH
993 link_args : noseh_link_args,
994 dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
996 glib_compile_resources = executable('glib-compile-resources',
997 [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-resources.c'],
1000 # intl.lib is not compatible with SAFESEH
1001 link_args : noseh_link_args,
1002 dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
1004 # Cannot override those programs in cross compilation case because they are
1005 # native executables that cannot be run on the build machine.
1006 # See https://gitlab.gnome.org/GNOME/glib/issues/1859.
1007 if not meson.is_cross_build()
1008 meson.override_find_program('glib-compile-schemas', glib_compile_schemas)
1009 meson.override_find_program('glib-compile-resources', glib_compile_resources)
1010 meson.override_find_program('gio-querymodules', gio_querymodules)
1013 executable('gsettings', 'gsettings-tool.c',
1015 c_args : gio_c_args,
1016 # intl.lib is not compatible with SAFESEH
1017 link_args : noseh_link_args,
1018 dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
1019 install_data('gschema.dtd',
1020 install_dir : join_paths(get_option('datadir'), schemas_subdir))
1022 install_data(['gschema.loc', 'gschema.its'],
1023 install_dir : join_paths(get_option('datadir'), 'gettext/its'))
1025 executable('gdbus', 'gdbus-tool.c',
1027 c_args : gio_c_args,
1028 # intl.lib is not compatible with SAFESEH
1029 link_args : noseh_link_args,
1030 dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
1032 if host_system != 'windows' and not glib_have_cocoa
1033 executable('gapplication', 'gapplication-tool.c',
1035 c_args : gio_c_args,
1036 # intl.lib is not compatible with SAFESEH
1037 link_args : noseh_link_args,
1038 dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
1042 gio_stp = configure_file(input : 'gio.stp.in',
1043 output : '@0@.stp'.format(libgio.full_path().split('/').get(-1)),
1044 configuration : stp_cdata,
1045 install_dir : tapset_install_dir,
1054 # The following is an example for building internal marshallers that are used
1055 # by GIO. We cannot guarantee glib-genmarshal availability while building GLib
1056 # so they are pre-generated and placed into gmarshal-internal.[ch].
1058 # gmarshal_internal = gnome.genmarshal('gmarshal-internal',
1059 # sources: 'gmarshal-internal.list',
1060 # prefix: '_g_cclosure_marshal',
1061 # valist_marshallers: true,