tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / programs-primary-rewritten.sh
blobe0219929d3d40e28f08b400ced6f91a617071822
1 #! /bin/sh
2 # Copyright (C) 2003-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 # Make sure xxx_PROGRAMS gets properly rewritten where needed. These
18 # checks have been introduced in commit 'Release-1-9-254-g9d0eaef' into
19 # the former test 'subst2.test'.
21 . test-init.sh
23 cat >> configure.ac << 'END'
24 AC_SUBST([FOO], [c])
25 AC_OUTPUT
26 END
28 cat >Makefile.am <<'END'
29 AUTOMAKE_OPTIONS = no-dependencies
30 CC = false
31 EXEEXT = .bin
33 check_PROGRAMS = a
34 bin_PROGRAMS = b @FOO@
35 noinst_PROGRAMS = $(bar) $(baz:=de)
36 EXTRA_PROGRAMS =
38 bar = zardoz
39 baz = mau
41 .PHONY: test
42 test:
43 is $(check_PROGRAMS) == a.bin
44 is $(bin_PROGRAMS) == b.bin c
45 is $(noinst_PROGRAMS) == zardoz.bin maude.bin
46 END
48 $ACLOCAL
49 $AUTOMAKE
51 grep PROGRAMS Makefile.in # For debugging.
53 # Check that no useless indirections are used.
54 grep '^check_PROGRAMS = a$(EXEEXT)$' Makefile.in
55 grep '^bin_PROGRAMS = b$(EXEEXT) @FOO@$' Makefile.in
57 $AUTOCONF
58 ./configure
59 $MAKE test