[Gllug] continuing the autoconf saga... AC_FUNC_MALLOC
Stig Brautaset
stigbrau at start.no
Sat Jun 29 17:38:46 UTC 2002
* Nix <nix at esperi.demon.co.uk> spake thus:
> On Sat, 29 Jun 2002, Stig Brautaset uttered the following:
> > The documentation for the AC_FUNC_MALLOC this:
> >
> > - Macro: AC_FUNC_MALLOC
[snip]
> > Regardless, the HAVE_MALLOC persists undefined in my config.h. Can
> > anyone shed any light on this?
>
> That certainly shouldn't happen.
>
> What version of autoconf is this?
stig at arwen:~/work/gga$ autoconf --version
autoconf (GNU Autoconf) 2.53
[snip]
Although sometimes it claims to be 2.13 (debian will not let me install
2.5X without installing 2.13 as well). I imagine it is due to some
"clever" wrapper that tries to figure out what you need or something.
> It works for me with autoconf-2.53, given a configure.ac like this:
> AC_INIT(foo,0.01)
> AC_CONFIG_HEADERS(config.h)
> AC_PROG_CC
> AC_PROG_CC_STDC
> AC_FUNC_MALLOC
> AC_OUTPUT
This works for me too. But, it wouldn't work with my configure.in --
after a bit of trial and error it turns out the AC_FUNC_MALLOC macro
does not like to be used after the AC_CHECK_LIB macro..
Although it is explicitly stated in the autobook that putting tests for
functions should come after tests for libraries etc..
Maybe it is a special case for this macro since one can load a library
to use your own malloc if it is not working?
Thanks for the help,
Stig
PS: On a related note, is there any reason why you would ever want
to do a malloc(0)?
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list