meson: drop parens when appending to list

Meson does not care either way, so let's use the simpler syntax. And files()
already gives a list, so nesting this in a list wouldn't be necessary even
if meson did not flatten everything.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-07-31 09:44:11 +02:00 committed by Yu Watanabe
parent 48e0e10ff5
commit 5a8b164092
5 changed files with 62 additions and 61 deletions

View File

@ -47,8 +47,8 @@ foreach tuple : xsltproc.found() ? manpages : []
manaliases = [] manaliases = []
htmlaliases = [] htmlaliases = []
foreach alias : aliases foreach alias : aliases
manaliases += [alias + '.' + section] manaliases += alias + '.' + section
htmlaliases += [alias + '.html'] htmlaliases += alias + '.html'
endforeach endforeach
mandirn = join_paths(get_option('mandir'), 'man' + section) mandirn = join_paths(get_option('mandir'), 'man' + section)
@ -62,7 +62,7 @@ foreach tuple : xsltproc.found() ? manpages : []
depend_files : custom_entities_ent, depend_files : custom_entities_ent,
install : want_man, install : want_man,
install_dir : mandirn) install_dir : mandirn)
man_pages += [p1] man_pages += p1
p2 = [] p2 = []
foreach htmlalias : htmlaliases foreach htmlalias : htmlaliases
@ -75,9 +75,9 @@ foreach tuple : xsltproc.found() ? manpages : []
dst = join_paths(docdir, 'html', htmlalias) dst = join_paths(docdir, 'html', htmlalias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst) cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
meson.add_install_script('sh', '-c', cmd) meson.add_install_script('sh', '-c', cmd)
p2 += [link] p2 += link
endif endif
html_pages += [link] html_pages += link
endforeach endforeach
p3 = custom_target( p3 = custom_target(
@ -89,7 +89,7 @@ foreach tuple : xsltproc.found() ? manpages : []
depends : p2, depends : p2,
install : want_html, install : want_html,
install_dir : join_paths(docdir, 'html')) install_dir : join_paths(docdir, 'html'))
html_pages += [p3] html_pages += p3
source_xml_files += files(tuple[0] + '.xml') source_xml_files += files(tuple[0] + '.xml')
else else
@ -135,7 +135,7 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
command : xslt_cmd + [custom_man_xsl, '@INPUT@'], command : xslt_cmd + [custom_man_xsl, '@INPUT@'],
install : want_man and have_lxml, install : want_man and have_lxml,
install_dir : mandirn) install_dir : mandirn)
man_pages += [p1] man_pages += p1
p2 = [] p2 = []
if html == 'systemd.index.html' if html == 'systemd.index.html'
@ -149,9 +149,9 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
dst = join_paths(docdir, 'html', htmlalias) dst = join_paths(docdir, 'html', htmlalias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst) cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
meson.add_install_script('sh', '-c', cmd) meson.add_install_script('sh', '-c', cmd)
p2 += [link] p2 += link
endif endif
html_pages += [link] html_pages += link
endif endif
p3 = custom_target( p3 = custom_target(
@ -163,7 +163,7 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
depends : p2, depends : p2,
install : want_html and have_lxml, install : want_html and have_lxml,
install_dir : join_paths(docdir, 'html')) install_dir : join_paths(docdir, 'html'))
html_pages += [p3] html_pages += p3
endforeach endforeach
# cannot use run_target until https://github.com/mesonbuild/meson/issues/1644 is resolved # cannot use run_target until https://github.com/mesonbuild/meson/issues/1644 is resolved

View File

@ -1534,7 +1534,7 @@ exe = executable('systemd-analyze',
libblkid], libblkid],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
executable('systemd-journald', executable('systemd-journald',
systemd_journald_sources, systemd_journald_sources,
@ -1557,7 +1557,7 @@ exe = executable('systemd-cat',
dependencies : [threads], dependencies : [threads],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
exe = executable('journalctl', exe = executable('journalctl',
journalctl_sources, journalctl_sources,
@ -1571,7 +1571,7 @@ exe = executable('journalctl',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
executable('systemd-getty-generator', executable('systemd-getty-generator',
'src/getty-generator/getty-generator.c', 'src/getty-generator/getty-generator.c',
@ -1648,7 +1648,7 @@ if conf.get('HAVE_BLKID') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootlibexecdir) install_dir : rootlibexecdir)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_RESOLVE') == 1 if conf.get('ENABLE_RESOLVE') == 1
@ -1675,7 +1675,7 @@ if conf.get('ENABLE_RESOLVE') == 1
libidn], libidn],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
meson.add_install_script(meson_make_symlink, meson.add_install_script(meson_make_symlink,
join_paths(bindir, 'resolvectl'), join_paths(bindir, 'resolvectl'),
@ -1708,7 +1708,7 @@ if conf.get('ENABLE_LOGIND') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
exe = executable('systemd-inhibit', exe = executable('systemd-inhibit',
'src/login/inhibit.c', 'src/login/inhibit.c',
@ -1717,7 +1717,7 @@ if conf.get('ENABLE_LOGIND') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
if conf.get('HAVE_PAM') == 1 if conf.get('HAVE_PAM') == 1
version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
@ -1769,7 +1769,7 @@ if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
dependencies : [libblkid], dependencies : [libblkid],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
endif endif
exe = executable('systemd-socket-activate', 'src/activate/activate.c', exe = executable('systemd-socket-activate', 'src/activate/activate.c',
@ -1778,7 +1778,7 @@ exe = executable('systemd-socket-activate', 'src/activate/activate.c',
dependencies : [threads], dependencies : [threads],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
if get_option('link-systemctl-shared') if get_option('link-systemctl-shared')
@ -1801,7 +1801,7 @@ exe = executable('systemctl', 'src/systemctl/systemctl.c',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
if conf.get('ENABLE_PORTABLED') == 1 if conf.get('ENABLE_PORTABLED') == 1
executable('systemd-portabled', executable('systemd-portabled',
@ -1820,7 +1820,7 @@ if conf.get('ENABLE_PORTABLED') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootlibexecdir) install_dir : rootlibexecdir)
public_programs += [exe] public_programs += exe
endif endif
foreach alias : ['halt', 'poweroff', 'reboot', 'runlevel', 'shutdown', 'telinit'] foreach alias : ['halt', 'poweroff', 'reboot', 'runlevel', 'shutdown', 'telinit']
@ -1928,7 +1928,7 @@ if conf.get('ENABLE_HOSTNAMED') == 1
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_LOCALED') == 1 if conf.get('ENABLE_LOCALED') == 1
@ -1954,7 +1954,7 @@ if conf.get('ENABLE_LOCALED') == 1
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_TIMEDATED') == 1 if conf.get('ENABLE_TIMEDATED') == 1
@ -1975,7 +1975,7 @@ if conf.get('ENABLE_TIMEDATECTL') == 1
link_with : [libshared], link_with : [libshared],
dependencies : [libm], dependencies : [libm],
install : true) install : true)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_TIMESYNCD') == 1 if conf.get('ENABLE_TIMESYNCD') == 1
@ -2018,7 +2018,7 @@ if conf.get('ENABLE_MACHINED') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_IMPORTD') == 1 if conf.get('ENABLE_IMPORTD') == 1
@ -2083,7 +2083,7 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootlibexecdir) install_dir : rootlibexecdir)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
@ -2139,7 +2139,7 @@ if conf.get('ENABLE_COREDUMP') == 1
liblz4], liblz4],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_BINFMT') == 1 if conf.get('ENABLE_BINFMT') == 1
@ -2150,7 +2150,7 @@ if conf.get('ENABLE_BINFMT') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootlibexecdir) install_dir : rootlibexecdir)
public_programs += [exe] public_programs += exe
meson.add_install_script('sh', '-c', meson.add_install_script('sh', '-c',
mkdir_p.format(binfmtdir)) mkdir_p.format(binfmtdir))
@ -2249,7 +2249,7 @@ exe = executable('systemd-sysctl',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootlibexecdir) install_dir : rootlibexecdir)
public_programs += [exe] public_programs += exe
executable('systemd-ac-power', executable('systemd-ac-power',
'src/ac-power/ac-power.c', 'src/ac-power/ac-power.c',
@ -2265,7 +2265,7 @@ exe = executable('systemd-detect-virt',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
exe = executable('systemd-delta', exe = executable('systemd-delta',
'src/delta/delta.c', 'src/delta/delta.c',
@ -2273,7 +2273,7 @@ exe = executable('systemd-delta',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
exe = executable('systemd-escape', exe = executable('systemd-escape',
'src/escape/escape.c', 'src/escape/escape.c',
@ -2282,7 +2282,7 @@ exe = executable('systemd-escape',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
exe = executable('systemd-notify', exe = executable('systemd-notify',
'src/notify/notify.c', 'src/notify/notify.c',
@ -2291,7 +2291,7 @@ exe = executable('systemd-notify',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
executable('systemd-volatile-root', executable('systemd-volatile-root',
'src/volatile-root/volatile-root.c', 'src/volatile-root/volatile-root.c',
@ -2315,7 +2315,7 @@ exe = executable('systemd-path',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
exe = executable('systemd-ask-password', exe = executable('systemd-ask-password',
'src/ask-password/ask-password.c', 'src/ask-password/ask-password.c',
@ -2324,7 +2324,7 @@ exe = executable('systemd-ask-password',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
executable('systemd-reply-password', executable('systemd-reply-password',
'src/reply-password/reply-password.c', 'src/reply-password/reply-password.c',
@ -2341,7 +2341,7 @@ exe = executable('systemd-tty-ask-password-agent',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
exe = executable('systemd-cgls', exe = executable('systemd-cgls',
'src/cgls/cgls.c', 'src/cgls/cgls.c',
@ -2349,7 +2349,7 @@ exe = executable('systemd-cgls',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
exe = executable('systemd-cgtop', exe = executable('systemd-cgtop',
'src/cgtop/cgtop.c', 'src/cgtop/cgtop.c',
@ -2357,7 +2357,7 @@ exe = executable('systemd-cgtop',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
executable('systemd-initctl', executable('systemd-initctl',
'src/initctl/initctl.c', 'src/initctl/initctl.c',
@ -2373,7 +2373,7 @@ exe = executable('systemd-mount',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
meson.add_install_script(meson_make_symlink, meson.add_install_script(meson_make_symlink,
'systemd-mount', join_paths(bindir, 'systemd-umount')) 'systemd-mount', join_paths(bindir, 'systemd-umount'))
@ -2384,7 +2384,7 @@ exe = executable('systemd-run',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
exe = executable('systemd-stdio-bridge', exe = executable('systemd-stdio-bridge',
'src/stdio-bridge/stdio-bridge.c', 'src/stdio-bridge/stdio-bridge.c',
@ -2392,7 +2392,7 @@ exe = executable('systemd-stdio-bridge',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
exe = executable('busctl', exe = executable('busctl',
'src/busctl/busctl.c', 'src/busctl/busctl.c',
@ -2402,7 +2402,7 @@ exe = executable('busctl',
link_with : [libshared], link_with : [libshared],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
if conf.get('ENABLE_SYSUSERS') == 1 if conf.get('ENABLE_SYSUSERS') == 1
exe = executable('systemd-sysusers', exe = executable('systemd-sysusers',
@ -2412,7 +2412,7 @@ if conf.get('ENABLE_SYSUSERS') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_TMPFILES') == 1 if conf.get('ENABLE_TMPFILES') == 1
@ -2424,7 +2424,7 @@ if conf.get('ENABLE_TMPFILES') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
test('test-systemd-tmpfiles', test('test-systemd-tmpfiles',
test_systemd_tmpfiles_py, test_systemd_tmpfiles_py,
@ -2441,7 +2441,7 @@ if conf.get('ENABLE_HWDB') == 1
install_rpath : udev_rpath, install_rpath : udev_rpath,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
endif endif
if conf.get('ENABLE_QUOTACHECK') == 1 if conf.get('ENABLE_QUOTACHECK') == 1
@ -2462,7 +2462,7 @@ exe = executable('systemd-socket-proxyd',
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootlibexecdir) install_dir : rootlibexecdir)
public_programs += [exe] public_programs += exe
exe = executable('systemd-udevd', exe = executable('systemd-udevd',
systemd_udevd_sources, systemd_udevd_sources,
@ -2479,7 +2479,7 @@ exe = executable('systemd-udevd',
install_rpath : udev_rpath, install_rpath : udev_rpath,
install : true, install : true,
install_dir : rootlibexecdir) install_dir : rootlibexecdir)
public_programs += [exe] public_programs += exe
exe = executable('udevadm', exe = executable('udevadm',
udevadm_sources, udevadm_sources,
@ -2496,7 +2496,7 @@ exe = executable('udevadm',
install_rpath : udev_rpath, install_rpath : udev_rpath,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
executable('systemd-shutdown', executable('systemd-shutdown',
systemd_shutdown_sources, systemd_shutdown_sources,
@ -2552,7 +2552,7 @@ exe = executable('systemd-nspawn',
dependencies : [libblkid], dependencies : [libblkid],
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true) install : true)
public_programs += [exe] public_programs += exe
if conf.get('ENABLE_NETWORKD') == 1 if conf.get('ENABLE_NETWORKD') == 1
executable('systemd-networkd', executable('systemd-networkd',
@ -2584,7 +2584,7 @@ if conf.get('ENABLE_NETWORKD') == 1
install_rpath : rootlibexecdir, install_rpath : rootlibexecdir,
install : true, install : true,
install_dir : rootbindir) install_dir : rootbindir)
public_programs += [exe] public_programs += exe
endif endif
executable('systemd-sulogin-shell', executable('systemd-sulogin-shell',
@ -2943,8 +2943,7 @@ status += [
# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS} # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
if conf.get('ENABLE_EFI') == 1 if conf.get('ENABLE_EFI') == 1
status += [ status += 'efi arch: @0@'.format(efi_arch)
'efi arch: @0@'.format(efi_arch)]
if have_gnu_efi if have_gnu_efi
status += [ status += [
@ -3046,9 +3045,9 @@ foreach tuple : [
cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
endif endif
if cond if cond
found += [tuple[0]] found += tuple[0]
else else
missing += [tuple[0]] missing += tuple[0]
endif endif
endforeach endforeach

View File

@ -147,10 +147,10 @@ if have_gnu_efi
+ compile_args, + compile_args,
depend_files : efi_headers) depend_files : efi_headers)
if (common_sources + systemd_boot_sources).contains(file) if (common_sources + systemd_boot_sources).contains(file)
systemd_boot_objects += [o_file] systemd_boot_objects += o_file
endif endif
if (common_sources + stub_sources).contains(file) if (common_sources + stub_sources).contains(file)
stub_objects += [o_file] stub_objects += o_file
endif endif
endforeach endforeach

View File

@ -143,11 +143,13 @@ systemd_resolved_sources += [resolved_gperf_c, resolved_dnssd_gperf_c]
systemd_resolved_dependencies = [threads, libgpg_error, libm, libidn] systemd_resolved_dependencies = [threads, libgpg_error, libm, libidn]
if conf.get('ENABLE_DNS_OVER_TLS') == 1 if conf.get('ENABLE_DNS_OVER_TLS') == 1
if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1 if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1
systemd_resolved_sources += [files(['resolved-dnstls-gnutls.c', 'resolved-dnstls-gnutls.h'])] systemd_resolved_sources += files('resolved-dnstls-gnutls.c',
systemd_resolved_dependencies += [libgnutls] 'resolved-dnstls-gnutls.h')
systemd_resolved_dependencies += libgnutls
elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1 elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1
systemd_resolved_sources += [files(['resolved-dnstls-openssl.c', 'resolved-dnstls-openssl.h'])] systemd_resolved_sources += files('resolved-dnstls-openssl.c',
systemd_resolved_dependencies += [libopenssl] 'resolved-dnstls-openssl.h')
systemd_resolved_dependencies += libopenssl
else else
error('unknown dependency for supporting DNS-over-TLS') error('unknown dependency for supporting DNS-over-TLS')
endif endif

View File

@ -106,7 +106,7 @@ shared_sources = files('''
'''.split()) '''.split())
test_tables_h = files('test-tables.h') test_tables_h = files('test-tables.h')
shared_sources += [test_tables_h] shared_sources += test_tables_h
if conf.get('HAVE_ACL') == 1 if conf.get('HAVE_ACL') == 1
shared_sources += files('acl-util.c') shared_sources += files('acl-util.c')