tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / aclocal-I-and-install.sh
blob151085cfeb95a01fbbec1edebf6bc63423cc7b25
1 #! /bin/sh
2 # Copyright (C) 2003-2018 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 # Make sure aclocal define macros in the same order as -I's.
18 # This is the similar to aclocal-I-order-1.sh, with the macro calls
19 # reversed (it did make a difference).
21 # Also check for --install.
23 # TODO: write a sister test that doesn't use a 'dirlist' file, but
24 # TODO: puts third-party macros directly into 'acdir'.
26 am_create_testdir=empty
27 . test-init.sh
29 cat > configure.ac << 'END'
30 AC_INIT
31 MACRO2
32 MACRO1
33 MACRO3
34 END
36 ACLOCAL="$ACLOCAL --system-acdir acdir"
38 mkdir m4_1 m4_2 acdir acdir2
39 echo ./acdir2 > acdir/dirlist
41 cat >m4_1/somedefs.m4 <<EOF
42 AC_DEFUN([MACRO1], [:macro11:])
43 AC_DEFUN([MACRO2], [:macro21:])
44 EOF
46 cat >m4_2/somedefs.m4 <<EOF
47 AC_DEFUN([MACRO1], [:macro12:])
48 EOF
50 cat >acdir2/macro.m4 <<EOF
51 AC_DEFUN([MACRO3], [:macro33:])
52 EOF
54 $ACLOCAL -I m4_1 -I m4_2
55 $AUTOCONF
56 $FGREP ':macro11:' configure
57 $FGREP ':macro21:' configure
58 $FGREP ':macro33:' configure
59 grep MACRO3 aclocal.m4
60 test ! -e m4_1/macro.m4
61 test ! -e m4_2/macro.m4
63 $sleep
65 $ACLOCAL -I m4_2 -I m4_1
66 $AUTOCONF
67 $FGREP ':macro12:' configure
68 $FGREP ':macro21:' configure
69 $FGREP ':macro33:' configure
70 grep MACRO3 aclocal.m4
71 test ! -e m4_1/macro.m4
72 test ! -e m4_2/macro.m4
74 $sleep
76 $ACLOCAL -I m4_1 -I m4_2 --install
77 $AUTOCONF
78 $FGREP ':macro11:' configure
79 $FGREP ':macro21:' configure
80 $FGREP ':macro33:' configure
81 grep MACRO3 aclocal.m4 && exit 1
82 test -f m4_1/macro.m4
83 test ! -e m4_2/macro.m4
84 cp aclocal.m4 copy.m4
86 $sleep
88 echo '#GREPME' >>acdir2/macro.m4
89 $ACLOCAL -I m4_1 -I m4_2 --install
90 $AUTOCONF
91 $FGREP ':macro11:' configure
92 $FGREP ':macro21:' configure
93 $FGREP ':macro33:' configure
94 grep MACRO3 aclocal.m4 && exit 1
95 grep GREPME m4_1/macro.m4 && exit 1
96 test -f m4_1/macro.m4
97 test ! -e m4_2/macro.m4
98 diff aclocal.m4 copy.m4