1 dnl Fix Autoconf-2.59 AC_CONFIG_SUBDIRS whitespace mangling,
2 dnl by overriding the broken internal Autoconf macro with a
3 dnl backport of the 2.60 fix.
5 dnl This file should be a no-op for Autoconf versions != 2.59.
6 dnl It can be removed once the complete tree has moved to a
7 dnl newer Autoconf version.
9 dnl m4_PACKAGE_VERSION is an undocumented Autoconf macro.
10 dnl We use it because this fix is intended for 2.59 only.
11 dnl A feature test for the broken AC_CONFIG_SUBDIRS instead
12 dnl would be better but is tricky.
14 dnl Use ifdef/ifelse over m4_ifdef/m4_ifelse to be clean for 2.13.
15 dnl Redefine AC_CONFIG_SUBDIRS so aclocal pulls in this file
18 ifdef([m4_PACKAGE_VERSION],
19 [ifelse(m4_PACKAGE_VERSION, [2.59], [
21 dnl Redefine AC_CONFIG_SUBDIRS so this file is picked up if needed.
22 AC_DEFUN([AC_CONFIG_SUBDIRS], defn([AC_CONFIG_SUBDIRS]))
24 dnl Override the broken macro.
27 # This is a subroutine of AC_OUTPUT, but it does not go into
28 # config.status, rather, it is called after running config.status.
29 m4_define([_AC_OUTPUT_SUBDIRS],
32 # CONFIG_SUBDIRS section, as fixed in confsubdir.m4.
34 if test "$no_recursion" != yes; then
36 # Remove --cache-file and --srcdir arguments so they do not pile up.
37 ac_sub_configure_args=
39 eval "set x $ac_configure_args"
43 if test -n "$ac_prev"; then
48 -cache-file | --cache-file | --cache-fil | --cache-fi \
49 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
51 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
52 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
57 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
59 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
61 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
63 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
67 *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
69 ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
73 # Always prepend --prefix to ensure using the same prefix
74 # in subdir configurations.
75 ac_arg="--prefix=$prefix"
77 *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
79 ac_sub_configure_args="$ac_arg $ac_sub_configure_args"
82 for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
84 # Do not complain, so a configure script can configure whichever
85 # parts of a large source tree are present.
86 test -d "$srcdir/$ac_dir" || continue
88 AC_MSG_NOTICE([configuring in $ac_dir])
89 AS_MKDIR_P(["$ac_dir"])
90 _AC_SRCPATHS(["$ac_dir"])
94 # Check for guested configure; otherwise get Cygnus style configure.
95 if test -f "$ac_srcdir/configure.gnu"; then
96 ac_sub_configure=$ac_srcdir/configure.gnu
97 elif test -f "$ac_srcdir/configure"; then
98 ac_sub_configure=$ac_srcdir/configure
99 elif test -f "$ac_srcdir/configure.in"; then
100 # This should be Cygnus configure.
101 ac_sub_configure=$ac_aux_dir/configure
103 AC_MSG_WARN([no configuration information is in $ac_dir])
107 # The recursion is here.
108 if test -n "$ac_sub_configure"; then
109 # Make the cache file name correct relative to the subdirectory.
111 [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
113 ac_sub_cache_file=$ac_top_builddir$cache_file ;;
116 AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
117 # The eval makes quoting arguments work.
118 eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
119 --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
120 AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
126 ])# _AC_OUTPUT_SUBDIRS