autoconf
[Top][All Lists]
Advanced

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

Re: configure script question ?


From: Ralf Wildenhues
Subject: Re: configure script question ?
Date: Sun, 5 Mar 2006 11:23:44 +0100
User-agent: Mutt/1.5.9i

Hi June,

* June Fang wrote on Fri, Feb 24, 2006 at 04:43:03PM CET:
> On 2/24/06, June Fang <address@hidden> wrote:
> >
> > i know ${ZSH_VERSION} means variable substituting;
> > and ${ZSH_VERSION:+set} means "If parameter is null or unset, nothing
> >                                        ~~ Note the `:`
> > is substituted, otherwise the expansion of word is substituted."
> >     ---- from Bash reference manual
> >
> > but what dose ${ZSH_VERSION+set} without the `:` means ?

It substitutes `set' when the variable is set; i.e., ZSH_VERSION may
also be empty.  This is done because some older shells do not understand
  ${foo:+bar}  ${foo:-bar}  ${foo:=bar}

correctly, but only
  ${foo+bar}   ${foo-bar}   ${foo=bar}

This actually quite inconvenient: there are also older shells that do
not support `unset'.  I think that's one reason why the config.cache
precious variables come in pairs: 
  ac_cv_env_CC_set=
  ac_cv_env_CC_value=

The first one is a witness as to whether CC was set or not.

> and what's more, the entire lines:
>       15  if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; 
> then
>       16   emulate sh
> i guess it means execuate "emulate sh" in subshell, and
> if it success, do it in our current shell ? am i right ?

Yes.  `emulate sh' is necessary for zsh to behave correctly.  zsh is the
default /bin/sh on some systems.

Cheers,
Ralf




reply via email to

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