]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
journalctl: regexp matching
[thirdparty/systemd.git] / meson.build
index 3c57bde5a751eecac6b71dc362a23da26764a313..1ecc6b088ba193f069ba5ced212aacf69beba465 100644 (file)
@@ -16,7 +16,7 @@
 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
 project('systemd', 'c',
-        version : '235',
+        version : '236',
         license : 'LGPLv2+',
         default_options: [
                 'c_std=gnu99',
@@ -27,8 +27,8 @@ project('systemd', 'c',
         meson_version : '>= 0.41',
        )
 
-libsystemd_version = '0.19.1'
-libudev_version = '1.6.7'
+libsystemd_version = '0.20.0'
+libudev_version = '1.6.8'
 
 # We need the same data in three different formats, ugh!
 # Also, for hysterical reasons, we use different variable
@@ -67,7 +67,7 @@ endif
 
 sysvinit_path = get_option('sysvinit-path')
 sysvrcnd_path = get_option('sysvrcnd-path')
-have = sysvinit_path != '' or sysvrcnd_path != ''
+have = sysvinit_path != '' and sysvrcnd_path != ''
 conf.set10('HAVE_SYSV_COMPAT', have,
            description : 'SysV init scripts and rcN.d links are supported')
 m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
@@ -422,7 +422,7 @@ 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_MODE',                 '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'],
@@ -437,6 +437,7 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE',         'linux/if_link.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'],
@@ -453,17 +454,17 @@ foreach ident : ['secure_getenv', '__secure_getenv']
 endforeach
 
 foreach ident : [
-        ['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
-                                 #include <sys/types.h>
+        ['memfd_create',      '''#include <sys/mman.h>'''],
+        ['gettid',            '''#include <sys/types.h>
+                                 #include <unistd.h>'''],
+        ['pivot_root',        '''#include <stdlib.h>
+                                 #include <unistd.h>'''],     # no known header declares pivot_root
+        ['name_to_handle_at', '''#include <sys/types.h>
                                  #include <sys/stat.h>
                                  #include <fcntl.h>'''],
-        ['setns',             '''#define _GNU_SOURCE
-                                 #include <sched.h>'''],
-        ['renameat2',         '''#include <stdio.h>'''],
+        ['setns',             '''#include <sched.h>'''],
+        ['renameat2',         '''#include <stdio.h>
+                                 #include <fcntl.h>'''],
         ['kcmp',              '''#include <linux/kcmp.h>'''],
         ['keyctl',            '''#include <sys/types.h>
                                  #include <keyutils.h>'''],
@@ -474,11 +475,11 @@ foreach ident : [
         ['explicit_bzero' ,   '''#include <string.h>'''],
 ]
 
-        have = cc.has_function(ident[0], prefix : ident[1])
+        have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
         conf.set10('HAVE_' + ident[0].to_upper(), have)
 endforeach
 
-if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
+if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
         conf.set10('USE_SYS_RANDOM_H', true)
         conf.set10('HAVE_GETRANDOM', true)
 else
@@ -502,8 +503,7 @@ splash_bmp = files('test/splash.bmp')
 
 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
 # /usr/sbin, /sbin, and fall back to the default from middle column.
-progs = [['telinit',    '/lib/sysvinit/telinit'],
-         ['quotaon',    '/usr/sbin/quotaon'    ],
+progs = [['quotaon',    '/usr/sbin/quotaon'    ],
          ['quotacheck', '/usr/sbin/quotacheck' ],
          ['kill',       '/usr/bin/kill'        ],
          ['kmod',       '/usr/bin/kmod'        ],
@@ -530,6 +530,8 @@ foreach prog : progs
         substs.set(name, path)
 endforeach
 
+conf.set_quoted('TELINIT', get_option('telinit-path'))
+
 if run_command('ln', '--relative', '--help').returncode() != 0
         error('ln does not support --relative')
 endif
@@ -1062,6 +1064,17 @@ else
 endif
 conf.set10('HAVE_XKBCOMMON', have)
 
+want_pcre2 = get_option('pcre2')
+if want_pcre2 != 'false'
+        libpcre2 = dependency('libpcre2-8',
+                              required : want_pcre2 == 'true')
+        have = libpcre2.found()
+else
+        have = false
+        libpcre2 = []
+endif
+conf.set10('HAVE_PCRE2', have)
+
 want_glib = get_option('glib')
 if want_glib != 'false'
         libglib =    dependency('glib-2.0',
@@ -1231,14 +1244,10 @@ includes = include_directories('src/basic',
                                'src/libsystemd/sd-netlink',
                                'src/libsystemd/sd-network',
                                'src/libsystemd-network',
-                               '.',
-                              )
+                               '.')
 
 add_project_arguments('-include', 'config.h', language : 'c')
 
-gcrypt_util_sources = files('src/shared/gcrypt-util.h',
-                            'src/shared/gcrypt-util.c')
-
 subdir('po')
 subdir('catalog')
 subdir('src/systemd')
@@ -1258,15 +1267,16 @@ libjournal_core = static_library(
 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
 libsystemd = shared_library(
         'systemd',
-        libsystemd_internal_sources,
-        journal_internal_sources,
+        'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug
         version : libsystemd_version,
         include_directories : includes,
         link_args : ['-shared',
                      '-Wl,--version-script=' + libsystemd_sym_path],
-        link_with : [libbasic],
+        link_with : [libbasic,
+                     libbasic_gcrypt],
+        link_whole : [libsystemd_static,
+                      libjournal_client],
         dependencies : [threads,
-                        libgcrypt,
                         librt,
                         libxz,
                         liblz4],
@@ -1338,7 +1348,7 @@ foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
                                      '-shared',
                                      '-Wl,--version-script=' + version_script_arg,
                                      '-Wl,--undefined'],
-                        link_with : [libsystemd_internal,
+                        link_with : [libsystemd_static,
                                      libbasic],
                         dependencies : [threads,
                                         librt],
@@ -1420,7 +1430,8 @@ exe = executable('journalctl',
                  dependencies : [threads,
                                  libqrencode,
                                  libxz,
-                                 liblz4],
+                                 liblz4,
+                                 libpcre2],
                  install_rpath : rootlibexecdir,
                  install : true,
                  install_dir : rootbindir)
@@ -1507,11 +1518,11 @@ endif
 if conf.get('ENABLE_RESOLVE') == 1
         executable('systemd-resolved',
                    systemd_resolved_sources,
-                   gcrypt_util_sources,
                    include_directories : includes,
-                   link_with : [libshared],
+                   link_with : [libshared,
+                                libbasic_gcrypt,
+                                libsystemd_resolve_core],
                    dependencies : [threads,
-                                   libgcrypt,
                                    libgpg_error,
                                    libm,
                                    libidn],
@@ -1521,11 +1532,11 @@ if conf.get('ENABLE_RESOLVE') == 1
 
         exe = executable('systemd-resolve',
                          systemd_resolve_sources,
-                         gcrypt_util_sources,
                          include_directories : includes,
-                         link_with : [libshared],
+                         link_with : [libshared,
+                                      libbasic_gcrypt,
+                                      libsystemd_resolve_core],
                          dependencies : [threads,
-                                         libgcrypt,
                                          libgpg_error,
                                          libm,
                                          libidn],
@@ -1576,7 +1587,7 @@ if conf.get('ENABLE_LOGIND') == 1
                         include_directories : includes,
                         link_args : ['-shared',
                                      '-Wl,--version-script=' + version_script_arg],
-                        link_with : [libsystemd_internal,
+                        link_with : [libsystemd_static,
                                      libshared_static],
                         dependencies : [threads,
                                         libpam,
@@ -2229,7 +2240,7 @@ if conf.get('ENABLE_HWDB') == 1
                          'src/hwdb/hwdb.c',
                          'src/libsystemd/sd-hwdb/hwdb-internal.h',
                          include_directories : includes,
-                         link_with : [libudev_internal],
+                         link_with : [libudev_static],
                          install_rpath : udev_rpath,
                          install : true,
                          install_dir : rootbindir)
@@ -2262,7 +2273,7 @@ exe = executable('systemd-udevd',
                  c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
                  link_with : [libudev_core,
                               libsystemd_network,
-                              libudev_internal],
+                              libudev_static],
                  dependencies : [threads,
                                  libkmod,
                                  libidn,
@@ -2275,10 +2286,11 @@ public_programs += [exe]
 
 exe = executable('udevadm',
                  udevadm_sources,
+                 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
                  include_directories : includes,
                  link_with : [libudev_core,
                               libsystemd_network,
-                              libudev_internal],
+                              libudev_static],
                  dependencies : [threads,
                                  libkmod,
                                  libidn,
@@ -2352,7 +2364,7 @@ if conf.get('ENABLE_NETWORKD') == 1
                    include_directories : includes,
                    link_with : [libnetworkd_core,
                                 libsystemd_network,
-                                libudev_internal,
+                                libudev_static,
                                 libshared],
                    dependencies : [threads],
                    install_rpath : rootlibexecdir,
@@ -2489,6 +2501,8 @@ install_data('README',
              'ENVIRONMENT.md',
              'LICENSE.GPL2',
              'LICENSE.LGPL2.1',
+             'TRANSIENT-SETTINGS.md',
+             'UIDS-GIDS.md',
              'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
              install_dir : docdir)
 
@@ -2554,6 +2568,14 @@ endif
 
 ############################################################
 
+meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh')
+run_target(
+        'check-api-docs',
+        depends : [man, libsystemd, libudev],
+        command : [meson_check_api_docs_sh, libsystemd.full_path(), libudev.full_path()])
+
+############################################################
+
 status = [
         '@0@ @1@'.format(meson.project_name(), meson.project_version()),
 
@@ -2683,6 +2705,7 @@ foreach tuple : [
         ['gnu-efi',          have_gnu_efi],
         ['kmod'],
         ['xkbcommon'],
+        ['pcre2'],
         ['blkid'],
         ['dbus'],
         ['glib'],