Hash :
00c3eb23
Author :
Date :
2008-09-13T09:55:23
install: cope with non-injective $(transform). * lib/am/progs.am (install-%DIR%PROGRAMS): Rewrite rule to not try to use the installed name as key in a hash, so destructive $(transform) scripts still work. * lib/am/scripts.am (install-%DIR%SCRIPTS): Likewise. * tests/transform.test: Fix test to look in right place for installed files. * tests/transform2.test: New test. * tests/Makefile.am: Adjust. Report by Jim Meyering. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
#! /bin/sh
# Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Make sure that --program-transform works even when multiple files are
# collapsed.
. ./defs || Exit 1
set -e
cat >>configure.in <<'END'
AC_PROG_CC
AC_OUTPUT
END
cat >Makefile.am <<'EOF'
bin_PROGRAMS = p1 p2
bin_SCRIPTS = s1.sh s2.sh
man_MANS = m1.1 m2.1
test-install: install
test -f inst/bin/p$(EXEEXT)
test -f inst/bin/s.sh
test -f inst/man/man1/m.1
test-install-foo: install
test -f inst/bin/foo$(EXEEXT)
test -f inst/bin/foo
test -f inst/man/man1/foo.1
test ! -f inst/bin/p1$(EXEEXT)
test ! -f inst/bin/p2$(EXEEXT)
test ! -f inst/bin/s1.sh
test ! -f inst/bin/s2.sh
test ! -f inst/man/man/m1.1
test ! -f inst/man/man/m2.1
EOF
cat >p1.c <<'EOF'
int
main ()
{
return 0;
}
EOF
cp p1.c p2.c
: > s1.sh
: > s2.sh
: > m1.1
: > m2.1
$ACLOCAL
$AUTOCONF
$AUTOMAKE
./configure --program-transform-name='s/[12]//' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
$MAKE
$MAKE test-install
$MAKE uninstall
test `find inst -type f -print | wc -l` = 0
# Also squash all file types in question.
./configure --program-transform-name='s/.*/foo/' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
$MAKE
$MAKE test-install-foo
$MAKE uninstall
test `find inst -type f -print | wc -l` = 0
: