]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
test-hostname-util: add assert_se's to make coverity happy
[thirdparty/systemd.git] / meson.build
index 5c98c937b763cac9ac9a59d4a685847fa2da8fcd..6ca506c41f0e1b30634fae06062c9e47d2441f62 100644 (file)
@@ -1,3 +1,20 @@
+# SPDX-License-Identifier: LGPL-2.1+
+#
+# Copyright 2017 Zbigniew JÄ™drzejewski-Szmek
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
 project('systemd', 'c',
         version : '235',
         license : 'LGPLv2+',
@@ -7,11 +24,11 @@ project('systemd', 'c',
                 'sysconfdir=/etc',
                 'localstatedir=/var',
         ],
-        meson_version : '>= 0.40',
+        meson_version : '>= 0.41',
        )
 
-libsystemd_version = '0.19.0'
-libudev_version = '1.6.6'
+libsystemd_version = '0.19.1'
+libudev_version = '1.6.7'
 
 # We need the same data in three different formats, ugh!
 # Also, for hysterical reasons, we use different variable
@@ -37,13 +54,8 @@ endif
 
 #####################################################################
 
-rootprefixdir = get_option('rootprefix')
 conf.set10('HAVE_SPLIT_USR', get_option('split-usr'))
-if get_option('split-usr')
-        rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
-else
-        rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
-endif
+rootprefixdir = get_option('split-usr') ? '/' : '/usr'
 
 sysvinit_path = get_option('sysvinit-path')
 sysvrcnd_path = get_option('sysvrcnd-path')
@@ -83,7 +95,10 @@ polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor
 varlogdir = join_paths(localstatedir, 'log')
 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
 rpmmacrosdir = get_option('rpmmacrosdir')
-modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
+if rpmmacrosdir != 'no'
+        rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
+endif
+modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
 
 # Our own paths
 pkgdatadir = join_paths(datadir, 'systemd')
@@ -164,7 +179,6 @@ conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH',                  join_paths(rootlib
 conf.set_quoted('SYSTEMCTL_BINARY_PATH',                      join_paths(rootbindir, 'systemctl'))
 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH',           join_paths(bindir, 'systemd-stdio-bridge'))
-conf.set_quoted('ROOTPREFIX',                                 rootprefixdir)
 conf.set_quoted('RANDOM_SEED_DIR',                            randomseeddir)
 conf.set_quoted('RANDOM_SEED',                                join_paths(randomseeddir, 'random-seed'))
 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH',                    join_paths(rootlibexecdir, 'systemd-cryptsetup'))
@@ -260,6 +274,7 @@ foreach arg : ['-Wextra',
                '-Wstrict-prototypes',
                '-Wredundant-decls',
                '-Wmissing-noreturn',
+               '-Wimplicit-fallthrough=5',
                '-Wshadow',
                '-Wendif-labels',
                '-Wstrict-aliasing=2',
@@ -415,6 +430,7 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
                 ['IFA_FLAGS',                        'linux/if_addr.h'],
                 ['FRA_UID_RANGE',                    'linux/fib_rules.h'],
                 ['LO_FLAGS_PARTSCAN',                'linux/loop.h'],
+                ['VXCAN_INFO_PEER',                  'linux/can/vxcan.h'],
                ]
         prefix = decl.length() > 2 ? decl[2] : ''
         have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
@@ -426,7 +442,8 @@ foreach ident : ['secure_getenv', '__secure_getenv']
 endforeach
 
 foreach ident : [
-        ['memfd_create',      '''#include <sys/memfd.h>'''],
+        ['memfd_create',      '''#define _GNU_SOURCE
+                                 #include <sys/mman.h>'''],
         ['gettid',            '''#include <sys/types.h>'''],
         ['pivot_root',        '''#include <stdlib.h>'''],     # no known header declares pivot_root
         ['name_to_handle_at', '''#define _GNU_SOURCE
@@ -462,7 +479,6 @@ endif
 #####################################################################
 
 sed = find_program('sed')
-grep = find_program('grep')
 awk = find_program('awk')
 m4 = find_program('m4')
 stat = find_program('stat')
@@ -615,6 +631,7 @@ if get_option('wheel-group')
 endif
 
 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
+substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
 
 kill_user_processes = get_option('default-kill-user-processes')
 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
@@ -1036,42 +1053,41 @@ else
 endif
 conf.set10('ENABLE_REMOTE', have)
 
-foreach pair : [['utmp',          'ENABLE_UTMP'],
-                ['hibernate',     'ENABLE_HIBERNATE'],
-                ['environment-d', 'ENABLE_ENVIRONMENT_D'],
-                ['binfmt',        'ENABLE_BINFMT'],
-                ['coredump',      'ENABLE_COREDUMP'],
-                ['resolve',       'ENABLE_RESOLVED'],
-                ['logind',        'ENABLE_LOGIND'],
-                ['hostnamed',     'ENABLE_HOSTNAMED'],
-                ['localed',       'ENABLE_LOCALED'],
-                ['machined',      'ENABLE_MACHINED'],
-                ['networkd',      'ENABLE_NETWORKD'],
-                ['timedated',     'ENABLE_TIMEDATED'],
-                ['timesyncd',     'ENABLE_TIMESYNCD'],
-                ['myhostname',    'HAVE_MYHOSTNAME'],
-                ['firstboot',     'ENABLE_FIRSTBOOT'],
-                ['randomseed',    'ENABLE_RANDOMSEED'],
-                ['backlight',     'ENABLE_BACKLIGHT'],
-                ['vconsole',      'ENABLE_VCONSOLE'],
-                ['quotacheck',    'ENABLE_QUOTACHECK'],
-                ['sysusers',      'ENABLE_SYSUSERS'],
-                ['tmpfiles',      'ENABLE_TMPFILES'],
-                ['hwdb',          'ENABLE_HWDB'],
-                ['rfkill',        'ENABLE_RFKILL'],
-                ['ldconfig',      'ENABLE_LDCONFIG'],
-                ['efi',           'ENABLE_EFI'],
-                ['tpm',           'ENABLE_TPM'],
-                ['ima',           'HAVE_IMA'],
-                ['smack',         'HAVE_SMACK'],
-                ['gshadow',       'ENABLE_GSHADOW'],
-                ['idn',           'ENABLE_IDN'],
-                ['nss-systemd',   'ENABLE_NSS_SYSTEMD'],
-               ]
-
-        have = get_option(pair[0])
-        conf.set10(pair[1], have)
-        m4_defines += have ? ['-D' + pair[1]] : []
+foreach term : ['utmp',
+                'hibernate',
+                'environment-d',
+                'binfmt',
+                'coredump',
+                'resolve',
+                'logind',
+                'hostnamed',
+                'localed',
+                'machined',
+                'networkd',
+                'timedated',
+                'timesyncd',
+                'myhostname',
+                'firstboot',
+                'randomseed',
+                'backlight',
+                'vconsole',
+                'quotacheck',
+                'sysusers',
+                'tmpfiles',
+                'hwdb',
+                'rfkill',
+                'ldconfig',
+                'efi',
+                'tpm',
+                'ima',
+                'smack',
+                'gshadow',
+                'idn',
+                'nss-systemd']
+        have = get_option(term)
+        name = 'ENABLE_' + term.underscorify().to_upper()
+        conf.set10(name, have)
+        m4_defines += have ? ['-D' + name] : []
 endforeach
 
 want_tests = get_option('tests')
@@ -1206,6 +1222,7 @@ subdir('src/sulogin-shell')
 subdir('src/boot/efi')
 
 subdir('src/test')
+subdir('rules')
 subdir('test')
 
 ############################################################
@@ -1219,10 +1236,10 @@ test_dlopen = executable(
         link_with : [libbasic],
         dependencies : [libdl])
 
-foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
+foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
                  ['systemd',    'ENABLE_NSS_SYSTEMD'],
                  ['mymachines', 'ENABLE_MACHINED'],
-                 ['resolve',    'ENABLE_RESOLVED']]
+                 ['resolve',    'ENABLE_RESOLVE']]
 
         condition = tuple[1] == '' or conf.get(tuple[1]) == 1
         if condition
@@ -1405,7 +1422,7 @@ if conf.get('HAVE_BLKID') == 1
         public_programs += [exe]
 endif
 
-if conf.get('ENABLE_RESOLVED') == 1
+if conf.get('ENABLE_RESOLVE') == 1
         executable('systemd-resolved',
                    systemd_resolved_sources,
                    gcrypt_util_sources,
@@ -2333,7 +2350,6 @@ subdir('units')
 subdir('sysctl.d')
 subdir('sysusers.d')
 subdir('tmpfiles.d')
-subdir('rules')
 subdir('hwdb')
 subdir('network')
 subdir('man')
@@ -2429,23 +2445,23 @@ endif
 status = [
         '@0@ @1@'.format(meson.project_name(), meson.project_version()),
 
-        'prefix:                            @0@'.format(prefixdir),
-        'rootprefix:                        @0@'.format(rootprefixdir),
-        'sysconf dir:                       @0@'.format(sysconfdir),
-        'includedir:                        @0@'.format(includedir),
-        'lib dir:                           @0@'.format(libdir),
-        'rootlib dir:                       @0@'.format(rootlibdir),
+        'prefix directory:                  @0@'.format(prefixdir),
+        'rootprefix directory:              @0@'.format(rootprefixdir),
+        'sysconf directory:                 @0@'.format(sysconfdir),
+        'include directory:                 @0@'.format(includedir),
+        'lib directory:                     @0@'.format(libdir),
+        'rootlib directory:                 @0@'.format(rootlibdir),
         'SysV init scripts:                 @0@'.format(sysvinit_path),
         'SysV rc?.d directories:            @0@'.format(sysvrcnd_path),
-        'PAM modules dir:                   @0@'.format(pamlibdir),
-        'PAM configuration dir:             @0@'.format(pamconfdir),
-        'RPM macros dir:                    @0@'.format(rpmmacrosdir),
-        'modprobe.d dir:                    @0@'.format(modprobedir),
-        'D-Bus policy dir:                  @0@'.format(dbuspolicydir),
-        'D-Bus session dir:                 @0@'.format(dbussessionservicedir),
-        'D-Bus system dir:                  @0@'.format(dbussystemservicedir),
-        'bash completions dir:              @0@'.format(bashcompletiondir),
-        'zsh completions dir:               @0@'.format(zshcompletiondir),
+        'PAM modules directory:             @0@'.format(pamlibdir),
+        'PAM configuration directory:       @0@'.format(pamconfdir),
+        'RPM macros directory:              @0@'.format(rpmmacrosdir),
+        'modprobe.d directory:              @0@'.format(modprobedir),
+        'D-Bus policy directory:            @0@'.format(dbuspolicydir),
+        'D-Bus session directory:           @0@'.format(dbussessionservicedir),
+        'D-Bus system directory:            @0@'.format(dbussystemservicedir),
+        'bash completions directory:        @0@'.format(bashcompletiondir),
+        'zsh completions directory:         @0@'.format(zshcompletiondir),
         'extra start script:                @0@'.format(get_option('rc-local')),
         'extra stop script:                 @0@'.format(get_option('halt-local')),
         'debug shell:                       @0@ @ @1@'.format(get_option('debug-shell'),
@@ -2454,7 +2470,8 @@ status = [
         'maximum system UID:                @0@'.format(system_uid_max),
         'maximum system GID:                @0@'.format(system_gid_max),
         '/dev/kvm access mode:              @0@'.format(get_option('dev-kvm-mode')),
-        'certificate root:                  @0@'.format(get_option('certificate-root')),
+        'render group access mode:          @0@'.format(get_option('group-render-mode')),
+        'certificate root directory:        @0@'.format(get_option('certificate-root')),
         'support URL:                       @0@'.format(support_url),
         'nobody user name:                  @0@'.format(get_option('nobody-user')),
         'nobody group name:                 @0@'.format(get_option('nobody-group')),
@@ -2489,9 +2506,9 @@ if conf.get('ENABLE_EFI') == 1
                 status += [
                         'EFI machine type:                  @0@'.format(EFI_MACHINE_TYPE_NAME),
                         'EFI CC                             @0@'.format(efi_cc),
-                        'EFI libdir:                        @0@'.format(efi_libdir),
-                        'EFI ldsdir:                        @0@'.format(efi_ldsdir),
-                        'EFI includedir:                    @0@'.format(efi_incdir)]
+                        'EFI lib directory:                 @0@'.format(efi_libdir),
+                        'EFI lds directory:                 @0@'.format(efi_ldsdir),
+                        'EFI include directory:             @0@'.format(efi_incdir)]
         endif
 endif
 
@@ -2541,7 +2558,7 @@ foreach tuple : [
         ['timesyncd'],
         ['localed'],
         ['networkd'],
-        ['resolved'],
+        ['resolve'],
         ['coredump'],
         ['polkit'],
         ['legacy pkla',      install_polkit_pkla],
@@ -2552,7 +2569,7 @@ foreach tuple : [
         ['blkid'],
         ['dbus'],
         ['glib'],
-        ['nss-myhostname',   conf.get('HAVE_MYHOSTNAME') == 1],
+        ['nss-myhostname',   conf.get('ENABLE_MYHOSTNAME') == 1],
         ['hwdb'],
         ['tpm'],
         ['man pages',        want_man],