1 ## --------------------------------------------------------- ##
2 ## Fake the existence of programs that GNU maintainers use. ##
3 ## --------------------------------------------------------- ##
7 # AM_MISSING_PROG(NAME, PROGRAM)
8 # ------------------------------
9 AC_DEFUN([AM_MISSING_PROG],
10 [AC_REQUIRE([AM_MISSING_HAS_RUN])
11 $1=${$1-"${am_missing_run}$2"}
15 # AM_MISSING_INSTALL_SH
16 # ---------------------
17 # Like AM_MISSING_PROG, but only looks for install-sh.
18 AC_DEFUN([AM_MISSING_INSTALL_SH],
19 [AC_REQUIRE([AM_MISSING_HAS_RUN])
20 if test -z "$install_sh"; then
21 for install_sh in "$ac_aux_dir/install-sh" \
22 "$ac_aux_dir/install.sh" \
23 "${am_missing_run}${ac_auxdir}/install-sh";
25 test -f "$install_sh" && break
27 # FIXME: an evil hack: we remove the SHELL invocation from
28 # install_sh because automake adds it back in. Sigh.
29 install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
31 AC_SUBST(install_sh)])
36 # Define MISSING if not defined so far and test if it supports --run.
37 # If it does, set am_missing_run to use it, otherwise, to nothing.
38 AC_DEFUN([AM_MISSING_HAS_RUN],
39 [test x"${MISSING+set}" = xset ||
40 MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
41 # Use eval to expand $SHELL
42 if eval "$MISSING --run true"; then
43 am_missing_run="$MISSING --run "
47 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
53 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
54 # $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
55 # Of course, Automake must honor this variable whenever it call a tool
56 # from the auxiliary directory. The problem is that $srcdir (hence
57 # $ac_aux_dir) can be either an absolute path or a path relative to
58 # $top_srcdir or absolute, this depends on how configure is run. This
59 # is pretty anoying since it makes $ac_aux_dir quite unusable in
60 # subdirectories: on the top source directory, any form will work
61 # fine, but in subdirectories relative pat needs to be adapted.
62 # - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
63 # relative, but fail if $srcdir is absolute
64 # - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
65 # absolute, and success on relative paths.
67 # Consequently, we define and use $am_aux_dir, the "always absolute"
68 # version of $ac_aux_dir.
70 AC_DEFUN([AM_AUX_DIR_EXPAND], [
71 # expand $ac_aux_dir to an absolute path
72 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`