tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / exeext.sh
blob125764f1b768b6b4f209d5adf86151a47648d407
1 #! /bin/sh
2 # Copyright (C) 2001-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 # Test to make sure '.' in an exe name doesn't fool us.
18 # Report from Robert Collins.
19 # Also make sure we rewrite conditionals variables.
20 # Also check for PR/352.
21 # Also make sure the old definitions of bin_PROGRAMS and friend
22 # aren't left around. Report from Jim Meyering.
24 required=cc
25 . test-init.sh
27 cat >> configure.ac << 'END'
28 AC_PROG_CC
29 AM_CONDITIONAL([WANT_MT], [test -z "$revert"])
30 AM_CONDITIONAL([WANT_RMT], [test -z "$revert"])
31 AC_OUTPUT
32 END
34 cat > Makefile.am << 'END'
35 bin_PROGRAMS = maude
36 sbin_PROGRAMS = maude.static
37 ## We don't define this one for now. Probably it is an error.
38 ## noinst_PROGRAMS = maude2.exe
39 check_PROGRAMS = maude3$(EXEEXT)
41 if WANT_MT
42 bin_PROGRAMS += mt
43 endif
44 if WANT_RMT
45 libexec_PROGRAMS = rmt
46 endif
48 test-default:
49 is $(bin_PROGRAMS) == maude$(EXEEXT) mt$(EXEEXT)
50 is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
51 is $(check_PROGRAMS) == maude3$(EXEEXT)
52 is $(libexec_PROGRAMS) == rmt$(EXEEXT)
54 test-revert:
55 is $(bin_PROGRAMS) == maude$(EXEEXT)
56 is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
57 is $(check_PROGRAMS) == maude3$(EXEEXT)
58 is $(libexec_PROGRAMS) ==
59 END
61 $ACLOCAL
62 $AUTOCONF
63 $AUTOMAKE
65 grep '^maude$(EXEEXT):' Makefile.in
66 grep '^maude\.static$(EXEEXT):' Makefile.in
67 grep '^maude3$(EXEEXT):' Makefile.in
68 grep '^mt$(EXEEXT):' Makefile.in
69 grep '^rmt$(EXEEXT):' Makefile.in
70 test $(grep -c '^bin_PROGRAMS =' Makefile.in) -eq 1
72 # Make sure $(EXEEXT) gets stripped before canonicalization.
73 grep 'maude3__EXEEXT__OBJECTS' Makefile.in && exit 1
75 ./configure
76 run_make test-default
77 run_make test-default EXEEXT=.foo
79 ./configure revert=yes
80 run_make test-revert
81 run_make test-revert EXEEXT=.foo