2 # Copyright (C) 2010-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 # Test remake rules in deeply nested subdirectories, and with a lot
18 # of files. This is basically a mild stress test, ensuring that rebuild
19 # rules don't break in obvious ways in a slightly "heavier than usual"
24 ocwd=$(pwd) || fatal_ "getting current working directory"
26 magic1=::MagicStringOne::
27 magic2=__MagicStringTwo__
29 echo "AC_SUBST([FOO], [$magic1])" >> configure.ac
32 echo "AC_CONFIG_FILES([bar])" >> configure.ac
33 d=; unset d # Avoid unduly interferences from the environment.
34 for i in 0 1 2 3 4 5 6 7 8 9; do
36 echo "SUBDIRS = sub$i" > Makefile.am
37 echo "AC_CONFIG_FILES([$d/Makefile])" >> "$ocwd"/configure.ac
38 echo "AC_CONFIG_FILES([$d/bar])" >> "$ocwd"/configure.ac
41 echo "$d: @FOO@" > bar.in
43 echo AC_OUTPUT >> "$ocwd"/configure.ac
47 bottom=$(pwd) || fatal_ "getting current working directory"
51 makefiles_am_list=`find . -name Makefile.am | LC_ALL=C sort`
52 makefiles_list=`echo "$makefiles_am_list" | sed 's/\.am$//'`
53 bar_in_list=`find . -name bar.in | LC_ALL=C sort`
54 bar_list=`echo "$bar_in_list" | sed 's/\.in$//'`
56 cat configure.ac # For debugging.
64 for f in configure config.status $makefiles_list $bar_list; do
69 sed "s/$magic1/$magic2/" configure.ac >configure.tmp
70 mv -f configure.tmp configure.ac
76 for f in configure config.status $makefiles_list $bar_list; do
79 $FGREP "$magic1" configure config.status $makefiles_list $bar_list && Exit 1