2 # Copyright (C) 2011-2018 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 <https://www.gnu.org/licenses/>.
17 # It should be legitimate for many subdir Makefiles to require the
18 # same config-aux files.
20 am_create_testdir
=empty
25 ocwd
=$
(pwd) || fatal_
"cannot get current working directory"
27 # Usage: do_check [--add-missing] [CONFIG-AUXDIR-PATH=.]
31 -a|
--add-missing) add_missing
=yes; shift;;
41 unindent
> configure.ac
<< END
42 AC_INIT([$me], [$count])
43 AC_CONFIG_AUX_DIR([$auxdir])
46 # We don't want to require python or emcas in this test, so
48 AM_PATH_PYTHON([2.2], [], [:])
49 EMACS=no; AM_PATH_LISPDIR
50 AC_CONFIG_FILES([Makefile])
53 unindent
> Makefile.stub
<<'END'
58 python_PYTHON = bar.py
72 echo "SUBDIRS =" > Makefile.am
74 suffixes
='0 1 2 3 4 5 6 7 8 9'
76 for x
in $suffixes; do
78 echo "SUBDIRS += sub$x" >> Makefile.am
79 echo "AC_CONFIG_FILES([sub$x/Makefile])" >> configure.ac
80 cp Makefile.stub sub
$x/Makefile.am
81 echo 'int main (void) { return 0; }' > sub
$x/foo.c
82 touch sub
$x/bar.py sub
$x/baz.el
84 echo AC_OUTPUT
>> configure.ac
89 "$am_scriptdir"/install-sh
-d $auxdir \
90 || fatal_
"creating directory '$auxdir' with install-sh"
91 if test $add_missing = yes; then
93 for f
in $required_files; do
95 # To ensure that if a auxiliary file is required and distributed
96 # by many Makefiles, the "dist" rule won't try to copy it multiple
97 # times in $(distdir).
101 for f
in $required_files; do
102 cp "$am_scriptdir"/$f $auxdir/$f \
103 || fatal_
"faild to fetch auxiliary script '$f'"
104 # See comments above.
110 for vpath
in : false
; do
120 find $distdir # For debugging.
121 for f
in $required_files; do
122 test -f $distdir/$auxdir/$f
127 cd "$ocwd" || fatal_
"cannot chdir back to '$ocwd'"
131 do_check
--add-missing .
133 do_check
--add-missing build-aux
135 do_check
--add-missing a
/b
/c