[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix `set -o posix' again (was: 1.5.22 fails to configure on AIX 5.1)
From: |
Ralf Wildenhues |
Subject: |
Fix `set -o posix' again (was: 1.5.22 fails to configure on AIX 5.1) |
Date: |
Sat, 21 Jan 2006 18:19:32 +0100 |
User-agent: |
Mutt/1.5.9i |
Sorry for the delay. Eliding libtool list.
* Paul Eggert wrote on Sun, Jan 15, 2006 at 01:57:29PM CET:
> Ralf Wildenhues <address@hidden> writes:
>
> > | elif (set -o posix) >/dev/null 2>&1; then
> > | set -o posix
> > | fi
>
> Why does this hang under AIX? Can you truss it, or strace it, or whatever?
D'oh. It waits for stdin and finishes when given an EOF. I can't
believe this either, I could swear I tried this last time and it did not
work. Sorry for that noise. :-/
> Does it work if we use two parens, e.g.,
>
> elif ((set -o posix)) >/dev/null 2>&1; then
> set -o posix
> fi
FWIW, yes, that returns immediately.
* Bruce Korb wrote on Sat, Jan 14, 2006 at 05:30:03PM CET:
> Ralf Wildenhues wrote:
>
> >because, for example, OpenBSD uses a modified pdksh as /bin/sh, and one
> >of the modifications consists of not setting KSH_VERSION any more. :-/
> >I am at a loss as how to detect this cleanly, suggestions welcome.
>
> if test "X${RANDOM}" != "X${RANDOM}" -a "X${BASH_VERSION+set}" = "Xset"
> then echo this is ksh
> fi
Thanks! OK to apply this patch, to avoid the fork&exec on uninvolved
systems similar to the code before?
Cheers,
Ralf
* lib/m4sugar/m4sh.m4 (_AS_BOURNE_COMPATIBLE): Allow either of
`BASH_VERSION', `KSH_VERSION', or `RANDOM' as indication of ksh
or bash, to set the `posix' option.
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.156
diff -u -r1.156 m4sh.m4
--- lib/m4sugar/m4sh.m4 21 Jan 2006 09:09:46 -0000 1.156
+++ lib/m4sugar/m4sh.m4 21 Jan 2006 17:19:39 -0000
@@ -169,7 +169,8 @@
# is contrary to our usage. Disable this feature.
alias -g '${1+"address@hidden"}'='"address@hidden"'
setopt NO_GLOB_SUBST
-elif (set -o posix) >/dev/null 2>&1; then
+elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}${RANDOM+set}" &&
+ (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
BIN_SH=xpg4; export BIN_SH # for Tru64