automake: require ABOUT-NLS only at gnits strictness.
[automake.git] / t / remake-configure-dependencies.sh
blob90639841de069b191a28ec35dc7277d69fa3684e
1 #! /bin/sh
2 # Copyright (C) 2013-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 CONFIGURE_DEPENDENCIES.
19 . test-init.sh
21 cat > configure.ac <<'END'
22 AC_INIT([confdeps], m4_esyscmd([./print-version]))
23 AM_INIT_AUTOMAKE([foreign])
24 AC_CONFIG_FILES([Makefile])
25 AC_OUTPUT
26 END
28 # Needless to say, the autom4te cache happily break this test.
29 cat > .autom4te.cfg <<'END'
30 begin-language: "Autoconf-without-aclocal-m4"
31 args: --no-cache
32 end-language: "Autoconf-without-aclocal-m4"
33 END
35 cat > Makefile.am <<'END'
36 EXTRA_DIST = .autom4te.cfg
37 CONFIGURE_DEPENDENCIES = $(top_srcdir)/print-version
39 test-1:
40 test $(VERSION) = 1.0
41 test-2:
42 test $(VERSION) = 2.1
43 test-3:
44 test $(VERSION) = 3.14
46 .PHONY: test-1 test-2 test-3
48 # Contents of $(CONFIGURE_DEPENDENCIES) are to be automatically
49 # distributed.
50 local-check: test-3 distdir
51 test -f $(distdir)/print-version
52 END
54 (echo '#!/bin/sh' && echo 'printf %s 1.0') > print-version
55 chmod a+x print-version
57 $ACLOCAL
58 $AUTOCONF
59 $AUTOMAKE
61 ./configure
62 $MAKE test-1
64 $sleep
65 (echo '#!/bin/sh' && echo 'printf %s 2.1') > print-version
66 using_gmake || $MAKE Makefile
67 $MAKE test-2
69 $MAKE distclean
70 mkdir build
71 cd build
72 ../configure
73 $MAKE test-2
75 $sleep
76 (echo '#!/bin/sh' && echo 'printf %s 3.14') > ../print-version
77 using_gmake || $MAKE Makefile
78 $MAKE test-3
80 # Check that $(CONFIGURE_DEPENDENCIES) are automatically distributed.
81 $MAKE distcheck