2 # Copyright (C) 2011-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 # 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
26 for auxdir in build-aux ''; do
28 echo "*** Testing with auxdir '$auxdir' ***"
34 unindent > configure.ac <<END
36 AC_CONFIG_AUX_DIR([${auxdir:-.}])
38 AC_REQUIRE_AUX_FILE([foo.txt])
39 AC_REQUIRE_AUX_FILE([bar.sh])
40 AC_REQUIRE_AUX_FILE([zardoz])
41 AC_CONFIG_FILES([Makefile subdir/Makefile])
45 echo auxdir = ${auxdir:+"$auxdir/"} > Makefile.am
46 unindent >> Makefile.am <<'END'
49 ls -l $(distdir) $(distdir)/* ;: For debugging.
50 @echo DIST_COMMON = $(DIST_COMMON) ;: Likewise.
51 echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)foo.txt '
52 echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)bar.sh '
53 echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)zardoz '
54 test -f $(distdir)/$(auxdir)foo.txt
55 test -f $(distdir)/$(auxdir)bar.sh
56 test -f $(distdir)/$(auxdir)zardoz
62 echo > subdir/Makefile.am # 'echo', not ':', for Solaris /bin/sh.
64 test -z "$auxdir" || mkdir "$auxdir" || Exit 99
66 if test -z "$auxdir"; then
77 grep "^configure\\.ac:4:.* required file.*$auxdir_rx/foo\\.txt" stderr
78 grep "^configure\\.ac:5:.* required file.*$auxdir_rx/bar\\.sh" stderr
79 grep "^configure\\.ac:6:.* required file.*$auxdir_rx/zardoz" stderr
81 touch $auxdir/foo.txt $auxdir/bar.sh $auxdir/zardoz
82 cp "$am_scriptdir"/missing "$am_scriptdir"/install-sh $auxdir \
83 || fatal_ "fetching auxiliary scripts 'missing' and 'install-sh'"
87 $EGREP '(foo\.txt|bar\.sh|zardoz)' subdir/Makefile.in && Exit 1