@@ -1693,6 +1693,7 @@ update_hwdb_sh = find_program('tools/update-hwdb.sh')
16931693update_hwdb_autosuspend_sh = find_program (' tools/update-hwdb-autosuspend.sh' )
16941694update_syscall_tables_sh = find_program (' tools/update-syscall-tables.sh' )
16951695xml_helper_py = find_program (' tools/xml_helper.py' )
1696+ export_dbus_interfaces_py = find_program (' tools/dbus_exporter.py' )
16961697
16971698#####################################################################
16981699
@@ -1708,6 +1709,13 @@ add_project_arguments('-include', 'config.h', language : 'c')
17081709# usually, but not always, installed in /bin.
17091710public_programs = []
17101711
1712+ # D-Bus introspection XML export
1713+ dbus_programs = []
1714+ dbus_interfaces_dir = get_option (' dbus-interfaces-dir' )
1715+ if dbus_interfaces_dir == ''
1716+ dbus_interfaces_dir = get_option (' datadir' ) + ' /dbus-1'
1717+ endif
1718+
17111719tests = []
17121720fuzzers = []
17131721
@@ -1975,7 +1983,7 @@ endforeach
19751983
19761984############################################################
19771985
1978- executable (
1986+ dbus_programs += executable (
19791987 ' systemd' ,
19801988 systemd_sources,
19811989 include_directories : includes,
@@ -2144,7 +2152,7 @@ if conf.get('HAVE_BLKID') == 1
21442152endif
21452153
21462154if conf.get(' ENABLE_RESOLVE' ) == 1
2147- executable (
2155+ dbus_programs += executable (
21482156 ' systemd-resolved' ,
21492157 systemd_resolved_sources,
21502158 include_directories : resolve_includes,
@@ -2181,7 +2189,7 @@ if conf.get('ENABLE_RESOLVE') == 1
21812189endif
21822190
21832191if conf.get(' ENABLE_LOGIND' ) == 1
2184- executable (
2192+ dbus_programs += executable (
21852193 ' systemd-logind' ,
21862194 systemd_logind_sources,
21872195 include_directories : includes,
@@ -2327,7 +2335,7 @@ public_programs += executable(
23272335 install_dir : rootbindir)
23282336
23292337if conf.get(' ENABLE_PORTABLED' ) == 1
2330- executable (
2338+ dbus_programs += executable (
23312339 ' systemd-portabled' ,
23322340 systemd_portabled_sources,
23332341 include_directories : includes,
@@ -2407,7 +2415,7 @@ if conf.get('ENABLE_HOMED') == 1
24072415 install : true ,
24082416 install_dir : rootlibexecdir)
24092417
2410- executable (
2418+ dbus_programs += executable (
24112419 ' systemd-homed' ,
24122420 systemd_homed_sources,
24132421 include_directories : home_includes,
@@ -2610,7 +2618,7 @@ if conf.get('ENABLE_XDG_AUTOSTART') == 1
26102618endif
26112619
26122620if conf.get(' ENABLE_HOSTNAMED' ) == 1
2613- executable (
2621+ dbus_programs += executable (
26142622 ' systemd-hostnamed' ,
26152623 ' src/hostname/hostnamed.c' ,
26162624 include_directories : includes,
@@ -2637,7 +2645,7 @@ if conf.get('ENABLE_LOCALED') == 1
26372645 deps = []
26382646 endif
26392647
2640- executable (
2648+ dbus_programs += executable (
26412649 ' systemd-localed' ,
26422650 systemd_localed_sources,
26432651 include_directories : includes,
@@ -2657,7 +2665,7 @@ if conf.get('ENABLE_LOCALED') == 1
26572665endif
26582666
26592667if conf.get(' ENABLE_TIMEDATED' ) == 1
2660- executable (
2668+ dbus_programs += executable (
26612669 ' systemd-timedated' ,
26622670 ' src/timedate/timedated.c' ,
26632671 include_directories : includes,
@@ -2701,7 +2709,7 @@ if conf.get('ENABLE_TIMESYNCD') == 1
27012709endif
27022710
27032711if conf.get(' ENABLE_MACHINED' ) == 1
2704- executable (
2712+ dbus_programs += executable (
27052713 ' systemd-machined' ,
27062714 systemd_machined_sources,
27072715 include_directories : includes,
@@ -2726,7 +2734,7 @@ if conf.get('ENABLE_MACHINED') == 1
27262734endif
27272735
27282736if conf.get(' ENABLE_IMPORTD' ) == 1
2729- executable (
2737+ dbus_programs += executable (
27302738 ' systemd-importd' ,
27312739 systemd_importd_sources,
27322740 include_directories : includes,
@@ -2885,7 +2893,7 @@ if conf.get('ENABLE_PSTORE') == 1
28852893endif
28862894
28872895if conf.get(' ENABLE_OOMD' ) == 1
2888- executable (' systemd-oomd' ,
2896+ dbus_programs += executable (' systemd-oomd' ,
28892897 systemd_oomd_sources,
28902898 include_directories : includes,
28912899 link_with : [libshared],
@@ -3829,6 +3837,13 @@ run_target(
38293837alias_target (' update-dbus-docs' , update_dbus_docs)
38303838alias_target (' update-man-rules' , update_man_rules)
38313839
3840+ custom_target (
3841+ ' export-dbus-interfaces' ,
3842+ output : ' interfaces' ,
3843+ install : dbus_interfaces_dir != ' no' ,
3844+ install_dir : dbus_interfaces_dir,
3845+ command : [export_dbus_interfaces_py, ' @OUTPUT@' , dbus_programs])
3846+
38323847############################################################
38333848
38343849alt_time_epoch = run_command (' date' , ' -Is' , ' -u' , ' -d' , ' @@0@' .format(time_epoch),
0 commit comments