]> git.openfabrics.org - ~emulex/for-vlad/old/compat-rdma.git/commitdiff
configure: Use check_autofconf to verify kernel configuration
authorVladimir Sokolovsky <vlad@mellanox.com>
Mon, 27 Oct 2014 15:07:43 +0000 (17:07 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Mon, 27 Oct 2014 15:07:43 +0000 (17:07 +0200)
Some kernel-devel packages do not include .config. So, inspect
autoconf.h instead.

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
configure

index 10d3f1708a1f52077c3b873e06e24024b5cea622..b0c0e0e4a627f9c42fbe1f3132c01ca838e9d5ec 100755 (executable)
--- a/configure
+++ b/configure
@@ -231,6 +231,13 @@ check_kerver()
         return 0
 }
 
+function check_autofconf {
+       VAR=$1
+       VALUE=$(tac ${KSRC}/include/*/autoconf.h | grep -m1 ${VAR} | sed -ne 's/.*\([01]\)$/\1/gp')
+
+       eval "export $VAR=$VALUE"
+}
+
 main()
 {
         ofed_patch_params=
@@ -781,7 +788,8 @@ CONFIG_INFINIBAND_NES_DEBUG=${CONFIG_INFINIBAND_NES_DEBUG:-''}
 CONFIG_INFINIBAND_AMSO1100=${CONFIG_INFINIBAND_AMSO1100:-''}
 CONFIG_MLX4_EN_DCB=''
 if [ "X${CONFIG_MLX4_EN}" == "Xm" ]; then
-    if (grep -q "^CONFIG_DCB=y" $KSRC/.config > /dev/null 2>&1); then
+    check_autofconf CONFIG_DCB
+    if [ X${CONFIG_DCB} == "X1" ]; then
         CONFIG_MLX4_EN_DCB=y
     fi
 fi