[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make check hangs on test 93 under Sun Solaris 9
From: |
Paul Eggert |
Subject: |
Re: make check hangs on test 93 under Sun Solaris 9 |
Date: |
Wed, 07 Feb 2007 09:48:27 -0800 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Ralf Menzel <address@hidden> writes:
> Do you think it would be a good idea to add something like the
> following to the autoconf manual:
I'd already written something like that but hadn't checked it in.
Also, the bare CR should be put into a separate variable so that
the problem occurs only once.
Also, we should prefer \r. I don't know of any Awk in modern use
that doesn't support \r -- does anyone else? V7 awk didn't support \r
but it got added a long time ago.
Also, the current test for CR etc. fails on Solaris 8 due to a bug in
Bash 2.03 printf (which is standard on Solaris 8).
I installed this. Most likely the CR will be hosed in this patch
too, but you can look at CVS to see what it is.
2007-02-07 Paul Eggert <address@hidden>
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Prefer \r to
an actual carriage return. Use "ac_cr" to contain the actual
carriage return.
* doc/autoconf.texi (Limitations of Usual Tools): Document problem
with traditional Awk and begin.
* tests/torture.at (Limitations of Builtins): Document the problem
with Bash 2.03 printf.
(Substitute and define special characters):
Remove trailing white space. Work around a bug in Solaris 8 /bin/bash.
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.128
diff -u -p -r1.128 status.m4
--- lib/autoconf/status.m4 6 Feb 2007 18:52:33 -0000 1.128
+++ lib/autoconf/status.m4 7 Feb 2007 17:45:32 -0000
@@ -1,7 +1,7 @@
# This file is part of Autoconf. -*- Autoconf -*-
# Parameterizing and creating config.status.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -363,8 +363,13 @@ else
'$ac_cs_awk_pipe_init
ac_cs_awk_pipe_fini='END { print "|#_!!_#|" }'
fi]])
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a
b" }' 2>/dev/null </dev/null`
-if test "$ac_cs_awk_cr" = 'a
b'; then ac_cs_awk_cr=; else ac_cs_awk_cr='\\'; fi
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
dnl
dnl Define the pipe that does the substitution.
m4_ifdef([_AC_SUBST_FILES],
@@ -524,7 +529,7 @@ cat >>"\$tmp/subs1.awk" <<CEOF
]m4_ifdef([_AC_SUBST_FILES],
[\$ac_cs_awk_pipe_fini])[
CEOF
-sed "s,
$,,; s,
,\$ac_cs_awk_cr&,g" < "\$tmp/subs1.awk" > "\$tmp/subs.awk"
+sed 's/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g' < "\$tmp/subs1.awk" >
"\$tmp/subs.awk"
_ACEOF
]dnl end of double-quoted part
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1130
diff -u -p -r1.1130 autoconf.texi
--- doc/autoconf.texi 4 Feb 2007 02:46:49 -0000 1.1130
+++ doc/autoconf.texi 7 Feb 2007 17:45:33 -0000
@@ -12636,16 +12636,23 @@ fi
@c ------------------
@prindex @command{printf}
A format string starting with a @samp{-} can cause problems.
-Bash (e.g., 2.05b) interprets it as an options argument and
+Bash interprets it as an option and
gives an error. And @samp{--} to mark the end of options is not good
in the address@hidden Almquist shell (e.g., 0.4.6) which takes that
literally as the format string. Putting the @samp{-} in a @samp{%c}
-or @samp{%s} is probably the easiest way to avoid doubt,
+or @samp{%s} is probably easiest:
@example
printf %s -foo
@end example
+Bash 2.03 mishandles an escape sequence that happens to evaluate to @samp{%}:
+
address@hidden
+$ @kbd{printf '\045'}
+bash: printf: `%': missing format character
address@hidden example
+
@item @command{read}
@c ------------------
@@ -13009,6 +13016,17 @@ $ @kbd{gawk 'function die () @{ print "A
Aaaaarg!
@end example
+Posix says that if a program contains only @samp{BEGIN} actions, and
+contains no instances of @code{getline}, then the program merely
+executes the actions without reading input. However, traditional Awk
+implementations (such as Solaris 10 @command{awk}) read and discard
+input in this case. Portable scripts can redirect input from
address@hidden/dev/null} to work around the problem. For example:
+
address@hidden
+awk 'BEGIN @{print "hello world"@}' </dev/null
address@hidden example
+
If you want your program to be deterministic, don't depend on @code{for}
on arrays:
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.80
diff -u -p -r1.80 torture.at
--- tests/torture.at 19 Jan 2007 06:54:34 -0000 1.80
+++ tests/torture.at 7 Feb 2007 17:45:33 -0000
@@ -1,8 +1,8 @@
# -*- Autotest -*-
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
-# Foundation, Inc.
-#
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free
+# Software Foundation, Inc.
+
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
@@ -623,7 +623,7 @@ address@hidden @address@hidden
address@hidden @address@hidden@
address@hidden @baz@@baz@
@file@
- @file@
+ @file@
address@hidden@
@address@hidden
])
@@ -644,7 +644,7 @@ baz=bla
for k in 0 1 2 3 4 5 6 7; do
case $i$j$k in #(
000) ;; #(
- *) printf \\$i$j$k ;;
+ *) printf \\$i$j$k's' ;; # The 's' works around a Solaris 8 /bin/bash
bug.
esac
done
done