]> git.pld-linux.org Git - packages/autoconf.git/blame - autoconf-subdirs.patch
- added subdirs,sizeof patches (two regression fixes from git, adjusted for 2.66)
[packages/autoconf.git] / autoconf-subdirs.patch
CommitLineData
fa1c8387
JB
1From 49a6f8a8b52060d8fe0f97aa6f1d5c47b40b65c1 Mon Sep 17 00:00:00 2001
2From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3Date: Tue, 06 Jul 2010 20:31:33 +0000
4Subject: Fix regression of AC_CONFIG_SUBDIRS with multiple arguments.
5
6* lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS): Do not assume the
7argument is a single word.
8* tests/torture.at (Deep Package): Extend test to cover this.
9(Non-literal AC_CONFIG_SUBDIRS): New test.
10* doc/autoconf.texi (Subdirectories): Add example marker.
11* NEWS: Update.
12Report by Bruno Haible.
13
14Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
15---
16diff --git a/ChangeLog b/ChangeLog
17index ab4d7b2..e9e465b 100644
18--- a/ChangeLog
19+++ b/ChangeLog
20@@ -1,3 +1,15 @@
21+2010-07-08 Eric Blake <eblake@redhat.com>
22+ and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
23+
24+ Fix regression of AC_CONFIG_SUBDIRS with multiple arguments.
25+ * lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS): Do not assume the
26+ argument is a single word.
27+ * tests/torture.at (Deep Package): Extend test to cover this.
28+ (Non-literal AC_CONFIG_SUBDIRS): New test.
29+ * doc/autoconf.texi (Subdirectories): Add example marker.
30+ * NEWS: Update.
31+ Report by Bruno Haible.
32+
33 2010-07-02 Eric Blake <eblake@redhat.com>
34
35 Pick up some maint.mk improvements from gnulib.
36diff --git a/NEWS b/NEWS
37index 7282697..5053557 100644
38--- a/NEWS
39+++ b/NEWS
40@@ -1,4 +1,7 @@
41 GNU Autoconf NEWS - User visible changes.
42
43+** AC_CONFIG_SUBDIRS with more than one subdirectory at a time works again.
44+ Regression introduced in 2.66.
45+
46 * Major changes in Autoconf 2.66 (2010-07-02) [stable]
47 Released by Eric Blake, based on git versions 2.65.*.
48diff --git a/doc/autoconf.texi b/doc/autoconf.texi
49index 0c106c7..39c2ba6 100644
50--- a/doc/autoconf.texi
51+++ b/doc/autoconf.texi
52@@ -3617,6 +3617,7 @@ Make @code{AC_OUTPUT} run @command{configure} in each subdirectory
53 be a literal, i.e., please do not use:
54
55 @example
56+@c If you change this example, adjust tests/torture.at:Non-literal AC_CONFIG_SUBDIRS.
57 if test "x$package_foo_enabled" = xyes; then
58 my_subdirs="$my_subdirs foo"
59 fi
60diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
61index 52b7a3d..b9e7026 100644
62--- a/lib/autoconf/status.m4
63+++ b/lib/autoconf/status.m4
64@@ -1102,7 +1102,7 @@ AC_DEFUN([AC_CONFIG_SUBDIRS],
65 _AC_CONFIG_COMPUTE_DEST(], [))])]dnl
66 [m4_append([_AC_LIST_SUBDIRS], [$1], [
67 ])]dnl
68-[AS_LITERAL_WORD_IF([$1], [],
69+[AS_LITERAL_IF([$1], [],
70 [AC_DIAGNOSE([syntax], [$0: you should use literals])])]dnl
71 [AC_SUBST([subdirs], ["$subdirs m4_normalize([$1])"])])
72
73diff --git a/tests/torture.at b/tests/torture.at
74index 5f13874..e7f61ed 100644
75--- a/tests/torture.at
76+++ b/tests/torture.at
77@@ -1567,7 +1567,9 @@ AC_ARG_VAR([INNER2], [an inner2 variable])
78 AC_OUTPUT
79 ]])
80
81-AT_CHECK([autoreconf -Wall -v], [0], [ignore], [ignore])
82+AT_CHECK([autoreconf -Wall -v], [0], [ignore], [stderr])
83+# We should not warn about nonliteral argument to AC_CONFIG_SUBDIRS here.
84+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [1])
85 AT_CHECK([test -f inner/configure])
86 AT_CHECK([test -f inner/innermost/configure])
87 AT_CHECK([test -f inner/innermost/config.hin])
88@@ -1693,6 +1695,56 @@ AT_CHECK([test -f inner/myfile], 0)
89 AT_CLEANUP
90
91
92+## ------------------------------- ##
93+## Non-literal AC_CONFIG_SUBDIRS. ##
94+## ------------------------------- ##
95+
96+AT_SETUP([Non-literal AC_CONFIG_SUBDIRS])
97+AT_KEYWORDS([autoreconf])
98+
99+# We use aclocal (via autoreconf).
100+AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
101+
102+AT_DATA([install-sh], [])
103+AT_DATA([configure.in],
104+[[AC_INIT(GNU Outer, 1.0)
105+
106+my_subdirs=
107+# Taken from autoconf.texi:Subdirectories.
108+if test "x$package_foo_enabled" = xyes; then
109+ my_subdirs="$my_subdirs foo"
110+fi
111+AC_CONFIG_SUBDIRS([$my_subdirs])
112+AC_OUTPUT
113+]])
114+
115+AS_MKDIR_P([foo])
116+
117+AT_DATA([foo/configure],
118+[[#! /bin/sh
119+touch innerfile
120+exit 0
121+]])
122+chmod +x foo/configure
123+
124+# autoreconf should warn without -Wno-syntax, but should not fail without -Werror.
125+AT_CHECK([autoreconf -Werror -v], [1], [ignore], [stderr])
126+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [0], [ignore])
127+AT_CHECK([autoreconf -v], [0], [ignore], [stderr])
128+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [0], [ignore])
129+# We cannot assume aclocal won't warn (aclocal-1.9 does not understand -W*
130+# options), so check autoconf only.
131+AT_CHECK([autoconf --force -Wno-syntax], 0, [ignore], [stderr])
132+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [1])
133+
134+AT_CHECK([./configure $configure_options], [0], [ignore])
135+AT_CHECK([test ! -f foo/innerfile])
136+# Running the outer configure should trigger the inner.
137+AT_CHECK([./configure $configure_options package_foo_enabled=yes], [0], [ignore])
138+AT_CHECK([test -f foo/innerfile])
139+
140+AT_CLEANUP
141+
142
143 ## ----------------- ##
144 ## Empty directory. ##
145--
146cgit v0.8.2.1
This page took 0.062844 seconds and 4 git commands to generate.