doc: update Vala documentation
[automake.git] / t / aclocal-remake-misc.sh
blob8f44c44b2c2ff7b2ffe6e2c62f652cfc412d70c9
1 #! /bin/sh
2 # Copyright (C) 2003-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 # Make sure aclocal.m4 is rebuilt whenever a configure
18 # dependency changes. Test for acinclude.m4 and VPATH too.
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 SOME_DEFS
24 AC_CONFIG_FILES([sub/Makefile])
25 AC_CONFIG_MACRO_DIR([m4])
26 AC_OUTPUT
27 END
29 cat > Makefile.am << 'END'
30 SUBDIRS = sub
31 END
33 mkdir sub
34 : > sub/Makefile.am
36 mkdir m4
37 echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
38 echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
40 $ACLOCAL
41 $AUTOCONF
42 $AUTOMAKE --copy --add-missing
44 mkdir build
45 cd build
47 ../configure
48 $MAKE
50 # Modified configure dependencies must be newer than config.status.
51 $sleep
52 # Update an aclocal.m4 dependency, then make sure all Makefiles
53 # are updated, even from a sub-directory.
54 echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
55 # Because aclocal will run again, it should also pick up acinclude.m4.
56 echo 'AC_SUBST([METOO])' > ../acinclude.m4
58 cd sub
59 $MAKE
60 cd ..
61 grep GREPME Makefile
62 grep GREPME sub/Makefile
63 grep GREPME sub/Makefile
64 grep METOO Makefile
65 grep METOO sub/Makefile
66 grep METOO sub/Makefile
68 # Make sure configure dependencies are distributed.
69 $MAKE distdir
70 test -f $me-1.0/m4/moredefs.m4
71 test -f $me-1.0/m4/somedefs.m4
72 test -f $me-1.0/acinclude.m4