help-gnu-utils
[Top][All Lists]
Advanced

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

Re: autoconf: exporting functions


From: Ralf Wildenhues
Subject: Re: autoconf: exporting functions
Date: Fri, 26 Oct 2007 20:25:06 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Petter,

* Petter Gustad wrote on Fri, Oct 26, 2007 at 04:23:37PM CEST:
> 
> function blabla {
> }
> ...
> blabla arg1 arg2 arg2
[...]
> But then blabla gets stripped off by autoconf so I get 
> 
> ./configure: line nnnn: blabla: command not found

That's really weird, I can't reproduce that at all, it would be nice to
see a small reproducible example.  Here:

cat >configure.ac <<EOF
AC_INIT
func_hello ()
{
  echo hello world
}
func_hello
EOF
autoconf
./configure
| hello world

Please note that the `function' keyword isn't all that portable to other
shells, but specifying a function by `()' is.  Also, note there are
obscure shells out there that have only one namespace for functions and
variables, and very old ones had no function support at all; I guess you
won't care about them.  There are more caveats in the Autoconf manual
(shell portability chapter).

Cheers,
Ralf




reply via email to

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