2 # Copyright (C) 2008-2012 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 # Build either as CONFIG_FILE or as PROGRAM.
24 cat >>configure.
in <<'END'
26 AM_CONDITIONAL([COND], [test "$COND" = true])
27 AM_COND_IF([COND], [],
28 [AC_CONFIG_FILES([prog1], [chmod 755 prog1])
29 AC_CONFIG_FILES([sub/prog2], [chmod 755 sub/prog2])])
30 AC_CONFIG_FILES([sub/Makefile])
34 cat >Makefile.am
<<'END'
38 prog1_SOURCES = prog.c
45 test -f prog1 || test -f prog1$(EXEEXT)
46 test -f sub/prog2 || test -f sub/prog2$(EXEEXT)
49 test ! -f prog1 && test ! -f prog1$(EXEEXT)
50 test ! -f sub/prog2 && test ! -f sub/prog2$(EXEEXT)
53 cat >sub
/Makefile.am
<<'END'
56 prog2_SOURCES = prog.c
64 int main () { return 42; }
70 echo "hi, this is $0, and bindir is $bindir"
74 cp prog1.
in sub
/prog2.
in
78 $AUTOMAKE --add-missing
81 $MAKE 2>stderr ||
{ cat stderr
>&2; Exit
1; }
83 grep 'overriding commands' stderr
&& Exit
1
95 .
/configure COND
=false
96 $MAKE 2>stderr ||
{ cat stderr
>&2; Exit
1; }
98 grep 'overriding commands' stderr
&& Exit
1