Re: autoconf: exporting functions

Ralf Wildenhues <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization Department of Numerical Simulation, University of Bonn
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.