2 # Copyright (C) 2011 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 # Files specified by AC_REQUIRE_AUX_FILE must exist, and they get
18 # automatically distributed by the top-level Makefile.am.
19 # Automake bug#9651 reported that this didn't happen when the build-aux
20 # directory was set to `.' by AC_CONFIG_AUX_DIR.
22 am_create_testdir=empty
28 for auxdir in build-aux ''; do
30 echo "*** Testing with auxdir '$auxdir' ***"
36 unindent > configure.in <<END
38 AC_CONFIG_AUX_DIR([${auxdir:-.}])
40 AC_REQUIRE_AUX_FILE([foo.txt])
41 AC_REQUIRE_AUX_FILE([bar.sh])
42 AC_REQUIRE_AUX_FILE([zardoz])
43 AC_CONFIG_FILES([Makefile subdir/Makefile])
47 echo auxdir = ${auxdir:+"$auxdir/"} > Makefile.am
48 unindent >> Makefile.am <<'END'
51 ls -l $(distdir) $(distdir)/* ;: For debugging.
52 @echo DIST_COMMON = $(DIST_COMMON) ;: Likewise.
53 echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)foo.txt '
54 echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)bar.sh '
55 echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)zardoz '
56 test -f $(distdir)/$(auxdir)foo.txt
57 test -f $(distdir)/$(auxdir)bar.sh
58 test -f $(distdir)/$(auxdir)zardoz
64 : > subdir/Makefile.am
66 test -z "$auxdir" || mkdir "$auxdir" || Exit 99
68 if test -z "$auxdir"; then
79 grep "^configure\\.in:4:.* required file.*$auxdir_rx/foo\\.txt" stderr
80 grep "^configure\\.in:5:.* required file.*$auxdir_rx/bar\\.sh" stderr
81 grep "^configure\\.in:6:.* required file.*$auxdir_rx/zardoz" stderr
83 touch $auxdir/foo.txt $auxdir/bar.sh $auxdir/zardoz
84 cp "$testsrcdir"/../lib/missing "$testsrcdir"/../lib/install-sh $auxdir
88 $EGREP '(foo\.txt|bar\.sh|zardoz)' subdir/Makefile.in && Exit 1