Merge branch 'micro' into maint
[platform/upstream/automake.git] / t / mmode.sh
1 #! /bin/sh
2 # Copyright (C) 2008-2013 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 . test-init.sh
20
21 cat >> configure.ac << 'END'
22 AM_MAINTAINER_MODE
23 AC_OUTPUT
24 END
25
26 : >Makefile.am
27
28 $ACLOCAL
29 $AUTOCONF
30 $AUTOMAKE -a
31
32 ./configure
33 grep '^MAINT.*#' Makefile
34
35 ./configure --disable-maintainer-mode
36 grep '^MAINT.*#' Makefile
37
38 ./configure --enable-maintainer-mode
39 grep '^MAINT.*#' Makefile && exit 1
40
41 sed 's/\(AM_MAINTAINER_MODE\).*/\1([disable])/' configure.ac > configure.tmp
42 mv -f configure.tmp configure.ac
43 mv configure configure1
44 $AUTOCONF --force
45 diff configure configure1
46
47 sed 's/\(AM_MAINTAINER_MODE\).*/\1([enable])/' configure.ac > configure.tmp
48 mv -f configure.tmp configure.ac
49 $AUTOCONF --force
50
51 ./configure
52 grep '^MAINT.*#' Makefile && exit 1
53
54 ./configure --enable-maintainer-mode
55 grep '^MAINT.*#' Makefile && exit 1
56
57 ./configure --disable-maintainer-mode
58 grep '^MAINT.*#' Makefile
59
60 sed 's/\(AM_MAINTAINER_MODE\).*/\1([foo])/' configure.ac > configure.tmp
61 mv -f configure.tmp configure.ac
62 $AUTOCONF --force -Werror && exit 1
63
64 :