2 # Copyright (C) 2010-2012 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 <http://www.gnu.org/licenses/>.
17 # Test that POSIX variable expansion '$(var:str=rpl)' works when used
18 # with the SCRIPTS primary.
22 cat >> configure.ac << 'END'
26 # We have to be careful with 'test -x' commands on MinGW/MSYS, because
27 # the file system does not actually have execute permission information.
28 # Instead, that is emulated by looking at the file content, and returning
29 # 0 if the file starts with, e.g., a COFF header or with '#!'.
30 # So we need to create actual scripts in the make rules and in the file
33 cat > Makefile.am << 'END'
39 (echo '#!/bin/sh' && echo 'exit 0') > $@
41 (echo '#!/bin/perl' && echo '1;') > $@
42 CLEANFILES = bar1 bar2 quux.pl
44 # Also try an empty match suffix, to ensure that the ':=' in there is
45 # not confused by the parser with an unportable assignment operator.
46 dist_sbin_SCRIPTS = $(t1:=.sh)
47 libexec_SCRIPTS = $(t2:x=)
48 nodist_bin_SCRIPTS = $(t3:-baz=x.pl)
50 check-local: test1 test2
59 ## The scripts foo1.sh and foo2.sh should be distributed.
60 test -f $(distdir)/foo1.sh
61 test -f $(distdir)/foo2.sh
62 ## The scripts bar1, bar2 and quux.pl shouldn't be distributed.
63 test ! -r $(distdir)/bar1
64 test ! -r $(distdir)/bar2
65 test ! -r $(distdir)/quux.pl
68 ls -l $(prefix)/libexec $(prefix)/bin $(prefix)/sbin
69 test -f $(prefix)/sbin/foo1.sh
70 test -x $(prefix)/sbin/foo1.sh
71 test -f $(prefix)/sbin/foo2.sh
72 test -x $(prefix)/sbin/foo2.sh
73 test -f $(prefix)/libexec/bar1
74 test -x $(prefix)/libexec/bar1
75 test -f $(prefix)/libexec/bar2
76 test -x $(prefix)/libexec/bar2
77 test -f $(prefix)/bin/quux.pl
78 test -x $(prefix)/bin/quux.pl
92 ./configure --prefix="$cwd/_inst"