'sysconfdir=/etc',
'localstatedir=/var',
],
- meson_version : '>= 0.39.1',
+ meson_version : '>= 0.40',
)
# We need the same data in three different formats, ugh!
cc = meson.get_compiler('c')
pkgconfig = import('pkgconfig')
+check_compilation_sh = find_program('tools/meson-check-compilation.sh')
foreach arg : ['-Wundef',
'-Wlogical-op',
struct timespec now;
return 0;
}
-')
- # TODO: message?
+', name : '-Werror=shadow with local shadowing')
add_project_arguments('-Werror=shadow', language : 'c')
endif
foreach arg : ['-Wno-typedef-redefinition',
'-Wno-gnu-variable-sized-type-not-at-end',
]
- if cc.has_argument(arg)
+ if cc.has_argument(arg,
+ name : '@0@ is supported'.format(arg))
add_project_arguments(arg, language : 'c')
endif
endforeach
endif
+link_test_c = files('tools/meson-link-test.c')
+
# --as-needed and --no-undefined are provided by meson by default,
# run mesonconf to see what is enabled
foreach arg : ['-Wl,-z,relro',
'-pie',
'-Wl,-fuse-ld=gold',
]
- if cc.has_argument(arg)
+
+ have = run_command(check_compilation_sh,
+ cc.cmd_array(), '-x', 'c', arg,
+ '-include', link_test_c).returncode() == 0
+ message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
+ if have
add_project_link_arguments(arg, language : 'c')
endif
endforeach
+if get_option('buildtype') != 'debug'
+ foreach arg : ['-ffunction-sections',
+ '-fdata-sections']
+ if cc.has_argument(arg,
+ name : '@0@ is supported'.format(arg))
+ add_project_arguments(arg, language : 'c')
+ endif
+ endforeach
+
+ foreach arg : ['-Wl,--gc-sections']
+ have = run_command(check_compilation_sh,
+ cc.cmd_array(), '-x', 'c', arg,
+ '-include', link_test_c).returncode() == 0
+ message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
+ if have
+ add_project_link_arguments(arg, language : 'c')
+ endif
+ endforeach
+endif
+
cpp = ' '.join(cc.cmd_array()) + ' -E'
#####################################################################
['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
['IFLA_VXLAN_GPE', 'linux/if_link.h'],
+ ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
# if_tunnel.h is buggy and cannot be included on its own
['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
sed = find_program('sed')
grep = find_program('grep')
awk = find_program('awk')
-m4 = find_program('/usr/bin/m4')
+m4 = find_program('m4')
stat = find_program('stat')
git = find_program('git', required : false)
etags = find_program('etags', required : false)
meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
mkdir_p = 'mkdir -p $DESTDIR/@0@'
-check_compilation_sh = find_program('tools/meson-check-compilation.sh')
test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
splash_bmp = files('test/splash.bmp')
system_uid_max = system_uid_max.to_int()
conf.set('SYSTEM_UID_MAX', system_uid_max)
substs.set('systemuidmax', system_uid_max)
-message('Maximum system UID is @0@'.format(system_uid_max))
+message('maximum system UID is @0@'.format(system_uid_max))
conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
system_gid_max = system_gid_max.to_int()
conf.set('SYSTEM_GID_MAX', system_gid_max)
substs.set('systemgidmax', system_gid_max)
-message('Maximum system GID is @0@'.format(system_gid_max))
+message('maximum system GID is @0@'.format(system_gid_max))
tty_gid = get_option('tty-gid')
conf.set('TTY_GID', tty_gid)
libdl = cc.find_library('dl')
libcrypt = cc.find_library('crypt')
-libcap = dependency('libcap')
+libcap = dependency('libcap', required : false)
+if not libcap.found()
+ # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
+ libcap = cc.find_library('cap')
+endif
+
libmount = dependency('mount',
version : '>= 2.27')
libapparmor = []
endif
-want_smack = get_option('smack')
-if want_smack != 'false'
- libsmack = dependency('libsmack',
- required : want_smack == 'true')
- if libsmack.found()
- conf.set('HAVE_SMACK', 1)
- m4_defines += ['-DHAVE_SMACK']
- endif
-else
- libsmack = []
-endif
-
smack_run_label = get_option('smack-run-label')
if smack_run_label != ''
conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
['rfkill', 'ENABLE_RFKILL'],
['ldconfig', 'ENABLE_LDCONFIG'],
['efi', 'ENABLE_EFI'],
+ ['tpm', 'SD_BOOT_LOG_TPM'],
['ima', 'HAVE_IMA'],
+ ['smack', 'HAVE_SMACK'],
]
if get_option(pair[0])
conf.set('ENABLE_EFI', 1)
conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
+
+ conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
endif
#####################################################################
'git-contrib',
command : [meson_git_contrib_sh])
endif
+
+if git.found()
+ git_head = run_command(
+ git,
+ ['--git-dir=@0@/.git'.format(meson.source_root()),
+ 'rev-parse', 'HEAD']).stdout().strip()
+ git_head_short = run_command(
+ git,
+ ['--git-dir=@0@/.git'.format(meson.source_root()),
+ 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
+
+ run_target(
+ 'git-snapshot',
+ command : ['git', 'archive',
+ '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
+ git_head_short),
+ '--prefix', 'systemd-@0@/'.format(git_head),
+ 'HEAD'])
+endif