summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build37
1 files changed, 21 insertions, 16 deletions
diff --git a/meson.build b/meson.build
index e421519..b1a110c 100644
--- a/meson.build
+++ b/meson.build
@@ -13,12 +13,19 @@ project('systemd', 'c',
meson_version : '>= 0.60.0',
)
+project_major_version = meson.project_version().split('.')[0].split('~')[0]
+if meson.project_version().contains('.')
+ project_minor_version = meson.project_version().split('.')[-1].split('~')[0]
+else
+ project_minor_version = '0'
+endif
+
libsystemd_version = '0.39.0'
libudev_version = '1.7.9'
conf = configuration_data()
conf.set_quoted('PROJECT_URL', 'https://systemd.io/')
-conf.set('PROJECT_VERSION', meson.project_version().split('~')[0],
+conf.set('PROJECT_VERSION', project_major_version,
description : 'Numerical project version (used where a simple number is expected)')
conf.set_quoted('PROJECT_VERSION_FULL', meson.project_version(), description : 'Full project version')
@@ -547,6 +554,7 @@ decl_headers = '''
#include <uchar.h>
#include <sys/mount.h>
#include <sys/stat.h>
+#include <sched.h>
'''
foreach decl : ['char16_t',
@@ -554,6 +562,7 @@ foreach decl : ['char16_t',
'struct mount_attr',
'struct statx',
'struct dirent64',
+ 'struct sched_attr',
]
# We get -1 if the size cannot be determined
@@ -601,6 +610,7 @@ foreach ident : [
#include <unistd.h>'''], # no known header declares pivot_root
['ioprio_get', '''#include <sched.h>'''], # no known header declares ioprio_get
['ioprio_set', '''#include <sched.h>'''], # no known header declares ioprio_set
+ ['sched_setattr', '''#include <sched.h>'''], # no known header declares sched_setattr
['name_to_handle_at', '''#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>'''],
@@ -1740,6 +1750,7 @@ if conf.get('BPF_FRAMEWORK') == 1
'-ffile-prefix-map=',
'-fdebug-prefix-map=',
'-fmacro-prefix-map=',
+ '--sysroot=',
]
foreach opt : c_args
@@ -1759,15 +1770,15 @@ if conf.get('BPF_FRAMEWORK') == 1
# C.f. https://mesonbuild.com/Reference-tables.html#cpu-families
# and src/basic/missing_syscall_def.h.
cpu_arch_defines = {
- 'ppc' : ['-D__powerpc__'],
- 'ppc64' : ['-D__powerpc64__', '-D_CALL_ELF=2'],
- 'riscv32' : ['-D__riscv', '-D__riscv_xlen=32'],
- 'riscv64' : ['-D__riscv', '-D__riscv_xlen=64'],
- 'x86' : ['-D__i386__'],
- 's390x' : ['-D__s390__', '-D__s390x__'],
+ 'ppc' : ['-D__powerpc__', '-D__TARGET_ARCH_powerpc'],
+ 'ppc64' : ['-D__powerpc64__', '-D__TARGET_ARCH_powerpc', '-D_CALL_ELF=2'],
+ 'riscv32' : ['-D__riscv', '-D__riscv_xlen=32', '-D__TARGET_ARCH_riscv'],
+ 'riscv64' : ['-D__riscv', '-D__riscv_xlen=64', '-D__TARGET_ARCH_riscv'],
+ 'x86' : ['-D__i386__', '-D__TARGET_ARCH_x86'],
+ 's390x' : ['-D__s390__', '-D__s390x__', '-D__TARGET_ARCH_s390'],
# For arm, assume hardware fp is available.
- 'arm' : ['-D__arm__', '-D__ARM_PCS_VFP'],
+ 'arm' : ['-D__arm__', '-D__ARM_PCS_VFP', '-D__TARGET_ARCH_arm'],
}
bpf_arch_flags = cpu_arch_defines.get(host_machine.cpu_family(),
@@ -1993,7 +2004,7 @@ version_h = vcs_tag(
shared_lib_tag = get_option('shared-lib-tag')
if shared_lib_tag == ''
- shared_lib_tag = meson.project_version().split('~')[0]
+ shared_lib_tag = project_major_version
endif
#####################################################################
@@ -2754,17 +2765,11 @@ foreach exec : public_programs
args : exec.full_path(),
depends: exec)
- version = meson.project_version()
- if name == 'udevadm'
- # For compatibility reasons we can't use the full version in udevadm.
- version = version.split('~')[0]
- endif
-
test('check-version-' + name,
check_version,
suite : 'dist',
args : [exec.full_path(),
- version],
+ project_major_version],
depends: exec)
endif
endforeach