]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
journalctl: drop format_journal_url() if gcrypt is not used
[thirdparty/systemd.git] / meson.build
index 3bec86db813a6a7e3331f7d16481dd20e4a36185..5cfc24c2d6d5b47331d5c9a906245e9cfc679143 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1+
 
 project('systemd', 'c',
-        version : '246',
+        version : '247',
         license : 'LGPLv2+',
         default_options: [
                 'c_std=gnu99',
@@ -13,7 +13,7 @@ project('systemd', 'c',
         meson_version : '>= 0.46',
        )
 
-libsystemd_version = '0.29.0'
+libsystemd_version = '0.30.0'
 libudev_version = '1.7.0'
 
 # We need the same data in two different formats, ugh!
@@ -38,8 +38,8 @@ relative_source_path = run_command('realpath',
                                    project_source_root).stdout().strip()
 conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
 
-conf.set10('DEVELOPER_MODE', get_option('mode') == 'developer',
-           description : 'enable additional checks only suitable in development')
+conf.set('BUILD_MODE', 'BUILD_MODE_' + get_option('mode').to_upper(),
+         description : 'tailor build to development or release builds')
 
 want_ossfuzz = get_option('oss-fuzz')
 want_libfuzzer = get_option('llvm-fuzz')
@@ -532,6 +532,8 @@ foreach ident : [
                                  #include <unistd.h>
                                  #include <signal.h>
                                  #include <sys/wait.h>'''],
+        ['mallinfo',          '''#include <malloc.h>'''],
+        ['close_range',       '''#include <unistd.h>'''],
 ]
 
         have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
@@ -881,8 +883,9 @@ libcrypt = cc.find_library('crypt')
 
 crypt_header = conf.get('HAVE_CRYPT_H') == 1 ? '''#include <crypt.h>''' : '''#include <unistd.h>'''
 foreach ident : [
-        ['crypt_ra',          crypt_header],
-        ['crypt_gensalt_ra',  crypt_header]]
+        ['crypt_ra',               crypt_header],
+        ['crypt_preferred_method', crypt_header],
+        ['crypt_gensalt_ra',       crypt_header]]
 
         have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE',
                                dependencies : libcrypt)
@@ -1409,6 +1412,18 @@ conf.set10('ENABLE_HOMED', have)
 have = have and conf.get('HAVE_PAM') == 1
 conf.set10('ENABLE_PAM_HOME', have)
 
+have = get_option('oomd')
+if have == 'auto'
+        have = get_option('mode') == 'developer'
+else
+        have = have == 'true'
+        if have and get_option('mode') != 'developer'
+                error('oomd is not available in release mode (yet)')
+        endif
+endif
+conf.set10('ENABLE_OOMD', have)
+substs.set10('ENABLE_OOMD', have)
+
 want_remote = get_option('remote')
 if want_remote != 'false'
         have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
@@ -1467,6 +1482,7 @@ foreach term : ['analyze',
         have = get_option(term)
         name = 'ENABLE_' + term.underscorify().to_upper()
         conf.set10(name, have)
+        substs.set10(name, have)
 endforeach
 
 enable_sysusers = conf.get('ENABLE_SYSUSERS') == 1
@@ -1545,21 +1561,11 @@ meson_apply_m4 = find_program('tools/meson-apply-m4.sh')
 
 includes = include_directories('src/basic',
                                'src/boot',
+                               'src/core',
                                'src/home',
-                               'src/shared',
-                               'src/systemd',
                                'src/journal',
                                'src/journal-remote',
-                               'src/nspawn',
-                               'src/resolve',
-                               'src/timesync',
-                               'src/time-wait-sync',
-                               'src/login',
-                               'src/udev',
-                               'src/libudev',
-                               'src/core',
-                               'src/shutdown',
-                               'src/xdg-autostart-generator',
+                               'src/libsystemd-network',
                                'src/libsystemd/sd-bus',
                                'src/libsystemd/sd-device',
                                'src/libsystemd/sd-event',
@@ -1568,7 +1574,17 @@ includes = include_directories('src/basic',
                                'src/libsystemd/sd-netlink',
                                'src/libsystemd/sd-network',
                                'src/libsystemd/sd-resolve',
-                               'src/libsystemd-network',
+                               'src/libudev',
+                               'src/login',
+                               'src/nspawn',
+                               'src/resolve',
+                               'src/shared',
+                               'src/shutdown',
+                               'src/systemd',
+                               'src/time-wait-sync',
+                               'src/timesync',
+                               'src/udev',
+                               'src/xdg-autostart-generator',
                                '.')
 
 add_project_arguments('-include', 'config.h', language : 'c')
@@ -1667,6 +1683,7 @@ subdir('src/analyze')
 subdir('src/journal-remote')
 subdir('src/coredump')
 subdir('src/pstore')
+subdir('src/oom')
 subdir('src/hostname')
 subdir('src/import')
 subdir('src/partition')
@@ -2103,9 +2120,77 @@ endif
 
 public_programs += executable(
         'systemctl',
+        'src/systemctl/systemctl-add-dependency.c',
+        'src/systemctl/systemctl-add-dependency.h',
+        'src/systemctl/systemctl-cancel-job.c',
+        'src/systemctl/systemctl-cancel-job.h',
+        'src/systemctl/systemctl-clean-or-freeze.c',
+        'src/systemctl/systemctl-clean-or-freeze.h',
+        'src/systemctl/systemctl-compat-halt.c',
+        'src/systemctl/systemctl-compat-halt.h',
+        'src/systemctl/systemctl-compat-runlevel.c',
+        'src/systemctl/systemctl-compat-runlevel.h',
+        'src/systemctl/systemctl-compat-shutdown.c',
+        'src/systemctl/systemctl-compat-shutdown.h',
+        'src/systemctl/systemctl-compat-telinit.c',
+        'src/systemctl/systemctl-compat-telinit.h',
+        'src/systemctl/systemctl-daemon-reload.c',
+        'src/systemctl/systemctl-daemon-reload.h',
+        'src/systemctl/systemctl-edit.c',
+        'src/systemctl/systemctl-edit.h',
+        'src/systemctl/systemctl-enable.c',
+        'src/systemctl/systemctl-enable.h',
+        'src/systemctl/systemctl-is-active.c',
+        'src/systemctl/systemctl-is-active.h',
+        'src/systemctl/systemctl-is-enabled.c',
+        'src/systemctl/systemctl-is-enabled.h',
+        'src/systemctl/systemctl-is-system-running.c',
+        'src/systemctl/systemctl-is-system-running.h',
+        'src/systemctl/systemctl-kill.c',
+        'src/systemctl/systemctl-kill.h',
+        'src/systemctl/systemctl-list-dependencies.c',
+        'src/systemctl/systemctl-list-dependencies.h',
+        'src/systemctl/systemctl-list-jobs.c',
+        'src/systemctl/systemctl-list-jobs.h',
+        'src/systemctl/systemctl-list-machines.c',
+        'src/systemctl/systemctl-list-machines.h',
+        'src/systemctl/systemctl-list-unit-files.c',
+        'src/systemctl/systemctl-list-unit-files.h',
+        'src/systemctl/systemctl-list-units.c',
+        'src/systemctl/systemctl-list-units.h',
+        'src/systemctl/systemctl-log-setting.c',
+        'src/systemctl/systemctl-log-setting.h',
+        'src/systemctl/systemctl-logind.c',
+        'src/systemctl/systemctl-logind.h',
+        'src/systemctl/systemctl-preset-all.c',
+        'src/systemctl/systemctl-preset-all.h',
+        'src/systemctl/systemctl-reset-failed.c',
+        'src/systemctl/systemctl-reset-failed.h',
+        'src/systemctl/systemctl-service-watchdogs.c',
+        'src/systemctl/systemctl-service-watchdogs.h',
+        'src/systemctl/systemctl-set-default.c',
+        'src/systemctl/systemctl-set-default.h',
+        'src/systemctl/systemctl-set-environment.c',
+        'src/systemctl/systemctl-set-environment.h',
+        'src/systemctl/systemctl-set-property.c',
+        'src/systemctl/systemctl-set-property.h',
+        'src/systemctl/systemctl-show.c',
+        'src/systemctl/systemctl-show.h',
+        'src/systemctl/systemctl-start-special.c',
+        'src/systemctl/systemctl-start-special.h',
+        'src/systemctl/systemctl-start-unit.c',
+        'src/systemctl/systemctl-start-unit.h',
+        'src/systemctl/systemctl-switch-root.c',
+        'src/systemctl/systemctl-switch-root.h',
+        'src/systemctl/systemctl-sysv-compat.c',
+        'src/systemctl/systemctl-sysv-compat.h',
+        'src/systemctl/systemctl-trivial-method.c',
+        'src/systemctl/systemctl-trivial-method.h',
+        'src/systemctl/systemctl-util.c',
+        'src/systemctl/systemctl-util.c',
+        'src/systemctl/systemctl-util.h',
         'src/systemctl/systemctl.c',
-        'src/systemctl/sysv-compat.h',
-        'src/systemctl/sysv-compat.c',
+        'src/systemctl/systemctl.h',
         include_directories : includes,
         link_with : systemctl_link_with,
         dependencies : [threads,
@@ -2658,6 +2743,27 @@ if conf.get('ENABLE_PSTORE') == 1
                 install_dir : rootlibexecdir)
 endif
 
+if conf.get('ENABLE_OOMD') == 1
+        executable('systemd-oomd',
+                   systemd_oomd_sources,
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootlibexecdir)
+
+        public_programs += executable(
+                   'oomctl',
+                   oomctl_sources,
+                   include_directories : includes,
+                   link_with : [libshared],
+                   dependencies : [],
+                   install_rpath : rootlibexecdir,
+                   install : true,
+                   install_dir : rootbindir)
+endif
+
 if conf.get('ENABLE_BINFMT') == 1
         public_programs += executable(
                 'systemd-binfmt',
@@ -2988,6 +3094,7 @@ if enable_sysusers
                         'systemd-sysusers.standalone',
                         'src/sysusers/sysusers.c',
                         include_directories : includes,
+                        c_args : '-DSTANDALONE',
                         link_with : [libshared_static,
                                      libbasic,
                                      libbasic_gcrypt,
@@ -3030,6 +3137,7 @@ if conf.get('ENABLE_TMPFILES') == 1
                         'systemd-tmpfiles.standalone',
                         systemd_tmpfiles_sources,
                         include_directories : includes,
+                        c_args : '-DSTANDALONE',
                         link_with : [libshared_static,
                                      libbasic,
                                      libbasic_gcrypt,
@@ -3230,6 +3338,7 @@ foreach tuple : tests
         type = tuple.length() >= 5 ? tuple[4] : ''
         defs = tuple.length() >= 6 ? tuple[5] : []
         incs = tuple.length() >= 7 ? tuple[6] : includes
+        parallel = tuple.length() >= 8 ? tuple[7] : true
         timeout = 30
 
         name = sources[0].split('/')[-1].split('.')[0]
@@ -3676,6 +3785,7 @@ foreach tuple : [
         ['DNS-over-TLS(openssl)', conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1],
         ['coredump'],
         ['pstore'],
+        ['oomd'],
         ['polkit'],
         ['legacy pkla',      install_polkit_pkla],
         ['efi'],