Merge branch 'micro' into maint
[platform/upstream/automake.git] / t / dist-tarZ.sh
1 #! /bin/sh
2 # Copyright (C) 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 support for no-dist-gzip with dist-tarZ.
18
19 . test-init.sh
20
21 # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
22 # and is just a dummy script that is not able to actually compress
23 # (it can only decompress).  So, check that the 'compress' program
24 # is actually able to compress input.
25 # Note that, at least on GNU/Linux, 'compress' does (and is
26 # documented to) exit with status 2 if the output is larger than
27 # the input after (attempted) compression; so we need to pass it
28 # an input that it can actually reduce in size when compressing.
29 for x in 1 2 3 4 5 6 7 8; do
30   echo aaaaaaaaaaaaaaaaaaaaa
31 done | compress -c >/dev/null \
32   || skip_ "cannot find a working 'compress' program"
33
34 errmsg=".*legacy .*'compress' .*deprecated"
35
36 echo AUTOMAKE_OPTIONS = dist-tarZ > Makefile.am
37 $ACLOCAL
38 AUTOMAKE_fails -Wnone -Wobsolete
39 grep "^Makefile\\.am:1:.*$errmsg" stderr
40
41 cat > configure.ac <<END
42 AC_INIT([$me], [1.0])
43 AM_INIT_AUTOMAKE([no-dist-gzip dist-tarZ])
44 AC_CONFIG_FILES([Makefile])
45 AC_OUTPUT
46 END
47 : > Makefile.am
48
49 rm -rf autom4te*.cache
50 $ACLOCAL
51 AUTOMAKE_run -Wno-error
52 grep "^configure\\.ac:2:.*$errmsg" stderr
53
54 $AUTOCONF
55 ./configure
56 $MAKE distcheck
57 test -f dist-tarz-1.0.tar.Z
58
59 :