On Wed, 22 May 2013, Zack Weinberg wrote:
On Wed, May 22, 2013 at 1:06 PM, Nick Bowler <nbowler@xxxxxxxxxxxxxxxx> wrote:
The fundamental problem, I think, is that you really need the proper
headers included and AC_REPLACE_FUNCS does not seem to allow you to
specify the includes. So you probably can't use this macro at all.
You can use AC_LINK_IFELSE to fully specify the test program to compile
and link, which is probably what you'll need to do here. This may still
be tricky to get right. Alternately, Gnulib[1] has a getaddrinfo module[2]
which may already do everything you need (although I have not used it).
I wrote the attached macro to solve a closely related problem (looking
for ntohl, not getaddrinfo; the way Winsock works, it's equivalent).
Perhaps it will be useful to you.
Going forward I think AC_*_FUNC[S] really need to grow a way to
specify headers. Fake-declaring everything as "char foo();" has been
kinda silly for years now.
What I really need from autoconf is to append to config.h the results of
the tests so far right after every test. That way I'd be able to #include
"platform.h" instead of AC_DEFAULT_INCLUDES and I'd get an increasing
number of headers included after every test.
That in combination to checking for the exact prototype I define, would
have resolved many of my problems. Something like:
AC_CHECK_FUNC([int getaddrinfo(NULL,NULL,NULL,NULL)])
Thanks,
Dimitris
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf