ifneq ($(KERNELRELEASE),)
ifneq ($(CONFIG_TRACEPOINTS),)
-KERNELDIR=${LTTNG_KERNELDIR}
+KERNELDIR = ${LTTNG_KERNELDIR}
+MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST)))
-include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds
+include $(MAKEFILEDIR)/../Makefile.ABI.workarounds
ccflags-y += -I$(PWD)/probes
obj-m += lttng-types.o
ifneq ($(CONFIG_KVM),)
obj-m += lttng-probe-kvm.o
ifneq ($(CONFIG_X86),)
+kvm_dep_lapic = $(srctree)/arch/x86/kvm/lapic.h
+ifneq ($(wildcard $(kvm_dep_lapic)),)
kvm_dep = $(srctree)/virt/kvm/iodev.h $(srctree)/include/kvm/iodev.h
ifneq ($(wildcard $(kvm_dep)),)
CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm
else
$(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
endif
+else
+$(warning File $(kvm_dep_lapic) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
+endif
endif
endif