Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1 | project('systemd', 'c', |
| 2 | version : '233', |
| 3 | license : 'LGPLv2+', |
| 4 | default_options: [ |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 5 | 'c_std=gnu99', |
| 6 | 'prefix=/usr', |
| 7 | 'sysconfdir=/etc', |
| 8 | 'localstatedir=/var', |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 9 | ], |
Zbigniew Jędrzejewski-Szmek | d730e2d | 2017-04-25 08:49:58 -0400 | [diff] [blame] | 10 | meson_version : '>= 0.40', |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 11 | ) |
| 12 | |
| 13 | # We need the same data in three different formats, ugh! |
| 14 | # Also, for hysterical reasons, we use different variable |
| 15 | # names, sometimes. Not all variables are included in every |
| 16 | # set. Ugh, ugh, ugh! |
| 17 | conf = configuration_data() |
| 18 | conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version()) |
| 19 | conf.set_quoted('PACKAGE_VERSION', meson.project_version()) |
| 20 | |
| 21 | substs = configuration_data() |
| 22 | substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd') |
| 23 | substs.set('PACKAGE_VERSION', meson.project_version()) |
| 24 | |
| 25 | m4_defines = [] |
| 26 | |
| 27 | ##################################################################### |
| 28 | |
Zbigniew Jędrzejewski-Szmek | ab916f2 | 2017-04-13 22:15:01 -0400 | [diff] [blame] | 29 | rootprefixdir = get_option('rootprefix') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 30 | if get_option('split-usr') |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 31 | conf.set('HAVE_SPLIT_USR', 1) |
| 32 | rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/' |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 33 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 34 | rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr' |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 35 | endif |
| 36 | |
| 37 | sysvinit_path = get_option('sysvinit-path') |
| 38 | sysvrcnd_path = get_option('sysvrcnd-path') |
| 39 | if sysvinit_path != '' or sysvrcnd_path != '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 40 | conf.set('HAVE_SYSV_COMPAT', 1, |
| 41 | description : 'SysV init scripts and rcN.d links are supported') |
| 42 | m4_defines += ['-DHAVE_SYSV_COMPAT'] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 43 | endif |
| 44 | |
| 45 | # join_paths ignore the preceding arguments if an absolute component is |
| 46 | # encountered, so this should canonicalize various paths when they are |
| 47 | # absolute or relative. |
| 48 | prefixdir = get_option('prefix') |
| 49 | if not prefixdir.startswith('/') |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 50 | error('Prefix is not absolute: "@0@"'.format(prefixdir)) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 51 | endif |
| 52 | bindir = join_paths(prefixdir, get_option('bindir')) |
| 53 | libdir = join_paths(prefixdir, get_option('libdir')) |
| 54 | sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) |
| 55 | includedir = join_paths(prefixdir, get_option('includedir')) |
| 56 | datadir = join_paths(prefixdir, get_option('datadir')) |
| 57 | localstatedir = join_paths('/', get_option('localstatedir')) |
| 58 | |
| 59 | rootbindir = join_paths(rootprefixdir, 'bin') |
| 60 | rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd') |
| 61 | |
| 62 | rootlibdir = get_option('rootlibdir') |
| 63 | if rootlibdir == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 64 | rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 65 | endif |
| 66 | |
| 67 | # Dirs of external packages |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 68 | pkgconfigdatadir = join_paths(datadir, 'pkgconfig') |
| 69 | pkgconfiglibdir = join_paths(libdir, 'pkgconfig') |
| 70 | polkitpolicydir = join_paths(datadir, 'polkit-1/actions') |
| 71 | polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d') |
| 72 | polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d') |
| 73 | varlogdir = join_paths(localstatedir, 'log') |
| 74 | xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 75 | rpmmacrosdir = get_option('rpmmacrosdir') |
| 76 | |
| 77 | # Our own paths |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 78 | pkgdatadir = join_paths(datadir, 'systemd') |
| 79 | environmentdir = join_paths(prefixdir, 'lib/environment.d') |
| 80 | pkgsysconfdir = join_paths(sysconfdir, 'systemd') |
| 81 | userunitdir = join_paths(prefixdir, 'lib/systemd/user') |
| 82 | userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset') |
| 83 | tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d') |
| 84 | sysusersdir = join_paths(prefixdir, 'lib/sysusers.d') |
| 85 | sysctldir = join_paths(prefixdir, 'lib/sysctl.d') |
| 86 | binfmtdir = join_paths(prefixdir, 'lib/binfmt.d') |
| 87 | modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d') |
| 88 | networkdir = join_paths(rootprefixdir, 'lib/systemd/network') |
| 89 | pkgincludedir = join_paths(includedir, 'systemd') |
| 90 | systemgeneratordir = join_paths(rootlibexecdir, 'system-generators') |
| 91 | usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators') |
| 92 | systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators') |
| 93 | userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators') |
| 94 | systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown') |
| 95 | systemsleepdir = join_paths(rootlibexecdir, 'system-sleep') |
| 96 | systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system') |
| 97 | systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset') |
| 98 | udevlibexecdir = join_paths(rootprefixdir, 'lib/udev') |
| 99 | udevhomedir = udevlibexecdir |
| 100 | udevrulesdir = join_paths(udevlibexecdir, 'rules.d') |
| 101 | udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d') |
| 102 | catalogdir = join_paths(prefixdir, 'lib/systemd/catalog') |
| 103 | kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d') |
| 104 | factorydir = join_paths(datadir, 'factory') |
| 105 | docdir = join_paths(datadir, 'doc/systemd') |
| 106 | bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi') |
| 107 | testsdir = join_paths(prefixdir, 'lib/systemd/tests') |
| 108 | systemdstatedir = join_paths(localstatedir, 'lib/systemd') |
| 109 | catalogstatedir = join_paths(systemdstatedir, 'catalog') |
| 110 | randomseeddir = join_paths(localstatedir, 'lib/systemd') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 111 | |
| 112 | dbuspolicydir = get_option('dbuspolicydir') |
| 113 | if dbuspolicydir == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 114 | dbuspolicydir = join_paths(datadir, 'dbus-1/system.d') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 115 | endif |
| 116 | |
| 117 | dbussessionservicedir = get_option('dbussessionservicedir') |
| 118 | if dbussessionservicedir == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 119 | dbussessionservicedir = join_paths(datadir, 'dbus-1/services') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 120 | endif |
| 121 | |
| 122 | dbussystemservicedir = get_option('dbussystemservicedir') |
| 123 | if dbussystemservicedir == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 124 | dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 125 | endif |
| 126 | |
| 127 | pamlibdir = get_option('pamlibdir') |
| 128 | if pamlibdir == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 129 | pamlibdir = join_paths(rootlibdir, 'security') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 130 | endif |
| 131 | |
| 132 | pamconfdir = get_option('pamconfdir') |
| 133 | if pamconfdir == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 134 | pamconfdir = join_paths(sysconfdir, 'pam.d') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 135 | endif |
| 136 | |
| 137 | conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 138 | conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 139 | conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) |
| 140 | conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) |
| 141 | conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) |
Zbigniew Jędrzejewski-Szmek | 2a4c156 | 2017-04-12 19:54:33 -0400 | [diff] [blame] | 142 | conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) |
| 143 | conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 144 | conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 145 | conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir) |
| 146 | conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 147 | conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database')) |
| 148 | conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent')) |
| 149 | conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd')) |
| 150 | conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck')) |
| 151 | conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown')) |
| 152 | conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep')) |
| 153 | conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl')) |
| 154 | conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent')) |
| 155 | conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 156 | conf.set_quoted('ROOTPREFIX', rootprefixdir) |
Zbigniew Jędrzejewski-Szmek | 3131bfe | 2017-04-10 19:06:45 -0400 | [diff] [blame] | 157 | conf.set_quoted('RANDOM_SEED_DIR', randomseeddir) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 158 | conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) |
| 159 | conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 160 | conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir) |
| 161 | conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir) |
| 162 | conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir) |
| 163 | conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir) |
| 164 | conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir) |
| 165 | conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 166 | conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map')) |
| 167 | conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 168 | conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 169 | conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 170 | conf.set_quoted('LIBDIR', libdir) |
| 171 | conf.set_quoted('ROOTLIBDIR', rootlibdir) |
| 172 | conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir) |
| 173 | conf.set_quoted('BOOTLIBDIR', bootlibdir) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 174 | conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull')) |
| 175 | conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import')) |
| 176 | conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export')) |
| 177 | conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg')) |
| 178 | conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg')) |
| 179 | conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 180 | |
| 181 | conf.set_quoted('ABS_BUILD_DIR', meson.build_root()) |
| 182 | conf.set_quoted('ABS_SRC_DIR', meson.source_root()) |
| 183 | |
| 184 | substs.set('prefix', prefixdir) |
Zbigniew Jędrzejewski-Szmek | 3131bfe | 2017-04-10 19:06:45 -0400 | [diff] [blame] | 185 | substs.set('exec_prefix', prefixdir) |
| 186 | substs.set('libdir', libdir) |
| 187 | substs.set('rootlibdir', rootlibdir) |
| 188 | substs.set('includedir', includedir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 189 | substs.set('pkgsysconfdir', pkgsysconfdir) |
Zbigniew Jędrzejewski-Szmek | 3131bfe | 2017-04-10 19:06:45 -0400 | [diff] [blame] | 190 | substs.set('bindir', bindir) |
| 191 | substs.set('rootbindir', rootbindir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 192 | substs.set('rootlibexecdir', rootlibexecdir) |
| 193 | substs.set('systemunitdir', systemunitdir) |
| 194 | substs.set('userunitdir', userunitdir) |
| 195 | substs.set('systempresetdir', systempresetdir) |
| 196 | substs.set('userpresetdir', userpresetdir) |
| 197 | substs.set('udevhwdbdir', udevhwdbdir) |
| 198 | substs.set('udevrulesdir', udevrulesdir) |
Zbigniew Jędrzejewski-Szmek | 3131bfe | 2017-04-10 19:06:45 -0400 | [diff] [blame] | 199 | substs.set('udevlibexecdir', udevlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 200 | substs.set('catalogdir', catalogdir) |
| 201 | substs.set('tmpfilesdir', tmpfilesdir) |
| 202 | substs.set('sysusersdir', sysusersdir) |
| 203 | substs.set('sysctldir', sysctldir) |
| 204 | substs.set('binfmtdir', binfmtdir) |
| 205 | substs.set('modulesloaddir', modulesloaddir) |
| 206 | substs.set('systemgeneratordir', systemgeneratordir) |
| 207 | substs.set('usergeneratordir', usergeneratordir) |
| 208 | substs.set('systemenvgeneratordir', systemenvgeneratordir) |
| 209 | substs.set('userenvgeneratordir', userenvgeneratordir) |
| 210 | substs.set('systemshutdowndir', systemshutdowndir) |
| 211 | substs.set('systemsleepdir', systemsleepdir) |
Zbigniew Jędrzejewski-Szmek | 2a4c156 | 2017-04-12 19:54:33 -0400 | [diff] [blame] | 212 | substs.set('VARLOGDIR', varlogdir) |
| 213 | substs.set('CERTIFICATEROOT', get_option('certificate-root')) |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 214 | substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl')) |
| 215 | substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) |
Zbigniew Jędrzejewski-Szmek | 2a4c156 | 2017-04-12 19:54:33 -0400 | [diff] [blame] | 216 | substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path) |
| 217 | substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) |
| 218 | substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) |
| 219 | substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 220 | |
| 221 | ##################################################################### |
| 222 | |
| 223 | cc = meson.get_compiler('c') |
| 224 | pkgconfig = import('pkgconfig') |
Zbigniew Jędrzejewski-Szmek | 6e2afb1 | 2017-04-24 21:03:35 -0400 | [diff] [blame] | 225 | check_compilation_sh = find_program('tools/meson-check-compilation.sh') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 226 | |
| 227 | foreach arg : ['-Wundef', |
| 228 | '-Wlogical-op', |
| 229 | '-Wmissing-include-dirs', |
| 230 | '-Wold-style-definition', |
| 231 | '-Wpointer-arith', |
| 232 | '-Winit-self', |
| 233 | '-Wdeclaration-after-statement', |
| 234 | '-Wfloat-equal', |
| 235 | '-Wsuggest-attribute=noreturn', |
| 236 | '-Werror=missing-prototypes', |
| 237 | '-Werror=implicit-function-declaration', |
| 238 | '-Werror=missing-declarations', |
| 239 | '-Werror=return-type', |
| 240 | '-Werror=incompatible-pointer-types', |
| 241 | '-Werror=format=2', |
| 242 | '-Wstrict-prototypes', |
| 243 | '-Wredundant-decls', |
| 244 | '-Wmissing-noreturn', |
| 245 | '-Wshadow', |
| 246 | '-Wendif-labels', |
| 247 | '-Wstrict-aliasing=2', |
| 248 | '-Wwrite-strings', |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 249 | '-Werror=overflow', |
| 250 | '-Wdate-time', |
| 251 | '-Wnested-externs', |
| 252 | '-ffast-math', |
| 253 | '-fno-common', |
| 254 | '-fdiagnostics-show-option', |
| 255 | '-fno-strict-aliasing', |
| 256 | '-fvisibility=hidden', |
| 257 | '-fstack-protector', |
| 258 | '-fstack-protector-strong', |
| 259 | '-fPIE', |
| 260 | '--param=ssp-buffer-size=4', |
| 261 | ] |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 262 | if cc.has_argument(arg) |
| 263 | add_project_arguments(arg, language : 'c') |
| 264 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 265 | endforeach |
| 266 | |
Zbigniew Jędrzejewski-Szmek | 2c5434a | 2017-04-27 10:05:41 -0400 | [diff] [blame] | 267 | # "negative" arguments: gcc on purpose does not return an error for "-Wno-" |
| 268 | # arguments, just emits a warnings. So test for the "positive" version instead. |
| 269 | foreach arg : ['unused-parameter', |
| 270 | 'missing-field-initializers', |
| 271 | 'unused-result', |
| 272 | 'format-signedness'] |
| 273 | if cc.has_argument('-W' + arg) |
| 274 | add_project_arguments('-Wno-' + arg, language : 'c') |
| 275 | endif |
| 276 | endforeach |
| 277 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 278 | if cc.compiles(' |
| 279 | #include <time.h> |
| 280 | #include <inttypes.h> |
| 281 | typedef uint64_t usec_t; |
| 282 | usec_t now(clockid_t clock); |
| 283 | int main(void) { |
| 284 | struct timespec now; |
| 285 | return 0; |
| 286 | } |
Zbigniew Jędrzejewski-Szmek | 7572aa8 | 2017-04-24 21:46:40 -0400 | [diff] [blame] | 287 | ', name : '-Werror=shadow with local shadowing') |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 288 | add_project_arguments('-Werror=shadow', language : 'c') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 289 | endif |
| 290 | |
| 291 | if cc.get_id() == 'clang' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 292 | foreach arg : ['-Wno-typedef-redefinition', |
| 293 | '-Wno-gnu-variable-sized-type-not-at-end', |
| 294 | ] |
Zbigniew Jędrzejewski-Szmek | 7572aa8 | 2017-04-24 21:46:40 -0400 | [diff] [blame] | 295 | if cc.has_argument(arg, |
| 296 | name : '@0@ is supported'.format(arg)) |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 297 | add_project_arguments(arg, language : 'c') |
| 298 | endif |
| 299 | endforeach |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 300 | endif |
| 301 | |
Zbigniew Jędrzejewski-Szmek | 6e2afb1 | 2017-04-24 21:03:35 -0400 | [diff] [blame] | 302 | link_test_c = files('tools/meson-link-test.c') |
| 303 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 304 | # --as-needed and --no-undefined are provided by meson by default, |
| 305 | # run mesonconf to see what is enabled |
| 306 | foreach arg : ['-Wl,-z,relro', |
| 307 | '-Wl,-z,now', |
| 308 | '-pie', |
| 309 | '-Wl,-fuse-ld=gold', |
| 310 | ] |
Zbigniew Jędrzejewski-Szmek | 6e2afb1 | 2017-04-24 21:03:35 -0400 | [diff] [blame] | 311 | |
| 312 | have = run_command(check_compilation_sh, |
| 313 | cc.cmd_array(), '-x', 'c', arg, |
| 314 | '-include', link_test_c).returncode() == 0 |
| 315 | message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no')) |
| 316 | if have |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 317 | add_project_link_arguments(arg, language : 'c') |
| 318 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 319 | endforeach |
| 320 | |
Zbigniew Jędrzejewski-Szmek | 41afb5e | 2017-04-24 19:28:04 -0400 | [diff] [blame] | 321 | if get_option('buildtype') != 'debug' |
| 322 | foreach arg : ['-ffunction-sections', |
| 323 | '-fdata-sections'] |
Zbigniew Jędrzejewski-Szmek | 7572aa8 | 2017-04-24 21:46:40 -0400 | [diff] [blame] | 324 | if cc.has_argument(arg, |
| 325 | name : '@0@ is supported'.format(arg)) |
Zbigniew Jędrzejewski-Szmek | 41afb5e | 2017-04-24 19:28:04 -0400 | [diff] [blame] | 326 | add_project_arguments(arg, language : 'c') |
| 327 | endif |
| 328 | endforeach |
| 329 | |
| 330 | foreach arg : ['-Wl,--gc-sections'] |
Zbigniew Jędrzejewski-Szmek | 6e2afb1 | 2017-04-24 21:03:35 -0400 | [diff] [blame] | 331 | have = run_command(check_compilation_sh, |
| 332 | cc.cmd_array(), '-x', 'c', arg, |
| 333 | '-include', link_test_c).returncode() == 0 |
| 334 | message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no')) |
| 335 | if have |
Zbigniew Jędrzejewski-Szmek | 41afb5e | 2017-04-24 19:28:04 -0400 | [diff] [blame] | 336 | add_project_link_arguments(arg, language : 'c') |
| 337 | endif |
| 338 | endforeach |
| 339 | endif |
| 340 | |
Zbigniew Jędrzejewski-Szmek | 9cc0e6e | 2017-04-11 10:25:34 -0400 | [diff] [blame] | 341 | cpp = ' '.join(cc.cmd_array()) + ' -E' |
| 342 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 343 | ##################################################################### |
| 344 | # compilation result tests |
| 345 | |
| 346 | conf.set('_GNU_SOURCE', 1) |
| 347 | conf.set('__SANE_USERSPACE_TYPES__', 1) |
| 348 | |
| 349 | conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>')) |
| 350 | conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>')) |
| 351 | conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>')) |
| 352 | conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>')) |
| 353 | conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>')) |
| 354 | conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>')) |
| 355 | conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>')) |
| 356 | |
| 357 | decl_headers = ''' |
| 358 | #include <uchar.h> |
| 359 | #include <linux/ethtool.h> |
| 360 | ''' |
| 361 | # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail |
| 362 | |
| 363 | foreach decl : ['char16_t', |
| 364 | 'char32_t', |
| 365 | 'key_serial_t', |
| 366 | 'struct ethtool_link_settings', |
| 367 | ] |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 368 | if cc.sizeof(decl, prefix : decl_headers) > 0 |
| 369 | # We get -1 if the size cannot be determined |
| 370 | conf.set('HAVE_' + decl.underscorify().to_upper(), 1) |
| 371 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 372 | endforeach |
| 373 | |
| 374 | foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], |
| 375 | ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], |
| 376 | ['IFLA_VRF_TABLE', 'linux/if_link.h'], |
| 377 | ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'], |
| 378 | ['IFLA_IPVLAN_MODE', 'linux/if_link.h'], |
| 379 | ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'], |
| 380 | ['IFLA_BOND_AD_INFO', 'linux/if_link.h'], |
| 381 | ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'], |
| 382 | ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'], |
| 383 | ['IFLA_VXLAN_GPE', 'linux/if_link.h'], |
Susant Sahani | 9dfed8d | 2017-04-25 20:30:34 +0530 | [diff] [blame] | 384 | ['IFLA_GENEVE_LABEL', 'linux/if_link.h'], |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 385 | # if_tunnel.h is buggy and cannot be included on its own |
| 386 | ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'], |
| 387 | ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'], |
| 388 | ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'], |
| 389 | ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'], |
| 390 | ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'], |
| 391 | ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'], |
| 392 | ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'], |
| 393 | ['NDA_IFINDEX', 'linux/neighbour.h'], |
| 394 | ['IFA_FLAGS', 'linux/if_addr.h'], |
| 395 | ['LO_FLAGS_PARTSCAN', 'linux/loop.h'], |
| 396 | ] |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 397 | prefix = decl.length() > 2 ? decl[2] : '' |
| 398 | have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) |
| 399 | conf.set10('HAVE_DECL_' + decl[0], have) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 400 | endforeach |
| 401 | |
| 402 | skip = false |
| 403 | foreach ident : ['secure_getenv', '__secure_getenv'] |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 404 | if not skip and cc.has_function(ident) |
| 405 | conf.set('HAVE_' + ident.to_upper(), 1) |
| 406 | skip = true |
| 407 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 408 | endforeach |
| 409 | |
| 410 | foreach ident : [ |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 411 | ['memfd_create', '''#include <sys/memfd.h>'''], |
| 412 | ['gettid', '''#include <sys/types.h>'''], |
| 413 | ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root |
| 414 | ['name_to_handle_at', '''#define _GNU_SOURCE |
| 415 | #include <sys/types.h> |
| 416 | #include <sys/stat.h> |
| 417 | #include <fcntl.h>'''], |
| 418 | ['setns', '''#define _GNU_SOURCE |
| 419 | #include <sched.h>'''], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 420 | ['renameat2', '''#include <stdio.h>'''], |
| 421 | ['kcmp', '''#include <linux/kcmp.h>'''], |
| 422 | ['keyctl', '''#include <sys/types.h> |
| 423 | #include <keyutils.h>'''], |
| 424 | ['copy_file_range', '''#include <sys/syscall.h> |
| 425 | #include <unistd.h>'''], |
Zbigniew Jędrzejewski-Szmek | 38f1ae0 | 2017-04-19 16:14:16 -0400 | [diff] [blame] | 426 | ['explicit_bzero' , '''#include <string.h>'''], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 427 | ] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 428 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 429 | have = cc.has_function(ident[0], prefix : ident[1]) |
| 430 | conf.set10('HAVE_DECL_' + ident[0].to_upper(), have) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 431 | endforeach |
| 432 | |
Zbigniew Jędrzejewski-Szmek | 4984c8b | 2017-04-19 21:20:54 -0400 | [diff] [blame] | 433 | if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''') |
| 434 | conf.set('USE_SYS_RANDOM_H', 1) |
| 435 | conf.set10('HAVE_DECL_GETRANDOM', 1) |
| 436 | else |
| 437 | have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''') |
| 438 | conf.set10('HAVE_DECL_GETRANDOM', have) |
| 439 | endif |
| 440 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 441 | ##################################################################### |
| 442 | |
| 443 | sed = find_program('sed') |
| 444 | grep = find_program('grep') |
| 445 | awk = find_program('awk') |
Zbigniew Jędrzejewski-Szmek | d730e2d | 2017-04-25 08:49:58 -0400 | [diff] [blame] | 446 | m4 = find_program('m4') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 447 | stat = find_program('stat') |
Zbigniew Jędrzejewski-Szmek | d68b342 | 2017-04-06 14:33:27 -0400 | [diff] [blame] | 448 | git = find_program('git', required : false) |
| 449 | etags = find_program('etags', required : false) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 450 | |
Zbigniew Jędrzejewski-Szmek | 7b76fce | 2017-04-09 23:55:50 -0400 | [diff] [blame] | 451 | meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh' |
Zbigniew Jędrzejewski-Szmek | 94e75a5 | 2017-04-09 23:55:05 -0400 | [diff] [blame] | 452 | mkdir_p = 'mkdir -p $DESTDIR/@0@' |
Zbigniew Jędrzejewski-Szmek | d83f4f5 | 2017-04-16 12:04:46 -0400 | [diff] [blame] | 453 | test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh') |
| 454 | splash_bmp = files('test/splash.bmp') |
Zbigniew Jędrzejewski-Szmek | 94e75a5 | 2017-04-09 23:55:05 -0400 | [diff] [blame] | 455 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 456 | # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, |
| 457 | # /usr/sbin, /sbin, and fall back to the default from middle column. |
| 458 | progs = [['telinit', '/lib/sysvinit/telinit'], |
| 459 | ['quotaon', '/usr/sbin/quotaon' ], |
| 460 | ['quotacheck', '/usr/sbin/quotacheck' ], |
| 461 | ['kill', '/usr/bin/kill' ], |
| 462 | ['kmod', '/usr/bin/kmod' ], |
| 463 | ['kexec', '/usr/sbin/kexec' ], |
| 464 | ['sulogin', '/usr/sbin/sulogin' ], |
| 465 | ['mount', '/usr/bin/mount', 'MOUNT_PATH'], |
| 466 | ['umount', '/usr/bin/umount', 'UMOUNT_PATH'], |
| 467 | ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'], |
| 468 | ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'], |
| 469 | ] |
| 470 | foreach prog : progs |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 471 | path = get_option(prog[0] + '-path') |
| 472 | if path != '' |
| 473 | message('Using @1@ for @0@'.format(prog[0], path)) |
| 474 | else |
| 475 | exe = find_program(prog[0], |
| 476 | '/usr/sbin/' + prog[0], |
| 477 | '/sbin/' + prog[0], |
| 478 | required: false) |
| 479 | path = exe.found() ? exe.path() : prog[1] |
| 480 | endif |
| 481 | name = prog.length() > 2 ? prog[2] : prog[0].to_upper() |
| 482 | conf.set_quoted(name, path) |
| 483 | substs.set(name, path) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 484 | endforeach |
| 485 | |
Zbigniew Jędrzejewski-Szmek | 1276a9f | 2017-04-18 19:11:54 -0400 | [diff] [blame] | 486 | if run_command('ln', '--relative', '--help').returncode() != 0 |
| 487 | error('ln does not support --relative') |
| 488 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 489 | |
| 490 | ############################################################ |
| 491 | |
| 492 | gperf = find_program('gperf') |
| 493 | |
| 494 | gperf_test_format = ''' |
| 495 | #include <string.h> |
| 496 | const char * in_word_set(const char *, @0@); |
| 497 | @1@ |
| 498 | ''' |
| 499 | gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C' |
| 500 | gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path())) |
| 501 | gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout()) |
| 502 | if cc.compiles(gperf_test) |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 503 | gperf_len_type = 'size_t' |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 504 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 505 | gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout()) |
| 506 | if cc.compiles(gperf_test) |
| 507 | gperf_len_type = 'unsigned' |
| 508 | else |
| 509 | error('unable to determine gperf len type') |
| 510 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 511 | endif |
| 512 | message('gperf len type is @0@'.format(gperf_len_type)) |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 513 | conf.set('GPERF_LEN_TYPE', gperf_len_type, |
| 514 | description : 'The type of gperf "len" parameter') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 515 | |
| 516 | ############################################################ |
| 517 | |
| 518 | if not cc.has_header('sys/capability.h') |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 519 | error('POSIX caps headers not found') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 520 | endif |
| 521 | foreach header : ['linux/btrfs.h', |
| 522 | 'linux/memfd.h', |
| 523 | 'linux/vm_sockets.h', |
| 524 | 'valgrind/memcheck.h', |
| 525 | 'valgrind/valgrind.h', |
| 526 | ] |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 527 | if cc.has_header(header) |
| 528 | conf.set('HAVE_' + header.underscorify().to_upper(), 1) |
| 529 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 530 | endforeach |
| 531 | |
| 532 | ############################################################ |
| 533 | |
| 534 | conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname')) |
| 535 | |
| 536 | default_hierarchy = get_option('default-hierarchy') |
| 537 | conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy, |
| 538 | description : 'default cgroup hierarchy as string') |
| 539 | if default_hierarchy == 'legacy' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 540 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 541 | elif default_hierarchy == 'hybrid' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 542 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 543 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 544 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 545 | endif |
| 546 | |
| 547 | time_epoch = get_option('time-epoch') |
| 548 | if time_epoch == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 549 | NEWS = files('NEWS') |
| 550 | time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout() |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 551 | endif |
| 552 | time_epoch = time_epoch.to_int() |
| 553 | conf.set('TIME_EPOCH', time_epoch) |
| 554 | |
| 555 | system_uid_max = get_option('system-uid-max') |
| 556 | if system_uid_max == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 557 | system_uid_max = run_command( |
| 558 | awk, |
| 559 | 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }', |
| 560 | '/etc/login.defs').stdout() |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 561 | endif |
| 562 | system_uid_max = system_uid_max.to_int() |
| 563 | conf.set('SYSTEM_UID_MAX', system_uid_max) |
| 564 | substs.set('systemuidmax', system_uid_max) |
Zbigniew Jędrzejewski-Szmek | 7572aa8 | 2017-04-24 21:46:40 -0400 | [diff] [blame] | 565 | message('maximum system UID is @0@'.format(system_uid_max)) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 566 | |
| 567 | conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user')) |
| 568 | conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group')) |
| 569 | |
| 570 | system_gid_max = get_option('system-gid-max') |
| 571 | if system_gid_max == '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 572 | system_gid_max = run_command( |
| 573 | awk, |
| 574 | 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }', |
| 575 | '/etc/login.defs').stdout() |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 576 | endif |
| 577 | system_gid_max = system_gid_max.to_int() |
| 578 | conf.set('SYSTEM_GID_MAX', system_gid_max) |
| 579 | substs.set('systemgidmax', system_gid_max) |
Zbigniew Jędrzejewski-Szmek | 7572aa8 | 2017-04-24 21:46:40 -0400 | [diff] [blame] | 580 | message('maximum system GID is @0@'.format(system_gid_max)) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 581 | |
| 582 | tty_gid = get_option('tty-gid') |
| 583 | conf.set('TTY_GID', tty_gid) |
Zbigniew Jędrzejewski-Szmek | 2a4c156 | 2017-04-12 19:54:33 -0400 | [diff] [blame] | 584 | substs.set('TTY_GID', tty_gid) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 585 | |
| 586 | if get_option('adm-group') |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 587 | m4_defines += ['-DENABLE_ADM_GROUP'] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 588 | endif |
| 589 | |
| 590 | if get_option('wheel-group') |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 591 | m4_defines += ['-DENABLE_WHEEL_GROUP'] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 592 | endif |
| 593 | |
| 594 | substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode')) |
| 595 | |
Zbigniew Jędrzejewski-Szmek | 2a4c156 | 2017-04-12 19:54:33 -0400 | [diff] [blame] | 596 | kill_user_processes = get_option('default-kill-user-processes') |
| 597 | conf.set10('KILL_USER_PROCESSES', kill_user_processes) |
| 598 | substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 599 | |
| 600 | default_dnssec = get_option('default-dnssec') |
| 601 | conf.set('DEFAULT_DNSSEC_MODE', |
| 602 | 'DNSSEC_' + default_dnssec.underscorify().to_upper()) |
Zbigniew Jędrzejewski-Szmek | 2a4c156 | 2017-04-12 19:54:33 -0400 | [diff] [blame] | 603 | substs.set('DEFAULT_DNSSEC_MODE', default_dnssec) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 604 | |
Zbigniew Jędrzejewski-Szmek | 829257d | 2017-04-27 20:54:52 -0400 | [diff] [blame^] | 605 | dns_servers = get_option('dns-servers') |
| 606 | conf.set_quoted('DNS_SERVERS', dns_servers) |
| 607 | substs.set('DNS_SERVERS', dns_servers) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 608 | |
Zbigniew Jędrzejewski-Szmek | 829257d | 2017-04-27 20:54:52 -0400 | [diff] [blame^] | 609 | ntp_servers = get_option('ntp-servers') |
| 610 | conf.set_quoted('NTP_SERVERS', ntp_servers) |
| 611 | substs.set('NTP_SERVERS', ntp_servers) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 612 | |
| 613 | conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) |
| 614 | |
Zbigniew Jędrzejewski-Szmek | 3131bfe | 2017-04-10 19:06:45 -0400 | [diff] [blame] | 615 | substs.set('SUSHELL', get_option('debug-shell')) |
| 616 | substs.set('DEBUGTTY', get_option('debug-tty')) |
| 617 | |
Zbigniew Jędrzejewski-Szmek | 671677d | 2017-04-27 20:51:34 -0400 | [diff] [blame] | 618 | debug = get_option('debug') |
| 619 | if debug != '' |
| 620 | foreach name : debug.split(',') |
| 621 | if name == 'hashmap' |
| 622 | conf.set('ENABLE_DEBUG_HASHMAP', 1) |
| 623 | elif name == 'mmap-cache' |
| 624 | conf.set('ENABLE_DEBUG_MMAP_CACHE', 1) |
| 625 | else |
| 626 | message('unknown debug option "@0@", ignoring'.format(name)) |
| 627 | endif |
| 628 | endforeach |
| 629 | endif |
| 630 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 631 | ##################################################################### |
| 632 | |
| 633 | threads = dependency('threads') |
| 634 | librt = cc.find_library('rt') |
| 635 | libm = cc.find_library('m') |
| 636 | libdl = cc.find_library('dl') |
| 637 | libcrypt = cc.find_library('crypt') |
| 638 | |
Zbigniew Jędrzejewski-Szmek | 1800cc8 | 2017-04-27 01:30:30 -0400 | [diff] [blame] | 639 | libcap = dependency('libcap', required : false) |
| 640 | if not libcap.found() |
| 641 | # Compat with Ubuntu 14.04 which ships libcap w/o .pc file |
| 642 | libcap = cc.find_library('cap') |
| 643 | endif |
| 644 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 645 | libmount = dependency('mount', |
| 646 | version : '>= 2.27') |
| 647 | |
| 648 | want_seccomp = get_option('seccomp') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 649 | if want_seccomp != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 650 | libseccomp = dependency('libseccomp', |
Zbigniew Jędrzejewski-Szmek | 9f0e9c0 | 2017-04-27 10:05:18 -0400 | [diff] [blame] | 651 | version : '>= 2.3.1', |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 652 | required : want_seccomp == 'true') |
| 653 | if libseccomp.found() |
| 654 | conf.set('HAVE_SECCOMP', 1) |
| 655 | m4_defines += ['-DHAVE_SECCOMP'] |
| 656 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 657 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 658 | libseccomp = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 659 | endif |
| 660 | |
| 661 | want_selinux = get_option('selinux') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 662 | if want_selinux != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 663 | libselinux = dependency('libselinux', |
| 664 | version : '>= 2.1.9', |
| 665 | required : want_selinux == 'true') |
| 666 | if libselinux.found() |
| 667 | conf.set('HAVE_SELINUX', 1) |
| 668 | m4_defines += ['-DHAVE_SELINUX'] |
| 669 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 670 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 671 | libselinux = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 672 | endif |
| 673 | |
| 674 | want_apparmor = get_option('apparmor') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 675 | if want_apparmor != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 676 | libapparmor = dependency('libapparmor', |
| 677 | required : want_apparmor == 'true') |
| 678 | if libapparmor.found() |
| 679 | conf.set('HAVE_APPARMOR', 1) |
| 680 | m4_defines += ['-DHAVE_APPARMOR'] |
| 681 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 682 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 683 | libapparmor = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 684 | endif |
| 685 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 686 | smack_run_label = get_option('smack-run-label') |
| 687 | if smack_run_label != '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 688 | conf.set_quoted('SMACK_RUN_LABEL', smack_run_label) |
| 689 | m4_defines += ['-DHAVE_SMACK_RUN_LABEL'] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 690 | endif |
| 691 | |
Zbigniew Jędrzejewski-Szmek | 3ca0cb7 | 2017-04-12 19:09:26 -0400 | [diff] [blame] | 692 | want_polkit = get_option('polkit') |
| 693 | install_polkit = false |
| 694 | install_polkit_pkla = false |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 695 | if want_polkit != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 696 | conf.set('ENABLE_POLKIT', 1) |
| 697 | install_polkit = true |
Zbigniew Jędrzejewski-Szmek | 3ca0cb7 | 2017-04-12 19:09:26 -0400 | [diff] [blame] | 698 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 699 | libpolkit = dependency('polkit-gobject-1', |
| 700 | required : false) |
| 701 | if libpolkit.found() and libpolkit.version().version_compare('< 0.106') |
| 702 | message('Old polkit detected, will install pkla files') |
| 703 | install_polkit_pkla = true |
| 704 | endif |
Zbigniew Jędrzejewski-Szmek | 3ca0cb7 | 2017-04-12 19:09:26 -0400 | [diff] [blame] | 705 | endif |
| 706 | |
Zbigniew Jędrzejewski-Szmek | 36f0387 | 2017-04-21 13:53:59 -0400 | [diff] [blame] | 707 | want_acl = get_option('acl') |
| 708 | if want_acl != 'false' |
| 709 | libacl = cc.find_library('acl', required : want_acl == 'true') |
| 710 | if libacl.found() |
| 711 | conf.set('HAVE_ACL', 1) |
| 712 | m4_defines += ['-DHAVE_ACL'] |
| 713 | endif |
| 714 | else |
| 715 | libacl = [] |
| 716 | endif |
| 717 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 718 | want_audit = get_option('audit') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 719 | if want_audit != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 720 | libaudit = dependency('audit', required : want_audit == 'true') |
| 721 | if libaudit.found() |
| 722 | conf.set('HAVE_AUDIT', 1) |
| 723 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 724 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 725 | libaudit = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 726 | endif |
| 727 | |
| 728 | want_blkid = get_option('blkid') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 729 | if want_blkid != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 730 | libblkid = dependency('blkid', required : want_blkid == 'true') |
| 731 | if libblkid.found() |
| 732 | conf.set('HAVE_BLKID', 1) |
| 733 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 734 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 735 | libblkid = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 736 | endif |
| 737 | |
| 738 | want_kmod = get_option('kmod') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 739 | if want_kmod != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 740 | libkmod = dependency('libkmod', |
| 741 | version : '>= 15', |
| 742 | required : want_kmod == 'true') |
| 743 | if libkmod.found() |
| 744 | conf.set('HAVE_KMOD', 1) |
| 745 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 746 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 747 | libkmod = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 748 | endif |
| 749 | |
| 750 | want_pam = get_option('pam') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 751 | if want_pam != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 752 | libpam = cc.find_library('pam', required : want_pam == 'true') |
| 753 | libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true') |
| 754 | if libpam.found() and libpam_misc.found() |
| 755 | conf.set('HAVE_PAM', 1) |
| 756 | m4_defines += ['-DHAVE_PAM'] |
| 757 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 758 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 759 | libpam = [] |
| 760 | libpam_misc = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 761 | endif |
| 762 | |
| 763 | want_microhttpd = get_option('microhttpd') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 764 | if want_microhttpd != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 765 | libmicrohttpd = dependency('libmicrohttpd', |
| 766 | version : '>= 0.9.33', |
| 767 | required : want_microhttpd == 'true') |
| 768 | if libmicrohttpd.found() |
| 769 | conf.set('HAVE_MICROHTTPD', 1) |
| 770 | m4_defines += ['-DHAVE_MICROHTTPD'] |
| 771 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 772 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 773 | libmicrohttpd = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 774 | endif |
| 775 | |
| 776 | want_libcryptsetup = get_option('libcryptsetup') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 777 | if want_libcryptsetup != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 778 | libcryptsetup = dependency('libcryptsetup', |
| 779 | version : '>= 1.6.0', |
| 780 | required : want_libcryptsetup == 'true') |
| 781 | if libcryptsetup.found() |
| 782 | conf.set('HAVE_LIBCRYPTSETUP', 1) |
| 783 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 784 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 785 | libcryptsetup = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 786 | endif |
| 787 | |
| 788 | want_libcurl = get_option('libcurl') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 789 | if want_libcurl != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 790 | libcurl = dependency('libcurl', |
| 791 | version : '>= 7.32.0', |
| 792 | required : want_libcurl == 'true') |
| 793 | if libcurl.found() |
| 794 | conf.set('HAVE_LIBCURL', 1) |
| 795 | m4_defines += ['-DHAVE_LIBCURL'] |
| 796 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 797 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 798 | libcurl = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 799 | endif |
| 800 | |
| 801 | want_libidn = get_option('libidn') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 802 | if want_libidn != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 803 | libidn = dependency('libidn', |
| 804 | required : want_libidn == 'true') |
| 805 | if libidn.found() |
| 806 | conf.set('HAVE_LIBIDN', 1) |
| 807 | m4_defines += ['-DHAVE_LIBIDN'] |
| 808 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 809 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 810 | libidn = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 811 | endif |
| 812 | |
| 813 | want_libiptc = get_option('libiptc') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 814 | if want_libiptc != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 815 | libiptc = dependency('libiptc', |
| 816 | required : want_libiptc == 'true') |
| 817 | if libiptc.found() |
| 818 | conf.set('HAVE_LIBIPTC', 1) |
| 819 | m4_defines += ['-DHAVE_LIBIPTC'] |
| 820 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 821 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 822 | libiptc = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 823 | endif |
| 824 | |
| 825 | want_qrencode = get_option('qrencode') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 826 | if want_qrencode != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 827 | libqrencode = dependency('libqrencode', |
| 828 | required : want_qrencode == 'true') |
| 829 | if libqrencode.found() |
| 830 | conf.set('HAVE_QRENCODE', 1) |
| 831 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 832 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 833 | libqrencode = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 834 | endif |
| 835 | |
| 836 | want_gnutls = get_option('gnutls') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 837 | if want_gnutls != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 838 | libgnutls = dependency('gnutls', |
| 839 | version : '>= 3.1.4', |
| 840 | required : want_gnutls == 'true') |
| 841 | if libgnutls.found() |
| 842 | conf.set('HAVE_GNUTLS', 1) |
| 843 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 844 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 845 | libgnutls = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 846 | endif |
| 847 | |
| 848 | want_elfutils = get_option('elfutils') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 849 | if want_elfutils != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 850 | libdw = dependency('libdw', |
| 851 | required : want_elfutils == 'true') |
| 852 | if libdw.found() |
| 853 | conf.set('HAVE_ELFUTILS', 1) |
| 854 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 855 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 856 | libdw = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 857 | endif |
| 858 | |
| 859 | want_zlib = get_option('zlib') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 860 | if want_zlib != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 861 | libz = dependency('zlib', |
| 862 | required : want_zlib == 'true') |
| 863 | if libz.found() |
| 864 | conf.set('HAVE_ZLIB', 1) |
| 865 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 866 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 867 | libz = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 868 | endif |
| 869 | |
| 870 | want_bzip2 = get_option('bzip2') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 871 | if want_bzip2 != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 872 | libbzip2 = cc.find_library('bz2', |
| 873 | required : want_bzip2 == 'true') |
| 874 | if libbzip2.found() |
| 875 | conf.set('HAVE_BZIP2', 1) |
| 876 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 877 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 878 | libbzip2 = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 879 | endif |
| 880 | |
| 881 | want_xz = get_option('xz') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 882 | if want_xz != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 883 | libxz = dependency('liblzma', |
| 884 | required : want_xz == 'true') |
| 885 | if libxz.found() |
| 886 | conf.set('HAVE_XZ', 1) |
| 887 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 888 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 889 | libxz = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 890 | endif |
| 891 | |
| 892 | want_lz4 = get_option('lz4') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 893 | if want_lz4 != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 894 | liblz4 = dependency('liblz4', |
| 895 | required : want_lz4 == 'true') |
| 896 | if liblz4.found() |
| 897 | conf.set('HAVE_LZ4', 1) |
| 898 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 899 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 900 | liblz4 = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 901 | endif |
| 902 | |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 903 | want_glib = get_option('glib') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 904 | if want_glib != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 905 | libglib = dependency('glib-2.0', |
| 906 | version : '>= 2.22.0', |
| 907 | required : want_glib == 'true') |
| 908 | libgobject = dependency('gobject-2.0', |
| 909 | version : '>= 2.22.0', |
| 910 | required : want_glib == 'true') |
| 911 | libgio = dependency('gio-2.0', |
| 912 | required : want_glib == 'true') |
| 913 | if libglib.found() and libgobject.found() and libgio.found() |
| 914 | conf.set('HAVE_GLIB', 1) |
| 915 | endif |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 916 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 917 | libglib = [] |
| 918 | libgobject = [] |
| 919 | libgio = [] |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 920 | endif |
| 921 | |
Zbigniew Jędrzejewski-Szmek | 1eeb43f | 2017-04-13 19:37:14 -0400 | [diff] [blame] | 922 | want_xkbcommon = get_option('xkbcommon') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 923 | if want_xkbcommon != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 924 | libxkbcommon = dependency('xkbcommon', |
| 925 | version : '>= 0.3.0', |
| 926 | required : want_xkbcommon == 'true') |
| 927 | if libxkbcommon.found() |
| 928 | conf.set('HAVE_XKBCOMMON', 1) |
| 929 | endif |
Zbigniew Jędrzejewski-Szmek | 1eeb43f | 2017-04-13 19:37:14 -0400 | [diff] [blame] | 930 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 931 | libxkbcommon = [] |
Zbigniew Jędrzejewski-Szmek | 1eeb43f | 2017-04-13 19:37:14 -0400 | [diff] [blame] | 932 | endif |
| 933 | |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 934 | want_dbus = get_option('dbus') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 935 | if want_dbus != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 936 | libdbus = dependency('dbus-1', |
| 937 | version : '>= 1.3.2', |
| 938 | required : want_dbus == 'true') |
| 939 | if libdbus.found() |
| 940 | conf.set('HAVE_DBUS', 1) |
| 941 | endif |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 942 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 943 | libdbus = [] |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 944 | endif |
| 945 | |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 946 | want_gcrypt = get_option('gcrypt') |
| 947 | if want_gcrypt != 'false' |
| 948 | libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true') |
| 949 | libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true') |
| 950 | |
| 951 | if libgcrypt.found() and libgpg_error.found() |
| 952 | conf.set('HAVE_GCRYPT', 1) |
| 953 | else |
| 954 | # link to neither of the libs if one is not found |
| 955 | libgcrypt = [] |
| 956 | libgpg_error = [] |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 957 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 958 | else |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 959 | libgcrypt = [] |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 960 | libgpg_error = [] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 961 | endif |
| 962 | |
| 963 | want_importd = get_option('importd') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 964 | if want_importd != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 965 | have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and |
| 966 | conf.get('HAVE_ZLIB', 0) == 1 and |
| 967 | conf.get('HAVE_BZIP2', 0) == 1 and |
| 968 | conf.get('HAVE_XZ', 0) == 1 and |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 969 | conf.get('HAVE_GCRYPT', 0) == 1) |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 970 | if have_deps |
| 971 | conf.set('ENABLE_IMPORTD', 1) |
| 972 | elif want_importd == 'true' |
| 973 | error('importd support was requested, but dependencies are not available') |
| 974 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 975 | endif |
| 976 | |
| 977 | want_remote = get_option('remote') |
Zbigniew Jędrzejewski-Szmek | 4390be3 | 2017-04-13 20:30:07 -0400 | [diff] [blame] | 978 | if want_remote != 'false' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 979 | have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1, |
| 980 | conf.get('HAVE_LIBCURL', 0) == 1] |
| 981 | # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so |
| 982 | # it's possible to build one without the other. Complain only if |
| 983 | # support was explictly requested. The auxiliary files like sysusers |
| 984 | # config should be installed when any of the programs are built. |
| 985 | if want_remote == 'true' and not (have_deps[0] and have_deps[1]) |
| 986 | error('remote support was requested, but dependencies are not available') |
| 987 | endif |
| 988 | if have_deps[0] or have_deps[1] |
| 989 | conf.set('ENABLE_REMOTE', 1) |
| 990 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 991 | endif |
| 992 | |
| 993 | foreach pair : [['utmp', 'HAVE_UTMP'], |
| 994 | ['hibernate', 'ENABLE_HIBERNATE'], |
| 995 | ['environment-d', 'ENABLE_ENVIRONMENT_D'], |
| 996 | ['binfmt', 'ENABLE_BINFMT'], |
| 997 | ['coredump', 'ENABLE_COREDUMP'], |
| 998 | ['resolve', 'ENABLE_RESOLVED'], |
| 999 | ['logind', 'ENABLE_LOGIND'], |
| 1000 | ['hostnamed', 'ENABLE_HOSTNAMED'], |
| 1001 | ['localed', 'ENABLE_LOCALED'], |
| 1002 | ['machined', 'ENABLE_MACHINED'], |
| 1003 | ['networkd', 'ENABLE_NETWORKD'], |
| 1004 | ['timedated', 'ENABLE_TIMEDATED'], |
| 1005 | ['timesyncd', 'ENABLE_TIMESYNCD'], |
| 1006 | ['myhostname', 'HAVE_MYHOSTNAME'], |
| 1007 | ['firstboot', 'ENABLE_FIRSTBOOT'], |
| 1008 | ['randomseed', 'ENABLE_RANDOMSEED'], |
| 1009 | ['backlight', 'ENABLE_BACKLIGHT'], |
| 1010 | ['vconsole', 'ENABLE_VCONSOLE'], |
| 1011 | ['quotacheck', 'ENABLE_QUOTACHECK'], |
| 1012 | ['sysusers', 'ENABLE_SYSUSERS'], |
| 1013 | ['tmpfiles', 'ENABLE_TMPFILES'], |
| 1014 | ['hwdb', 'ENABLE_HWDB'], |
| 1015 | ['rfkill', 'ENABLE_RFKILL'], |
| 1016 | ['ldconfig', 'ENABLE_LDCONFIG'], |
Zbigniew Jędrzejewski-Szmek | b710072 | 2017-04-12 15:05:55 -0400 | [diff] [blame] | 1017 | ['efi', 'ENABLE_EFI'], |
Zbigniew Jędrzejewski-Szmek | 80c6fce | 2017-04-24 19:28:04 -0400 | [diff] [blame] | 1018 | ['tpm', 'SD_BOOT_LOG_TPM'], |
Zbigniew Jędrzejewski-Szmek | 2895c8e | 2017-04-13 19:45:05 -0400 | [diff] [blame] | 1019 | ['ima', 'HAVE_IMA'], |
Zbigniew Jędrzejewski-Szmek | 5464ec8 | 2017-04-24 19:28:04 -0400 | [diff] [blame] | 1020 | ['smack', 'HAVE_SMACK'], |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1021 | ] |
| 1022 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1023 | if get_option(pair[0]) |
| 1024 | conf.set(pair[1], 1) |
| 1025 | m4_defines += ['-D' + pair[1]] |
| 1026 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1027 | endforeach |
| 1028 | |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 1029 | want_tests = get_option('tests') |
Zbigniew Jędrzejewski-Szmek | 572baca | 2017-04-08 01:55:38 -0400 | [diff] [blame] | 1030 | install_tests = get_option('install-tests') |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 1031 | tests = [] |
| 1032 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1033 | ##################################################################### |
| 1034 | |
| 1035 | if get_option('efi') |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1036 | efi_arch = host_machine.cpu_family() |
Zbigniew Jędrzejewski-Szmek | b710072 | 2017-04-12 15:05:55 -0400 | [diff] [blame] | 1037 | |
Zbigniew Jędrzejewski-Szmek | 6800fe7 | 2017-04-19 22:57:52 -0400 | [diff] [blame] | 1038 | if efi_arch == 'x86' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1039 | EFI_MACHINE_TYPE_NAME = 'ia32' |
Zbigniew Jędrzejewski-Szmek | 6800fe7 | 2017-04-19 22:57:52 -0400 | [diff] [blame] | 1040 | gnu_efi_arch = 'ia32' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1041 | elif efi_arch == 'x86_64' |
| 1042 | EFI_MACHINE_TYPE_NAME = 'x64' |
Zbigniew Jędrzejewski-Szmek | 6800fe7 | 2017-04-19 22:57:52 -0400 | [diff] [blame] | 1043 | gnu_efi_arch = 'x86_64' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1044 | elif efi_arch == 'arm' |
| 1045 | EFI_MACHINE_TYPE_NAME = 'arm' |
Zbigniew Jędrzejewski-Szmek | 6800fe7 | 2017-04-19 22:57:52 -0400 | [diff] [blame] | 1046 | gnu_efi_arch = 'arm' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1047 | elif efi_arch == 'aarch64' |
| 1048 | EFI_MACHINE_TYPE_NAME = 'aa64' |
Zbigniew Jędrzejewski-Szmek | 6800fe7 | 2017-04-19 22:57:52 -0400 | [diff] [blame] | 1049 | gnu_efi_arch = 'aarch64' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1050 | else |
| 1051 | EFI_MACHINE_TYPE_NAME = '' |
Zbigniew Jędrzejewski-Szmek | 6800fe7 | 2017-04-19 22:57:52 -0400 | [diff] [blame] | 1052 | gnu_efi_arch = '' |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1053 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1054 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1055 | conf.set('ENABLE_EFI', 1) |
| 1056 | conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) |
Zbigniew Jędrzejewski-Szmek | 80c6fce | 2017-04-24 19:28:04 -0400 | [diff] [blame] | 1057 | |
| 1058 | conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int()) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1059 | endif |
| 1060 | |
| 1061 | ##################################################################### |
| 1062 | |
| 1063 | config_h = configure_file( |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1064 | output : 'config.h', |
| 1065 | configuration : conf) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1066 | |
| 1067 | includes = include_directories('src/basic', |
| 1068 | 'src/shared', |
| 1069 | 'src/systemd', |
| 1070 | 'src/journal', |
| 1071 | 'src/resolve', |
| 1072 | 'src/timesync', |
| 1073 | 'src/login', |
| 1074 | 'src/udev', |
| 1075 | 'src/libudev', |
| 1076 | 'src/core', |
| 1077 | 'src/libsystemd/sd-bus', |
| 1078 | 'src/libsystemd/sd-device', |
| 1079 | 'src/libsystemd/sd-hwdb', |
| 1080 | 'src/libsystemd/sd-id128', |
| 1081 | 'src/libsystemd/sd-netlink', |
| 1082 | 'src/libsystemd/sd-network', |
| 1083 | 'src/libsystemd-network', |
| 1084 | ) |
| 1085 | |
| 1086 | add_project_arguments('-include', 'config.h', language : 'c') |
| 1087 | |
| 1088 | gcrypt_util_sources = files('src/shared/gcrypt-util.h', |
| 1089 | 'src/shared/gcrypt-util.c') |
| 1090 | |
| 1091 | subdir('po') |
| 1092 | subdir('catalog') |
| 1093 | subdir('src/systemd') |
| 1094 | subdir('src/basic') |
| 1095 | subdir('src/libsystemd') |
| 1096 | subdir('src/libsystemd-network') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1097 | subdir('src/journal') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1098 | subdir('src/login') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1099 | |
| 1100 | libjournal_core = static_library( |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1101 | 'journal-core', |
| 1102 | libjournal_core_sources, |
| 1103 | journald_gperf_c, |
| 1104 | include_directories : includes, |
| 1105 | install : false) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1106 | |
Zbigniew Jędrzejewski-Szmek | 37ab1a2 | 2017-04-10 14:13:40 -0400 | [diff] [blame] | 1107 | libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1108 | libsystemd = shared_library( |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1109 | 'systemd', |
| 1110 | libsystemd_internal_sources, |
| 1111 | journal_internal_sources, |
| 1112 | version : '0.18.0', |
| 1113 | include_directories : includes, |
| 1114 | link_args : ['-shared', |
| 1115 | '-Wl,--version-script=' + libsystemd_sym_path], |
| 1116 | link_with : [libbasic], |
| 1117 | dependencies : [threads, |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 1118 | libgcrypt, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1119 | librt, |
| 1120 | libxz, |
| 1121 | liblz4], |
| 1122 | link_depends : libsystemd_sym, |
| 1123 | install : true, |
| 1124 | install_dir : rootlibdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1125 | |
| 1126 | ############################################################ |
| 1127 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1128 | # binaries that have --help and are intended for use by humans, |
| 1129 | # usually, but not always, installed in /bin. |
| 1130 | public_programs = [] |
| 1131 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1132 | subdir('src/libudev') |
| 1133 | subdir('src/shared') |
| 1134 | subdir('src/core') |
| 1135 | subdir('src/udev') |
| 1136 | subdir('src/network') |
| 1137 | |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 1138 | subdir('src/analyze') |
| 1139 | subdir('src/journal-remote') |
| 1140 | subdir('src/coredump') |
| 1141 | subdir('src/hostname') |
| 1142 | subdir('src/import') |
| 1143 | subdir('src/kernel-install') |
| 1144 | subdir('src/locale') |
| 1145 | subdir('src/machine') |
| 1146 | subdir('src/nspawn') |
| 1147 | subdir('src/resolve') |
| 1148 | subdir('src/timedate') |
| 1149 | subdir('src/timesync') |
| 1150 | subdir('src/vconsole') |
Zbigniew Jędrzejewski-Szmek | 4e4ab1c | 2017-04-10 12:37:52 -0400 | [diff] [blame] | 1151 | subdir('src/sulogin-shell') |
Zbigniew Jędrzejewski-Szmek | b710072 | 2017-04-12 15:05:55 -0400 | [diff] [blame] | 1152 | subdir('src/boot/efi') |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 1153 | |
| 1154 | subdir('src/test') |
Zbigniew Jędrzejewski-Szmek | 4ff3f25 | 2017-04-13 20:47:20 -0400 | [diff] [blame] | 1155 | subdir('test') |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 1156 | |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1157 | ############################################################ |
| 1158 | |
| 1159 | # only static linking apart from libdl, to make sure that the |
| 1160 | # module is linked to all libraries that it uses. |
| 1161 | test_dlopen = executable( |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1162 | 'test-dlopen', |
| 1163 | test_dlopen_c, |
| 1164 | include_directories : includes, |
| 1165 | link_with : [libbasic], |
| 1166 | dependencies : [libdl]) |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1167 | |
| 1168 | foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []], |
| 1169 | ['systemd', '', []], |
| 1170 | ['mymachines', 'ENABLE_MACHINED', []], |
| 1171 | ['resolve', 'ENABLE_RESOLVED', [libdl]]] |
| 1172 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1173 | condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1 |
| 1174 | if condition |
| 1175 | module = tuple[0] |
| 1176 | extra_deps = tuple[2] |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1177 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1178 | sym = 'src/nss-@0@/nss-@0@.sym'.format(module) |
| 1179 | version_script_arg = join_paths(meson.current_source_dir(), sym) |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1180 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1181 | nss = shared_library( |
| 1182 | 'nss_' + module, |
| 1183 | 'src/nss-@0@/nss-@0@.c'.format(module), |
| 1184 | version : '2', |
| 1185 | include_directories : includes, |
| 1186 | link_args : ['-shared', |
| 1187 | '-Wl,--version-script=' + version_script_arg, |
| 1188 | '-Wl,--undefined'], |
| 1189 | link_with : [libsystemd_internal, |
| 1190 | libbasic], |
| 1191 | dependencies : [threads, |
| 1192 | librt] + extra_deps, |
| 1193 | link_depends : sym, |
| 1194 | install : true, |
| 1195 | install_dir : rootlibdir) |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1196 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1197 | # We cannot use shared_module because it does not support version suffix. |
| 1198 | # Unfortunately shared_library insists on creating the symlink… |
| 1199 | meson.add_install_script('sh', '-c', |
| 1200 | 'rm $DESTDIR@0@/libnss_@1@.so' |
| 1201 | .format(rootlibdir, module)) |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1202 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1203 | test('dlopen-nss_' + module, |
| 1204 | test_dlopen, |
| 1205 | args : [nss.full_path()]) # path to dlopen must include a slash |
| 1206 | endif |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1207 | endforeach |
| 1208 | |
| 1209 | ############################################################ |
| 1210 | |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1211 | executable('systemd', |
| 1212 | systemd_sources, |
| 1213 | include_directories : includes, |
| 1214 | link_with : [libcore, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1215 | libshared], |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1216 | dependencies : [threads, |
| 1217 | librt, |
| 1218 | libseccomp, |
| 1219 | libselinux, |
Zbigniew Jędrzejewski-Szmek | f4ee10a | 2017-04-09 14:08:53 -0400 | [diff] [blame] | 1220 | libmount, |
| 1221 | libblkid], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1222 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1223 | install : true, |
| 1224 | install_dir : rootlibexecdir) |
| 1225 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1226 | exe = executable('systemd-analyze', |
| 1227 | systemd_analyze_sources, |
| 1228 | include_directories : includes, |
| 1229 | link_with : [libcore, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1230 | libshared], |
| 1231 | dependencies : [threads, |
| 1232 | librt, |
| 1233 | libseccomp, |
| 1234 | libselinux, |
| 1235 | libmount, |
| 1236 | libblkid], |
| 1237 | install_rpath : rootlibexecdir, |
| 1238 | install : true) |
| 1239 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1240 | |
| 1241 | executable('systemd-journald', |
| 1242 | systemd_journald_sources, |
| 1243 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1244 | link_with : [libjournal_core, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1245 | libshared], |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1246 | dependencies : [threads, |
| 1247 | libxz, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1248 | liblz4, |
| 1249 | libselinux], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1250 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1251 | install : true, |
| 1252 | install_dir : rootlibexecdir) |
| 1253 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1254 | exe = executable('systemd-cat', |
| 1255 | systemd_cat_sources, |
| 1256 | include_directories : includes, |
| 1257 | link_with : [libjournal_core, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1258 | libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1259 | dependencies : [threads], |
| 1260 | install_rpath : rootlibexecdir, |
| 1261 | install : true) |
| 1262 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1263 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1264 | exe = executable('journalctl', |
| 1265 | journalctl_sources, |
| 1266 | include_directories : includes, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1267 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1268 | dependencies : [threads, |
| 1269 | libqrencode, |
| 1270 | libxz, |
| 1271 | liblz4], |
| 1272 | install_rpath : rootlibexecdir, |
| 1273 | install : true, |
| 1274 | install_dir : rootbindir) |
| 1275 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1276 | |
| 1277 | executable('systemd-getty-generator', |
| 1278 | 'src/getty-generator/getty-generator.c', |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1279 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | b2fc583 | 2017-04-10 18:13:00 -0400 | [diff] [blame] | 1280 | link_with : [libshared], |
| 1281 | install_rpath : rootlibexecdir, |
| 1282 | install : true, |
| 1283 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1284 | |
| 1285 | executable('systemd-debug-generator', |
| 1286 | 'src/debug-generator/debug-generator.c', |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1287 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | b2fc583 | 2017-04-10 18:13:00 -0400 | [diff] [blame] | 1288 | link_with : [libshared], |
| 1289 | install_rpath : rootlibexecdir, |
| 1290 | install : true, |
| 1291 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1292 | |
| 1293 | executable('systemd-fstab-generator', |
| 1294 | 'src/fstab-generator/fstab-generator.c', |
| 1295 | 'src/core/mount-setup.c', |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1296 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | b2fc583 | 2017-04-10 18:13:00 -0400 | [diff] [blame] | 1297 | link_with : [libshared], |
| 1298 | install_rpath : rootlibexecdir, |
| 1299 | install : true, |
| 1300 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1301 | |
| 1302 | if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1303 | executable('30-systemd-environment-d-generator', |
| 1304 | 'src/environment-d-generator/environment-d-generator.c', |
| 1305 | include_directories : includes, |
| 1306 | link_with : [libshared], |
| 1307 | install_rpath : rootlibexecdir, |
| 1308 | install : true, |
| 1309 | install_dir : userenvgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 7b76fce | 2017-04-09 23:55:50 -0400 | [diff] [blame] | 1310 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1311 | meson.add_install_script(meson_make_symlink, |
| 1312 | join_paths(sysconfdir, 'environment'), |
| 1313 | join_paths(environmentdir, '99-environment.conf')) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1314 | endif |
| 1315 | |
| 1316 | if conf.get('ENABLE_HIBERNATE', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1317 | executable('systemd-hibernate-resume-generator', |
| 1318 | 'src/hibernate-resume/hibernate-resume-generator.c', |
| 1319 | include_directories : includes, |
| 1320 | link_with : [libshared], |
| 1321 | install_rpath : rootlibexecdir, |
| 1322 | install : true, |
| 1323 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1324 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1325 | executable('systemd-hibernate-resume', |
| 1326 | 'src/hibernate-resume/hibernate-resume.c', |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1327 | include_directories : includes, |
| 1328 | link_with : [libshared], |
| 1329 | install_rpath : rootlibexecdir, |
| 1330 | install : true, |
| 1331 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1332 | endif |
| 1333 | |
| 1334 | if conf.get('HAVE_BLKID', 0) == 1 |
| 1335 | executable('systemd-gpt-auto-generator', |
| 1336 | 'src/gpt-auto-generator/gpt-auto-generator.c', |
| 1337 | 'src/basic/blkid-util.h', |
| 1338 | include_directories : includes, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1339 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1340 | dependencies : libblkid, |
| 1341 | install_rpath : rootlibexecdir, |
| 1342 | install : true, |
| 1343 | install_dir : systemgeneratordir) |
| 1344 | |
| 1345 | exe = executable('systemd-dissect', |
| 1346 | 'src/dissect/dissect.c', |
| 1347 | include_directories : includes, |
| 1348 | link_with : [libshared], |
| 1349 | install_rpath : rootlibexecdir, |
| 1350 | install : true, |
| 1351 | install_dir : rootlibexecdir) |
| 1352 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1353 | endif |
| 1354 | |
| 1355 | if conf.get('ENABLE_RESOLVED', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1356 | executable('systemd-resolved', |
| 1357 | systemd_resolved_sources, |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 1358 | gcrypt_util_sources, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1359 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1360 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1361 | dependencies : [threads, |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 1362 | libgcrypt, |
| 1363 | libgpg_error, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1364 | libm, |
| 1365 | libidn], |
| 1366 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1367 | install : true, |
| 1368 | install_dir : rootlibexecdir) |
| 1369 | |
| 1370 | exe = executable('systemd-resolve', |
| 1371 | systemd_resolve_sources, |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 1372 | gcrypt_util_sources, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1373 | include_directories : includes, |
| 1374 | link_with : [libshared], |
| 1375 | dependencies : [threads, |
Michael Biebl | 76c8741 | 2017-04-21 23:45:54 +0200 | [diff] [blame] | 1376 | libgcrypt, |
| 1377 | libgpg_error, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1378 | libm, |
| 1379 | libidn], |
| 1380 | install_rpath : rootlibexecdir, |
| 1381 | install : true) |
| 1382 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1383 | endif |
| 1384 | |
| 1385 | if conf.get('ENABLE_LOGIND', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1386 | executable('systemd-logind', |
| 1387 | systemd_logind_sources, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1388 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1389 | link_with : [liblogind_core, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1390 | libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1391 | dependencies : [threads, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1392 | libacl], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1393 | install_rpath : rootlibexecdir, |
| 1394 | install : true, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1395 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1396 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1397 | exe = executable('loginctl', |
| 1398 | loginctl_sources, |
| 1399 | include_directories : includes, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1400 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1401 | dependencies : [threads, |
| 1402 | liblz4, |
| 1403 | libxz], |
| 1404 | install_rpath : rootlibexecdir, |
| 1405 | install : true, |
| 1406 | install_dir : rootbindir) |
| 1407 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1408 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1409 | exe = executable('systemd-inhibit', |
| 1410 | 'src/login/inhibit.c', |
| 1411 | include_directories : includes, |
| 1412 | link_with : [libshared], |
| 1413 | install_rpath : rootlibexecdir, |
| 1414 | install : true, |
| 1415 | install_dir : rootbindir) |
| 1416 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 83b6af3 | 2017-04-14 20:10:28 -0400 | [diff] [blame] | 1417 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1418 | if conf.get('HAVE_PAM', 0) == 1 |
| 1419 | version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym) |
| 1420 | pam_systemd = shared_library( |
| 1421 | 'pam_systemd', |
| 1422 | pam_systemd_c, |
| 1423 | name_prefix : '', |
| 1424 | include_directories : includes, |
| 1425 | link_args : ['-shared', |
| 1426 | '-Wl,--version-script=' + version_script_arg], |
| 1427 | link_with : [libsystemd_internal, |
| 1428 | libshared_static], |
| 1429 | dependencies : [threads, |
| 1430 | libpam, |
| 1431 | libpam_misc], |
| 1432 | link_depends : pam_systemd_sym, |
| 1433 | install : true, |
| 1434 | install_dir : pamlibdir) |
| 1435 | |
| 1436 | test('dlopen-pam_systemd', |
| 1437 | test_dlopen, |
| 1438 | args : [pam_systemd.full_path()]) # path to dlopen must include a slash |
| 1439 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1440 | endif |
| 1441 | |
| 1442 | if conf.get('HAVE_PAM', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1443 | executable('systemd-user-sessions', |
| 1444 | 'src/user-sessions/user-sessions.c', |
| 1445 | include_directories : includes, |
| 1446 | link_with : [libshared], |
| 1447 | install_rpath : rootlibexecdir, |
| 1448 | install : true, |
| 1449 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1450 | endif |
| 1451 | |
Zbigniew Jędrzejewski-Szmek | 8191c59 | 2017-04-12 12:36:20 -0400 | [diff] [blame] | 1452 | if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1453 | exe = executable('bootctl', |
| 1454 | 'src/boot/bootctl.c', |
| 1455 | include_directories : includes, |
| 1456 | link_with : [libshared], |
| 1457 | dependencies : [libblkid], |
| 1458 | install_rpath : rootlibexecdir, |
| 1459 | install : true) |
| 1460 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1461 | endif |
| 1462 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1463 | exe = executable('systemd-socket-activate', 'src/activate/activate.c', |
| 1464 | include_directories : includes, |
| 1465 | link_with : [libshared], |
| 1466 | dependencies : [threads], |
| 1467 | install_rpath : rootlibexecdir, |
| 1468 | install : true) |
| 1469 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1470 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1471 | exe = executable('systemctl', 'src/systemctl/systemctl.c', |
| 1472 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1473 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1474 | dependencies : [threads, |
| 1475 | libcap, |
| 1476 | libselinux, |
| 1477 | libxz, |
| 1478 | liblz4], |
| 1479 | install_rpath : rootlibexecdir, |
| 1480 | install : true, |
| 1481 | install_dir : rootbindir) |
| 1482 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1483 | |
| 1484 | if conf.get('ENABLE_BACKLIGHT', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1485 | executable('systemd-backlight', |
| 1486 | 'src/backlight/backlight.c', |
| 1487 | include_directories : includes, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1488 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1489 | install_rpath : rootlibexecdir, |
| 1490 | install : true, |
| 1491 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1492 | endif |
| 1493 | |
| 1494 | if conf.get('ENABLE_RFKILL', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1495 | executable('systemd-rfkill', |
| 1496 | 'src/rfkill/rfkill.c', |
| 1497 | include_directories : includes, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1498 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1499 | install_rpath : rootlibexecdir, |
| 1500 | install : true, |
| 1501 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1502 | endif |
| 1503 | |
| 1504 | executable('systemd-system-update-generator', |
| 1505 | 'src/system-update-generator/system-update-generator.c', |
| 1506 | include_directories : includes, |
| 1507 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | b2fc583 | 2017-04-10 18:13:00 -0400 | [diff] [blame] | 1508 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1509 | install : true, |
| 1510 | install_dir : systemgeneratordir) |
| 1511 | |
| 1512 | if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1513 | executable('systemd-cryptsetup', |
| 1514 | 'src/cryptsetup/cryptsetup.c', |
| 1515 | include_directories : includes, |
| 1516 | link_with : [libshared], |
| 1517 | dependencies : [libcryptsetup], |
| 1518 | install_rpath : rootlibexecdir, |
| 1519 | install : true, |
| 1520 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1521 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1522 | executable('systemd-cryptsetup-generator', |
| 1523 | 'src/cryptsetup/cryptsetup-generator.c', |
| 1524 | include_directories : includes, |
| 1525 | link_with : [libshared], |
| 1526 | dependencies : [libcryptsetup], |
| 1527 | install_rpath : rootlibexecdir, |
| 1528 | install : true, |
| 1529 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1530 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1531 | executable('systemd-veritysetup', |
| 1532 | 'src/veritysetup/veritysetup.c', |
| 1533 | include_directories : includes, |
| 1534 | link_with : [libshared], |
| 1535 | dependencies : [libcryptsetup], |
| 1536 | install_rpath : rootlibexecdir, |
| 1537 | install : true, |
| 1538 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1539 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1540 | executable('systemd-veritysetup-generator', |
| 1541 | 'src/veritysetup/veritysetup-generator.c', |
| 1542 | include_directories : includes, |
| 1543 | link_with : [libshared], |
| 1544 | dependencies : [libcryptsetup], |
| 1545 | install_rpath : rootlibexecdir, |
| 1546 | install : true, |
| 1547 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1548 | endif |
| 1549 | |
| 1550 | if conf.get('HAVE_SYSV_COMPAT', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1551 | executable('systemd-sysv-generator', |
| 1552 | 'src/sysv-generator/sysv-generator.c', |
| 1553 | include_directories : includes, |
| 1554 | link_with : [libshared], |
| 1555 | install_rpath : rootlibexecdir, |
| 1556 | install : true, |
| 1557 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1558 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1559 | executable('systemd-rc-local-generator', |
| 1560 | 'src/rc-local-generator/rc-local-generator.c', |
| 1561 | include_directories : includes, |
| 1562 | link_with : [libshared], |
| 1563 | install_rpath : rootlibexecdir, |
| 1564 | install : true, |
| 1565 | install_dir : systemgeneratordir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1566 | endif |
| 1567 | |
| 1568 | if conf.get('ENABLE_HOSTNAMED', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1569 | executable('systemd-hostnamed', |
| 1570 | 'src/hostname/hostnamed.c', |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1571 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1572 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1573 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1574 | install : true, |
| 1575 | install_dir : rootlibexecdir) |
| 1576 | |
| 1577 | exe = executable('hostnamectl', |
| 1578 | 'src/hostname/hostnamectl.c', |
| 1579 | include_directories : includes, |
| 1580 | link_with : [libshared], |
| 1581 | install_rpath : rootlibexecdir, |
| 1582 | install : true) |
| 1583 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1584 | endif |
| 1585 | |
| 1586 | if conf.get('ENABLE_LOCALED', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1587 | if conf.get('HAVE_XKBCOMMON', 0) == 1 |
| 1588 | # logind will load libxkbcommon.so dynamically on its own |
| 1589 | deps = [libdl] |
| 1590 | else |
| 1591 | deps = [] |
| 1592 | endif |
Zbigniew Jędrzejewski-Szmek | 1eeb43f | 2017-04-13 19:37:14 -0400 | [diff] [blame] | 1593 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1594 | executable('systemd-localed', |
| 1595 | systemd_localed_sources, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1596 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1597 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1598 | dependencies : deps, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1599 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1600 | install : true, |
| 1601 | install_dir : rootlibexecdir) |
| 1602 | |
| 1603 | exe = executable('localectl', |
| 1604 | localectl_sources, |
| 1605 | include_directories : includes, |
| 1606 | link_with : [libshared], |
| 1607 | install_rpath : rootlibexecdir, |
| 1608 | install : true) |
| 1609 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1610 | endif |
| 1611 | |
| 1612 | if conf.get('ENABLE_TIMEDATED', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1613 | executable('systemd-timedated', |
| 1614 | 'src/timedate/timedated.c', |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1615 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1616 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1617 | install_rpath : rootlibexecdir, |
| 1618 | install : true, |
| 1619 | install_dir : rootlibexecdir) |
| 1620 | |
| 1621 | exe = executable('timedatectl', |
| 1622 | 'src/timedate/timedatectl.c', |
| 1623 | include_directories : includes, |
| 1624 | install_rpath : rootlibexecdir, |
| 1625 | link_with : [libshared], |
| 1626 | install : true) |
| 1627 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1628 | endif |
| 1629 | |
| 1630 | if conf.get('ENABLE_TIMESYNCD', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1631 | executable('systemd-timesyncd', |
| 1632 | systemd_timesyncd_sources, |
| 1633 | include_directories : includes, |
| 1634 | link_with : [libshared], |
| 1635 | dependencies : [threads, |
| 1636 | libm], |
| 1637 | install_rpath : rootlibexecdir, |
| 1638 | install : true, |
| 1639 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1640 | endif |
| 1641 | |
| 1642 | if conf.get('ENABLE_MACHINED', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1643 | executable('systemd-machined', |
| 1644 | systemd_machined_sources, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1645 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1646 | link_with : [libmachine_core, |
| 1647 | libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1648 | install_rpath : rootlibexecdir, |
| 1649 | install : true, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1650 | install_dir : rootlibexecdir) |
| 1651 | |
| 1652 | exe = executable('machinectl', |
| 1653 | 'src/machine/machinectl.c', |
| 1654 | include_directories : includes, |
| 1655 | link_with : [libshared], |
| 1656 | dependencies : [threads, |
| 1657 | libxz, |
| 1658 | liblz4], |
| 1659 | install_rpath : rootlibexecdir, |
| 1660 | install : true, |
| 1661 | install_dir : rootbindir) |
| 1662 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1663 | endif |
| 1664 | |
| 1665 | if conf.get('ENABLE_IMPORTD', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1666 | executable('systemd-importd', |
| 1667 | systemd_importd_sources, |
| 1668 | include_directories : includes, |
| 1669 | link_with : [libshared], |
| 1670 | dependencies : [threads], |
| 1671 | install_rpath : rootlibexecdir, |
| 1672 | install : true, |
| 1673 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1674 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1675 | systemd_pull = executable('systemd-pull', |
| 1676 | systemd_pull_sources, |
| 1677 | include_directories : includes, |
| 1678 | link_with : [libshared], |
| 1679 | dependencies : [libcurl, |
| 1680 | libz, |
| 1681 | libbzip2, |
| 1682 | libxz, |
| 1683 | libgcrypt], |
| 1684 | install_rpath : rootlibexecdir, |
| 1685 | install : true, |
| 1686 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1687 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1688 | systemd_import = executable('systemd-import', |
| 1689 | systemd_import_sources, |
| 1690 | include_directories : includes, |
| 1691 | link_with : [libshared], |
| 1692 | dependencies : [libcurl, |
| 1693 | libz, |
| 1694 | libbzip2, |
| 1695 | libxz], |
| 1696 | install_rpath : rootlibexecdir, |
| 1697 | install : true, |
| 1698 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1699 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1700 | systemd_export = executable('systemd-export', |
| 1701 | systemd_export_sources, |
| 1702 | include_directories : includes, |
| 1703 | link_with : [libshared], |
| 1704 | dependencies : [libcurl, |
| 1705 | libz, |
| 1706 | libbzip2, |
| 1707 | libxz], |
| 1708 | install_rpath : rootlibexecdir, |
| 1709 | install : true, |
| 1710 | install_dir : rootlibexecdir) |
| 1711 | public_programs += [systemd_pull, systemd_import, systemd_export] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1712 | endif |
| 1713 | |
| 1714 | if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1715 | exe = executable('systemd-journal-upload', |
| 1716 | systemd_journal_upload_sources, |
| 1717 | include_directories : includes, |
| 1718 | link_with : [libshared], |
| 1719 | dependencies : [threads, |
| 1720 | libcurl, |
| 1721 | libgnutls, |
| 1722 | libxz, |
| 1723 | liblz4], |
| 1724 | install_rpath : rootlibexecdir, |
| 1725 | install : true, |
| 1726 | install_dir : rootlibexecdir) |
| 1727 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1728 | endif |
| 1729 | |
| 1730 | if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1731 | s_j_remote = executable('systemd-journal-remote', |
| 1732 | systemd_journal_remote_sources, |
| 1733 | include_directories : includes, |
| 1734 | link_with : [libshared], |
| 1735 | dependencies : [threads, |
| 1736 | libmicrohttpd, |
| 1737 | libgnutls, |
| 1738 | libxz, |
| 1739 | liblz4], |
| 1740 | install_rpath : rootlibexecdir, |
| 1741 | install : true, |
| 1742 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1743 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1744 | s_j_gatewayd = executable('systemd-journal-gatewayd', |
| 1745 | systemd_journal_gatewayd_sources, |
| 1746 | include_directories : includes, |
| 1747 | link_with : [libshared], |
| 1748 | dependencies : [threads, |
| 1749 | libmicrohttpd, |
| 1750 | libgnutls, |
| 1751 | libxz, |
| 1752 | liblz4], |
| 1753 | install_rpath : rootlibexecdir, |
| 1754 | install : true, |
| 1755 | install_dir : rootlibexecdir) |
| 1756 | public_programs += [s_j_remote, s_j_gatewayd] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1757 | endif |
| 1758 | |
| 1759 | if conf.get('ENABLE_COREDUMP', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1760 | executable('systemd-coredump', |
| 1761 | systemd_coredump_sources, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1762 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1763 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1764 | dependencies : [threads, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1765 | libacl, |
| 1766 | libdw, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1767 | libxz, |
| 1768 | liblz4], |
| 1769 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1770 | install : true, |
| 1771 | install_dir : rootlibexecdir) |
| 1772 | |
| 1773 | exe = executable('coredumpctl', |
| 1774 | coredumpctl_sources, |
| 1775 | include_directories : includes, |
| 1776 | link_with : [libshared], |
| 1777 | dependencies : [threads, |
| 1778 | libxz, |
| 1779 | liblz4], |
| 1780 | install_rpath : rootlibexecdir, |
| 1781 | install : true) |
| 1782 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1783 | endif |
| 1784 | |
| 1785 | if conf.get('ENABLE_BINFMT', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1786 | exe = executable('systemd-binfmt', |
| 1787 | 'src/binfmt/binfmt.c', |
| 1788 | include_directories : includes, |
| 1789 | link_with : [libshared], |
| 1790 | install_rpath : rootlibexecdir, |
| 1791 | install : true, |
| 1792 | install_dir : rootlibexecdir) |
| 1793 | public_programs += [exe] |
| 1794 | |
| 1795 | meson.add_install_script('sh', '-c', |
| 1796 | mkdir_p.format(binfmtdir)) |
| 1797 | meson.add_install_script('sh', '-c', |
| 1798 | mkdir_p.format(join_paths(sysconfdir, 'binfmt.d'))) |
| 1799 | endif |
| 1800 | |
| 1801 | if conf.get('ENABLE_VCONSOLE', 0) == 1 |
| 1802 | executable('systemd-vconsole-setup', |
| 1803 | 'src/vconsole/vconsole-setup.c', |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1804 | include_directories : includes, |
| 1805 | link_with : [libshared], |
| 1806 | install_rpath : rootlibexecdir, |
| 1807 | install : true, |
| 1808 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1809 | endif |
| 1810 | |
| 1811 | if conf.get('ENABLE_RANDOMSEED', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1812 | executable('systemd-random-seed', |
| 1813 | 'src/random-seed/random-seed.c', |
| 1814 | include_directories : includes, |
| 1815 | link_with : [libshared], |
| 1816 | install_rpath : rootlibexecdir, |
| 1817 | install : true, |
| 1818 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1819 | endif |
| 1820 | |
| 1821 | if conf.get('ENABLE_FIRSTBOOT', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 1822 | executable('systemd-firstboot', |
| 1823 | 'src/firstboot/firstboot.c', |
| 1824 | include_directories : includes, |
| 1825 | link_with : [libshared], |
| 1826 | dependencies : [libcrypt], |
| 1827 | install_rpath : rootlibexecdir, |
| 1828 | install : true, |
| 1829 | install_dir : rootbindir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1830 | endif |
| 1831 | |
| 1832 | executable('systemd-remount-fs', |
| 1833 | 'src/remount-fs/remount-fs.c', |
| 1834 | 'src/core/mount-setup.c', |
| 1835 | 'src/core/mount-setup.h', |
| 1836 | include_directories : includes, |
| 1837 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | b2fc583 | 2017-04-10 18:13:00 -0400 | [diff] [blame] | 1838 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1839 | install : true, |
| 1840 | install_dir : rootlibexecdir) |
| 1841 | |
| 1842 | executable('systemd-machine-id-setup', |
| 1843 | 'src/machine-id-setup/machine-id-setup-main.c', |
| 1844 | 'src/core/machine-id-setup.c', |
| 1845 | 'src/core/machine-id-setup.h', |
| 1846 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1847 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | b2fc583 | 2017-04-10 18:13:00 -0400 | [diff] [blame] | 1848 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1849 | install : true, |
| 1850 | install_dir : rootbindir) |
| 1851 | |
| 1852 | executable('systemd-fsck', |
| 1853 | 'src/fsck/fsck.c', |
| 1854 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1855 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1856 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1857 | install : true, |
| 1858 | install_dir : rootlibexecdir) |
| 1859 | |
| 1860 | executable('systemd-sleep', |
| 1861 | 'src/sleep/sleep.c', |
| 1862 | include_directories : includes, |
| 1863 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1864 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1865 | install : true, |
| 1866 | install_dir : rootlibexecdir) |
| 1867 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1868 | exe = executable('systemd-sysctl', |
| 1869 | 'src/sysctl/sysctl.c', |
| 1870 | include_directories : includes, |
| 1871 | link_with : [libshared], |
| 1872 | install_rpath : rootlibexecdir, |
| 1873 | install : true, |
| 1874 | install_dir : rootlibexecdir) |
| 1875 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1876 | |
| 1877 | executable('systemd-ac-power', |
| 1878 | 'src/ac-power/ac-power.c', |
| 1879 | include_directories : includes, |
| 1880 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1881 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1882 | install : true, |
| 1883 | install_dir : rootlibexecdir) |
| 1884 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1885 | exe = executable('systemd-detect-virt', |
| 1886 | 'src/detect-virt/detect-virt.c', |
| 1887 | include_directories : includes, |
| 1888 | link_with : [libshared], |
| 1889 | install_rpath : rootlibexecdir, |
| 1890 | install : true) |
| 1891 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1892 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1893 | exe = executable('systemd-delta', |
| 1894 | 'src/delta/delta.c', |
| 1895 | include_directories : includes, |
| 1896 | link_with : [libshared], |
| 1897 | install_rpath : rootlibexecdir, |
| 1898 | install : true) |
| 1899 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1900 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1901 | exe = executable('systemd-escape', |
| 1902 | 'src/escape/escape.c', |
| 1903 | include_directories : includes, |
| 1904 | link_with : [libshared], |
| 1905 | install_rpath : rootlibexecdir, |
| 1906 | install : true, |
| 1907 | install_dir : rootbindir) |
| 1908 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1909 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1910 | exe = executable('systemd-notify', |
| 1911 | 'src/notify/notify.c', |
| 1912 | include_directories : includes, |
| 1913 | link_with : [libshared], |
| 1914 | install_rpath : rootlibexecdir, |
| 1915 | install : true, |
| 1916 | install_dir : rootbindir) |
| 1917 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1918 | |
| 1919 | executable('systemd-volatile-root', |
| 1920 | 'src/volatile-root/volatile-root.c', |
| 1921 | include_directories : includes, |
| 1922 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1923 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1924 | install : true, |
| 1925 | install_dir : rootlibexecdir) |
| 1926 | |
| 1927 | executable('systemd-cgroups-agent', |
| 1928 | 'src/cgroups-agent/cgroups-agent.c', |
| 1929 | include_directories : includes, |
| 1930 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1931 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1932 | install : true, |
| 1933 | install_dir : rootlibexecdir) |
| 1934 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1935 | exe = executable('systemd-path', |
| 1936 | 'src/path/path.c', |
| 1937 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1938 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1939 | install_rpath : rootlibexecdir, |
| 1940 | install : true) |
| 1941 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1942 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1943 | exe = executable('systemd-ask-password', |
| 1944 | 'src/ask-password/ask-password.c', |
| 1945 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1946 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1947 | install_rpath : rootlibexecdir, |
| 1948 | install : true, |
| 1949 | install_dir : rootbindir) |
| 1950 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1951 | |
| 1952 | executable('systemd-reply-password', |
| 1953 | 'src/reply-password/reply-password.c', |
| 1954 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1955 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1956 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1957 | install : true, |
| 1958 | install_dir : rootlibexecdir) |
| 1959 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1960 | exe = executable('systemd-tty-ask-password-agent', |
| 1961 | 'src/tty-ask-password-agent/tty-ask-password-agent.c', |
| 1962 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1963 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1964 | install_rpath : rootlibexecdir, |
| 1965 | install : true, |
| 1966 | install_dir : rootbindir) |
| 1967 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1968 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1969 | exe = executable('systemd-cgls', |
| 1970 | 'src/cgls/cgls.c', |
| 1971 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1972 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1973 | install_rpath : rootlibexecdir, |
| 1974 | install : true) |
| 1975 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1976 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1977 | exe = executable('systemd-cgtop', |
| 1978 | 'src/cgtop/cgtop.c', |
| 1979 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1980 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1981 | install_rpath : rootlibexecdir, |
| 1982 | install : true) |
| 1983 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1984 | |
| 1985 | executable('systemd-initctl', |
| 1986 | 'src/initctl/initctl.c', |
| 1987 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 1988 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 1989 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 1990 | install : true, |
| 1991 | install_dir : rootlibexecdir) |
| 1992 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1993 | exe = executable('systemd-mount', |
| 1994 | 'src/mount/mount-tool.c', |
| 1995 | include_directories : includes, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 1996 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 1997 | install_rpath : rootlibexecdir, |
| 1998 | install : true) |
| 1999 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2000 | |
Zbigniew Jędrzejewski-Szmek | 7b76fce | 2017-04-09 23:55:50 -0400 | [diff] [blame] | 2001 | meson.add_install_script(meson_make_symlink, |
Michael Biebl | e17e5ba | 2017-04-13 10:30:56 -0400 | [diff] [blame] | 2002 | 'systemd-mount', join_paths(bindir, 'systemd-umount')) |
Zbigniew Jędrzejewski-Szmek | 7b76fce | 2017-04-09 23:55:50 -0400 | [diff] [blame] | 2003 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2004 | exe = executable('systemd-run', |
| 2005 | 'src/run/run.c', |
| 2006 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2007 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2008 | install_rpath : rootlibexecdir, |
| 2009 | install : true) |
| 2010 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2011 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2012 | exe = executable('systemd-stdio-bridge', |
| 2013 | 'src/stdio-bridge/stdio-bridge.c', |
| 2014 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2015 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2016 | install_rpath : rootlibexecdir, |
| 2017 | install : true) |
| 2018 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2019 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2020 | exe = executable('busctl', |
| 2021 | 'src/busctl/busctl.c', |
| 2022 | 'src/busctl/busctl-introspect.c', |
| 2023 | 'src/busctl/busctl-introspect.h', |
| 2024 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2025 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2026 | install_rpath : rootlibexecdir, |
| 2027 | install : true) |
| 2028 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2029 | |
| 2030 | if conf.get('ENABLE_SYSUSERS', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2031 | exe = executable('systemd-sysusers', |
| 2032 | 'src/sysusers/sysusers.c', |
| 2033 | include_directories : includes, |
| 2034 | link_with : [libshared], |
| 2035 | install_rpath : rootlibexecdir, |
| 2036 | install : true, |
| 2037 | install_dir : rootbindir) |
| 2038 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2039 | endif |
| 2040 | |
| 2041 | if conf.get('ENABLE_TMPFILES', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2042 | exe = executable('systemd-tmpfiles', |
| 2043 | 'src/tmpfiles/tmpfiles.c', |
| 2044 | include_directories : includes, |
| 2045 | link_with : [libshared], |
| 2046 | dependencies : [libacl], |
| 2047 | install_rpath : rootlibexecdir, |
| 2048 | install : true, |
| 2049 | install_dir : rootbindir) |
| 2050 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2051 | endif |
| 2052 | |
| 2053 | if conf.get('ENABLE_HWDB', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2054 | exe = executable('systemd-hwdb', |
| 2055 | 'src/hwdb/hwdb.c', |
| 2056 | 'src/libsystemd/sd-hwdb/hwdb-internal.h', |
| 2057 | include_directories : includes, |
Michael Biebl | 0da6f39 | 2017-04-21 18:32:14 +0200 | [diff] [blame] | 2058 | link_with : [libudev_internal], |
| 2059 | install_rpath : udev_rpath, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2060 | install : true, |
| 2061 | install_dir : rootbindir) |
| 2062 | public_programs += [exe] |
| 2063 | endif |
| 2064 | |
| 2065 | if conf.get('ENABLE_QUOTACHECK', 0) == 1 |
| 2066 | executable('systemd-quotacheck', |
| 2067 | 'src/quotacheck/quotacheck.c', |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2068 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2069 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2070 | install_rpath : rootlibexecdir, |
| 2071 | install : true, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2072 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2073 | endif |
| 2074 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2075 | exe = executable('systemd-socket-proxyd', |
| 2076 | 'src/socket-proxy/socket-proxyd.c', |
| 2077 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2078 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2079 | dependencies : [threads], |
| 2080 | install_rpath : rootlibexecdir, |
| 2081 | install : true, |
| 2082 | install_dir : rootlibexecdir) |
| 2083 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2084 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2085 | exe = executable('systemd-udevd', |
| 2086 | systemd_udevd_sources, |
| 2087 | include_directories : includes, |
| 2088 | link_with : [libudev_core, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2089 | libsystemd_network, |
Zbigniew Jędrzejewski-Szmek | 1aec3ed | 2017-04-17 19:33:10 -0400 | [diff] [blame] | 2090 | libudev_internal], |
Zbigniew Jędrzejewski-Szmek | 3a30f21 | 2017-04-17 12:07:12 -0400 | [diff] [blame] | 2091 | dependencies : [threads, |
| 2092 | libkmod, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2093 | libidn, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2094 | libacl, |
| 2095 | libblkid], |
Zbigniew Jędrzejewski-Szmek | 1aec3ed | 2017-04-17 19:33:10 -0400 | [diff] [blame] | 2096 | install_rpath : udev_rpath, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2097 | install : true, |
| 2098 | install_dir : rootlibexecdir) |
| 2099 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2100 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2101 | exe = executable('udevadm', |
| 2102 | udevadm_sources, |
| 2103 | include_directories : includes, |
| 2104 | link_with : [libudev_core, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2105 | libsystemd_network, |
Zbigniew Jędrzejewski-Szmek | 1aec3ed | 2017-04-17 19:33:10 -0400 | [diff] [blame] | 2106 | libudev_internal], |
Zbigniew Jędrzejewski-Szmek | 3a30f21 | 2017-04-17 12:07:12 -0400 | [diff] [blame] | 2107 | dependencies : [threads, |
| 2108 | libkmod, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2109 | libidn, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2110 | libacl, |
| 2111 | libblkid], |
Zbigniew Jędrzejewski-Szmek | 1aec3ed | 2017-04-17 19:33:10 -0400 | [diff] [blame] | 2112 | install_rpath : udev_rpath, |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2113 | install : true, |
| 2114 | install_dir : rootbindir) |
| 2115 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2116 | |
| 2117 | executable('systemd-shutdown', |
| 2118 | systemd_shutdown_sources, |
| 2119 | include_directories : includes, |
Michael Biebl | 34ce0a5 | 2017-04-25 20:19:54 +0200 | [diff] [blame] | 2120 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 2121 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2122 | install : true, |
| 2123 | install_dir : rootlibexecdir) |
| 2124 | |
| 2125 | executable('systemd-update-done', |
| 2126 | 'src/update-done/update-done.c', |
| 2127 | include_directories : includes, |
| 2128 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 2129 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2130 | install : true, |
| 2131 | install_dir : rootlibexecdir) |
| 2132 | |
| 2133 | executable('systemd-update-utmp', |
| 2134 | 'src/update-utmp/update-utmp.c', |
| 2135 | include_directories : includes, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2136 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2137 | dependencies : [libaudit], |
Zbigniew Jędrzejewski-Szmek | 421f001 | 2017-04-12 12:02:30 -0400 | [diff] [blame] | 2138 | install_rpath : rootlibexecdir, |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2139 | install : true, |
| 2140 | install_dir : rootlibexecdir) |
| 2141 | |
| 2142 | if conf.get('HAVE_KMOD', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2143 | executable('systemd-modules-load', |
| 2144 | 'src/modules-load/modules-load.c', |
| 2145 | include_directories : includes, |
| 2146 | link_with : [libshared], |
| 2147 | dependencies : [libkmod], |
| 2148 | install_rpath : rootlibexecdir, |
| 2149 | install : true, |
| 2150 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 94e75a5 | 2017-04-09 23:55:05 -0400 | [diff] [blame] | 2151 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2152 | meson.add_install_script('sh', '-c', |
| 2153 | mkdir_p.format(modulesloaddir)) |
| 2154 | meson.add_install_script('sh', '-c', |
| 2155 | mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2156 | endif |
| 2157 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2158 | exe = executable('systemd-nspawn', |
| 2159 | systemd_nspawn_sources, |
| 2160 | 'src/core/mount-setup.c', # FIXME: use a variable? |
| 2161 | 'src/core/mount-setup.h', |
| 2162 | 'src/core/loopback-setup.c', |
| 2163 | 'src/core/loopback-setup.h', |
| 2164 | include_directories : [includes, include_directories('src/nspawn')], |
Zbigniew Jędrzejewski-Szmek | 0bc9115 | 2017-04-27 13:39:54 -0400 | [diff] [blame] | 2165 | link_with : [libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2166 | dependencies : [libacl, |
| 2167 | libblkid, |
| 2168 | libseccomp, |
| 2169 | libselinux], |
| 2170 | install_rpath : rootlibexecdir, |
| 2171 | install : true) |
| 2172 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2173 | |
Zbigniew Jędrzejewski-Szmek | f0bd7cc | 2017-04-12 12:14:30 -0400 | [diff] [blame] | 2174 | if conf.get('ENABLE_NETWORKD', 0) == 1 |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2175 | executable('systemd-networkd', |
| 2176 | systemd_networkd_sources, |
| 2177 | include_directories : includes, |
| 2178 | link_with : [libnetworkd_core, |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2179 | libsystemd_network, |
| 2180 | libudev_internal, |
| 2181 | libshared], |
| 2182 | install_rpath : rootlibexecdir, |
| 2183 | install : true, |
| 2184 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2185 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2186 | executable('systemd-networkd-wait-online', |
| 2187 | systemd_networkd_wait_online_sources, |
| 2188 | include_directories : includes, |
| 2189 | link_with : [libnetworkd_core, |
| 2190 | libshared], |
| 2191 | install_rpath : rootlibexecdir, |
| 2192 | install : true, |
| 2193 | install_dir : rootlibexecdir) |
Zbigniew Jędrzejewski-Szmek | f0bd7cc | 2017-04-12 12:14:30 -0400 | [diff] [blame] | 2194 | endif |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2195 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2196 | exe = executable('networkctl', |
| 2197 | networkctl_sources, |
| 2198 | include_directories : includes, |
| 2199 | link_with : [libsystemd_network, |
Zbigniew Jędrzejewski-Szmek | aac2605 | 2017-04-14 18:49:47 -0400 | [diff] [blame] | 2200 | libshared], |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2201 | install_rpath : rootlibexecdir, |
| 2202 | install : true, |
| 2203 | install_dir : rootbindir) |
| 2204 | public_programs += [exe] |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2205 | |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 2206 | ############################################################ |
| 2207 | |
| 2208 | foreach tuple : tests |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2209 | sources = tuple[0] |
| 2210 | link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] |
| 2211 | dependencies = tuple[2] |
| 2212 | condition = tuple.length() >= 4 ? tuple[3] : '' |
| 2213 | type = tuple.length() >= 5 ? tuple[4] : '' |
| 2214 | defs = tuple.length() >= 6 ? tuple[5] : [] |
| 2215 | incs = tuple.length() >= 7 ? tuple[6] : includes |
| 2216 | timeout = 30 |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 2217 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2218 | name = sources[0].split('/')[-1].split('.')[0] |
| 2219 | if type.startswith('timeout=') |
| 2220 | timeout = type.split('=')[1].to_int() |
| 2221 | type = '' |
| 2222 | endif |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 2223 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2224 | if condition == '' or conf.get(condition, 0) == 1 |
| 2225 | install = install_tests and type == '' |
Zbigniew Jędrzejewski-Szmek | 572baca | 2017-04-08 01:55:38 -0400 | [diff] [blame] | 2226 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2227 | exe = executable( |
| 2228 | name, |
| 2229 | sources, |
| 2230 | include_directories : incs, |
| 2231 | link_with : link_with, |
| 2232 | dependencies : dependencies, |
| 2233 | c_args : defs, |
| 2234 | install_rpath : rootlibexecdir, |
| 2235 | install : install, |
| 2236 | install_dir : testsdir) |
Zbigniew Jędrzejewski-Szmek | 572baca | 2017-04-08 01:55:38 -0400 | [diff] [blame] | 2237 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2238 | if type == 'manual' |
| 2239 | message('@0@ is a manual test'.format(name)) |
| 2240 | elif type == 'unsafe' and want_tests != 'unsafe' |
| 2241 | message('@0@ is an unsafe test'.format(name)) |
| 2242 | else |
| 2243 | test(name, exe, |
| 2244 | env : test_env, |
| 2245 | timeout : timeout) |
| 2246 | endif |
| 2247 | else |
| 2248 | message('Not compiling @0@ because @1@ is not true'.format(name, condition)) |
| 2249 | endif |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 2250 | endforeach |
| 2251 | |
Zbigniew Jędrzejewski-Szmek | 37ab1a2 | 2017-04-10 14:13:40 -0400 | [diff] [blame] | 2252 | test_libsystemd_sym = executable( |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2253 | 'test-libsystemd-sym', |
| 2254 | test_libsystemd_sym_c, |
| 2255 | include_directories : includes, |
| 2256 | link_with : [libsystemd], |
| 2257 | install : install_tests, |
| 2258 | install_dir : testsdir) |
Zbigniew Jędrzejewski-Szmek | 37ab1a2 | 2017-04-10 14:13:40 -0400 | [diff] [blame] | 2259 | test('test-libsystemd-sym', |
| 2260 | test_libsystemd_sym) |
| 2261 | |
Zbigniew Jędrzejewski-Szmek | e0bec52 | 2017-04-10 15:20:42 -0400 | [diff] [blame] | 2262 | test_libudev_sym = executable( |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2263 | 'test-libudev-sym', |
| 2264 | test_libudev_sym_c, |
| 2265 | include_directories : includes, |
| 2266 | c_args : ['-Wno-deprecated-declarations'], |
| 2267 | link_with : [libudev], |
| 2268 | install : install_tests, |
| 2269 | install_dir : testsdir) |
Zbigniew Jędrzejewski-Szmek | e0bec52 | 2017-04-10 15:20:42 -0400 | [diff] [blame] | 2270 | test('test-libudev-sym', |
| 2271 | test_libudev_sym) |
| 2272 | |
Zbigniew Jędrzejewski-Szmek | 69e9642 | 2017-04-07 00:19:09 -0400 | [diff] [blame] | 2273 | ############################################################ |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2274 | |
| 2275 | make_directive_index_py = find_program('tools/make-directive-index.py') |
| 2276 | make_man_index_py = find_program('tools/make-man-index.py') |
Zbigniew Jędrzejewski-Szmek | b184e8f | 2017-04-13 19:59:21 -0400 | [diff] [blame] | 2277 | xml_helper_py = find_program('tools/xml_helper.py') |
Zbigniew Jędrzejewski-Szmek | abba22c | 2017-04-15 00:40:59 -0400 | [diff] [blame] | 2278 | hwdb_update_sh = find_program('tools/meson-hwdb-update.sh') |
Zbigniew Jędrzejewski-Szmek | 5c23128 | 2017-04-04 23:03:47 -0400 | [diff] [blame] | 2279 | |
| 2280 | subdir('units') |
| 2281 | subdir('sysctl.d') |
| 2282 | subdir('sysusers.d') |
| 2283 | subdir('tmpfiles.d') |
| 2284 | subdir('rules') |
| 2285 | subdir('hwdb') |
| 2286 | subdir('network') |
| 2287 | subdir('man') |
| 2288 | subdir('shell-completion/bash') |
| 2289 | subdir('shell-completion/zsh') |
| 2290 | subdir('docs/sysvinit') |
| 2291 | subdir('docs/var-log') |
| 2292 | |
| 2293 | # FIXME: figure out if the warning is true: |
| 2294 | # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir |
| 2295 | install_subdir('factory/etc', |
| 2296 | install_dir : factorydir) |
| 2297 | |
| 2298 | |
| 2299 | install_data('xorg/50-systemd-user.sh', |
| 2300 | install_dir : xinitrcdir) |
| 2301 | install_data('system-preset/90-systemd.preset', |
| 2302 | install_dir : systempresetdir) |
| 2303 | install_data('README', |
| 2304 | 'NEWS', |
| 2305 | 'CODING_STYLE', |
| 2306 | 'DISTRO_PORTING', |
| 2307 | 'ENVIRONMENT.md', |
| 2308 | 'LICENSE.GPL2', |
| 2309 | 'LICENSE.LGPL2.1', |
| 2310 | 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION', |
| 2311 | install_dir : docdir) |
Zbigniew Jędrzejewski-Szmek | d68b342 | 2017-04-06 14:33:27 -0400 | [diff] [blame] | 2312 | |
Zbigniew Jędrzejewski-Szmek | 94e75a5 | 2017-04-09 23:55:05 -0400 | [diff] [blame] | 2313 | meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir)) |
| 2314 | meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir)) |
| 2315 | |
Zbigniew Jędrzejewski-Szmek | d68b342 | 2017-04-06 14:33:27 -0400 | [diff] [blame] | 2316 | ############################################################ |
| 2317 | |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2318 | meson_check_help = find_program('tools/meson-check-help.sh') |
| 2319 | |
| 2320 | foreach exec : public_programs |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2321 | name = exec.full_path().split('/')[-1] |
| 2322 | test('check-help-' + name, |
| 2323 | meson_check_help, |
| 2324 | args : [exec.full_path()]) |
Zbigniew Jędrzejewski-Szmek | 005a29f | 2017-04-13 11:52:05 -0400 | [diff] [blame] | 2325 | endforeach |
| 2326 | |
| 2327 | ############################################################ |
| 2328 | |
Zbigniew Jędrzejewski-Szmek | d68b342 | 2017-04-06 14:33:27 -0400 | [diff] [blame] | 2329 | if git.found() and etags.found() |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2330 | all_files = run_command( |
| 2331 | git, |
| 2332 | ['--git-dir=@0@/.git'.format(meson.source_root()), |
| 2333 | 'ls-files', |
| 2334 | ':/*.[ch]']) |
| 2335 | all_files = files(all_files.stdout().split()) |
Zbigniew Jędrzejewski-Szmek | d68b342 | 2017-04-06 14:33:27 -0400 | [diff] [blame] | 2336 | |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2337 | custom_target( |
| 2338 | 'TAGS', |
| 2339 | output : 'TAGS', |
| 2340 | input : all_files, |
| 2341 | command : [etags, '-o', '@OUTPUT@'] + all_files) |
Zbigniew Jędrzejewski-Szmek | d68b342 | 2017-04-06 14:33:27 -0400 | [diff] [blame] | 2342 | endif |
Zbigniew Jędrzejewski-Szmek | 177929c | 2017-04-15 00:16:23 -0400 | [diff] [blame] | 2343 | |
| 2344 | if git.found() |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2345 | meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') |
Zbigniew Jędrzejewski-Szmek | a923e08 | 2017-04-17 19:48:20 -0400 | [diff] [blame] | 2346 | run_target( |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2347 | 'git-contrib', |
Zbigniew Jędrzejewski-Szmek | 37efbbd | 2017-04-17 19:25:00 -0400 | [diff] [blame] | 2348 | command : [meson_git_contrib_sh]) |
Zbigniew Jędrzejewski-Szmek | 177929c | 2017-04-15 00:16:23 -0400 | [diff] [blame] | 2349 | endif |
Zbigniew Jędrzejewski-Szmek | dd6ab3d | 2017-04-24 19:28:05 -0400 | [diff] [blame] | 2350 | |
| 2351 | if git.found() |
| 2352 | git_head = run_command( |
| 2353 | git, |
| 2354 | ['--git-dir=@0@/.git'.format(meson.source_root()), |
| 2355 | 'rev-parse', 'HEAD']).stdout().strip() |
| 2356 | git_head_short = run_command( |
| 2357 | git, |
| 2358 | ['--git-dir=@0@/.git'.format(meson.source_root()), |
| 2359 | 'rev-parse', '--short=7', 'HEAD']).stdout().strip() |
| 2360 | |
| 2361 | run_target( |
| 2362 | 'git-snapshot', |
| 2363 | command : ['git', 'archive', |
| 2364 | '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(), |
| 2365 | git_head_short), |
| 2366 | '--prefix', 'systemd-@0@/'.format(git_head), |
| 2367 | 'HEAD']) |
| 2368 | endif |
Zbigniew Jędrzejewski-Szmek | 829257d | 2017-04-27 20:54:52 -0400 | [diff] [blame^] | 2369 | |
| 2370 | ############################################################ |
| 2371 | |
| 2372 | status = [ |
| 2373 | '@0@ @1@'.format(meson.project_name(), meson.project_version()), |
| 2374 | |
| 2375 | 'prefix: @0@'.format(prefixdir), |
| 2376 | 'rootprefix: @0@'.format(rootprefixdir), |
| 2377 | 'sysconf dir: @0@'.format(sysconfdir), |
| 2378 | 'includedir: @0@'.format(includedir), |
| 2379 | 'lib dir: @0@'.format(libdir), |
| 2380 | 'rootlib dir: @0@'.format(rootlibdir), |
| 2381 | 'SysV init scripts: @0@'.format(sysvinit_path), |
| 2382 | 'SysV rc?.d directories: @0@'.format(sysvrcnd_path), |
| 2383 | 'PAM modules dir: @0@'.format(pamlibdir), |
| 2384 | 'PAM configuration dir: @0@'.format(pamconfdir), |
| 2385 | 'RPM macros dir: @0@'.format(rpmmacrosdir), |
| 2386 | 'D-Bus policy dir: @0@'.format(dbuspolicydir), |
| 2387 | 'D-Bus session dir: @0@'.format(dbussessionservicedir), |
| 2388 | 'D-Bus system dir: @0@'.format(dbussystemservicedir), |
| 2389 | 'bash completions dir: @0@'.format(bashcompletiondir), |
| 2390 | 'zsh completions dir: @0@'.format(zshcompletiondir), |
| 2391 | 'extra start script: @0@'.format(get_option('rc-local')), |
| 2392 | 'extra stop script: @0@'.format(get_option('halt-local')), |
| 2393 | 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'), |
| 2394 | get_option('debug-tty')), |
| 2395 | 'TTY GID: @0@'.format(tty_gid), |
| 2396 | 'maximum system UID: @0@'.format(system_uid_max), |
| 2397 | 'maximum system GID: @0@'.format(system_gid_max), |
| 2398 | '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')), |
| 2399 | 'certificate root: @0@'.format(get_option('certificate-root')), |
| 2400 | 'support URL: @0@'.format(support_url), |
| 2401 | 'nobody user name: @0@'.format(get_option('nobody-user')), |
| 2402 | 'nobody group name: @0@'.format(get_option('nobody-group')), |
| 2403 | 'fallback hostname: @0@'.format(get_option('fallback-hostname')), |
| 2404 | |
| 2405 | 'default DNSSEC mode: @0@'.format(default_dnssec), |
| 2406 | 'default cgroup hierarchy: @0@'.format(default_hierarchy), |
| 2407 | 'default KillUserProcesses setting: @0@'.format(kill_user_processes)] |
| 2408 | |
| 2409 | alt_dns_servers = '\n '.join(dns_servers.split(' ')) |
| 2410 | alt_ntp_servers = '\n '.join(ntp_servers.split(' ')) |
| 2411 | status += [ |
| 2412 | 'default DNS servers: @0@'.format(alt_dns_servers), |
| 2413 | 'default NTP servers: @0@'.format(alt_ntp_servers)] |
| 2414 | |
| 2415 | alt_time_epoch = run_command('date', '-Is', '-u', '-d', |
| 2416 | '@@0@'.format(time_epoch)).stdout().strip() |
| 2417 | status += [ |
| 2418 | 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)] |
| 2419 | |
| 2420 | # TODO: |
| 2421 | # CFLAGS: ${OUR_CFLAGS} ${CFLAGS} |
| 2422 | # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} |
| 2423 | # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS} |
| 2424 | |
| 2425 | if conf.get('ENABLE_EFI', 0) == 1 |
| 2426 | status += [ |
| 2427 | 'efi arch: @0@'.format(efi_arch)] |
| 2428 | |
| 2429 | if have_gnu_efi |
| 2430 | status += [ |
| 2431 | 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME), |
| 2432 | 'EFI CC @0@'.format(efi_cc), |
| 2433 | 'EFI libdir: @0@'.format(efi_libdir), |
| 2434 | 'EFI ldsdir: @0@'.format(efi_ldsdir), |
| 2435 | 'EFI includedir: @0@'.format(efi_incdir)] |
| 2436 | endif |
| 2437 | endif |
| 2438 | |
| 2439 | found = [] |
| 2440 | missing = [] |
| 2441 | |
| 2442 | foreach tuple : [ |
| 2443 | ['libcryptsetup'], |
| 2444 | ['PAM'], |
| 2445 | ['AUDIT'], |
| 2446 | ['IMA'], |
| 2447 | ['AppArmor'], |
| 2448 | ['SELinux'], |
| 2449 | ['SECCOMP'], |
| 2450 | ['SMACK'], |
| 2451 | ['zlib'], |
| 2452 | ['xz'], |
| 2453 | ['lz4'], |
| 2454 | ['bzip2'], |
| 2455 | ['ACL'], |
| 2456 | ['gcrypt'], |
| 2457 | ['qrencode'], |
| 2458 | ['microhttpd'], |
| 2459 | ['gnutls'], |
| 2460 | ['libcurl'], |
| 2461 | ['libidn'], |
| 2462 | ['libiptc'], |
| 2463 | ['elfutils'], |
| 2464 | ['binfmt'], |
| 2465 | ['vconsole'], |
| 2466 | ['quotacheck'], |
| 2467 | ['tmpfiles'], |
| 2468 | ['environment.d'], |
| 2469 | ['sysusers'], |
| 2470 | ['firstboot'], |
| 2471 | ['randomseed'], |
| 2472 | ['backlight'], |
| 2473 | ['rfkill'], |
| 2474 | ['logind'], |
| 2475 | ['machined'], |
| 2476 | ['importd'], |
| 2477 | ['hostnamed'], |
| 2478 | ['timedated'], |
| 2479 | ['timesyncd'], |
| 2480 | ['localed'], |
| 2481 | ['networkd'], |
| 2482 | ['resolved'], |
| 2483 | ['coredump'], |
| 2484 | ['polkit'], |
| 2485 | ['legacy pkla', install_polkit_pkla], |
| 2486 | ['efi'], |
| 2487 | ['gnu-efi', have_gnu_efi], |
| 2488 | ['kmod'], |
| 2489 | ['xkbcommon'], |
| 2490 | ['blkid'], |
| 2491 | ['dbus'], |
| 2492 | ['glib'], |
| 2493 | ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', 0) == 1], |
| 2494 | ['hwdb'], |
| 2495 | ['tpm'], |
| 2496 | ['man pages', want_man], |
| 2497 | ['html pages', want_html], |
| 2498 | ['man page indices', want_man and have_lxml], |
| 2499 | ['split /usr', conf.get('HAVE_SPLIT_USR', 0) == 1], |
| 2500 | ['SysV compat'], |
| 2501 | ['utmp'], |
| 2502 | ['ldconfig'], |
| 2503 | ['hibernate'], |
| 2504 | ['adm group', get_option('adm-group')], |
| 2505 | ['wheel group', get_option('wheel-group')], |
| 2506 | ['debug hashmap'], |
| 2507 | ['debug mmap cache'], |
| 2508 | ] |
| 2509 | |
| 2510 | cond = tuple.get(1, '') |
| 2511 | if cond == '' |
| 2512 | ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() |
| 2513 | ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() |
| 2514 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 |
| 2515 | endif |
| 2516 | if cond |
| 2517 | found += [tuple[0]] |
| 2518 | else |
| 2519 | missing += [tuple[0]] |
| 2520 | endif |
| 2521 | endforeach |
| 2522 | |
| 2523 | status += [ |
| 2524 | 'enabled features: @0@'.format(', '.join(found)), |
| 2525 | 'disabled features: @0@'.format(', '.join(missing))] |
| 2526 | message('\n '.join(status)) |