Without the patch below, ./configure would fail like this on Fedora 10: checking linux/dlm_plock.h usability... no checking linux/dlm_plock.h presence... yes configure: WARNING: linux/dlm_plock.h: present but cannot be compiled configure: WARNING: linux/dlm_plock.h: check for missing prerequisite headers? configure: WARNING: linux/dlm_plock.h: see the Autoconf documentation configure: WARNING: linux/dlm_plock.h: section "Present But Cannot Be Compiled" configure: WARNING: linux/dlm_plock.h: proceeding with the compiler's result configure: WARNING: ## --------------------------------------- ## configure: WARNING: ## Report this to [email protected] ## configure: WARNING: ## --------------------------------------- ## checking for linux/dlm_plock.h... no configure: error: Unable to find dlm kernel headers. Make sure to install kernel headers 2.6.26 (or higher) or use --with-kernel=path configure option to point to the kernel source. [Exit 1]
and config.log showed the problem: In file included from conftest.c:79:0: /usr/include/linux/dlm_plock.h:25:2: error: expected specifier-qualifier-list before '__u32' Here's the patch: >From 013d711c8731da4f11df2437c6c1251d7edb91ea Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Fri, 19 Jun 2009 20:24:18 +0200 Subject: [PATCH] avoid configure failure with F10's 2.6.27.21 kernel headers * configure.ac: Include <linux/types.h> before checking for linux/dlm_plock.h. Otherwise, we'd get a syntax error on __u32. --- configure.ac | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b10639b..d50de87 100644 --- a/configure.ac +++ b/configure.ac @@ -154,12 +154,17 @@ BACKUP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$KERNEL_CPPFLAGS" # check kernel headers +AC_CHECK_HEADERS([linux/major.h linux/types.h linux/dlmconstants.h]) +AC_CHECK_HEADERS([linux/dlm.h linux/dlm_device.h]) # 2.6.26 adds dlm_plock.h that's our checking barrier, instead # of implementing some insane kernel version checks -AC_CHECK_HEADERS([linux/major.h linux/types.h linux/dlmconstants.h linux/dlm.h linux/dlm_device.h linux/dlm_plock.h],, +# At least on 2.6.27.21-170.2.56.fc10.x86_64, one must include +# <linux/types.h> to avoid syntax errors regarding __u32. +AC_CHECK_HEADERS([linux/dlm_plock.h],, [AC_MSG_ERROR([Unable to find dlm kernel headers. Make sure to install kernel headers 2.6.26 (or higher) or use --with-kernel=path -configure option to point to the kernel source.])]) +configure option to point to the kernel source.])], + [#include <linux/types.h>]) CPPFLAGS="$BACKUP_CPPFLAGS" -- 1.6.3.2.416.g04d0
