From c31f8664cff475b8f4160506e582fc423c71f381 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 4 Jul 2019 11:14:41 +0200 Subject: compat: define conversion constants for ancient kernels --- src/compat/Kbuild.include | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/compat/Kbuild.include') diff --git a/src/compat/Kbuild.include b/src/compat/Kbuild.include index 95041a9..1b555f8 100644 --- a/src/compat/Kbuild.include +++ b/src/compat/Kbuild.include @@ -47,6 +47,10 @@ ccflags-y += -include $(kbuild-dir)/compat/memneq/include.h wireguard-y += compat/memneq/memneq.o endif +ifeq ($(wildcard $(srctree)/include/generated/timeconst.h),) +ccflags-y += $(shell echo 'define gcd(a,b){auto t;while(b){t=b;b=a%b;a=t;};return a;};hz=$(CONFIG_HZ);cd=gcd(hz,1000000);print "-DHZ_TO_USEC_NUM=",1000000/cd," -DHZ_TO_USEC_DEN=",hz/cd;halt;' | bc -q) +endif + ifeq ($(wildcard $(srctree)/arch/arm/include/asm/neon.h)$(CONFIG_ARM),y) ccflags-y += -I$(kbuild-dir)/compat/neon-arm/include endif -- cgit v1.2.3-59-g8ed1b