2 # Copyright (C) 2013 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check that $(am__make_keepgoing) works as expected.
23 mkdir kool # Also used later.
24 if echo nil: | $MAKE -I kool -f -; then
25 make_supports_option_I () { return 0; }
27 make_supports_option_I () { return 1; }
30 echo AC_OUTPUT >> configure.ac
32 cat > Makefile.am <<'END'
34 @echo 'Default target $@ should not be called'>&2; exit 1;
36 @echo ":: $$MAKEFLAGS ::" ;: For debugging.
39 @echo ":: $$MAKEFLAGS ::" ;: For debugging.
40 $(am__make_keepgoing) && exit 1; exit 0
45 r=ok msg= mode= condition=: directive= reason= skip_reason=
48 *) fatal_ "check_run: invalid usage";;
51 while test $# -gt 0; do
53 -C) condition=$2 skip_reason=$3; shift; shift;;
61 msg=${mode}${msg:+" [$msg]"}
63 $MAKE "$mode" ${1+"$@"} || r='not ok'
65 directive=SKIP reason=$skip_reason
67 result_ "$r" -D "$directive" -r "$reason" "$msg"
68 unset r msg mode condition directive reason skip_reason
71 # ----------------------------------------------------------------------
73 $ACLOCAL || fatal_ "aclocal failed"
74 $AUTOCONF || fatal_ "autoconf failed"
75 $AUTOMAKE || fatal_ "automake failed"
76 ./configure || fatal_ "configure failed"
78 # ----------------------------------------------------------------------
82 # Test against a possible regressions similar to those that affected
83 # detection of dry mode ("make -n").
84 check_make k-n TESTS="k.test k2.test"
85 check_make k-n TESTS="k1 k k2" AM_MAKEFLAGS="TESTS='k1 k2'"
86 check_make k-n TESTS="k1 k k2" AM_MAKEFLAGS='TESTS="k1 k k2"'
87 check_make k-n FOOFLAGS="-k -k -nkf2 k -ks --keep -k"
88 check_make k-n MYFLAGS="-k --keepgoing -k --keep-run -k"
90 # ----------------------------------------------------------------------
93 check_make k-y -C using_gmake "\$MAKE is not GNU make" --keep-going
95 # ----------------------------------------------------------------------
97 # Related to automake bug#12554: the "k" in "kool" used to confound
98 # am__make_keepgoing into thinking the '-k' option had been passed.
102 check_make k-n -C make_supports_option_I "-I make option unsupported" \
105 check_make k-n -C using_gmake "\$MAKE is not GNU make" \
106 -M "$pr" -I kool --include keep-going
108 check_make k-y -C make_supports_option_I "-I make option unsupported" \
111 check_make k-y -C using_gmake "\$MAKE is not GNU make" \
112 -M "$pr" --keep-going -I kool --include keep-going
114 # ----------------------------------------------------------------------
116 # Test for when shell metacharacters or backslashes are in $(MAKEFLAGS).
120 check_make k-n -M "metachars" "$@"
123 check_metachars MYFLAGS="-k \"k\" '-k' --keep-going -k"
124 check_metachars MYFLAGS='-knf2\ k\ \\k'
125 check_metachars MYFLAGS="(&) | ; \" \` '"
126 check_metachars MYFLAGS=" ' # ' "
127 check_metachars MYFLAGS='$(foo)'
128 check_metachars MYFLAGS='$(foo -k)'
129 check_metachars MYFLAGS='`touch bad`'
130 check_metachars MYFLAGS='`touch --keep-going bad`'
132 # ----------------------------------------------------------------------