tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / dist-vs-built-sources.sh
blobcce726aa667415d67c40fd7a175d66d22eb7777a
1 #! /bin/sh
2 # Copyright (C) 2017-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)
7 # any later version.
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 that "make dist" no longer fails when a distributed file
18 # depends on a file from the list of BUILT_SOURCES.
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AC_OUTPUT
25 END
27 cat > Makefile.am << 'END'
28 BUILT_SOURCES = h.h
29 h.h:
30 rm -f $@ $@-t
31 printf '%s\n' '#define F "F"' > $@-t
32 mv -f $@-t $@
33 CLEANFILES = h.h
35 EXTRA_DIST = gen
36 gen: foo
37 ./foo > $@-t && mv $@-t $@
39 bin_PROGRAMS = foo
40 foo_SOURCES = foo.c
41 END
43 cat > foo.c << 'END'
44 #include "h.h"
45 int main (void) { printf ("%s\n", F); return 0; }
46 END
47 chmod a-w foo.c
49 $ACLOCAL
50 $AUTOCONF
51 $AUTOMAKE
53 ./configure
54 $MAKE dist