* m4/init.m4 (AM_INIT_AUTOMAKE): Don't rely on variable
[platform/upstream/automake.git] / m4 / missing.m4
1 ## --------------------------------------------------------- ##
2 ## Fake the existence of programs that GNU maintainers use.  ##
3 ## --------------------------------------------------------- ##
4 # AM_MISSING_PROG(NAME, PROGRAM)
5 AC_DEFUN([AM_MISSING_PROG], [
6 AC_REQUIRE([AM_MISSING_HAS_RUN])
7 $1=${$1-"${am_missing_run}$2"}
8 AC_SUBST($1)])
9
10 # Like AM_MISSING_PROG, but only looks for install-sh.
11 # AM_MISSING_INSTALL_SH()
12 AC_DEFUN([AM_MISSING_INSTALL_SH], [
13 AC_REQUIRE([AM_MISSING_HAS_RUN])
14 if test -z "$install_sh"; then
15    install_sh="$ac_aux_dir/install-sh"
16    test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
17    test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
18    dnl FIXME: an evil hack: we remove the SHELL invocation from
19    dnl install_sh because automake adds it back in.  Sigh.
20    install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
21 fi
22 AC_SUBST(install_sh)])
23
24 # AM_MISSING_HAS_RUN.
25 # Define MISSING if not defined so far and test if it supports --run.
26 # If it does, set am_missing_run to use it, otherwise, to nothing.
27 AC_DEFUN([AM_MISSING_HAS_RUN], [
28 test x"${MISSING+set}" = xset || \
29   MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
30 # Use eval to expand $SHELL
31 if eval "$MISSING --run :"; then
32   am_missing_run="$MISSING --run "
33 else
34   am_missing_run=
35   am_backtick='`'
36   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
37 fi
38 ])