0
|
1 dnl Fix Autoconf-2.59 bugs: by overriding broken internal
|
|
2 dnl Autoconf macros with backports of the 2.60+ fix.
|
|
3 dnl - AC_CONFIG_SUBDIRS whitespace mangling,
|
|
4 dnl - more lenient precious variable checks
|
|
5 dnl - better configure error message
|
|
6 dnl - reliance on non-Posix m4wrap (M4 1.6 or newer implement FIFO)
|
|
7 dnl
|
|
8 dnl The override bits of this file should be a no-op for the newest
|
|
9 dnl Autoconf version, which means they can be removed once the complete
|
|
10 dnl tree has moved to a new enough Autoconf version.
|
|
11 dnl
|
|
12 dnl The _GCC_AUTOCONF_VERSION_TEST ensures that exactly the desired
|
|
13 dnl Autoconf version is used. It should be kept for consistency.
|
|
14
|
|
15 dnl m4_PACKAGE_VERSION is an undocumented Autoconf macro.
|
|
16 dnl We use it because this fix is intended for 2.59 only.
|
|
17 dnl A feature test for the broken AC_CONFIG_SUBDIRS instead
|
|
18 dnl would be better but is tricky.
|
|
19 dnl
|
|
20 dnl Use ifdef/ifelse over m4_ifdef/m4_ifelse to be clean for 2.13.
|
|
21 dnl Redefine AC_CONFIG_SUBDIRS so aclocal pulls in this file
|
|
22 dnl when needed.
|
|
23
|
|
24 ifdef([m4_PACKAGE_VERSION],
|
|
25 [dnl AC_DEFUN a commonly used macro so this file is picked up.
|
|
26 m4_copy([AC_PREREQ], [_AC_PREREQ])
|
|
27 AC_DEFUN([AC_PREREQ], [frob])
|
|
28 m4_copy([_AC_PREREQ], [AC_PREREQ])
|
|
29
|
|
30
|
|
31 dnl Ensure exactly this Autoconf version is used
|
|
32 m4_ifndef([_GCC_AUTOCONF_VERSION],
|
|
33 [m4_define([_GCC_AUTOCONF_VERSION], [2.59])])
|
|
34
|
|
35 dnl Test for the exact version when AC_INIT is expanded.
|
|
36 dnl This allows to update the tree in steps (for testing)
|
|
37 dnl by putting
|
|
38 dnl m4_define([_GCC_AUTOCONF_VERSION], [X.Y])
|
|
39 dnl in configure.ac before AC_INIT,
|
|
40 dnl without rewriting this file.
|
|
41 dnl Or for updating the whole tree at once with the definition above.
|
|
42 AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
|
|
43 [m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
|
|
44 m4_defn([m4_PACKAGE_VERSION]), [],
|
|
45 [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
|
|
46 ])
|
|
47 m4_define([AC_INIT], m4_defn([AC_INIT])[
|
|
48 _GCC_AUTOCONF_VERSION_CHECK
|
|
49 ])
|
|
50
|
|
51 m4_version_prereq([2.60],, [
|
|
52 dnl We use $ac_pwd in some of the overrides below; ensure its definition
|
|
53 m4_divert_push([PARSE_ARGS])dnl
|
|
54 ac_pwd=`pwd`
|
|
55 m4_divert_pop([PARSE_ARGS])dnl
|
|
56 ])
|
|
57
|
|
58
|
|
59 m4_version_prereq([2.60],, [
|
|
60
|
|
61 # _AC_OUTPUT_SUBDIRS
|
|
62 # ------------------
|
|
63 # This is a subroutine of AC_OUTPUT, but it does not go into
|
|
64 # config.status, rather, it is called after running config.status.
|
|
65 m4_define([_AC_OUTPUT_SUBDIRS],
|
|
66 [
|
|
67 #
|
|
68 # CONFIG_SUBDIRS section, as fixed in confsubdir.m4.
|
|
69 #
|
|
70 if test "$no_recursion" != yes; then
|
|
71
|
|
72 # Remove --cache-file and --srcdir arguments so they do not pile up.
|
|
73 ac_sub_configure_args=
|
|
74 ac_prev=
|
|
75 eval "set x $ac_configure_args"
|
|
76 shift
|
|
77 for ac_arg
|
|
78 do
|
|
79 if test -n "$ac_prev"; then
|
|
80 ac_prev=
|
|
81 continue
|
|
82 fi
|
|
83 case $ac_arg in
|
|
84 -cache-file | --cache-file | --cache-fil | --cache-fi \
|
|
85 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
|
|
86 ac_prev=cache_file ;;
|
|
87 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
|
|
88 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
|
|
89 | --c=*)
|
|
90 ;;
|
|
91 --config-cache | -C)
|
|
92 ;;
|
|
93 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
|
|
94 ac_prev=srcdir ;;
|
|
95 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
|
|
96 ;;
|
|
97 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
|
|
98 ac_prev=prefix ;;
|
|
99 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
|
|
100 ;;
|
|
101 *)
|
|
102 case $ac_arg in
|
|
103 *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
|
|
104 esac
|
|
105 ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
|
|
106 esac
|
|
107 done
|
|
108
|
|
109 # Always prepend --prefix to ensure using the same prefix
|
|
110 # in subdir configurations.
|
|
111 ac_arg="--prefix=$prefix"
|
|
112 case $ac_arg in
|
|
113 *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
|
|
114 esac
|
|
115 ac_sub_configure_args="$ac_arg $ac_sub_configure_args"
|
|
116
|
|
117 ac_popdir=`pwd`
|
|
118 for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
|
|
119
|
|
120 # Do not complain, so a configure script can configure whichever
|
|
121 # parts of a large source tree are present.
|
|
122 test -d "$srcdir/$ac_dir" || continue
|
|
123
|
|
124 AC_MSG_NOTICE([configuring in $ac_dir])
|
|
125 AS_MKDIR_P(["$ac_dir"])
|
|
126 _AC_SRCPATHS(["$ac_dir"])
|
|
127
|
|
128 cd "$ac_dir"
|
|
129
|
|
130 # Check for guested configure; otherwise get Cygnus style configure.
|
|
131 if test -f "$ac_srcdir/configure.gnu"; then
|
|
132 ac_sub_configure=$ac_srcdir/configure.gnu
|
|
133 elif test -f "$ac_srcdir/configure"; then
|
|
134 ac_sub_configure=$ac_srcdir/configure
|
|
135 elif test -f "$ac_srcdir/configure.in"; then
|
|
136 # This should be Cygnus configure.
|
|
137 ac_sub_configure=$ac_aux_dir/configure
|
|
138 else
|
|
139 AC_MSG_WARN([no configuration information is in $ac_dir])
|
|
140 ac_sub_configure=
|
|
141 fi
|
|
142
|
|
143 # The recursion is here.
|
|
144 if test -n "$ac_sub_configure"; then
|
|
145 # Make the cache file name correct relative to the subdirectory.
|
|
146 case $cache_file in
|
|
147 [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
|
|
148 *) # Relative path.
|
|
149 ac_sub_cache_file=$ac_top_builddir$cache_file ;;
|
|
150 esac
|
|
151
|
|
152 AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
|
|
153 # The eval makes quoting arguments work.
|
|
154 eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
|
|
155 --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
|
|
156 AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
|
|
157 fi
|
|
158
|
|
159 cd "$ac_popdir"
|
|
160 done
|
|
161 fi
|
|
162 ])# _AC_OUTPUT_SUBDIRS
|
|
163 ])
|
|
164
|
|
165 m4_version_prereq([2.63],, [
|
|
166
|
|
167 # _AC_ARG_VAR_VALIDATE
|
|
168 # --------------------
|
|
169 # The code is the same as autoconf 2.59, but with a more lenient check
|
|
170 # on precious variables and an output of pwd that have been added in
|
|
171 # autoconf 2.62.
|
|
172 m4_define([_AC_ARG_VAR_VALIDATE],
|
|
173 [m4_divert_text([INIT_PREPARE],
|
|
174 [# Check that the precious variables saved in the cache have kept the same
|
|
175 # value.
|
|
176 ac_cache_corrupted=false
|
|
177 for ac_var in `(set) 2>&1 |
|
|
178 sed -n 's/^ac_env_\([[a-zA-Z_0-9]]*\)_set=.*/\1/p'`; do
|
|
179 eval ac_old_set=\$ac_cv_env_${ac_var}_set
|
|
180 eval ac_new_set=\$ac_env_${ac_var}_set
|
|
181 eval ac_old_val="\$ac_cv_env_${ac_var}_value"
|
|
182 eval ac_new_val="\$ac_env_${ac_var}_value"
|
|
183 case $ac_old_set,$ac_new_set in
|
|
184 set,)
|
|
185 AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2)
|
|
186 ac_cache_corrupted=: ;;
|
|
187 ,set)
|
|
188 AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2)
|
|
189 ac_cache_corrupted=: ;;
|
|
190 ,);;
|
|
191 *)
|
|
192 if test "x$ac_old_val" != "x$ac_new_val"; then
|
|
193 # differences in whitespace do not lead to failure.
|
|
194 ac_old_val_w=`echo x $ac_old_val`
|
|
195 ac_new_val_w=`echo x $ac_new_val`
|
|
196 if test "$ac_old_val_w" != "$ac_new_val_w"; then
|
|
197 AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2)
|
|
198 ac_cache_corrupted=:
|
|
199 else
|
|
200 AS_MESSAGE([warning: ignoring whitespace changes in `$ac_var' since the previous run:], 2)
|
|
201 eval $ac_var=\$ac_old_val
|
|
202 fi
|
|
203 AS_MESSAGE([ former value: `$ac_old_val'], 2)
|
|
204 AS_MESSAGE([ current value: `$ac_new_val'], 2)
|
|
205 fi;;
|
|
206 esac
|
|
207 # Pass precious variables to config.status.
|
|
208 if test "$ac_new_set" = set; then
|
|
209 case $ac_new_val in
|
|
210 dnl If you change this globbing pattern, test it on an old shell --
|
|
211 dnl it's sensitive. Putting any kind of quote in it causes syntax errors.
|
|
212 [ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
|
|
213 ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
|
|
214 *) ac_arg=$ac_var=$ac_new_val ;;
|
|
215 esac
|
|
216 case " $ac_configure_args " in
|
|
217 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
|
|
218 *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
|
|
219 esac
|
|
220 fi
|
|
221 done
|
|
222 if $ac_cache_corrupted; then
|
|
223 AS_MESSAGE([error: in `$ac_pwd':], 2)
|
|
224 AS_MESSAGE([error: changes in the environment can compromise the build], 2)
|
|
225 AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])
|
|
226 fi])dnl
|
|
227 ])# _AC_ARG_VAR_VALIDATE
|
|
228 ])
|
|
229
|
|
230 m4_version_prereq([2.63],, [
|
|
231
|
|
232 # AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1])
|
|
233 # ----------------------------------------
|
|
234 # This is the same code as in 2.59 and 2.61, except it also outputs pwd.
|
|
235 m4_define([AC_MSG_FAILURE],
|
|
236 [{ AS_MESSAGE([error: in `$ac_pwd':], 2)
|
|
237 AC_MSG_ERROR([$1
|
|
238 See `config.log' for more details.], [$2]); }])
|
|
239 ])
|
|
240 ])
|
|
241
|
|
242 m4_version_prereq([2.60],, [
|
|
243 dnl M4 1.6 and newer implement m4wrap using FIFO semantics, as required
|
|
244 dnl by Posix; earlier versions used LIFO semantics. Unfortunately,
|
|
245 dnl Autoconf versions before 2.60 require those LIFO semantics, so
|
|
246 dnl make sure to give it to them.
|
|
247 m4_define([m4_wrap], [m4_ifdef([_$0_text],
|
|
248 [m4_define([_$0_text], [$1]m4_defn([_$0_text]))],
|
|
249 [m4_define([_$0_text], [$1])m4_builtin([m4wrap],
|
|
250 [m4_default(m4_defn([_$0_text])m4_undefine([_$0_text]))])])])
|
|
251 ])
|