autoconf
[Top][All Lists]
Advanced

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

Re: [RFH] zsh shell function portability issue


From: Paolo Bonzini
Subject: Re: [RFH] zsh shell function portability issue
Date: Fri, 17 Oct 2008 09:14:20 +0200
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

>> Do you think that:
>>
>>       (eval "$ac_link") 2>&5
>>       ac_status=$?
>>         (eval "$ac_try") 2>&5
>>         ac_status=$?
>>
>> 
>> are portable?
> 
> Pretty likely not:
> 
> $ zsh --version
> zsh 4.2.3 (powerpc-apple-darwin8.0)
> $ zsh
> $ f () { ( exit 1); echo $?; }; f
> 0
> $ f () { ( exit 1) && echo bad; }; f
> bad
> $ f () { { ( exit 1); } && echo bad; }; f
> bad

But the only arguments in the eval *when the eval appears in shell
functions* (I don't care about user code relying on _AC_DO, because it
will appear outside functions) are:

  $ac_cpp
  $ac_compile
  $ac_link
  ./conftest$ac_exeext

and in turn

$ grep ac_compile= *
c.m4:ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext
>&AS_MESSAGE_LOG_FD'
c.m4:ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext
>&AS_MESSAGE_LOG_FD'
c.m4:ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext
>&AS_MESSAGE_LOG_FD'
erlang.m4:ac_compile='$ERLC $ERLCFLAGS -b beam conftest.$ac_ext
>&AS_MESSAGE_LOG_FD'
fortran.m4:ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
fortran.m4:ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext
conftest.$ac_ext >&AS_MESSAGE_LOG_FD'

$ grep ac_cpp= *
c.m4:ac_cpp='$CPP $CPPFLAGS'
c.m4:ac_cpp='$CXXCPP $CPPFLAGS'
c.m4:ac_cpp='$OBJCPP $CPPFLAGS'

$ grep ac_link= *
c.m4:ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
c.m4:ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
c.m4:ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
erlang.m4:ac_link='$ERLC $ERLCFLAGS -b beam conftest.$ac_ext
>&AS_MESSAGE_LOG_FD ; echo "[#]!/bin/sh" > conftest$ac_exeext ;
AS_ECHO(["\"$ERL\" -run conftest start -run init stop -noshell"]) >>
conftest$ac_exeext ; chmod +x conftest$ac_exeext'
fortran.m4:ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
fortran.m4:ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS
$ac_fcflags_srcext conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
scientist-2:~/devel/autoconf/lib/autoconf bonzinip$



No "exit in a subshell" here, right?

Paolo




reply via email to

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