[lttng-dev] [lttng-modules PATCH] makefile: check kernel version and config token

Yannick Brosseau yannick.brosseau at gmail.com
Wed Dec 21 09:08:16 EST 2011


On 2011-12-21 08:30, Gerlando Falauto wrote:
> a) When kernel is not compatible (version < 2.6.39), don't try to
>    compile but display a warning instead
Is that really the oldest version you can compile it with? Initial test
have should that we were able to support at least 2.6.35, but that may
have changed.

> b) When configuration token CONFIG_TRACEPOINTS is not enabled,
>    display a warning
>
> Signed-off-by: Gerlando Falauto <gerlando.falauto at keymile.com>
> ---
>  Makefile |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 5ac13d7..a7eb624 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -5,6 +5,15 @@
>  ifneq ($(KERNELRELEASE),)
>  ifneq ($(CONFIG_TRACEPOINTS),)
>  
> +COMPATIBLE_KERNEL=$(shell \
> +	if [ $(VERSION) -ge 3 \
> +		-o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 39 \) ] ; then \
> +		echo "y" ; fi;)
> +
> +ifeq ($(COMPATIBLE_KERNEL),)
> +$(warning Trying to compile lttng-modules against kernel $(KERNELRELEASE). Minimum required version is 2.6.39. Skipping.)
> +else
> +
>  obj-m += ltt-ring-buffer-client-discard.o
>  obj-m += ltt-ring-buffer-client-overwrite.o
>  obj-m += ltt-ring-buffer-metadata-client.o
> @@ -35,6 +44,10 @@ endif
>  obj-m += probes/
>  obj-m += lib/
>  
> +endif # COMPATIBLE_KERNEL
> +
> +else
> +$(warning CONFIG_TRACEPOINTS is not enabled, LTTng modules will not be compiled!)
>  endif
>  
>  else




More information about the lttng-dev mailing list