]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
Merge pull request #7476 from jhxie/ycm-meson-backend
[thirdparty/systemd.git] / meson.build
index 6317847663db482fce9322f69da92d4ee1e3b61d..e0e8178910f6518b8bd54094340eb960d737cb6d 100644 (file)
@@ -54,8 +54,16 @@ endif
 
 #####################################################################
 
-conf.set10('HAVE_SPLIT_USR', get_option('split-usr'))
-rootprefixdir = get_option('split-usr') ? '/' : '/usr'
+split_usr = get_option('split-usr')
+conf.set10('HAVE_SPLIT_USR', split_usr)
+
+rootprefixdir = get_option('rootprefix')
+# Unusual rootprefixdir values are used by some distros
+# (see https://github.com/systemd/systemd/pull/7461).
+rootprefix_default = get_option('split-usr') ? '/' : '/usr'
+if rootprefixdir == ''
+        rootprefixdir = rootprefix_default
+endif
 
 sysvinit_path = get_option('sysvinit-path')
 sysvrcnd_path = get_option('sysvrcnd-path')
@@ -94,7 +102,10 @@ polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
 varlogdir = join_paths(localstatedir, 'log')
 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
-rpmmacrosdir = join_paths(prefixdir, get_option('rpmmacrosdir'))
+rpmmacrosdir = get_option('rpmmacrosdir')
+if rpmmacrosdir != 'no'
+        rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
+endif
 modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
 
 # Our own paths
@@ -171,11 +182,14 @@ conf.set_quoted('CATALOG_DATABASE',                           join_paths(catalog
 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH',                  join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
 conf.set_quoted('SYSTEMD_BINARY_PATH',                        join_paths(rootlibexecdir, 'systemd'))
 conf.set_quoted('SYSTEMD_FSCK_PATH',                          join_paths(rootlibexecdir, 'systemd-fsck'))
+conf.set_quoted('SYSTEMD_MAKEFS_PATH',                        join_paths(rootlibexecdir, 'systemd-makefs'))
+conf.set_quoted('SYSTEMD_GROWFS_PATH',                        join_paths(rootlibexecdir, 'systemd-growfs'))
 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH',               join_paths(rootlibexecdir, 'systemd-shutdown'))
 conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH',                  join_paths(rootlibexecdir, 'systemd-sleep'))
 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'))
@@ -439,7 +453,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
@@ -618,6 +633,14 @@ tty_gid = get_option('tty-gid')
 conf.set('TTY_GID', tty_gid)
 substs.set('TTY_GID', tty_gid)
 
+# Ensure provided GID argument is numeric, otherwise fallback to default assignment
+if get_option('users-gid') != ''
+    users_gid = get_option('users-gid').to_int()
+else
+    users_gid = '-'
+endif
+substs.set('USERS_GID', users_gid)
+
 if get_option('adm-group')
         m4_defines += ['-DENABLE_ADM_GROUP']
 endif
@@ -1923,6 +1946,23 @@ executable('systemd-fsck',
            install : true,
            install_dir : rootlibexecdir)
 
+executable('systemd-growfs',
+           'src/partition/growfs.c',
+           include_directories : includes,
+           link_with : [libshared],
+           dependencies : [libcryptsetup],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
+executable('systemd-makefs',
+           'src/partition/makefs.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : rootlibexecdir)
+
 executable('systemd-sleep',
            'src/sleep/sleep.c',
            include_directories : includes,
@@ -2441,33 +2481,34 @@ 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'),
                                                               get_option('debug-tty')),
         'TTY GID:                           @0@'.format(tty_gid),
+        'users GID:                         @0@'.format(users_gid),
         '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')),
         'render group access mode:          @0@'.format(get_option('group-render-mode')),
-        'certificate root:                  @0@'.format(get_option('certificate-root')),
+        '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')),
@@ -2502,9 +2543,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
 
@@ -2603,3 +2644,10 @@ status += [
         'disabled features: @0@'.format(', '.join(missing)),
         '']
 message('\n         '.join(status))
+
+if rootprefixdir != rootprefix_default
+        message('WARNING:\n' +
+                '        Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
+                '        systemd used fixed names for unit file directories and other paths, so anything\n' +
+                '        except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))
+endif