source: trunk/essentials/sys-devel/automake-1.10/tests/exeext4.test

Last change on this file was 3147, checked in by bird, 18 years ago

automake 1.10

File size: 2.3 KB
Line 
1#! /bin/sh
2# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
6# GNU Automake is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# GNU Automake is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Automake; see the file COPYING. If not, write to
18# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19# Boston, MA 02110-1301, USA.
20
21# Make sure $(EXEEXT) is appended to programs and to tests that are
22# programs, but not to @substitutions@.
23
24. ./defs || exit 1
25
26set -e
27
28cat >> configure.in << 'END'
29AM_CONDITIONAL([COND], [test -n "$cond"])
30AC_SUBST([programs], ['prg1$(EXEEXT) prg2$(EXEEXT)'])
31AC_PROG_CC
32AC_OUTPUT
33END
34
35cat > Makefile.am << 'END'
36EXEEXT = .bin
37if COND
38 BAR = bar
39 DEP = bar
40 BAZE = baz$(EXEEXT)
41 BAZ = baz $(DEP)
42endif
43bin_PROGRAMS = $(programs) @programs@ prg3 $(BAR) $(BAZE)
44EXTRA_PROGRAMS = prg1 prg2 prg3
45TESTS = prg1 prg3 prg4 $(BAZ)
46
47print-bin:
48 echo BEG: $(bin_PROGRAMS) :END
49print-extra:
50 echo BEG: $(EXTRA_PROGRAMS) :END
51print-tests:
52 echo BEG: $(TESTS) :END
53print-barbaz:
54 echo BEG: $(BAR) $(BAZ) :END
55END
56
57$ACLOCAL
58$AUTOCONF
59$AUTOMAKE
60./configure
61$MAKE print-bin > output
62cat output
63grep 'prg1.bin prg2.bin prg1.bin prg2.bin prg3.bin' output
64$MAKE print-extra > output
65cat output
66grep 'prg1.bin prg2.bin prg3.bin' output
67$MAKE print-tests > output
68cat output
69grep 'prg1.bin prg3.bin prg4' output
70
71./configure cond=yes
72$MAKE print-bin > output
73cat output
74grep 'prg1.bin prg2.bin prg1.bin prg2.bin prg3.bin bar.bin baz.bin' output
75$MAKE print-tests > output
76cat output
77grep 'prg1.bin prg3.bin prg4 baz.bin bar.bin' output
78$MAKE print-barbaz > output
79cat output
80grep 'bar baz bar' output
81
82# Only two am__EXEEXT_* variables are needed here: one for BAR, and one
83# BAZ. The latter must use the former.
84test 2 = `grep '__EXEEXT_. =' Makefile.in | wc -l`
85grep 'am__EXEEXT_2 = .*am__EXEEXT_1' Makefile.in
Note: See TracBrowser for help on using the repository browser.