1#! /bin/sh 2# Copyright (C) 2011-2021 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 <https://www.gnu.org/licenses/>. 16 17# Check that errors about AUTOMAKE_OPTIONS refers to correct 18# locations. 19 20. test-init.sh 21 22cat > Makefile.am <<'END' 23# comment \ 24# continued 25include Makefile0.am 26END 27 28cat > Makefile0.am <<'END' 29#1 30#2 31#3 32include Makefile1.am 33END 34 35cat > Makefile1.am <<'END' 36AUTOMAKE_OPTIONS = tar-pax 37# comment 38END 39 40cat > Makefile2.am <<'END' 41## automake comment 42bar: 43 : 44line = \ 45continued 46AUTOMAKE_OPTIONS = tar-ustar 47END 48 49cat > Makefile3.am <<'END' 50quux = a 51AUTOMAKE_OPTIONS = 52quux += b 53AUTOMAKE_OPTIONS += tar-v7 54zardoz = 1 55END 56 57cat >>configure.ac <<'END' 58AC_CONFIG_FILES([Makefile2 Makefile3]) 59END 60 61$ACLOCAL 62# Automake options 'tar-v7', 'tar-ustar' and 'tar-pax' can only be used 63# as argument to AM_INIT_AUTOMAKE, and not in AUTOMAKE_OPTIONS. 64AUTOMAKE_fails 65 66# Check that all the expected line numbers are correctly reported 67# in automake warning/error messages. 68grep '^Makefile1\.am:1:.*tar-pax' stderr 69grep '^Makefile2\.am:6:.*tar-ustar' stderr 70grep '^Makefile3\.am:2:.*tar-v7' stderr 71grep '^Makefile\.am:3:.*Makefile0\.am.*included from here' stderr 72grep '^Makefile0\.am:4:.*Makefile1\.am.*included from here' stderr 73 74# And also check that no botched line number is reported. 75cat stderr \ 76 | grep -v '^Makefile\.am:3:' \ 77 | grep -v '^Makefile0\.am:4:' \ 78 | grep -v '^Makefile1\.am:1:' \ 79 | grep -v '^Makefile2\.am:6:' \ 80 | grep -v '^Makefile3\.am:2:' \ 81 | grep . && exit 1 82 83: 84