summaryrefslogtreecommitdiff
path: root/m4/missing.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/missing.m4')
-rw-r--r--m4/missing.m438
1 files changed, 25 insertions, 13 deletions
diff --git a/m4/missing.m4 b/m4/missing.m4
index 39178df2..868aa6b6 100644
--- a/m4/missing.m4
+++ b/m4/missing.m4
@@ -1,18 +1,30 @@
## --------------------------------------------------------- ##
## Fake the existence of programs that GNU maintainers use. ##
## --------------------------------------------------------- ##
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN(AM_MISSING_PROG,
-[AC_MSG_CHECKING(for working $2)
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
+
+# serial 2
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
+ am_missing_run=
+ am_backtick='`'
+ AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
fi
-AC_SUBST($1)])
+])