]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / meson.build
index 5dd105f09769895fa7872a5a68a28082aca7e9b0..239f13c061455ec5f43d2c99ad977a8087e7bda0 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1+
 
 project('systemd', 'c',
-        version : '240',
+        version : '241',
         license : 'LGPLv2+',
         default_options: [
                 'c_std=gnu99',
@@ -12,8 +12,8 @@ project('systemd', 'c',
         meson_version : '>= 0.46',
        )
 
-libsystemd_version = '0.24.0'
-libudev_version = '1.6.12'
+libsystemd_version = '0.25.0'
+libudev_version = '1.6.13'
 
 # We need the same data in two different formats, ugh!
 # Also, for hysterical reasons, we use different variable
@@ -135,7 +135,6 @@ systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
 systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
 systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
 udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
-udevhomedir = udevlibexecdir
 udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
 udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
 catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
@@ -235,11 +234,12 @@ conf.set10('MEMORY_ACCOUNTING_DEFAULT',                       memory_accounting_
 conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO',           memory_accounting_default ? 'yes' : 'no')
 
 substs.set('prefix',                                          prefixdir)
+substs.set('rootprefix',                                      rootprefixdir)
 substs.set('exec_prefix',                                     prefixdir)
 substs.set('libdir',                                          libdir)
 substs.set('rootlibdir',                                      rootlibdir)
 substs.set('includedir',                                      includedir)
-substs.set('pkgsysconfdir',                                   pkgsysconfdir)
+substs.set('sysconfdir',                                      sysconfdir)
 substs.set('bindir',                                          bindir)
 substs.set('rootbindir',                                      rootbindir)
 substs.set('rootlibexecdir',                                  rootlibexecdir)
@@ -334,6 +334,7 @@ possible_cc_flags = [
         '-Wno-missing-field-initializers',
         '-Wno-unused-result',
         '-Wno-format-signedness',
+        '-Wno-error=#warnings',
 
         # work-around for gcc 7.1 turning this on on its own.
         '-Wno-error=nonnull',
@@ -359,13 +360,6 @@ possible_link_flags = [
         '-Wl,-z,now',
 ]
 
-# the oss-fuzz fuzzers are not built with -fPIE, so don't
-# enable it when we are linking against them
-if not fuzzer_build
-        possible_cc_flags += '-fPIE'
-        possible_link_flags += '-pie'
-endif
-
 if cc.get_id() == 'clang'
         possible_cc_flags += [
                 '-Wno-typedef-redefinition',
@@ -416,15 +410,11 @@ conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h
 
 decl_headers = '''
 #include <uchar.h>
-#include <linux/ethtool.h>
-#include <linux/fib_rules.h>
 #include <sys/stat.h>
 '''
 
 foreach decl : ['char16_t',
                 'char32_t',
-                'struct fib_rule_uid_range',
-                'struct fib_rule_port_range',
                 'struct statx',
                ]
 
@@ -483,6 +473,7 @@ foreach decl : [['ETHTOOL_LINK_MODE_10baseT_Half_BIT',      'linux/ethtool.h'],
                 ['IFLA_TARGET_NETNSID',                     'linux/if_link.h'],
                 ['IFLA_NEW_IFINDEX',                        'linux/if_link.h'],
                 ['IFLA_MAX_MTU',                            'linux/if_link.h'],
+                ['IFLA_BOND_MODE',                          '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'],
@@ -586,6 +577,13 @@ vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
               get_option('version-tag'),
               meson.project_version()]
 
+version_h = vcs_tag(
+        input : 'src/version/version.h.in',
+        output : 'version.h',
+        command: vcs_tagger)
+
+versiondep = declare_dependency(sources: version_h)
+
 sed = find_program('sed')
 awk = find_program('awk')
 m4 = find_program('m4')
@@ -834,8 +832,12 @@ substs.set('NTP_SERVERS', ntp_servers)
 
 default_locale = get_option('default-locale')
 if default_locale == ''
-        choose_default_locale_sh = find_program('tools/choose-default-locale.sh')
-        default_locale = run_command(choose_default_locale_sh).stdout().strip()
+        if not meson.is_cross_build()
+                choose_default_locale_sh = find_program('tools/choose-default-locale.sh')
+                default_locale = run_command(choose_default_locale_sh).stdout().strip()
+        else
+                default_locale = 'C.UTF-8'
+        endif
 endif
 conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale)
 
@@ -1615,7 +1617,8 @@ executable('systemd',
            include_directories : includes,
            link_with : [libcore,
                         libshared],
-           dependencies : [threads,
+           dependencies : [versiondep,
+                           threads,
                            librt,
                            libseccomp,
                            libselinux,
@@ -1634,7 +1637,8 @@ exe = executable('systemd-analyze',
                  include_directories : includes,
                  link_with : [libcore,
                               libshared],
-                 dependencies : [threads,
+                 dependencies : [versiondep,
+                                 threads,
                                  librt,
                                  libseccomp,
                                  libselinux,
@@ -2180,7 +2184,8 @@ if conf.get('ENABLE_IMPORTD') == 1
                                   systemd_pull_sources,
                                   include_directories : includes,
                                   link_with : [libshared],
-                                  dependencies : [libcurl,
+                                  dependencies : [versiondep,
+                                                  libcurl,
                                                   libz,
                                                   libbzip2,
                                                   libxz,
@@ -2229,7 +2234,8 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
                          systemd_journal_upload_sources,
                          include_directories : includes,
                          link_with : [libshared],
-                         dependencies : [threads,
+                         dependencies : [versiondep,
+                                         threads,
                                          libcurl,
                                          libgnutls,
                                          libxz,
@@ -2555,6 +2561,7 @@ exe = executable('systemd-stdio-bridge',
                  'src/stdio-bridge/stdio-bridge.c',
                  include_directories : includes,
                  link_with : [libshared],
+                 dependencies : [versiondep],
                  install_rpath : rootlibexecdir,
                  install : true)
 public_programs += exe
@@ -2638,7 +2645,8 @@ exe = executable('systemd-udevd',
                  link_with : [libudev_core,
                               libsystemd_network,
                               libudev_static],
-                 dependencies : [threads,
+                 dependencies : [versiondep,
+                                 threads,
                                  libkmod,
                                  libidn,
                                  libacl,
@@ -2655,7 +2663,8 @@ exe = executable('udevadm',
                  link_with : [libudev_core,
                               libsystemd_network,
                               libudev_static],
-                 dependencies : [threads,
+                 dependencies : [versiondep,
+                                 threads,
                                  libkmod,
                                  libidn,
                                  libacl,
@@ -2795,7 +2804,8 @@ foreach tuple : tests
                         sources,
                         include_directories : incs,
                         link_with : link_with,
-                        dependencies : dependencies,
+                        dependencies : [versiondep,
+                                        dependencies],
                         c_args : defs,
                         build_by_default : want_tests != 'false',
                         install_rpath : rootlibexecdir,
@@ -2899,9 +2909,8 @@ foreach tuple : fuzzers
 endforeach
 endif
 
-run_target(
-        'fuzzers',
-        depends : [fuzzer_exes, version_h],
+run_target('fuzzers',
+        depends : fuzzer_exes,
         command : ['true'])
 
 ############################################################