Configure should fail if device-tree-compiler is not installed
authorAndrew Waterman <andrew@sifive.com>
Mon, 5 Jun 2017 19:55:26 +0000 (12:55 -0700)
committerAndrew Waterman <andrew@sifive.com>
Mon, 5 Jun 2017 19:56:17 +0000 (12:56 -0700)
Fixes #107

configure
configure.ac

index 77bab3062880b745cdf0128660d58c44584e4b17..015f63e965a04eabe6cecb4d7f984c0e35345476 100755 (executable)
--- a/configure
+++ b/configure
@@ -3409,6 +3409,7 @@ done
   done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_DTC" && ac_cv_path_DTC="no"
   ;;
 esac
 fi
@@ -3422,6 +3423,9 @@ $as_echo "no" >&6; }
 fi
 
 
+if test x"$DTC" == xno; then :
+  as_fn_error $? "device-tree-compiler not found" "$LINENO" 5
+fi
 
 cat >>confdefs.h <<_ACEOF
 #define DTC "$DTC"
index ea64de74830fdd22615463e93634ecd2a146b0eb..e361877da2a50db38b1424b280e7c639bdc611f7 100644 (file)
@@ -51,7 +51,8 @@ AC_PROG_CC
 AC_PROG_CXX
 AC_CHECK_TOOL([AR],[ar])
 AC_CHECK_TOOL([RANLIB],[ranlib])
-AC_PATH_PROG([DTC],[dtc])
+AC_PATH_PROG([DTC],[dtc],[no])
+AS_IF([test x"$DTC" == xno],AC_MSG_ERROR([device-tree-compiler not found]))
 AC_DEFINE_UNQUOTED(DTC, ["$DTC"], [Path to the device-tree-compiler])
 
 AC_C_BIGENDIAN(AC_MSG_ERROR([Spike requires a little-endian host]))