Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Nerode <neroden@gcc.gnu.org>2002-12-28 10:09:49 +0300
committerNathanael Nerode <neroden@gcc.gnu.org>2002-12-28 10:09:49 +0300
commit9ce3107655753d4463c642ef94340c577f862eb9 (patch)
tree6db18722c133c75ac68f654f8834932ff8135a2a /config/acx.m4
parentbafecfd6dd77d724e5c75eac8e865c30e1788e80 (diff)
missed in previous giant commit
Diffstat (limited to 'config/acx.m4')
-rw-r--r--config/acx.m483
1 files changed, 83 insertions, 0 deletions
diff --git a/config/acx.m4 b/config/acx.m4
new file mode 100644
index 000000000..36bc9bec9
--- /dev/null
+++ b/config/acx.m4
@@ -0,0 +1,83 @@
+# Autoconf M4 include file defining utility macros for complex Canadian
+# cross builds.
+
+####
+# _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM
+# or AC_INIT.
+# These demand that AC_CANONICAL_SYSTEM be called beforehand.
+AC_DEFUN([_NCN_TOOL_PREFIXES],
+[ncn_tool_prefix=
+test -n "$host_alias" && ncn_tool_prefix=$host_alias-
+ncn_target_tool_prefix=
+test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
+]) []dnl # _NCN_TOOL_PREFIXES
+
+####
+# NCN_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
+# Like AC_CHECK_TOOL, but tries a prefix of the target, not the host.
+# Code is pretty much lifted from autoconf2.53.
+
+AC_DEFUN([NCN_CHECK_TARGET_TOOL],
+[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
+if test -n "$ncn_target_tool_prefix"; then
+ AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}$2],
+ [${ncn_target_tool_prefix}$2], , [$4])
+fi
+if test -z "$ac_cv_prog_$1" ; then
+ ncn_ct_$1=$$1
+ AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
+ $1=$ncn_ct_$1
+else
+ $1="$ac_cv_prog_$1"
+fi
+]) []dnl # NCN_CHECK_TARGET_TOOL
+
+
+####
+# NCN_STRICT_CHECK_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
+# Like AC_CHECK_TOOL, but requires the prefix if build!=host.
+
+AC_DEFUN([NCN_STRICT_CHECK_TOOL],
+[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
+if test -n "$ncn_tool_prefix"; then
+ AC_CHECK_PROG([$1], [${ncn_tool_prefix}$2],
+ [${ncn_tool_prefix}$2], , [$4])
+fi
+if test -z "$ac_cv_prog_$1" ; then
+ if test $build = $host ; then
+ ncn_ct_$1=$$1
+ AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
+ $1=$ncn_ct_$1
+ else
+ $1="$3"
+ fi
+else
+ $1="$ac_cv_prog_$1"
+fi
+]) []dnl # NCN_STRICT_CHECK_TOOL
+
+
+####
+# NCN_STRICT_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
+# Like NCN_CHECK_TARGET_TOOL, but requires the prefix if build!=target.
+
+AC_DEFUN([NCN_STRICT_CHECK_TARGET_TOOL],
+[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
+if test -n "$ncn_target_tool_prefix"; then
+ AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}$2],
+ [${ncn_target_tool_prefix}$2], , [$4])
+fi
+if test -z "$ac_cv_prog_$1" ; then
+ if test $build = $target ; then
+ ncn_ct_$1=$$1
+ AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
+ $1=$ncn_ct_$1
+ else
+ $1="$3"
+ fi
+else
+ $1="$ac_cv_prog_$1"
+fi
+]) []dnl # NCN_STRICT_CHECK_TARGET_TOOL
+
+