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