automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variable


From: Ralf Wildenhues
Subject: Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variables.
Date: Sat, 18 Dec 2010 07:47:57 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

Hello Stefano,

* Stefano Lattarini wrote on Thu, Dec 09, 2010 at 01:46:48PM CET:
> Test `$(var:suf=rpl)' expansion in special automake variables.
> 
> * tests/posixsubst-data.test: New test.
[...]
> * tests/posixsubst-scripts.test: Likewise.

> --- /dev/null
> +++ b/tests/posixsubst-scripts.test
> @@ -0,0 +1,89 @@

> +# Test that POSIX variable expansion `$(var:str=rpl)' works when used
> +# with the SCRIPTS primary.

> +cat >> configure.in << 'END'
> +AC_OUTPUT
> +END
> +
> +cat > Makefile.am << 'END'
> +t1 = foo1 foo2
> +t2 = bar1x bar2
> +t3 = quu-baz
> +
> +bar1 bar2 quux.pl:
> +     : > $@
> +CLEANFILES = bar1 bar2 quux.pl
> +
> +# Try also with `:=', to ensure the parser is not unduly confused
> +# into thinking that it's an unportable assignement operator.

This comment is bogus, right?  There is no such thing as ':=' within
$(var:A=B), and the code below does not use := to assign variables.
What do you mean with this text?  "Also try an empty match suffix."?
(Repetitious as it is, it the same text is in all the other tests of
this patch as well.)

> +dist_sbin_SCRIPTS = $(t1:=.sh)
> +libexec_SCRIPTS = $(t2:x=)
> +nodist_bin_SCRIPTS = $(t3:-baz=x.pl)
> +
> +check-local: test1 test2
> +.PHONY: test1 test2
> +test1:
> +     ls -l
> +     test -f bar1
> +     test -f bar2
> +     test -f quux.pl
> +test2: distdir
> +     ls -l $(distdir)
> +     ## the scripts foo1.sh and foo2.sh should be distributed
> +     test -f $(distdir)/foo1.sh
> +     test -f $(distdir)/foo2.sh
> +     ## the scripts bar1, bar2 and quux.pl shouldn't be distributed
> +     test ! -r $(distdir)/bar1
> +     test ! -r $(distdir)/bar2
> +     test ! -r $(distdir)/quux.pl
> +
> +installcheck-local:
> +     ls -l $(prefix)/libexec $(prefix)/bin $(prefix)/sbin
> +     test -f $(prefix)/sbin/foo1.sh
> +     test -x $(prefix)/sbin/foo1.sh
> +     test -f $(prefix)/sbin/foo2.sh
> +     test -x $(prefix)/sbin/foo2.sh
> +     test -f $(prefix)/libexec/bar1
> +     test -x $(prefix)/libexec/bar1
> +     test -f $(prefix)/libexec/bar2
> +     test -x $(prefix)/libexec/bar2
> +     test -f $(prefix)/bin/quux.pl
> +     test -x $(prefix)/bin/quux.pl

These 'test -x' commands fail on MinGW/MSYS because the file system does
not actually have execute permission information.  Instead, it is
emulated by looking at the file, and returning 0 if the file starts
with, e.g., a COFF header or with '#!'.
(The same heuristic is used when executing a script as well.)

You can thus fix this by either creating actual scripts in above rules
and the file creation below, or by removing the tests here.  I'm not
sure which you prefer.

Thanks,
Ralf

> +END
> +
> +: > foo1.sh
> +: > foo2.sh
> +
> +$ACLOCAL
> +$AUTOCONF
> +$AUTOMAKE
> +
> +cwd=`pwd` || Exit 1
> +./configure --prefix="$cwd/_inst"
> +$MAKE
> +$MAKE test1 test2
> +$MAKE install
> +$MAKE installcheck
> +$MAKE distcheck




reply via email to

[Prev in Thread] Current Thread [Next in Thread]