2 # Copyright (C) 2014-2017 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 # Ensure "make distcheck" detects all missing files, without getting
18 # confused by the fact that they exists in the "original" source tree
19 # from which "make distcheck" is run. See automake bug#18286.
23 echo AC_OUTPUT
>> configure.ac
25 cat > Makefile.am
<<'END'
26 $(srcdir)/test_data.am: $(srcdir)/test_data.txt $(srcdir)/gen-testdata.sh
27 cd $(srcdir) && $(SHELL) gen-testdata.sh <test_data.txt >test_data.am
29 include $(srcdir)/test_data.am
32 is $(testdata) == foo bar
35 cat > test_data.txt
<<'END'
41 cat > gen-testdata.sh
<<'END'
43 printf 'testdata = \\\n'
45 echo '$(empty_string)'
47 chmod a
+x gen-testdata.sh
50 .
/gen-testdata.sh
<test_data.txt
>test_data.am
60 # Oops, we failed to distribute some required files!
61 run_make
-e FAIL
-M distcheck
62 $FGREP '../../test_data.txt' output
64 # But if we distribute them, everything will be OK.
65 echo 'EXTRA_DIST = test_data.txt gen-testdata.sh' >> Makefile.am
67 using_gmake ||
$MAKE Makefile