4 # Make sure we have enough version components
11 EXEC
="$(mktemp -t check-headers.XXXXXX)"
13 # We do not want to account for the patch-level, since headers are
14 # not supposed to change for different patchlevels, so we mask it out.
15 # This only applies to kernels >= 3.0, but those are the only one
16 # we actually care about; we treat all 2.6.x kernels equally.
17 ${HOSTCC} -imacros "${SYSROOT}/usr/include/linux/version.h" \
18 -x c
-o "${EXEC}" - <<_EOF_
22 int main(int argc __attribute__((unused)),
23 char** argv __attribute__((unused)))
25 if((LINUX_VERSION_CODE & ~0xFF)
26 != KERNEL_VERSION(${HDR_M},${HDR_m},0))
28 printf("Incorrect selection of kernel headers: ");
29 printf("expected %d.%d.x, got %d.%d.x\n", ${HDR_M}, ${HDR_m},
30 ((LINUX_VERSION_CODE>>16) & 0xFF),
31 ((LINUX_VERSION_CODE>>8) & 0xFF));