automake: require ABOUT-NLS only at gnits strictness.
[automake.git] / t / installdir.sh
blob786104b0d368ab7e9721af19a37ad2c159898437
1 #! /bin/sh
2 # Copyright (C) 2001-2024 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 for PR 203.
18 # See also automake bug#11030.
20 # == Original Report for PR/203 ==
21 # Some standard targets are missing '-local' hooks. For instance,
22 # installdirs is missing this. Ideally this would be an automatic
23 # feature of any exported target.
25 . test-init.sh
27 echo AC_OUTPUT >> configure.ac
29 cat > Makefile.am << 'END'
30 foodir = $(datadir)/$(distdir)
31 installdirs-local:
32 $(MKDIR_P) $(DESTDIR)$(foodir)
33 install-data-hook: installdirs-local
34 END
36 $ACLOCAL
37 $AUTOMAKE
39 test $(grep -c installdirs-local Makefile.in) -eq 4
41 cwd=$(pwd) || fatal_ "getting current working directory"
43 $AUTOCONF
44 ./configure --prefix="$cwd/inst"
46 $MAKE installdirs
47 test -d inst/share/$me-1.0
48 rm -rf inst
50 $MAKE install
51 test -d inst/share/$me-1.0
52 rm -rf inst
54 ./configure --prefix=/foo
56 $MAKE installdirs DESTDIR="$cwd/dest"
57 test -d dest/foo/share/$me-1.0
58 rm -rf dest
60 $MAKE install DESTDIR="$cwd/dest"
61 test -d dest/foo/share/$me-1.0
62 rm -rf dest