sequence and variant types: use previous field for length/tag if NULL
[lttng-modules.git] / src / Kbuild.common
CommitLineData
b7cdc182 1# SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
6c27a5cc 2
7b25fa17
MJ
3ccflags-y += -DLTTNG_LINUX_MAJOR=$(VERSION)
4ccflags-y += -DLTTNG_LINUX_MINOR=$(PATCHLEVEL)
5ccflags-y += -DLTTNG_LINUX_PATCH=$(SUBLEVEL)
6
72e6c528
MD
7# Work-around for distro-specific public modules ABI breakages.
8# Some distributions break the public module instrumentation ABI
9# compared to upstream stable kernels without providing other mean than
10# the kernel EXTRAVERSION to figure it out. Translate this information
11# into a define visible from the C preprocessor.
12
6c27a5cc 13DEB_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-debian-version.sh $(CURDIR))
72e6c528
MD
14
15ifneq ($(DEB_API_VERSION), 0)
a8907e9a 16 ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION)
72e6c528 17endif
b4c8e4d3 18
6c27a5cc 19RHEL_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-rhel-version.sh $(CURDIR))
c94ac1ac
MJ
20
21ifneq ($(RHEL_API_VERSION), 0)
22 ccflags-y += -DRHEL_API_VERSION=$(RHEL_API_VERSION)
23endif
24
6c27a5cc 25SLE_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-sle-version.sh $(CURDIR))
ce66b486
MJ
26
27ifneq ($(SLE_API_VERSION), 0)
28 ccflags-y += -DSLE_API_VERSION=$(SLE_API_VERSION)
29endif
30
6c27a5cc 31FEDORA_REVISION_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-fedora-version.sh $(CURDIR))
e4838da1
LG
32
33ifneq ($(FEDORA_REVISION_VERSION), 0)
34 ccflags-y += -DFEDORA_REVISION_VERSION=$(FEDORA_REVISION_VERSION)
35endif
36
6c27a5cc 37RT_PATCH_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/rt-patch-version.sh $(CURDIR))
b4c8e4d3
MJ
38
39ifneq ($(RT_PATCH_VERSION), 0)
40 ccflags-y += -DRT_PATCH_VERSION=$(RT_PATCH_VERSION)
41endif
f61d99f9 42
6c27a5cc 43EXTRA_VERSION_NAME:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/extra-version-name.sh $(TOP_LTTNG_MODULES_DIR))
101215b7
MJ
44
45ifneq ($(EXTRA_VERSION_NAME), 0)
46 ccflags-y += -DLTTNG_EXTRA_VERSION_NAME='"$(EXTRA_VERSION_NAME)"'
47endif
48
6c27a5cc 49EXTRA_VERSION_GIT:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/extra-version-git.sh $(TOP_LTTNG_MODULES_DIR))
101215b7
MJ
50
51ifneq ($(EXTRA_VERSION_GIT), 0)
52 ccflags-y += -DLTTNG_EXTRA_VERSION_GIT='"$(EXTRA_VERSION_GIT)"'
53endif
54
6c27a5cc 55EXTRA_VERSION_PATCHES:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/extra-version-patches.sh $(TOP_LTTNG_MODULES_DIR))
101215b7 56
a6cf40a4
MJ
57mnt_ns_dep = $(srctree)/fs/mount.h
58ifeq ($(wildcard $(mnt_ns_dep)),)
59 ccflags-y += -DLTTNG_MNT_NS_MISSING_HEADER
60endif
61
e6213a91 62# vim:syntax=make
This page took 0.049853 seconds and 4 git commands to generate.