[rtems commit] Generate an error if no valid gcc is found when configure runs.

Chris Johns chrisj at rtems.org
Mon Apr 9 22:22:45 UTC 2018


Module:    rtems
Branch:    master
Commit:    9f6f0261c172bee5463bb6724809e8486c9197ea
Changeset: http://git.rtems.org/rtems/commit/?id=9f6f0261c172bee5463bb6724809e8486c9197ea

Author:    Chris Johns <chrisj at rtems.org>
Date:      Mon Apr  9 16:18:09 2018 +1000

Generate an error if no valid gcc is found when configure runs.

Close #3385.

---

 aclocal/check-tool.m4 | 9 +++++++++
 configure.ac          | 6 +++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/aclocal/check-tool.m4 b/aclocal/check-tool.m4
new file mode 100644
index 0000000..210b1c0
--- /dev/null
+++ b/aclocal/check-tool.m4
@@ -0,0 +1,9 @@
+## Check for a cross tool, similar to AC_CHECK_TOOL, but do not fall back to
+## the un-prefixed version of PROG-TO-CHECK-FOR.
+dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([RTEMS_CHECK_TOOL],
+[
+  AS_IF([test "x$target_alias" != "x$host_alias"],
+    [rtems_tool_prefix=$target_alias-])
+  AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4)
+])
diff --git a/configure.ac b/configure.ac
index 2d1842e..d1fb7f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,12 +25,16 @@ RTEMS_ENABLE_MULTIPROCESSING
 RTEMS_ENABLE_POSIX
 RTEMS_ENABLE_NETWORKING
 RTEMS_ENABLE_CXX
-RTEMS_ENABLE_TESTS  
+RTEMS_ENABLE_TESTS
 RTEMS_ENABLE_RTEMS_DEBUG
 RTEMS_ENABLE_RTEMSBSP
 RTEMS_ENABLE_PARAVIRT
 RTEMS_ENABLE_DRVMGR
 
+## Check if there are valid tools install and in the path.
+RTEMS_CHECK_TOOL(RTEMS_CC,gcc)
+test -z "$RTEMS_CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+
 ## NOTES:
 ## * tools/build are host-native tools to be installed on the host.
 ## * tools/cpu are host-native or host-cross-target-tools




More information about the vc mailing list