2005-02-28 Paolo Bonzini <bonzini@gnu.org>
[deliverable/binutils-gdb.git] / config / acx.m4
index b96d688bde34c4373e3779d1022766a94a341dc2..6d3e6d5d5ab337e6f835d30d2d4752bce9ef45a8 100644 (file)
@@ -37,6 +37,30 @@ case ${target_alias} in
 esac
 ]) []dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
 
+dnl ####
+dnl # ACX_NONCANONICAL_BUILD
+dnl # Like underscored version, but AC_SUBST's.
+AC_DEFUN([ACX_NONCANONICAL_BUILD],
+[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
+AC_SUBST(build_noncanonical)
+]) []dnl # ACX_NONCANONICAL_BUILD
+
+dnl ####
+dnl # ACX_NONCANONICAL_HOST
+dnl # Like underscored version, but AC_SUBST's.
+AC_DEFUN([ACX_NONCANONICAL_HOST],
+[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
+AC_SUBST(host_noncanonical)
+]) []dnl # ACX_NONCANONICAL_HOST
+
+dnl ####
+dnl # ACX_NONCANONICAL_TARGET
+dnl # Like underscored version, but AC_SUBST's.
+AC_DEFUN([ACX_NONCANONICAL_TARGET],
+[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl
+AC_SUBST(target_noncanonical)
+]) []dnl # ACX_NONCANONICAL_TARGET
+
 dnl ####
 dnl # GCC_TOPLEV_SUBDIRS
 dnl # GCC & friends build 'build', 'host', and 'target' tools.  These must
@@ -52,8 +76,13 @@ AC_DEFUN([GCC_TOPLEV_SUBDIRS],
 AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
 # Prefix 'build-' so this never conflicts with target_subdir.
 build_subdir="build-${build_noncanonical}"
-# Not really a subdirectory, but here for completeness.
-host_subdir=.
+# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
+if ( test $srcdir = . && test -d gcc ) \
+   || test -d $srcdir/../host-${host_noncanonical}; then
+  host_subdir="host-${host_noncanonical}"
+else
+  host_subdir=.
+fi
 # No prefix.
 target_subdir=${target_noncanonical}
 AC_SUBST([build_subdir]) []dnl
@@ -258,3 +287,27 @@ if test $gcc_cv_c__bool = yes; then
 fi
 ])
 
+dnl See if hard links work and if not, try to substitute $1 or simple copy.
+AC_DEFUN([ACX_PROG_LN],
+[AC_MSG_CHECKING(whether ln works)
+AC_CACHE_VAL(acx_cv_prog_LN,
+[rm -f conftestdata_t
+echo >conftestdata_f
+if ln conftestdata_f conftestdata_t 2>/dev/null
+then
+  acx_cv_prog_LN=ln
+else
+  acx_cv_prog_LN=no
+fi
+rm -f conftestdata_f conftestdata_t
+])dnl
+if test $acx_cv_prog_LN = no; then
+  LN="ifelse([$1],,cp,[$1])"
+  AC_MSG_RESULT([no, using $LN])
+else
+  LN="$acx_cv_prog_LN"
+  AC_MSG_RESULT(yes)
+fi
+AC_SUBST(LN)dnl
+])
+
This page took 0.028582 seconds and 4 git commands to generate.