2 # Copyright (C) 2011-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)
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 # Check precedence rules for ACLOCAL_PATH.
19 am_create_testdir
=empty
22 cat > configure.ac
<< 'END'
32 mkdir mdir1 mdir2 mdir3 sysdir extradir
34 cat > mdir
1/foo1.
m4 << 'END'
35 AC_DEFUN
([FOO_MACRO
], [::pass-foo
::])
38 cat > mdir
2/foo2.
m4 << 'END'
39 AC_DEFUN
([FOO_MACRO
], [::fail-foo
::])
42 cat > mdir
1/baz.
m4 << 'END'
43 AC_DEFUN
([BAR_MACRO
], [::fail-bar
::])
46 cat > mdir
3/bar.
m4 << 'END'
47 AC_DEFUN
([BAR_MACRO
], [::pass-bar
::])
50 cat > mdir
2/quux.
m4 << 'END'
51 AC_DEFUN
([AM_INIT_AUTOMAKE
], [::fail-init
::])
52 AC_DEFUN
([AC_PROG_LIBTOOL
], [::pass-libtool
::])
53 AC_DEFUN
([AM_GNU_GETTEXT
], [::pass-gettext
::])
56 cat > sysdir
/libtool.
m4 << 'END'
57 AC_DEFUN
([AC_PROG_LIBTOOL
], [::fail-libtool
::])
60 cat > extradir
/gettext.
m4 << 'END'
61 AC_DEFUN
([AM_GNU_GETTEXT
], [::fail-gettext
::])
64 echo .
/extradir
> sysdir
/dirlist
66 ACLOCAL_PATH
=mdir1
:mdir2
$ACLOCAL -I mdir3
--system-acdir sysdir
69 $FGREP '::' configure
# For debugging.
71 # Directories coming first in ACLOCAL_PATH should take precedence
72 # over those coming later.
73 $FGREP '::pass-foo::' configure
75 # Directories from '-I' options should take precedence over directories
77 $FGREP '::pass-bar::' configure
79 # Directories in ACLOCAL_PATH should take precedence over system acdir
80 # (typically '${prefix}/share/aclocal'), and any directory added through
81 # the 'dirlist' special file.
82 $FGREP '::pass-gettext::' configure
83 $FGREP '::pass-libtool::' configure
85 # Directories in ACLOCAL_PATH shouldn't take precedence over the internal
86 # automake acdir (typically '${prefix}/share/aclocal-${APIVERSION}').
87 $FGREP 'am__api_version' configure
89 # A final sanity check.
90 $FGREP '::fail' configure
&& exit 1
92 # Same checks, but now with the command line option.
93 ACLOCAL_PATH
=mdir2
:mdir1
$ACLOCAL -I mdir3
--system-acdir sysdir
--aclocal-path "mdir1:mdir2"
94 $ACLOCAL -I mdir3
--system-acdir sysdir
--aclocal-path "mdir1:mdir2"
97 $FGREP '::' configure
# For debugging.
99 # Directories coming first in ACLOCAL_PATH should take precedence
100 # over those coming later.
101 $FGREP '::pass-foo::' configure
103 # Directories from '-I' options should take precedence over directories
105 $FGREP '::pass-bar::' configure
107 # Directories in ACLOCAL_PATH should take precedence over system acdir
108 # (typically '${prefix}/share/aclocal'), and any directory added through
109 # the 'dirlist' special file.
110 $FGREP '::pass-gettext::' configure
111 $FGREP '::pass-libtool::' configure
113 # Directories in ACLOCAL_PATH shouldn't take precedence over the internal
114 # automake acdir (typically '${prefix}/share/aclocal-${APIVERSION}').
115 $FGREP 'am__api_version' configure
117 # A final sanity check.
118 $FGREP '::fail' configure
&& exit 1