maint: Update HACKING
[automake.git] / t / aclocal-path-install.sh
blob3ff7d4196eddd2a78d31830389fc135891df2033
1 #! /bin/sh
2 # Copyright (C) 2011-2017 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 # ACLOCAL_PATH and '--install' interactions.
19 am_create_testdir=empty
20 . test-init.sh
22 cat > configure.ac << 'END'
23 AC_INIT
24 AM_FOO
25 END
27 mkdir acdir pdir ldir
29 ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/acdir"
30 ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
32 cat > acdir/foo.m4 << 'END'
33 AC_DEFUN([AM_FOO], [:])
34 END
36 cat > pdir/bar.m4 << 'END'
37 AC_DEFUN([AM_BAR], [:])
38 END
40 # The '--install' option should never cause anything to be installed
41 # in a directory specified in ACLOCAL_PATH.
42 $ACLOCAL --install 2>stderr && { cat stderr >&2; exit 1; }
43 cat stderr >&2
44 grep 'impossible without -I .* nor AC_CONFIG_MACRO_DIR' stderr
45 test ! -e pdir/foo.m4
47 # The '--install' option should cause a required macro found in a
48 # directory specified in ACLOCAL_PATH to be installed locally.
49 echo AM_BAR >> configure.ac
50 $ACLOCAL --install -I ldir
51 diff pdir/bar.m4 ldir/bar.m4