libtool
[Top][All Lists]
Advanced

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

Re: func_infer_tag() broken


From: Gary V. Vaughan
Subject: Re: func_infer_tag() broken
Date: Tue, 02 Mar 2004 13:37:53 +0000
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paolo Bonzini wrote:
|
|> At a slight tangent;  maybe m4sh could provide a shell function
|> calling macro
|> (off the top of my head):
|
| Isn't this a bit heavyweight?

I was just thinking out loud.  The parameter saving code need only be emitted
if the host shell test proves that functions can't cope without it.

|> | It should be even with an integer return value.  If you are at the
|> | end of a function (or in an if just before the end of the function, you
|> | got it) it is possible to replace it with (exit NUM), but I don't see a
|> | good reason to do so.
|>
|> Doesn't the exit actually terminate the script for (at least) some
|> shells?
|
| No, it is in a subshell.  Anyway it is among the shell function features
| that m4sh now explicitly tests.  It will complain at the start of the
| script (telling to write to address@hidden even if shell functions are
| not used, and also bailing out if they are).
|
|> BTW, we're thinking of moving the generation of ltmain.sh to m4sh when
|> the
|> shell function support in autoconf pans out...

Argh.  So this is broken?

# func_fatal_error arg...
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
~    func_error ${1+"$@"}
~    exit $EXIT_FAILURE
}

How do you write a function that terminates?  I guess I need to exit
explicitly after every call to to func_fatal_error through the rest of the
code, which then breaks this idiom:

feature=false
case $arg in
~   -foo) feature=: ;;
esac

...

$feature || func_fatal_error "barf"

:-(

I have been using this idiom successfully for years, and it is all over
cvs-utils and libtool now.  I'm very reluctant to let it go...

| It is already there.  There is the detection system outlined above;
| plus, a single macro is provided, AS_REQUIRE_SHELL_FN, which outputs the
| function into the initialization section of the script.  That's
| basically all you need.  Feel free to mail for help.

I've been watching the discussions on address@hidden :-)

After the next libtool release, I'll make a start.

Cheers,
        Gary.
- --
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://www.oranda.demon.co.uk
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFARI4xFRMICSmD1gYRAm5bAKCBparuRGjH0qavigZZpi8W46xTywCgnIlf
WhtDl0qHXa+twzW+jn0bDbQ=
=/KXz
-----END PGP SIGNATURE-----




reply via email to

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