]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
fileio: replace read_nul_string() by read_line() with a special flag
[thirdparty/systemd.git] / meson.build
index b01365b6ddf47646b425d9c06d1fc05de710065e..1608278fbb03b11e09bc15ac98c1891348a07d5f 100644 (file)
@@ -75,7 +75,7 @@ conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '',
 
 conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max'))
 conf.set10('BUMP_PROC_SYS_FS_NR_OPEN',  get_option('bump-proc-sys-fs-nr-open'))
-conf.set('HIGH_RLIMIT_NOFILE',          256*1024)
+conf.set('HIGH_RLIMIT_NOFILE',          512*1024)
 
 # join_paths ignore the preceding arguments if an absolute component is
 # encountered, so this should canonicalize various paths when they are
@@ -227,6 +227,7 @@ conf.set_quoted('ROOTLIBEXECDIR',                             rootlibexecdir)
 conf.set_quoted('BOOTLIBDIR',                                 bootlibdir)
 conf.set_quoted('SYSTEMD_PULL_PATH',                          join_paths(rootlibexecdir, 'systemd-pull'))
 conf.set_quoted('SYSTEMD_IMPORT_PATH',                        join_paths(rootlibexecdir, 'systemd-import'))
+conf.set_quoted('SYSTEMD_IMPORT_FS_PATH',                     join_paths(rootlibexecdir, 'systemd-import-fs'))
 conf.set_quoted('SYSTEMD_EXPORT_PATH',                        join_paths(rootlibexecdir, 'systemd-export'))
 conf.set_quoted('VENDOR_KEYRING_PATH',                        join_paths(rootlibexecdir, 'import-pubring.gpg'))
 conf.set_quoted('USER_KEYRING_PATH',                          join_paths(pkgsysconfdir, 'import-pubring.gpg'))
@@ -396,7 +397,7 @@ if cc.compiles('''
            struct timespec now;
            return 0;
    }
-''', name : '-Werror=shadow with local shadowing')
+''', args: '-Werror=shadow', name : '-Werror=shadow with local shadowing')
         add_project_arguments('-Werror=shadow', language : 'c')
 endif
 
@@ -425,8 +426,8 @@ decl_headers = '''
 
 foreach decl : ['char16_t',
                 'char32_t',
-                'struct ethtool_link_settings',
                 'struct fib_rule_uid_range',
+                'struct fib_rule_port_range',
                 'struct statx',
                ]
 
@@ -449,33 +450,89 @@ endforeach
 
 conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
 
-foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.h'],
-                ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
-                ['IFLA_VRF_TABLE',                   'linux/if_link.h'],
-                ['IFLA_MACVLAN_FLAGS',               'linux/if_link.h'],
-                ['IFLA_IPVLAN_FLAGS',                'linux/if_link.h'],
-                ['IFLA_PHYS_PORT_ID',                'linux/if_link.h'],
-                ['IFLA_BOND_AD_INFO',                'linux/if_link.h'],
-                ['IFLA_VLAN_PROTOCOL',               'linux/if_link.h'],
-                ['IFLA_VXLAN_REMCSUM_NOPARTIAL',     'linux/if_link.h'],
-                ['IFLA_VXLAN_GPE',                   'linux/if_link.h'],
-                ['IFLA_GENEVE_LABEL',                'linux/if_link.h'],
+foreach decl : [['ETHTOOL_LINK_MODE_10baseT_Half_BIT',      'linux/ethtool.h'],
+                ['ETHTOOL_LINK_MODE_25000baseCR_Full_BIT',  'linux/ethtool.h'],
+                ['ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT', 'linux/ethtool.h'],
+                ['ETHTOOL_LINK_MODE_1000baseX_Full_BIT',    'linux/ethtool.h'],
+                ['ETHTOOL_LINK_MODE_2500baseT_Full_BIT',    'linux/ethtool.h'],
+                ['ETHTOOL_LINK_MODE_FEC_NONE_BIT',          'linux/ethtool.h'],
+                ['FRA_TUN_ID',                              'linux/fib_rules.h'],
+                ['FRA_SUPPRESS_PREFIXLEN',                  'linux/fib_rules.h'],
+                ['FRA_PAD',                                 'linux/fib_rules.h'],
+                ['FRA_L3MDEV',                              'linux/fib_rules.h'],
+                ['FRA_UID_RANGE',                           'linux/fib_rules.h'],
+                ['FRA_DPORT_RANGE',                         'linux/fib_rules.h'],
+                ['FOU_ATTR_REMCSUM_NOPARTIAL',              'linux/fou.h'],
+                ['FOU_CMD_GET',                             'linux/fou.h'],
+                ['IFA_FLAGS',                               'linux/if_addr.h'],
+                ['IFLA_BRIDGE_VLAN_TUNNEL_INFO',            'linux/if_bridge.h'],
+                ['IFLA_INET6_ADDR_GEN_MODE',                'linux/if_link.h'],
+                ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY',        'linux/if_link.h'],
+                ['IN6_ADDR_GEN_MODE_RANDOM',                'linux/if_link.h'],
+                ['IFLA_IPVLAN_MODE',                        'linux/if_link.h'],
+                ['IPVLAN_MODE_L3S',                         'linux/if_link.h'],
+                ['IFLA_IPVLAN_FLAGS',                       'linux/if_link.h'],
+                ['IFLA_PHYS_PORT_ID',                       'linux/if_link.h'],
+                ['IFLA_CARRIER_CHANGES',                    'linux/if_link.h'],
+                ['IFLA_PHYS_SWITCH_ID',                     'linux/if_link.h'],
+                ['IFLA_LINK_NETNSID',                       'linux/if_link.h'],
+                ['IFLA_PHYS_PORT_NAME',                     'linux/if_link.h'],
+                ['IFLA_PROTO_DOWN',                         'linux/if_link.h'],
+                ['IFLA_GSO_MAX_SIZE',                       'linux/if_link.h'],
+                ['IFLA_PAD',                                'linux/if_link.h'],
+                ['IFLA_XDP',                                'linux/if_link.h'],
+                ['IFLA_EVENT',                              'linux/if_link.h'],
+                ['IFLA_IF_NETNSID',                         'linux/if_link.h'],
+                ['IFLA_TARGET_NETNSID',                     'linux/if_link.h'],
+                ['IFLA_NEW_IFINDEX',                        'linux/if_link.h'],
+                ['IFLA_MAX_MTU',                            'linux/if_link.h'],
+                ['IFLA_BOND_ACTIVE_SLAVE',                  'linux/if_link.h'],
+                ['IFLA_BOND_AD_INFO',                       'linux/if_link.h'],
+                ['IFLA_BOND_AD_ACTOR_SYSTEM',               'linux/if_link.h'],
+                ['IFLA_BOND_TLB_DYNAMIC_LB',                'linux/if_link.h'],
+                ['IFLA_VXLAN_UDP_ZERO_CSUM6_RX',            'linux/if_link.h'],
+                ['IFLA_VXLAN_REMCSUM_NOPARTIAL',            'linux/if_link.h'],
+                ['IFLA_VXLAN_COLLECT_METADATA',             'linux/if_link.h'],
+                ['IFLA_VXLAN_LABEL',                        'linux/if_link.h'],
+                ['IFLA_VXLAN_GPE',                          'linux/if_link.h'],
+                ['IFLA_VXLAN_TTL_INHERIT',                  'linux/if_link.h'],
+                ['IFLA_GENEVE_TOS',                         'linux/if_link.h'],
+                ['IFLA_GENEVE_COLLECT_METADATA',            'linux/if_link.h'],
+                ['IFLA_GENEVE_REMOTE6',                     'linux/if_link.h'],
+                ['IFLA_GENEVE_UDP_ZERO_CSUM6_RX',           'linux/if_link.h'],
+                ['IFLA_GENEVE_LABEL',                       'linux/if_link.h'],
+                ['IFLA_GENEVE_TTL_INHERIT',                 'linux/if_link.h'],
+                ['IFLA_BR_MAX_AGE',                         'linux/if_link.h'],
+                ['IFLA_BR_PRIORITY',                        'linux/if_link.h'],
+                ['IFLA_BR_VLAN_PROTOCOL',                   'linux/if_link.h'],
+                ['IFLA_BR_VLAN_DEFAULT_PVID',               'linux/if_link.h'],
+                ['IFLA_BR_VLAN_STATS_ENABLED',              'linux/if_link.h'],
+                ['IFLA_BR_MCAST_STATS_ENABLED',             'linux/if_link.h'],
+                ['IFLA_BR_MCAST_MLD_VERSION',               'linux/if_link.h'],
+                ['IFLA_BR_VLAN_STATS_PER_PORT',             'linux/if_link.h'],
+                ['IFLA_BRPORT_LEARNING_SYNC',               'linux/if_link.h'],
+                ['IFLA_BRPORT_PROXYARP_WIFI',               'linux/if_link.h'],
+                ['IFLA_BRPORT_MULTICAST_ROUTER',            'linux/if_link.h'],
+                ['IFLA_BRPORT_PAD',                         'linux/if_link.h'],
+                ['IFLA_BRPORT_MCAST_FLOOD',                 'linux/if_link.h'],
+                ['IFLA_BRPORT_VLAN_TUNNEL',                 'linux/if_link.h'],
+                ['IFLA_BRPORT_BCAST_FLOOD',                 'linux/if_link.h'],
+                ['IFLA_BRPORT_NEIGH_SUPPRESS',              'linux/if_link.h'],
+                ['IFLA_BRPORT_ISOLATED',                    'linux/if_link.h'],
+                ['IFLA_BRPORT_BACKUP_PORT',                 'linux/if_link.h'],
+                ['IFLA_VRF_TABLE',                          'linux/if_link.h'],
                 # if_tunnel.h is buggy and cannot be included on its own
-                ['IFLA_VTI_REMOTE',                  'linux/if_tunnel.h', '#include <net/if.h>'],
-                ['IFLA_IPTUN_ENCAP_DPORT',           'linux/if_tunnel.h', '#include <net/if.h>'],
-                ['IFLA_GRE_ENCAP_DPORT',             'linux/if_tunnel.h', '#include <net/if.h>'],
-                ['IFLA_BRIDGE_VLAN_INFO',            'linux/if_bridge.h'],
-                ['IFLA_BRPORT_PROXYARP',             'linux/if_link.h'],
-                ['IFLA_BRPORT_LEARNING_SYNC',        'linux/if_link.h'],
-                ['IFLA_BR_VLAN_DEFAULT_PVID',        'linux/if_link.h'],
-                ['IPVLAN_F_PRIVATE',                 'linux/if_link.h'],
-                ['NDA_IFINDEX',                      'linux/neighbour.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'],
-                ['FOU_ATTR_REMCSUM_NOPARTIAL',       'linux/fou.h'],
-                ['FOU_CMD_GET',                      'linux/fou.h'],
+                ['IFLA_VTI_FWMARK',                         'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_IPTUN_ENCAP_DPORT',                  'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_IPTUN_COLLECT_METADATA',             'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_IPTUN_FWMARK',                       'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_GRE_ENCAP_DPORT',                    'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_GRE_COLLECT_METADATA',               'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_GRE_IGNORE_DF',                      'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_GRE_FWMARK',                         'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_GRE_ERSPAN_INDEX',                   'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['IFLA_GRE_ERSPAN_HWID',                    'linux/if_tunnel.h', '#include <net/if.h>'],
+                ['LO_FLAGS_PARTSCAN',                       'linux/loop.h'],
                ]
         prefix = decl.length() > 2 ? decl[2] : ''
         have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
@@ -606,10 +663,11 @@ if not cc.has_header('sys/capability.h')
         error('POSIX caps headers not found')
 endif
 foreach header : ['crypt.h',
-                  'linux/btrfs.h',
+                  'linux/btrfs_tree.h',
                   'linux/fou.h',
                   'linux/memfd.h',
                   'linux/vm_sockets.h',
+                  'linux/can/vxcan.h',
                   'sys/auxv.h',
                   'valgrind/memcheck.h',
                   'valgrind/valgrind.h',
@@ -636,6 +694,9 @@ else
         conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
 endif
 
+default_net_naming_scheme = get_option('default-net-naming-scheme')
+conf.set_quoted('DEFAULT_NET_NAMING_SCHEME', default_net_naming_scheme)
+
 time_epoch = get_option('time-epoch')
 if time_epoch == -1
         NEWS = files('NEWS')
@@ -776,17 +837,25 @@ substs.set('DEBUGTTY', get_option('debug-tty'))
 
 enable_debug_hashmap = false
 enable_debug_mmap_cache = false
+enable_debug_siphash = false
+enable_debug_udev = false
 foreach name : get_option('debug-extra')
         if name == 'hashmap'
                 enable_debug_hashmap = true
         elif name == 'mmap-cache'
                 enable_debug_mmap_cache = true
+        elif name == 'siphash'
+                enable_debug_siphash = true
+        elif name == 'udev'
+                enable_debug_udev = true
         else
                 message('unknown debug option "@0@", ignoring'.format(name))
         endif
 endforeach
 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
+conf.set10('ENABLE_DEBUG_SIPHASH', enable_debug_siphash)
+conf.set10('ENABLE_DEBUG_UDEV', enable_debug_udev)
 
 conf.set10('VALGRIND', get_option('valgrind'))
 conf.set10('LOG_TRACE', get_option('log-trace'))
@@ -1092,6 +1161,7 @@ conf.set10('HAVE_XZ', have)
 want_lz4 = get_option('lz4')
 if want_lz4 != 'false' and not fuzzer_build
         liblz4 = dependency('liblz4',
+                            version : '>= 1.3.0',
                             required : want_lz4 == 'true')
         have = liblz4.found()
 else
@@ -1187,7 +1257,9 @@ if dns_over_tls != 'false'
         endif
         have = have_gnutls or have_openssl
 else
-        have = have_gnutls = have_openssl = false
+        have = false
+        have_gnutls = false
+        have_openssl = false
 endif
 conf.set10('ENABLE_DNS_OVER_TLS', have)
 conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls)
@@ -1360,15 +1432,19 @@ includes = include_directories('src/basic',
                                'src/core',
                                'src/libsystemd/sd-bus',
                                'src/libsystemd/sd-device',
+                               'src/libsystemd/sd-event',
                                'src/libsystemd/sd-hwdb',
                                'src/libsystemd/sd-id128',
                                'src/libsystemd/sd-netlink',
                                'src/libsystemd/sd-network',
+                               'src/libsystemd/sd-resolve',
                                'src/libsystemd-network',
                                '.')
 
 add_project_arguments('-include', 'config.h', language : 'c')
 
+generate_gperfs = find_program('tools/generate-gperfs.py')
+
 subdir('po')
 subdir('catalog')
 subdir('src/systemd')
@@ -1612,6 +1688,14 @@ executable('systemd-debug-generator',
            install : true,
            install_dir : systemgeneratordir)
 
+executable('systemd-run-generator',
+           'src/run-generator/run-generator.c',
+           include_directories : includes,
+           link_with : [libshared],
+           install_rpath : rootlibexecdir,
+           install : true,
+           install_dir : systemgeneratordir)
+
 executable('systemd-fstab-generator',
            'src/fstab-generator/fstab-generator.c',
            'src/core/mount-setup.c',
@@ -1656,7 +1740,7 @@ endif
 if conf.get('HAVE_BLKID') == 1
         executable('systemd-gpt-auto-generator',
                    'src/gpt-auto-generator/gpt-auto-generator.c',
-                   'src/basic/blkid-util.h',
+                   'src/shared/blkid-util.h',
                    include_directories : includes,
                    link_with : [libshared],
                    dependencies : libblkid,
@@ -2108,6 +2192,14 @@ if conf.get('ENABLE_IMPORTD') == 1
                                     install : true,
                                     install_dir : rootlibexecdir)
 
+        systemd_import_fs = executable('systemd-import-fs',
+                                    systemd_import_fs_sources,
+                                    include_directories : includes,
+                                    link_with : [libshared],
+                                    install_rpath : rootlibexecdir,
+                                    install : true,
+                                    install_dir : rootlibexecdir)
+
         systemd_export = executable('systemd-export',
                                     systemd_export_sources,
                                     include_directories : includes,
@@ -2119,7 +2211,8 @@ if conf.get('ENABLE_IMPORTD') == 1
                                     install_rpath : rootlibexecdir,
                                     install : true,
                                     install_dir : rootlibexecdir)
-        public_programs += [systemd_pull, systemd_import, systemd_export]
+
+        public_programs += [systemd_pull, systemd_import, systemd_import_fs, systemd_export]
 endif
 
 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
@@ -2767,6 +2860,7 @@ endif
 
 fuzzer_exes = []
 
+if get_option('tests') != 'false'
 foreach tuple : fuzzers
         sources = tuple[0]
         link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
@@ -2791,6 +2885,7 @@ foreach tuple : fuzzers
                 c_args : defs,
                 install : false)
 endforeach
+endif
 
 run_target('fuzzers',
         depends : fuzzer_exes,
@@ -3002,6 +3097,7 @@ status = [
         'default DNSSEC mode:               @0@'.format(default_dnssec),
         'default DNS-over-TLS mode:         @0@'.format(default_dns_over_tls),
         'default cgroup hierarchy:          @0@'.format(default_hierarchy),
+        'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme),
         'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
 
 alt_dns_servers = '\n                                            '.join(dns_servers.split(' '))
@@ -3030,7 +3126,7 @@ if conf.get('ENABLE_EFI') == 1
         if have_gnu_efi
                 status += [
                         'EFI machine type:                  @0@'.format(EFI_MACHINE_TYPE_NAME),
-                        'EFI CC                             @0@'.format(efi_cc),
+                        'EFI CC                             @0@'.format(' '.join(efi_cc)),
                         'EFI lib directory:                 @0@'.format(efi_libdir),
                         'EFI lds directory:                 @0@'.format(efi_ldsdir),
                         'EFI include directory:             @0@'.format(efi_incdir)]
@@ -3116,6 +3212,8 @@ foreach tuple : [
         ['gshadow'],
         ['debug hashmap'],
         ['debug mmap cache'],
+        ['debug siphash'],
+        ['debug udev'],
         ['valgrind',         conf.get('VALGRIND') == 1],
         ['trace logging',    conf.get('LOG_TRACE') == 1],
         ['link-udev-shared',      get_option('link-udev-shared')],