Merge branch 'maint'
[platform/upstream/automake.git] / m4 / missing.m4
1 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2
3 # Copyright (C) 1997-2012 Free Software Foundation, Inc.
4 #
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # serial 7
10
11 # AM_MISSING_PROG(NAME, PROGRAM)
12 # ------------------------------
13 AC_DEFUN([AM_MISSING_PROG],
14 [AC_REQUIRE([AM_MISSING_HAS_RUN])
15 $1=${$1-"${am_missing_run}$2"}
16 AC_SUBST($1)])
17
18
19 # AM_MISSING_HAS_RUN
20 # ------------------
21 # Define MISSING if not defined so far and test if it supports --run.
22 # If it does, set am_missing_run to use it, otherwise, to nothing.
23 AC_DEFUN([AM_MISSING_HAS_RUN],
24 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
25 AC_REQUIRE_AUX_FILE([missing])dnl
26 if test x"${MISSING+set}" != xset; then
27   case $am_aux_dir in
28   *\ * | *\     *)
29     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
30   *)
31     MISSING="\${SHELL} $am_aux_dir/missing" ;;
32   esac
33 fi
34 # Use eval to expand $SHELL
35 if eval "$MISSING --run true"; then
36   am_missing_run="$MISSING --run "
37 else
38   am_missing_run=
39   AC_MSG_WARN(['missing' script is too old or missing])
40 fi
41 ])