D'oh, I didn't mean to post the patch as on top of yours. Here it is against current master. Sorry about that.
Cheers, Ralf diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index b4dec08..e4daa38 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -539,9 +539,15 @@ m4_ifdef([_AC_SUBST_FILES], [\$ac_cs_awk_pipe_fini]) _ACAWK _ACEOF +dnl See if CR is the EOL marker. If not, remove any EOL-related +dnl ^M bytes and escape any remaining ones. If so, just use mv. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || AC_MSG_ERROR([could not setup config files machinery]) +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" || + AC_MSG_ERROR([could not setup config files machinery]) _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir),
