Revert Automake license to GPLv2+.
[platform/upstream/automake.git] / tests / mmode.test
1 #! /bin/sh
2 # Copyright (C) 2008  Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Check for AM_MAINTAINER_MODE defaults.
18
19 . ./defs || Exit 1
20
21 set -e
22
23 cat >> configure.in << 'END'
24 AM_MAINTAINER_MODE
25 AC_OUTPUT
26 END
27
28 : >Makefile.am
29
30 $ACLOCAL
31 $AUTOCONF
32 $AUTOMAKE -a
33
34 ./configure --help | grep 'enable-maintainer-mode.*enable make rules'
35 ./configure
36 grep '^MAINT.*#' Makefile
37
38 ./configure --disable-maintainer-mode
39 grep '^MAINT.*#' Makefile
40
41 ./configure --enable-maintainer-mode
42 grep '^MAINT.*#' Makefile && Exit 1
43
44 sed 's/\(AM_MAINTAINER_MODE\).*/\1([disable])/' configure.in > configure.int
45 mv -f configure.int configure.in
46 mv configure configure1
47 $AUTOCONF --force
48 diff configure configure1
49
50 sed 's/\(AM_MAINTAINER_MODE\).*/\1([enable])/' configure.in > configure.int
51 mv -f configure.int configure.in
52 $AUTOCONF --force
53
54 ./configure --help | grep 'disable-maintainer-mode.*disable make rules'
55 ./configure
56 grep '^MAINT.*#' Makefile && Exit 1
57
58 ./configure --enable-maintainer-mode
59 grep '^MAINT.*#' Makefile && Exit 1
60
61 ./configure --disable-maintainer-mode
62 grep '^MAINT.*#' Makefile
63
64 sed 's/\(AM_MAINTAINER_MODE\).*/\1([foo])/' configure.in > configure.int
65 mv -f configure.int configure.in
66 $AUTOCONF --force -Werror && Exit 1
67 :