autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: host_os has a space in it


From: Ralf Wildenhues
Subject: Re: host_os has a space in it
Date: Tue, 2 May 2006 19:44:37 +0200
User-agent: Mutt/1.5.11+cvs20060403

> * address@hidden wrote on Tue, May 02, 2006 at 08:20:50AM CEST:
> 
> > config.log:build_os='linux gnu'
> > config.log:host='i686-pc-linux-gnu'
> > config.log:host_os='linux gnu'

Darn.  Although I still don't know how the above could possibly have
happened with Autoconf-2.59c (as opposed to a slightly older CVS
version), I know the current code isn't ok: the Solaris /bin/sh does
not interpret
  ( set a b; sIFS=$IFS; IFS=-; h=$*; IFS=$sIFS; echo "$h")

Posix-correctly and outputs "a b" instead of "a-b".

Same with Tru64 non-Posix /bin/sh, but not with Solaris /bin/ksh nor
with Tru64 /usr/bin/posix/sh [1].  So, in the default setting we don't
expose the failure, as the better-shell search saves us, and without
cross-compilation, the respective strings don't contain extra hyphens
either, but I think it's still prudent to take measures anyway.

OK to apply this fix which doesn't fork in the common case?  :-)

Cheers,
Ralf

[1] http://www.in-ulm.de/~mascheck/various/ifs/ has a nice overview.

        * lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT): Cater for
        traditional shells like the Solaris one that do not use the
        first IFS character for assembling `$*'.
        Prompted by a related report from address@hidden

Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.914
diff -u -r1.914 general.m4
--- lib/autoconf/general.m4     30 Apr 2006 17:04:06 -0000      1.914
+++ lib/autoconf/general.m4     2 May 2006 09:09:36 -0000
@@ -1677,9 +1677,12 @@
 AC_SUBST([$1_cpu], [$[1]])dnl
 AC_SUBST([$1_vendor], [$[2]])dnl
 shift; shift
-[# Remember, the first character of IFS is used to create $]*:
-AC_SUBST([$1_os], [$[*]])dnl
+[# Remember, the first character of IFS is used to create $]*,
+# except with old shells:
+$1_os=$[*]
 IFS=$ac_save_IFS
+case $$1_os in *\ *) $1_os=`echo "$$1_os" | sed 's/ /-/g'`;; esac
+AC_SUBST([$1_os])dnl
 ])# _AC_CANONICAL_SPLIT
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]