summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog6
-rw-r--r--config/acx.m431
2 files changed, 36 insertions, 1 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 800698cf2b8..af6d9ac258d 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-05 Paolo Bonzini <bonzini@gnu.org>
+
+ * acx.m4 (GCC_TARGET_TOOL): New.
+
2005-09-23 Tom Tromey <tromey@redhat.com>
* enable.m4: New file.
@@ -5,7 +9,7 @@
2005-08-12 Paolo Bonzini <bonzini@gnu.org>
- * config/acx.m4 (NCN_CHECK_TARGET_TOOL, NCN_STRICT_CHECK_TOOL,
+ * acx.m4 (NCN_CHECK_TARGET_TOOL, NCN_STRICT_CHECK_TOOL,
NCN_STRICT_CHECK_TARGET_TOOL): Remove.
(NCN_STRICT_CHECK_TOOLS, NCN_STRICT_CHECK_TARGET_TOOLS): New,
based on the deleted macros.
diff --git a/config/acx.m4 b/config/acx.m4
index 94e3216367b..c71f39b44b8 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -296,3 +296,34 @@ fi
AC_SUBST(LN)dnl
])
+dnl GCC_TARGET_TOOL(PROGRAM, TARGET-VAR, HOST-VAR, IN-TREE-TOOL, LANGUAGE)
+AC_DEFUN([GCC_TARGET_TOOL],
+[AC_MSG_CHECKING(where to find the target $1)
+if test "x${build}" != "x${host}" ; then
+ # Canadian cross, just use what we found
+ AC_MSG_RESULT(pre-installed)
+else
+ ifelse([$4],,,
+ [ok=yes
+ case " ${configdirs} " in
+ *" patsubst([$4], [/.*], []) "*) ;;
+ *) ok=no ;;
+ esac
+ ifelse([$5],,,
+ [case ,${enable_languages}, in
+ *,$5,*) ;;
+ *) ok=no ;;
+ esac])
+ if test $ok = yes; then
+ # An in-tree tool is available and we can use it
+ $2='$$r/$(HOST_SUBDIR)/$4'
+ AC_MSG_RESULT(just compiled)
+ el])if test "x$target" = "x$host"; then
+ # We can use an host tool
+ $2='$($3)'
+ AC_MSG_RESULT(host tool)
+ else
+ # We need a cross tool
+ AC_MSG_RESULT(pre-installed)
+ fi
+fi])