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)
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.
21 cat > configure.ac
<<'END'
22 AC_INIT([confdeps], m4_esyscmd([./print-version]))
23 AM_INIT_AUTOMAKE([foreign])
24 AC_CONFIG_FILES([Makefile])
28 # Needless to say, the autom4te cache happily break this test.
29 cat > .autom4te.cfg
<<'END'
30 begin-language: "Autoconf-without-aclocal-m4"
32 end-language: "Autoconf-without-aclocal-m4"
35 cat > Makefile.am
<<'END'
36 EXTRA_DIST = .autom4te.cfg
37 CONFIGURE_DEPENDENCIES = $(top_srcdir)/print-version
44 test $(VERSION) = 3.14
46 .PHONY: test-1 test-2 test-3
48 # Contents of $(CONFIGURE_DEPENDENCIES) are to be automatically
50 local-check: test-3 distdir
51 test -f $(distdir)/print-version
54 (echo '#!/bin/sh' && echo 'printf %s 1.0') > print-version
55 chmod a
+x print-version
65 (echo '#!/bin/sh' && echo 'printf %s 2.1') > print-version
66 using_gmake ||
$MAKE Makefile
76 (echo '#!/bin/sh' && echo 'printf %s 3.14') > ..
/print-version
77 using_gmake ||
$MAKE Makefile
80 # Check that $(CONFIGURE_DEPENDENCIES) are automatically distributed.