Author: Jaret Cantu <jaret.cantu@timesys.com> 
Date:   Thu May 17 18:12:05 EDT 2018

---
 configure | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Index: util-linux-2.37.2/configure
===================================================================
--- util-linux-2.37.2.orig/configure
+++ util-linux-2.37.2/configure
@@ -33449,15 +33449,23 @@ fi
 
   if test "x$build_rfkill" != xno; then
 
-    case $enable_rfkill:$linux_os in #(
+    ac_fn_c_check_header_mongrel "$LINENO" "linux/rfkill.h" "ac_cv_header_linux_rfkill_h" "$ac_includes_default"
+
+    case $enable_rfkill:$linux_os:$ac_cv_header_linux_rfkill_h in #(
     no:*)
       build_rfkill=no ;;
-    yes:yes)
+    yes:yes:yes)
       build_rfkill=yes ;;
+    yes:yes:*)
+      as_fn_error $? "linux/rfkill.h is needed to build rfkill" "$LINENO" 5;;
     yes:*)
       as_fn_error $? "rfkill selected for non-linux system" "$LINENO" 5;;
-    check:yes)
+    check:yes:yes)
       build_rfkill=yes ;;
+    check:yes:*)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find linux/rfkill.h; not building rfkill" >&5
+$as_echo "$as_me: WARNING: could not find linux/rfkill.h; not building rfkill" >&2;}
+      build_rfkill=no ;;
     check:*)
       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: non-linux system; not building rfkill" >&5
 $as_echo "$as_me: WARNING: non-linux system; not building rfkill" >&2;}
